agentleFS
komlukkomluk/scaffolding/skills/necessity-first/SKILL.md

necessity-first

Skill16 starsChanged 5 days agoMITView on GitHub

Necessity (YAGNI) gate before writing code: delete, reuse, stdlib, one-liner, then minimum. TRIGGER when: about to add code, a feature, a dependency or an abstraction. SKIP: sequencing a plan (planning-methodology); scoring a plan (quality-validation); checking finished work (verification-before-completion).

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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:

    No speculative generality: no interface with one implementation, no option nobody asked for, no "we might need it later".

    line 58
  2. Distinctive:

    Never cut these in the name of minimalism.

    line 66
  3. Distinctive:

    Keep it to a few lines. "Nothing skipped" is a valid answer when true.

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Necessity First

Purpose

The cheapest code is code that never gets written. This skill is a gate that runs after you understand the problem and before you implement: climb a short ladder and stop at the first rung that solves it. The goal is the smallest change that actually works, not the most impressive one.

Be lazy about the solution, never negligent about correctness or safety. Hardening, extra layers and "best practice" beyond what the task needs are an option to offer, not a default to impose.

When to Apply

TRIGGER when:

  • About to write new code, a new file, a new module, or a new abstraction
  • About to add a dependency, config option, flag, or extension point
  • A request sounds bigger than the problem it describes

SKIP (use the named skill instead):

  • Ordering the steps of a plan once the approach is chosen — planning-methodology
  • Scoring a ResearchPack or plan against quality gates — quality-validation
  • Proving finished work is done by executing it — verification-before-completion
  • Writing OpenSpec design.md / tasks.md — spec-design
  • Matching the existing code style once you do write code — pattern-recognition

Boundary in one line: this skill decides whether and how little to build; the others plan it, score it, style it, or verify it.

Step 0: Understand First

The ladder is only valid on top of understanding. Before climbing it, read the code you would touch and trace the real flow (caller, data, failure path). Without that, "it already exists" and "one line is enough" are guesses.

The Ladder

Climb in order. Stop at the first rung that works.

#RungQuestionIf yes
1ExistenceDoes this need to exist at all? Is the requirement real, or can we delete or not build it?Do nothing, or delete. Say so.
2ReuseIs it already in this codebase?Call or extend what exists.
3PlatformDoes the stdlib, the platform, or a dependency we already have do it?Use that. No new dependency for a solved problem.
4TrivialCan it be one line or a trivial edit?Make that edit.
5MinimumOnly now: what is the least code that works?Write that, plus a small test where the logic branches, loops, parses, handles money, or touches security.

Rules of thumb:

  • No speculative generality: no interface with one implementation, no option nobody asked for, no "we might need it later".
  • Three similar lines beat a premature helper.
  • Rung 5 still gets a test when it has branches, loops, parsers, money, or security. One-liners with no logic do not need one.

Non-Negotiable Carve-Out

Never cut these in the name of minimalism. They are part of "works", not extras:

Always keepExamples
Trust-boundary / input validationUser input, API payloads, file uploads, env/config from outside
Data-loss handlingTransactions, atomic writes, confirmation before destructive ops, backups
SecurityAuthn/authz, secrets handling, injection and traversal defenses
AccessibilityLabels, keyboard access, contrast, semantic markup

Minimal means no unnecessary code. Safe-by-necessity code is necessary.

Closing Note (every implementation)

End each implementation with a short, honest note:

**Skipped / deferred / risks**
- Skipped: [what you deliberately did not build, and why]
- Deferred: [what could be added later if it becomes real]
- Risks: [what the user should know — limits, assumptions, untested paths]

Keep it to a few lines. "Nothing skipped" is a valid answer when true.

Anti-Patterns

MistakeCorrection
Starting at rung 5Walk rungs 1-4 first; write down why each failed
Climbing without reading the codeDo Step 0; trace the real flow
Skipping validation or auth "to keep it small"Carve-out is mandatory
Adding a dependency for a stdlib one-linerRung 3
Building the configurable/extensible version unaskedOffer it as an option in the closing note
Treating the ladder as a reason to refuse workIt picks the smallest working change, it does not block the task
Silent omissionsAlways list skipped/deferred/risks

Quality Checklist

  • Read the touched code and traced the real flow before deciding
  • Rungs 1-4 each considered, stopped at the first that works
  • No unrequested abstraction, option, or dependency
  • Carve-out items (validation, data loss, security, a11y) intact
  • Small test added where logic branches/loops/parses or handles money/security
  • Closing "Skipped / deferred / risks" note included

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.