agentleFS
kapadiaskapadias/nonna/.claude/skills/lean/SKILL.md

lean

Skill0 starsChanged 46 days agoMITView on GitHub

Sizing a solution before code: the seven-rung ladder (YAGNI, codebase, stdlib, native, installed dep, one line, minimum code), the never-simplify list, debt: markers.

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Stop at the first rung that holds.

    line 15
  2. Distinctive:

    Only then: the minimum code that works — no speculative parameters, no config for a value that never changes, no layer for a future nobody …

    line 30
  3. Distinctive:

    No interface with a single implementation, no factory for one product, no config knob for a value that never changes, no scaffolding "for …

    line 37
  4. Distinctive:

    Not corners to cut, ever: validation at a trust boundary, error handling that prevents data loss, security, accessibility, and anything the …

    line 47

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lean

Lazy means efficient, not careless — the goal is the smallest correct diff, never the least effort. The ladder below runs after you have read the task and the code it touches, not instead of reading it. Trace the real flow — who calls this, what already exists two files over, what the runtime already gives you for free — then climb.

The ladder

Stop at the first rung that holds; do not climb past it "just in case."

  1. YAGNI — does this need to exist? Name the lazier alternative in one line first. Half of "needed" code is speculative.
  2. Already in this codebase? Reuse it. Re-implementing something that lives a few files over is the single most common slop pattern — search before you write.
  3. The stdlib does it? Use it. Tested, documented, free; a hand-rolled equivalent is a maintenance liability with no upside.
  4. A native platform feature covers it? Use it — <input type="date"> over a date-picker dependency, a database UNIQUE constraint over app-level checks. The platform ships more than most reach for.
  5. An already-installed dependency solves it? Use it. Never add a new dependency for what a few lines, or something already in the lockfile, already does.
  6. Can it be one line? Make it one line — a comprehension or built-in beats a helper function that exists only to wrap it.
  7. Only then: the minimum code that works — no speculative parameters, no config for a value that never changes, no layer for a future nobody asked for.

Two rungs both hold? Take the higher one — it is closer to "does not exist."

Rules

  • No interface with a single implementation, no factory for one product, no config knob for a value that never changes, no scaffolding "for later."
  • Question a complex request in the same response, don't silently comply: "Did X; Y already covers the need. Want the full version? Say so."
  • Two same-size stdlib options: take the one correct on the edge case, not the shorter one.
  • The smallest change in the wrong place is still a second bug — lean is about size, not about dodging the real fix.

Never simplified away

Not corners to cut, ever: validation at a trust boundary, error handling that prevents data loss, security, accessibility, and anything the requester explicitly asked for. Nonna's own gates are not negotiable either: TDD with golden and property tests on the critical surface (.claude/rules/testing.md), the machine-checked review verdict, and the five-mirror sync (.claude/rules/sync.md). The ladder governs solution size, never the loop.

The debt: marker

Mark a deliberate shortcut so it stays visible instead of becoming permanent by accident: debt: <ceiling>, <upgrade trigger> — a comma separates what you accepted from the condition that should make someone revisit it.

# debt: global lock, per-account locks if throughput matters

Both halves must be non-empty; a marker with no trigger after the comma is unfinished debt, not a note. Gate: scripts/check-debt.sh. Default scans the tree and exits 1 if any marker lacks a trigger. --range <git-range> scans only lines added in that diff — what /review runs, so a PR is gated on debt it introduced, not on debt already in the tree. --ledger prints the grouped ledger instead of gating — what /sync runs to check for drift. Usage error, or --range outside a git repo, exits 2.

Review tags

Format: L<line>: <tag> <what>. <replacement>. Tags: delete: — adds nothing, remove it; stdlib: — a standard-library call replaces a hand-rolled block; native: — a platform feature replaces custom logic or a dependency; yagni: — built for a need that does not exist yet; shrink: — same behavior, fewer lines.

L42: stdlib:  27-line email validator class. `"@" in email` (or the stdlib's own check).
L58: native:  date-formatting library pulled in for one call. `Intl.DateTimeFormat`.
L71: yagni:   `AbstractRepository` with exactly one implementation. Inline it.
L90: delete:  retry wrapper around an idempotent local call that cannot fail transiently. Nothing.
L15: shrink:  manual loop building a dict from two lists. `dict(zip(keys, values))`.

Close with net: -<N> lines possible. when findings exist, or Lean already. Ship. when none do. The tags apply to review asks too: a reviewer's speculative bound or i18n case with no failing input is yagni: — answer it with a debt: marker, not code. These findings carry category: simplicity and are MEDIUM at most — size never outranks correctness or security.

You think you need X → the platform has Y

You think you needThe platform has
Date picker library<input type="date">
Deep-clone librarystructuredClone
UUID librarycrypto.randomUUID()
mkdirpfs.mkdirSync(p, {recursive: true})
pytzzoneinfo
requests for one GETurllib.request
App-level uniqueness checka UNIQUE constraint
Pagination logic in codeLIMIT/OFFSET
JS animation librarya CSS transition
Modal dialog library<dialog>
lodash debouncea 5-line closure
moment for one formatIntl.DateTimeFormat
Hand-rolled deep-equalthe test framework's own assertion
Manual env-var loaderthe platform's built-in env access

Output

Lead with the code, not the reasoning. What you deliberately skipped, and the trigger to add it later, goes under Remaining risk in Nonna's four-line report — never its own heading.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.