/ai-driven-development:code-that-fits-in-your-headfrom ai-driven-development
Applies heuristics from Mark Seemann's Code That Fits in Your Head for writing maintainable code: small units, invariants in types, APIs hard to misuse, explicit effects. Use when refactoring, decomposing modules, designing types or APIs, debugging by hypothesis, or setting up CI gates.
Ships in ai-driven-development. 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.
Read when SKILL.md points to them.
Heuristics for the shape of code inside one code base, based on Mark Seemann's 2021 book and clearly labelled agent-era amendments: can the next reader, human or agent, hold a unit in mind and change it safely?
Code examples are C#-first; every rule and the tooling tables are language-neutral.
A question belongs to this skill when it is answered by reading the code.
| The question is answered by | Use |
|---|---|
| Reading the code: size, cohesion, coupling, names, types, explicit effects | This skill |
| Running something: which checks to write and at which level, whether a test can fail, a flaky or slow test, when a task is done | pragmatic-verification |
| Replaying a sequence of events: a retry, a crash, two writers, two versions; where state lives; how a schema or contract changes; rollout and rollback; what an untrusted caller can reach | pragmatic-architecture |
| Thinking before or around the code: which problem to solve, build or buy, a cause outside the code, delivery and operations | fpf-problem-solving |
The skill prescribes no order of writing tests and code. Test-driven development is a large part of the book; here it is left to pragmatic-verification, which treats it as one working technique among others. Two ideas from it stay, because they are about code and not about tests: build a feature as a thin slice from the boundary inward, and treat code that is hard to check as a design smell.
Software development is principally a design activity, not construction. An agent may produce most of the text, but people still review, operate, extend, and own the resulting system. These heuristics make software sustainable: understandable, resistant to architectural erosion, and cheap to change after thousands of decisions.
Core mental model from Chapter 1:
| Metaphor | What it gets right | What it misses |
|---|---|---|
| Building a house | Plans, structure | Software endures; there's no construction phase (compiling is free); dependencies can start anywhere |
| Growing a garden | Pruning, refactoring, tending | Code does not improve by itself; generated code still needs stewardship |
| Art / craft | Skill, mastery, situational knowledge | Doesn't scale; leaves newcomers without guidance |
| Engineering (the target) | Heuristics, review, sign-off, checklists | We're not there yet — physical-construction calculations don't apply |
"The act of describing a program in unambiguous detail and the act of programming are one and the same." — Kevlin Henney
Practical implications for a code agent:
See references/foundations/ for more on sustainability, readability, and brain-limited design.
guidelines.md — it maps tasks and symptoms to specific reference filesreferences/practices-glossary/ for cross-referencesworkflows/operationalize-finding.md) so it persists as a gate and in project agent instructions.| Topic | Use when... |
|---|---|
references/foundations/ | Sustainability, readability, complexity control, and code as liability |
references/codebase-setup/ | Starting or inheriting a code base — git, build automation, warnings-as-errors |
references/encapsulation/ | Designing types with invariants; DTO vs Domain Model, always-valid, Postel's law, parse-don't-validate |
references/decomposition/ | Controlling method and system complexity; cyclomatic complexity, cohesion, coupling, feature envy, fractal architecture |
references/api-design/ | Designing a public API; affordance, poka-yoke, CQS, hierarchy of communication, naming over comments |
references/separation-of-concerns/ | Adding cross-cutting concerns; Decorator pattern, logging, what to log, performance vs legibility |
references/teamwork-git/ | Writing commits, reviewing changes, continuous integration, collective ownership |
references/evolution/ | Changing code that other code depends on; Strangler at method and class level, temporary paths and their removal, versioning, deprecation, regular dependency updates |
references/troubleshooting/ | Debugging a defect; scientific method, rubber ducking, reproduce-as-test, bisection, non-deterministic defects |
references/code-navigation/ | Onboarding to a code base; big picture, file organisation, cycles, tests as documentation, behavioural code analysis |
references/tooling/ | Executable measurement commands: complexity, cycles, duplication, dead code, hotspots, architecture tests |
references/practices-glossary/ | Looking up a named book practice and its current status |
The folder below is NOT content from Seemann's book. It contains our own additions covering agent-specific concerns the 2021 book does not address. Do not attribute these files to Seemann. See references/agent-native/knowledge.md.
| Topic | Use when... |
|---|---|
references/agent-native/ | Hallucinated APIs and dependency grounding, types and schemas as guardrails, and accountable review of agent-authored changes |
Composite step-by-step processes live in workflows/:
| Task | Workflow |
|---|---|
| Review a pull request / piece of code | workflows/review-code.md |
| Add a new feature as a thin slice from the boundary inward | workflows/add-feature.md |
| Investigate and fix a defect | workflows/debug-defect.md |
| Turn a recurring finding into an executable gate and persist it in project memory | workflows/operationalize-finding.md |
See guidelines.md for the full routing layer (task → file, symptom → file).
README.md (opens in a new tab)guidelines.md (opens in a new tab)references/agent-native/hallucination-debugging.md (opens in a new tab)references/agent-native/knowledge.md (opens in a new tab)references/agent-native/reviewability.md (opens in a new tab)references/agent-native/types-as-guardrails.md (opens in a new tab)references/api-design/examples.md (opens in a new tab)references/api-design/knowledge.md (opens in a new tab)references/api-design/rules.md (opens in a new tab)references/code-navigation/knowledge.md (opens in a new tab)references/code-navigation/rules.md (opens in a new tab)references/codebase-setup/checklist.md (opens in a new tab)references/codebase-setup/knowledge.md (opens in a new tab)references/codebase-setup/rules.md (opens in a new tab)references/decomposition/examples.md (opens in a new tab)references/decomposition/knowledge.md (opens in a new tab)references/decomposition/patterns.md (opens in a new tab)references/decomposition/rules.md (opens in a new tab)references/decomposition/smells.md (opens in a new tab)references/encapsulation/examples.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-quality, refactoring, software-design, maintainability, heuristics
22 skills in this plugin
/agentic-readinessAudit and improve repositories for reliable agentic work across Codex and Codex App, Claude Code, and OpenCode. Use when reviewing AGENTS.md or CLAUDE.md quality and discovery, instruction routing in monorepos or meta-repos, agent settings, MCP configuration, skills, subagents, context budgets, or repository organization for coding agents./bug-fix-protocol8-step disciplined bug-fix protocol that treats every production bug as two failures — the code defect itself and the testing system that allowed it through. Use when fixing a production bug, investigating a regression, writing a post-mortem, or auditing a missed defect. Triggers on "fix this bug", "production bug", "regression test", "post-mortem", "test gap", "why did the tests miss this"./npx claudepluginhub codealive-ai/ai-driven-development --plugin ai-driven-developmentOther plugins' skills for the same job