mcpbeat

Code That Fits In Your Head

codealive-ai/code-that-fits-in-your-head

Software-engineering heuristics based on Mark Seemann's Code That Fits in Your Head (2021), updated for agent-driven development. Use when writing or reviewing code, refactoring accidental complexity or a Big Ball of Mud, controlling technical or architectural debt in generated code, designing APIs and invariants, adding a feature through a walking skeleton and acceptance tests, debugging a defect with reproducible tests or bisection, threat-modelling endpoints and trust boundaries with STRIDE, planning a legacy or Strangler migration with rollback, or setting up a maintainable codebase. Covers decomposition and cyclomatic complexity, cohesion, encapsulation, outside-in TDD, separation of concerns, Git/review discipline, safe evolution, and troubleshooting. Not for language syntax, framework tutorials, production incident response, or performance profiling.

86k tokens
context cost
the whole folder, loaded on every use
53
files
instructions only
0
copies elsewhere
how many repositories repackaged it
115
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/CodeAlive-AI/ai-driven-development --skill code-that-fits-in-your-head

What comes with it

256 198 bytes besides the instruction
.skill_edit_log.jsonl
.skill_snapshots/SKILL.000254bf.md
README.md
guidelines.md
references/agent-native/hallucination-debugging.md
references/agent-native/knowledge.md
references/agent-native/reviewability.md
references/agent-native/types-as-guardrails.md
references/agent-native/verification-loops.md
references/api-design/examples.md
references/api-design/knowledge.md
references/api-design/rules.md
references/code-navigation/knowledge.md
references/code-navigation/rules.md
references/codebase-setup/checklist.md
references/codebase-setup/knowledge.md
references/codebase-setup/rules.md
references/decomposition/examples.md
references/decomposition/knowledge.md
references/decomposition/patterns.md
references/decomposition/rules.md
references/decomposition/smells.md
references/encapsulation/examples.md
references/encapsulation/knowledge.md
references/encapsulation/rules.md
references/evolution/examples.md
references/evolution/knowledge.md
references/evolution/patterns.md
references/evolution/rules.md
references/foundations/knowledge.md
references/foundations/rules.md
references/outside-in-tdd/examples.md
references/outside-in-tdd/knowledge.md
references/outside-in-tdd/patterns.md
references/outside-in-tdd/rules.md
references/practices-glossary/knowledge.md
references/security/checklist.md
references/security/knowledge.md
references/security/rules.md
references/separation-of-concerns/knowledge.md

The instruction itself

6 sections, as written by the author

Code That Fits in Your Head

Engineering heuristics for sustainable software, based on Mark Seemann's 2021 book and clearly labelled agent-era amendments.

Philosophy (Why This Skill Exists)

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:

  • Successful software endures. Prefer changes that preserve clear boundaries and keep future change affordable.
  • Complexity is the enemy, not task size. Agents can complete changes spanning tens of thousands of lines when architecture, plan, and acceptance criteria are sound. Reject needless coupling, duplication, hidden effects, and unverifiable bulk—not large scope by itself.
  • Heuristics, not laws. Understand the purpose of a rule before applying or relaxing it. Project policy overrides generic formatting and workflow conventions.
  • Verification is part of design. Types, tests, schemas, architecture checks, observability, and explicit acceptance criteria constrain both human- and agent-written code.
  • Code is a liability. Generated volume is not progress. Prefer the smallest coherent design that solves the problem without accumulating debt.

See references/foundations/ for more on sustainability, readability, and brain-limited design.

How to Use This Skill

  • Identify the user's task (writing, reviewing, debugging, security review, setting up, etc.)
  • Read guidelines.md — it maps tasks and symptoms to specific reference files
  • Load only the reference files relevant to the current task (progressive disclosure)
  • Apply the rules; when in doubt, consult references/practices-glossary/ for cross-references

Chapter Index

| 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/outside-in-tdd/ | Writing new features test-first; walking skeleton, AAA, triangulation, devil's advocate, editing tests |

| 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 running systems; feature flags, Strangler pattern, versioning, regular dependency updates, Conway's law |

| references/troubleshooting/ | Debugging a defect; scientific method, rubber ducking, reproduce-as-test, bisection, non-deterministic defects |

| references/security/ | Threat modelling; STRIDE (spoofing, tampering, repudiation, info disclosure, DoS, elevation) |

| references/code-navigation/ | Onboarding to a code base; big picture, file organisation, cycles, property-based testing, behavioural code analysis |

| references/practices-glossary/ | Looking up a named book practice and its current status |

⚠️ Editorial amendments (NOT from the book)

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/ | Agent-specific verification integrity, hallucination and dependency grounding, executable guardrails, and accountable review |

Workflows

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 from scratch | workflows/add-feature-outside-in.md |

| Investigate and fix a defect | workflows/debug-defect.md |

| Threat-model a new endpoint | workflows/threat-model.md |

See guidelines.md for the full routing layer (task → file, symptom → file, decision tree).

How to use it

Copy the folder

Take codealive-ai/code-that-fits-in-your-head from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.