From skills
Design a codebase to work well with AI coding agents (Claude Code, Codex, Cursor, Aider). Use this skill when the user is starting or retrofitting a repository for agents, asking what AGENTS.md or CLAUDE.md should contain, designing project structure for AI assistance, asking about harness engineering, saying an agent keeps making the same mistake, asking how to make agents reliable on long-running tasks, or trying to make their codebase legible to coding agents. Trigger on indirect phrasings too. Examples include "set up my project for Claude Code", "make my repo agent-friendly", "stop my agent from doing X", "best architecture for AI-generated code", or "the agent keeps reinventing utilities". Use proactively when the user describes building a project with agent assistance and has not yet thought about scaffolding, AGENTS.md, custom linters, hooks, or feedback loops.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skills:harness-codebase-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill helps users design (or retrofit) a codebase so coding agents can work in it reliably. The unifying mantra, from Mitchell Hashimoto: anytime an agent makes a mistake, engineer a fix into the environment so it cannot make that mistake again. The job is to design environments, specify intent, and build feedback loops, not to write code by hand.
references/01-mental-model.mdreferences/02-diagnostic-loop.mdreferences/03-knowledge-management.mdreferences/04-architectural-enforcement.mdreferences/05-application-legibility.mdreferences/06-tools-skills-subagents.mdreferences/07-feedback-loops.mdreferences/08-long-running-coordination.mdreferences/09-garbage-collection.mdreferences/10-throughput-and-merge.mdreferences/11-permissions-security.mdreferences/12-antipatterns-and-tiers.mdtemplates/AGENTS.md.templatetemplates/back-pressure-hook.sh.templatetemplates/docs-tree-skeleton.mdtemplates/golden-principles.md.templatetemplates/taste-invariants-starter.mdThis skill helps users design (or retrofit) a codebase so coding agents can work in it reliably. The unifying mantra, from Mitchell Hashimoto: anytime an agent makes a mistake, engineer a fix into the environment so it cannot make that mistake again. The job is to design environments, specify intent, and build feedback loops, not to write code by hand.
This file is a table of contents. The depth lives in references/. Read only the references you need for the current question.
templates/ when the user is ready.Ask only what is missing from the conversation so far. Use the ask_user_input_v0 tool when present; otherwise ask inline.
If the user gave a specific failure ("the agent keeps doing X"), skip diagnosis and go straight to references/02-diagnostic-loop.md.
Different patterns are load-bearing at different scales. Tag every recommendation by tier so the user does not over-build.
| User question or signal | Read this reference |
|---|---|
| "Where do I start" / "what is harness engineering" | references/01-mental-model.md |
| "The agent keeps doing X wrong" | references/02-diagnostic-loop.md |
| "What should AGENTS.md contain" / "is my CLAUDE.md good" | references/03-knowledge-management.md |
| "How should I structure docs" / "where does spec live" | references/03-knowledge-management.md |
| "How do I keep the agent from breaking architecture" | references/04-architectural-enforcement.md |
| "What should I lint" / "what taste rules to encode" | references/04-architectural-enforcement.md |
| "How does the agent see my running app" / "logs and UI" | references/05-application-legibility.md |
| "Should I install MCP X" / "too many tools" | references/06-tools-skills-subagents.md |
| "What are skills for" / "progressive disclosure" | references/06-tools-skills-subagents.md |
| "Should I use sub-agents" / "frontend engineer agent" | references/06-tools-skills-subagents.md |
| "Hooks" / "pre-commit" / "verification on stop" | references/07-feedback-loops.md |
| "Tests flooding context" / "back-pressure" | references/07-feedback-loops.md |
| "Multi-hour tasks" / "context resets" / "Ralph loop" | references/08-long-running-coordination.md |
| "Planner / generator / evaluator" / "GAN-style harness" | references/08-long-running-coordination.md |
| "Codebase drift" / "AI slop accumulating" / "cleanup PRs" | references/09-garbage-collection.md |
| "Should I block on flaky tests" / "merge gates at agent throughput" | references/10-throughput-and-merge.md |
| "What permissions should the agent have" / "MCP risks" | references/11-permissions-security.md |
| "What did not work for other teams" / "common mistakes" | references/12-antipatterns-and-tiers.md |
When the user wants concrete starter files, offer these:
templates/AGENTS.md.template: table-of-contents-style entry file under 100 lines.templates/docs-tree-skeleton.md: directory layout and stub files for the docs system of record.templates/golden-principles.md.template: opinionated mechanical rules to enforce continuously.templates/taste-invariants-starter.md: a starter list of static checks worth encoding as custom lints.templates/back-pressure-hook.sh.template: a verification hook with silent-success, verbose-failure semantics.Do not output every template at once. Ask which ones the user wants.
When recommending patterns drawn from the broader literature, be honest about what is still being learned:
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub jewunetie/skills --plugin skills