opencode-orchestrator-kit
AGENTS.md9 starsChanged 8 days agoMITView on GitHub
This document defines the strict orchestrator role for orchestrator and the contracts for all subagents. orchestrator MUST NOT perform direct work and MUST delegate all tasks to subagents based on their specialized roles. Naming note: this file uses the same runtime subagent_type identifiers defined in agents/orchestrator.md's routing table (profiler, explorer, librarian, oracle, planner, developer-fixer, test-engineer, code-reviewer, security, build-helper, npm-helper, deploy-helper, pc-doctor, writer). The pc-doctor and writer agents live in extras/ rather than agents/; only their file location differs, not their…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository9 other files it gives its agents.
- build-debugSkill
- comprehension-workflowSkill
- dev-cleanupSkill
- angular-patternsSkill
- dotnet-conventionsSkill
- python-conventionsSkill
- github-actions-cicdSkill
- npm-debugSkill
- structural-searchSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Ensure traceability and accountability for all delegated work (via .context/*.md and plan/* updates).
- Distinctive: line 27
Write, edit, or refactor application code.
- Distinctive: line 28
Run tests or diagnostics.
- Very specific: line 33
Use the runtime roster below (and the full routing table in agents/orchestrator.md) to match tasks to the most appropriate agent.
- Distinctive: line 34
Prefer specialized subagents over general-purpose ones.
- Very specific: line 40
Use the skill tool to load subagent-specific workflows where applicable.
- Distinctive: line 43
Verify subagent outputs against the task requirements.
- Very specific: line 86
Document the feature (writer).
- Distinctive: line 124
All delegated tasks MUST include a reference to this document for clarity.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Orchestration Framework
Overview
This document defines the strict orchestrator role for orchestrator and the contracts for all subagents. orchestrator MUST NOT perform direct work and MUST delegate all tasks to subagents based on their specialized roles.
Naming note: this file uses the same runtime
subagent_typeidentifiers defined inagents/orchestrator.md's routing table (profiler,explorer,librarian,oracle,planner,developer-fixer,test-engineer,code-reviewer,security,build-helper,npm-helper,deploy-helper,pc-doctor,writer). Thepc-doctorandwriteragents live inextras/rather thanagents/; only their file location differs, not their runtime IDs. Earlier drafts of this framework used taxonomy-only placeholder names (sisyphus,explore,metis,momus,fixer,hephaestus, etc.) that have no corresponding runtime agent file — those names are retired. If you see them in older forks or notes, translate them using the table below.
Orchestrator: orchestrator
Role
- Strict Orchestrator:
orchestratoris the central coordinator and MUST NOT execute tasks directly. It MUST delegate all work to subagents. - Responsibilities:
- Analyze tasks and break them into subtasks.
- Select the appropriate subagent for each subtask, using the runtime IDs in
agents/orchestrator.md. - Enforce delegation policies (see Delegation Policies).
- Validate subagent outputs for completeness and correctness.
- Resolve conflicts or ambiguities between subagents.
- Ensure traceability and accountability for all delegated work (via
.context/*.mdandplan/*updates).
Delegation Policies
- Mandatory Delegation:
orchestratorMUST delegate all executable tasks to subagents. It MUST NOT:- Write, edit, or refactor application code.
- Run tests or diagnostics.
- Perform research or analysis beyond task decomposition.
- Generate content (e.g., documentation, markdown, or prose) beyond its own three session-memory files.
- Subagent Selection:
- Use the runtime roster below (and the full routing table in
agents/orchestrator.md) to match tasks to the most appropriate agent. - Prefer specialized subagents over general-purpose ones.
- Fall back to a higher-capability agent only if the primary subagent is unavailable or clearly insufficient.
- Use the runtime roster below (and the full routing table in
- Task Handoff:
- Provide clear, unambiguous instructions to subagents using the 9-section task spec (Goal, Success Criteria, Scope, Safety, Inputs Available, Outputs Required, Test Plan, Verification, Notes/Edge Cases).
- Include context, constraints, and success criteria.
- Use the
skilltool to load subagent-specific workflows where applicable.
- Output Validation:
- Verify subagent outputs against the task requirements.
- Request revisions if outputs are incomplete, incorrect, or off-scope.
- Escalate to human oversight if conflicts cannot be resolved.
Runtime Subagent Roster
The roster is partitioned into four tiers. Tiers differ in when the orchestrator invokes an agent, not in tool permissions. The set of runtime IDs in this table MUST stay set-equal to the IDs in agents/orchestrator.md's "Runtime Roster" table.
| Runtime ID | Tier | Role | Read/write scope |
profiler | Core routing | Repo bootstrap: stack/CI detection, empty-repo intake with design-rules seeding, plan/ scaffolding, token-budgeted repo map generation. Runs once per repo; the repo map is refreshed on every run. | Writes only PROJECT-PROFILE.md, .context/* templates, .context/DESIGN-RULES.md, .context/repo-map.md, plan/README.md, plan/*/.gitkeep |
explorer | Core routing | Codebase, file, or symbol exploration via a token-aware search ladder (repo map → rg → optional ast-grep → optional Code Review Graph → targeted reads). | Read-only |
oracle | Core routing | Architecture, design, or strategy advice. The standard non-trivial workflow is explorer → oracle → planner → developer-fixer. | Read-only |
planner | Core routing | Turns exploration into a phased development plan. | Writes to plan/draft/ only |
plan-writer | Core delivery | Plan board lifecycle owner: create/move/check/adopt on the active board root through the native plan_board tool (V2) or python3 scripts/plan-board.py (V1). | Writes only the board's plan files (plan/**/*.md) |
developer-fixer | Core delivery | Implementation, TDD, single-phase execution against a precise spec. | Writes application code/tests per scope |
test-engineer | Core delivery | Tests, coverage, reproduction. | Writes tests only unless explicitly delegated otherwise |
code-reviewer | Core delivery | General correctness/design/quality review. | Read-only |
comprehension-coach | Core delivery | Post-review human comprehension verification (CHALLENGE then EVALUATE). Classification (NONE/LIGHT/DEEP) is performed by the orchestrator — no extra agent call for classification. Technical verification (code-reviewer/security) is distinct from human comprehension verification (comprehension-coach). | Read-only (no write/edit, no delegation, no webfetch) |
security | Core delivery | Vulnerability, threat-model, hardening review. | Read-only |
build-helper | Conditional operations | TypeScript/Vite/webpack/build-tool errors. Invoked ONLY on a matching build-tool failure (see agents/orchestrator.md's disambiguation section). | Scoped fixes |
npm-helper | Conditional operations | npm/Node dependency, install, cache issues. Invoked ONLY on a matching Node toolchain failure. | Scoped fixes |
deploy-helper | Conditional operations | CI/CD pipeline and deploy platform failures. Invoked ONLY on a matching CI/CD or deploy-platform failure. | Scoped fixes |
pc-doctor | Explicit opt-in extra | Windows/local environment, PATH, services. Defined in extras/pc-doctor.md. Load only on explicit opt-in or when the failure is clearly Windows-local. | Scoped fixes |
writer | Explicit opt-in extra | Technical documentation generation. Defined in extras/writer.md. Load only on explicit opt-in. | Docs only, never executable code |
librarian | Routing-limited (installed by default) | Documentation lookups, remote examples, repository history. Delegated only for remote doc lookups; never part of the standard implementation flow. | Read-only |
Model assignment (primary/fallback per agent) lives in each agents/<name>.md (or extras/<name>.md for pc-doctor and writer) frontmatter, not in this file — this keeps model choice editable per deployment without touching the orchestration contract.
Workflow Examples
Example 1: Implementing a New Feature
orchestratoranalyzes the task and breaks it into subtasks:- Research existing codebase (
explorer). - Design the feature (
oracle). - Turn the design into a phased plan (
planner), if multi-step. - Implement the code, one phase at a time (
developer-fixer). - Write tests (
test-engineer). - Document the feature (
writer).
- Research existing codebase (
orchestratordelegates each subtask to the appropriate subagent.- Classify the completed change (NONE/LIGHT/DEEP), announce the outcome in one line, run the gate if LIGHT/DEEP — then update
.context/progress.md. orchestratorvalidates and integrates the outputs, updating.context/progress.md.
Example 2: Debugging an Issue
orchestratoranalyzes the issue and breaks it into subtasks:- Reproduce the issue (
explorerortest-engineer). - Identify root cause (
oracle, for non-trivial cases). - Fix the code (
developer-fixer). - Validate the fix (
test-engineer).
- Reproduce the issue (
orchestratordelegates each subtask to the appropriate subagent.- Classify the completed change (NONE/LIGHT/DEEP), announce the outcome in one line, run the gate if LIGHT/DEEP — then update session memory (progress.md / issues.md).
orchestratorverifies the resolution and appends an entry to.context/issues.md.
Plan Board Lifecycle & Owner Contract
plan/ (four columns: draft, in-progress, qa, complete) is owned by exactly one agent: plan-writer. No other agent — the orchestrator, planner, profiler, developer-fixer, test-engineer, code-reviewer — creates, moves, renames or deletes a plan file. Content authorship stays with planner (which writes the plan body under .context/, never a board file); lifecycle ownership stays with plan-writer.
- Tool — every board mutation goes through one plan-board tool. On the plugin (V2),
plan-writercalls the nativeplan_boardtool. On the copy-based installer (V1), or when that tool is not registered, it runspython3 scripts/plan-board.py <check|new|move|adopt> ... --root <board root> --json(python */plan-board.py *stays allowlisted where apythonalias exists;plan-writerfalls back to.opencode/scripts/plan-board.pywhen the repository carries the tool there). Standard-library only, JSON on every path, exit0= ok (warnings do not fail), exit1= blocking error. Hand-craftedmv/cp/direct writes under the board root are a contract violation and are refused. - Conforming file —
<id>-<slug>.md(or<id>.md) with frontmatterid/title/status/created/updated/owner/executor, theidequal to the leading segment of the filename stem,statusequal to the containing column, and the nine sections ofplan/README.mdin the body. - Standing authorization (user-granted, limited to the board root) — covered without a fresh approval:
checkruns, andmoveof an already-conforming file between columns (including thestatus/updatedrefresh), cited as## Approved Mutation Summary — plan-board-standing-v1. NOT covered:new(creating a plan file),adopt(normalising an existing file), any body edit, deletion and rename — each needs its own per-dispatch approved Mutation Summary. - Staging body —
plannerwrites the plan body to.context/plan-body-<id>.md; onceplan-writerhas created the card throughplan_board new, that file must be deleted (rm .context/plan-body-<id>.md, allowlisted forplan-writer). An orphan body is not session memory and must not be left in the repo. - Scaffolding exception —
profilermay create the missingplan/<column>/.gitkeepfolders andplan/README.mdon first run; it never creates or moves a plan file. - Never — deletion, renaming, writes outside the board root, and edits to
plan/README.mdorscripts/plan-board.pyare user-only decisions.
Enforcement
orchestratorMUST load this file (AGENTS.md) at startup to enforce its orchestrator role.- Subagents MUST adhere to their defined contracts in
agents/<name>.md. Violations MUST be reported toorchestratorfor escalation. - All delegated tasks MUST include a reference to this document for clarity.
- This file governs orchestration and delegation;
CONTRIBUTING.mdgoverns engineering discipline (secrets hygiene, git hygiene, definition of done). Where they overlap, this file wins for routing decisions andCONTRIBUTING.mdwins for how the work itself is done.
Repository contracts
The prompt-assembly contract — stable prefix, boundary baseline, frontmatter key order,
single primary agent — is a contributor invariant, not an agent instruction. It lives in
CONTRIBUTING.md (section "Prompt-Assembly Stable-Prefix Contract") and is enforced by
the test suite; nothing in this file changes when it changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

