Agent Hierarchy logo

Agent Hierarchy

CommunityPopular
cbrock84
agent-hierarchy

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.

Overview

Publishercbrock84
Repositoryheadcount
Skill nameagent-hierarchy
Stars
1.6K
Forks
237
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by cbrock84 on GitHub. Read the source before you install it.

Installation

Install the Agent Hierarchy AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cbrock84/headcount.git /tmp/headcount
mkdir -p .claude/skills
cp -r /tmp/headcount/plugins/executive/skills/agent-hierarchy .claude/skills/agent-hierarchy
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Hierarchy in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agent Hierarchy on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agent Hierarchy is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

The whole method in one paragraph

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. Each row also carries an authorityautonomous, proposes, or escalates — which answers the separate question of whether that agent's work may land without a decision; most rows are autonomous, and gating everything makes the gate meaningless. Producer and auditor are never the same agent. For each class of fact, exactly one file owns it and everyone else derives.

Why topic splits fail

"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.

Order of operations

Do not start writing charters early; the order is the method.

  1. Inventory the real treegit ls-files | sed 's|/[^/]*$||' | sort -u. Report what is actually there before proposing anything.
  2. Propose the roster — the smallest set where no two agents share a file. Each needs an 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.
  3. Write the surface map — one Markdown file, one row per agent.
  4. Wire the guardscripts/agent-guard.mjs check proves the map is coherent (no path claimed 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.
  5. Write charters last, in the format in the playbook: why the agent exists, what it must never do, the verification its surface implies, and a six-section return contract.

Rules that carry a failure behind them

  • Producer and auditor are never the same agent. An agent that reviews its own output reliably approves it.
  • The orchestrator is not one of the two classes. It is the sole committer, and giving it a surface makes it a builder that can also merge.
  • One file owns each class of fact. Everything else derives from it, or the two copies diverge and nobody notices which is stale.
  • Never remove a shared-core export because it looks unused. You cannot see the consumers from inside the core. Deprecate, announce, then remove.

This repository's own log

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.

Never

  • Add an agent before the surface it will own exists. The map comes first, the agent second.
  • Let two agents hold a write claim on the same path. Overlap resolves itself as a race.
  • Hand-edit a generated artifact instead of the source it derives from.
  • Skip the guard because the change is small. Small changes are how surfaces drift.

References

  • references/playbook.md — the full 415-line playbook: surface splitting, the guard, the registry, 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 game portfolio, and a shared core, with producer/auditor pairings.
  • references/bootstrap-prompt.md — a fill-in-the-blanks prompt for standing this up in a fresh session against a target repo.
  • scripts/agent-guard.mjs — the executable guard. No dependencies, Node 18+.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Agent Hierarchy AI skill do?

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...

Why use Agent Hierarchy on TypingMind?

Because you install it once and use it with any model. Agent Hierarchy is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agent Hierarchy in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cbrock84/headcount/tree/main/plugins/executive/skills/agent-hierarchy. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Agent Hierarchy?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agent Hierarchy?

As many as you like. As long as a model supports skills, you can use Agent Hierarchy with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agent Hierarchy AI skill free?

Yes. It is published on GitHub by cbrock84 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇