Lukasz Boryn feb12b1586 feat(skills): port codebase-design vocabulary skill from upstream
Adds engineering/codebase-design/ — shared vocabulary for designing deep
modules (module, interface, seam, adapter, depth, leverage, locality).
Three files: SKILL.md (glossary + principles + R+Py testability examples +
rejected framings); DEEPENING.md (4 dependency categories, seam discipline,
replace-don't-layer); DESIGN-IT-TWICE.md (parallel sub-agent pattern for
exploring 3+ radically different interface designs).

Retargets existing bdd siblings as language-flavored leaves:
- bdd/SKILL.md gains a Vocabulary anchor pointing at codebase-design
- interface-design-{r,py}.md and deep-modules-r.md get "vocab lives
  upstream" headers; "deep modules" mention dropped from the py
  interface-design description (codebase-design owns it now)
- mocking-{r,py}.md swap "boundary" -> "seam" throughout — upstream
  rejects "boundary" as overloaded with DDD's bounded context
- refactoring-r.md cross-links Shallow-modules to DEEPENING.md

Cross-references added in sieve/SKILL.md (Minimal invokes depth),
winnow/SKILL.md (deletion test formalised there), diagnose/SKILL.md
(seam definition for Phase 5's "no correct seam" finding),
domain-modeling/SKILL.md (sibling — vocabulary for solution structure
vs problem domain). README gains a codebase-design bullet.

Source: mattpocock/skills@main engineering/codebase-design/. R+Py
testability examples replace upstream TS originals.
2026-06-19 00:37:37 +02:00

4.9 KiB

name, description
name description
sieve A Socratic gate that decides whether a change earns its place before you seal it — every line must pass three sieves (Real, Good, Minimal) to enter or to stay. The burden is on keeping, not cutting. Use when the user says "sieve", "/sieve", "should we build this", "is this worth it", "justify keeping this", "Real Good Minimal", "do we need this", before adding a feature/file/dependency, or before pruning one — any decision about whether code deserves to exist.

sieve

When to use

  • User says "sieve", "/sieve", "should we build this at all", "is this worth it", "justify keeping this", "do we actually need this".
  • About to add — a feature, file, dependency, abstraction, parameter.
  • About to prune — and a deletion is being defended ("but it's clearer").
  • A backlog item says "do X properly" — is the current way wrong, or just cheaper-to-improve?

Core principle

The burden is on keeping, not cutting. A line does not get to exist by default and survive review by inertia. To enter — or to stay — it must pass all three sieves. Fail one, it goes. This is the inversion that keeps the gate from becoming a rubber stamp: "Good" must justify survival, it cannot merely excuse it.

The three sieves

Each surviving line must pass all three:

  1. Real — Is the need true? Does the requirement actually exist, or is it imagined / speculative / "might need it later"? A speculative abstraction, a config nobody configures, a flag with one value — fails Real. Before taking on a "do it properly" change, prove the current way is actually wrong, not merely improvable — that sets the bar the change must clear.

  2. Good — Does it leave the code better than you found it — clearer to the next reader, sounder in shape — not merely shorter? This sieve faces forward (adds value), it does not crouch (guard against loss). But betterment must be real, not cosmetic: a change that only makes the code shorter, or only looks tidier, has not passed Good. Name the concrete thing it improves; if you can't name it, it hasn't.

  3. Minimal — Is this the leanest form that works? stdlib before custom code; a native feature before a dependency; an installed dependency before a new one; one line before fifty. Only then, minimal hand-written code.

Sieve at the boundary, never in the sandbox

The gate fires where scratch becomes artifact — a commit, a pipeline target, a published report. Inside the sandbox (a REPL, a spike branch, a scratch.* file) generation runs free; pruning exploration early throws away its option value. Run the sieve at the seal step (your jj describe), not per keystroke — otherwise it fights iteration.

Modes

Context What the gate guards
Build gates adding; Good leans forward — it is the sieve that lets necessary robustness in (validation, error handling), curing the under-build failure mode of pure YAGNI.
Prune gates keeping; default-delete, Good must earn each survivor (see ../winnow/SKILL.md for the mechanical cut).
Analysis gates the artifact (_targets.R, the report), never the scratch. Minimal is sharp and dangerous here: no type-checker catches a cut that changes a conclusion. Good carries epistemic weight — does removing this change what the analysis concludes? A kept step names the inference it supports.

Intensity

  • Lite — collapse to one sieve (Real?) for a one-liner; don't tax a trivial edit with the full ceremony.
  • Full (default) — all three sieves, balanced.
  • Ultra — suspend Good. Only Real + Minimal run, default-delete, no "but clarity" reprieve. The aggressive debloat pass when you want it.

Guardrails

  • Never let "Good" pass a change you can't name a concrete improvement for — that is the cowardice loophole, and it is how debloating dies.
  • Never sieve the sandbox. Exploration is not bloat.
  • Never apply Minimal to analysis without the epistemic check — a clean report is not a true one (the analysis form of "green is not correct").
  • Exceptions that pass Good automatically: input validation, error handling that prevents data loss, security, accessibility, and explicitly requested behaviour. Don't simplify these away.

See also