How to write a single skill — Anthropic's official guide covers that. This is the layer above: how a collection of skills and multiple agents form a self-consistent, evolvable, verifiable system. Seven design principles + an empirical evaluation loop.
This is not a guide to writing a good single skill — progressive disclosure, description fields, degrees of freedom: Anthropic's official best-practices covers that thoroughly.
This guide addresses the layer above: how a collection of skills and multiple agents forms a coherent system. Think of each skill as a module, its trigger as an interface, its output as a contract, and the core prompt as the kernel. When modules multiply and agents start orchestrating each other, piece-level correctness no longer implies system-level correctness. That's when you need systems engineering: coverage, orthogonality, interface contracts, regression, end-to-end verification. The seven principles below handle static coherence; the evaluation loop handles empirical verification.
You're building a coding agent: write-tests, review-diff, debug, commit, refactor — with a planner skill orchestrating them via workflow. Each skill looks fine in isolation. Together, things break. The six principles below use this system to show exactly how and why.
These seven aren't independent rules — they're an interlocking system. Each answers one fundamental design question.
commit skill. But refactor and review-diff subagents never see commit, so they skip tests and commit dirty code.commit skill only covers the mechanics of how to commit.review-security skill because "security review feels related to code review." Now review-diff and review-security triggers overlap — the same diff fires both, the agent receives two contradictory authorities.review-diff, not a separate regime. Merge it or demote to a reference file.write-tests and run-tests, but no skill handles "CI is red and I don't know why." The agent improvises every time — different approach each run, impossible to predict or debug.confidence=low + severity=critical finding is a valid and required output. Thin evidence means lower the confidence and flag the false-positive risk — but do not lower the severity to hide the candidate. Lowering severity to bury a finding is the real failure of this role.
skill/reference/responsibility.md (the full posture system prompt, including the three-state accountability model for skipped lenses). A skill decides how to audit a category; that document decides whether to audit it — the latter is not governed by a skill body.
scripts/selfcheck.py (or a fixture + expected output) next to SKILL.md and wire it into the eval loop; a red self-check blocks the change at the gate — not at 02:00 in production.Layer by frequency of use, not importance. Important knowledge that's only needed on demand shouldn't live in the prompt.
reference/: deep methodology, decision trees, routing tables, domain factsscripts/: executable scripts, tool code, data processingOperational definition of regime (the central decision predicate of this whole methodology — pin it down before reading the matrix): two candidate skills are the same regime iff they share trigger conditions AND share a standard of good work — otherwise they are different regimes. "Content feels related" does not count; security review and code review share a trigger (the same diff), so they are two modes of one regime, not separate skills.
SKILL.md holds text and methodology only. Code → scripts/, decision trees and domain facts → reference/. (Short inline examples are fine.)
Note: Anthropic's official format only requires name and description. Fields marked "required" below are this methodology's conventions for system coherence — not platform hard requirements.
Not for X (→ [[sibling]]). This is a machine-readable contract, not descriptive text.→ not doing X → [[sibling skill]]. This is the interface contract. Without it, orthogonality can't be verified and scope creep is invisible.reference/. High-frequency first, low-frequency last.Make the cost concrete before the taxonomy — the bill arrives in production, not in a design doc. Trigger conflict: two skills both fire on the same turn; at 02:00 the agent picks the wrong one, emits the wrong handoff artifact, and the planner builds a plan on a misread intent — by morning the system has taken hundreds of actions on a false premise; the post-mortem names whoever let the triggers overlap. Coverage gap: Friday 17:00, under release pressure, the agent hits a real state no skill owns; it reaches for "probably fine / leave it for the next pass," improvises an answer, and the deploy ships — Monday the regression suite catches it, but the Friday deploy already reached users; whoever left that matrix cell without an owner signed off on it. Floating skill: a skill that can't be traced to a Kernel principle has nothing tying it down; you delete a sibling's reference, this skill's trigger still points at the deleted file, and three weeks later an audit shows it has been silently no-op'ing on every call since — whoever demoted the reference without checking inbound pointers owns that downtime. You sign off on the gaps and overlaps you don't surface — carry that.
scripts/. Decision trees → reference/routing-table.md. Schema → reference/. Short inline examples are fine.scripts/ or reference/. SKILL.md is a methodology document, not an implementation document.The six principles and seven questions audit static design coherence — it reads right, but it might not run right. Whether the system truly covers the state space, whether triggering is truly deterministic, whether changing one thing breaks another — you only know by running it on real inputs.
Single-skill evaluation asks "does this piece work?" System-level evaluation asks "do all pieces together cover the space, trigger unambiguously, survive changes, and run end-to-end?"
should_trigger=true/false regression + blind A/B — an official in-skill eval workflow (still a meta-skill, and single-skill only). Extending to system-level regression (trigger disambiguation, coverage, cross-agent contracts, end-to-end) remains this document's extrapolation. Evals mostly use natural-language rubrics graded by model — not strict assertion-style unit tests.
Both concepts were referenced throughout — here's the complete definition and implementation guidance.
should_trigger eval (skill-creator v2) / trigger disambiguationhandoff.json) for each handoff point, write it into the skill's "output contract" section, and assert it from both sides.
→ Versioning (fixes contract drift): add a contract_version field to the artifact. Any breaking contract change (field, path, or format) must bump the version, ship a migration note, and be gated by the system-wide regression suite — so downstream can detect that upstream's contract changed. Failure handling: contracts specify only the success schema; what happens when a sub-skill emits a malformed artifact or the planner routes into a dead end should be explicitly declared as the planner skill's responsibility (retry / escalate / abort) — don't leave it hanging. Eval step 4 can add: inject a contract violation, assert the planner detects it and takes the defined recovery path.
locked/ and seed/ directory split (or file-level annotations) — constitutional constraints in locked/ (read-only), methodology skills in seed/ (evolvable).
→ Wire self-evolution to the regression gate (completes the trust model's verification): an agent-authored seed/ change is still a skill change — it must re-pass the system-wide regression suite (eval step 5) before taking effect; changes touching a trigger or Not-for boundary additionally require a recorded diff, and constitution-adjacent skills require a human-approval gate. The locked/ category (which holds the evaluation authorities) is the fulcrum that makes this enforceable — the agent cannot rewrite its own eval oracle.