Designs orchestrator-and-subagent hierarchies for a repository — splitting agents by exclusive write surface, pairing every producer with an independent auditor, and enforcing the split with a script that runs in CI. Use this whenever the user wants to set up, expand, audit, or fix a multi-agent or subagent structure for a codebase; asks how to divide work between agents; wants agent charters, roles, or a surface map written; or is hitting agents that collide on the same files, review their own work, or drift from their remit. Also use when sizing a roster or deciding whether a new agent is justified.
npx skills add https://github.com/cbrock84/headcount --skill agent-hierarchy
A method for standing up an orchestrator → specialist-subagent hierarchy, extracted from a
working implementation of ~24 agents over a 1,500-file monorepo, machine-checked on every PR.
Split agents by write surface, not by topic. Two classes only: builders, which edit
inside exactly one exclusive surface and never commit, and reviewers, which are permanently
read-only and can always run in parallel. The orchestrator — the main chat — is the sole
committer. Write the surface map before any charters, keep it in one Markdown file, and
enforce it with a script that runs in CI. Producer and auditor are never the same agent. For
each class of fact, exactly one file owns it and everyone else derives.
"One agent on SEO, one on UI" is the intuitive split and it breaks immediately: both end up
editing tokens.css. Neither is wrong, and neither can be held responsible. A surface split
has no such overlap by construction — which is exactly what makes it checkable.
Do not start writing charters early; the order is the method.
git ls-files | sed 's|/[^/]*$||' | sort -u. Report what isactually there before proposing anything.
id, a class, a one-line remit, and its exact globs. An agent whose surface cannot be stated
in globs is not an agent; fold it in.
scripts/agent-guard.mjs check proves the map is coherent (no pathclaimed twice, no path unowned); agent-guard.mjs diff <agent> proves a given diff obeyed
it. Both are needed: once the orchestrator commits, the authorship that diff checks is
gone, so it has to run while the work is still attributable.
never do, the verification its surface implies, and a six-section return contract.
reliably approves it.
a surface makes it a builder that can also merge.
diverge and nobody notices which is stale.
from inside the core. Deprecate, announce, then remove.
docs/DECISION-LOG.md is the live instance of the decision log described in the playbook. When a
decision is raised, assign it the next number immediately — before it is answered — and give it
lettered options with an explicit recommendation. Never renumber, never reuse a number, and record
resolutions in place rather than deleting them.
references/playbook.md — the full 415-line playbook: surface splitting, the guard, theregistry, the decision log, anti-patterns with their failure modes, sizing, multi-repo and
shared-core layouts, the charter format, and a day-one checklist.
references/starter-rosters.md — concrete rosters for a mobile-app portfolio, a gameportfolio, and a shared core, with producer/auditor pairings.
references/bootstrap-prompt.md — a fill-in-the-blanks prompt for standing this up in afresh session against a target repo.
scripts/agent-guard.mjs — the executable guard. No dependencies, Node 18+.Take cbrock84/agent-hierarchy from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
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.