Reference · Matt Pocock's Skills
Health Card
Keep the next feature easy: deepen the code, and fix the agent's environment.
Sources: codebase-design (+ DEEPENING.md), improve-codebase-architecture, retro, and their guides, commit 5beb35b.
Vocabulary (use these words exactly)
| Say | Means | Not |
|---|---|---|
| Module | Anything with an interface and an implementation, at any scale | unit, component, service |
| Interface | Everything a caller must know: types, invariants, ordering, errors, config, performance | API, signature |
| Seam | Where an interface lives; you can change behaviour there without editing there | boundary |
| Adapter | A concrete thing filling the slot at a seam (a role) | |
| Depth | Behaviour per unit of interface learned. Deep = small interface, lots behind it | lines ratio |
| Leverage / Locality | What callers get / what maintainers get from depth |
Four principles
- Deletion test: if complexity vanishes, the module was a pass-through; if it reappears across callers, it earns its keep.
- The interface is the test surface. Wanting to test past it means the module is the wrong shape.
- One adapter = hypothetical seam; two = real.
- Depth belongs to the interface. Internal seams stay private.
Testing across the seam, by dependency
| Dependency | Test with |
|---|---|
| In-process | Merge and test directly; no adapter |
| Local-substitutable | A local stand-in (PGLite, in-memory FS) |
| Remote but owned | A port: HTTP adapter for production, in-memory adapter for tests |
| True external | An injected port with a mock adapter |
Replace, don't layer: once tests at the deepened interface exist, delete the old shallow unit tests.
/improve-codebase-architecture
- Scope: take your direction, or read
git logfor hot spots. Best prompt: point it at the next spec and ask "how can we make this change easy?" - A subagent explores; each candidate must pass the deletion test.
- An HTML report in
$TMPDIR, with badgesStrong/Worth exploring/Speculative. It then stops and asks. It changes no code. - Grill one candidate → decision →
/to-spec→/to-tickets→/implement. Use one candidate per session.
- All
Speculativemeans it found nothing. - If it over-grills, say "don't grill me, just show the report."
- A rejection with a lasting reason becomes an ADR.
- Never drive a session with
/codebase-designalone. It's a reference, not a process.
/retro: where each finding goes
| Session symptom | Fix |
|---|---|
| Slow to find a file or fact | Navigation pointer |
| A mistake a tool could catch (mechanical) | Deterministic check: lint, hook, or CI |
| The reviewer missed a judgement call | CODING_STANDARDS.md (read by the reviewer) |
| Couldn't reach information | Widen access (tee logs, read-only service access) |
Bloated CLAUDE.md/AGENTS.md | Move steering out; delete no-ops |
- Check the existing guardrails first: an unwired check gets wired up. No guardrail at all is a finding in itself.
- Run it in the same session; past the smart zone,
/clearand point it at the log. - It only proposes. Discard any candidate you can't trace to a specific moment.
CLAUDE.mdis for navigation pointers only.