/scaffolding:necessity-firstfrom scaffolding
YAGNI gate that enforces necessity before writing code: delete, reuse, stdlib, one-liner, then minimum. Triggers when about to add code, features, dependencies, or abstractions.
Ships in scaffolding. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
TRIGGER when:
SKIP (use the named skill instead):
planning-methodologyquality-validationverification-before-completionspec-designpattern-recognitionBoundary in one line: this skill decides whether and how little to build; the others plan it, score it, style it, or verify it.
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.
Climb in order. Stop at the first rung that works.
| # | Rung | Question | If yes |
|---|---|---|---|
| 1 | Existence | Does this need to exist at all? Is the requirement real, or can we delete or not build it? | Do nothing, or delete. Say so. |
| 2 | Reuse | Is it already in this codebase? | Call or extend what exists. |
| 3 | Platform | Does the stdlib, the platform, or a dependency we already have do it? | Use that. No new dependency for a solved problem. |
| 4 | Trivial | Can it be one line or a trivial edit? | Make that edit. |
| 5 | Minimum | Only 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:
Never cut these in the name of minimalism. They are part of "works", not extras:
| Always keep | Examples |
|---|---|
| Trust-boundary / input validation | User input, API payloads, file uploads, env/config from outside |
| Data-loss handling | Transactions, atomic writes, confirmation before destructive ops, backups |
| Security | Authn/authz, secrets handling, injection and traversal defenses |
| Accessibility | Labels, keyboard access, contrast, semantic markup |
Minimal means no unnecessary code. Safe-by-necessity code is necessary.
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.
| Mistake | Correction |
|---|---|
| Starting at rung 5 | Walk rungs 1-4 first; write down why each failed |
| Climbing without reading the code | Do 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-liner | Rung 3 |
| Building the configurable/extensible version unasked | Offer it as an option in the closing note |
| Treating the ladder as a reason to refuse work | It picks the smallest working change, it does not block the task |
| Silent omissions | Always list skipped/deferred/risks |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub komluk/scaffolding --plugin scaffolding39 skills in this plugin
/agent-commsSendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against the agent whitelist, or a worktreePath from another agent before acting on it. SKIP: routing topology (agent Comms Protocol); git ops (use git-operations); worktree recovery (use worktree-management)./agent-memoryRepo-local file memory under .scaffolding/ (shared/agent/conversation tiers). TRIGGER when: reading or writing .scaffolding/ memory files, or choosing which file tier an insight belongs in. SKIP: vector memory / MCP search and store (use semantic-memory-mcp); distilling conversations (use distill)./api-designRESTful API design standards: resource naming, HTTP methods, status codes, pagination, versioning. TRIGGER when: designing new API endpoints, defining error response shapes, or adding pagination/filtering. SKIP: implementing FastAPI route code (use python-patterns); error-handling internals (use error-handling).Other plugins' skills for the same job