Get oriented in the repository within 30 minutes. After this chapter you can open any agent file, run the eval harness, and follow an end-to-end task scenario step by step.
ControlFlow/
├── *.agent.md ← 13 agent prompt files (P.A.R.T. structure)
├── schemas/ ← 15 JSON schemas (inter-agent contracts)
├── governance/ ← 5 JSON configs (permissions, policies, routing)
├── skills/
│ ├── index.md ← Skill registry
│ └── patterns/ ← 11 reusable domain patterns
├── evals/ ← Offline validation suite
│ ├── validate.mjs
│ ├── scenarios/ ← Regression fixtures
│ └── tests/
├── plans/
│ ├── project-context.md ← Agent roster, tiers, taxonomy
│ ├── session-outcomes.md ← Persistent session log
│ ├── templates/ ← Plan and gate-event templates
│ └── artifacts/ ← Per-task history
├── plugins/
│ ├── controlflow-claude-code/ ← Portable Claude Code plugin
│ └── controlflow-codex/ ← Portable Codex CLI plugin
├── docs/
│ └── agent-engineering/ ← Engineering policy docs
└── NOTES.md ← Active objective state
The canonical verification command is:
cd evals && npm testThis runs ~410 offline checks — schema validation, behavioral invariants, orchestration handoff contracts, and drift detection. No live agents, no network calls.
Faster targeted runs:
npm run test:structural # schemas and P.A.R.T. structure only
npm run test:behavior # behavior + handoff + drift onlyRun npm install once before npm test if you haven't already.
flowchart TD
User([User]) --> Planner
User --> Orchestrator
Planner -->|handoff| Orchestrator
Orchestrator --> PlanReview[Plan Review\nPlanAuditor / AssumptionVerifier / ExecutabilityVerifier]
PlanReview -->|approved| Execution[Phase Execution\nCoreImplementer / UIImplementer / PlatformEngineer\nTechnicalWriter / BrowserTester]
Execution --> CodeReviewer[CodeReviewer]
CodeReviewer -->|approved| Orchestrator
Orchestrator -->|approval gate| User
Entry points:
@Planner— for vague goals; runs an idea interview, produces a phased plan.@Orchestrator— for a concrete task or an existing plan; dispatches subagents and manages gates.@Researcher— for evidence-based investigation.@CodeMapper— for quick codebase exploration.
Open CoreImplementer-subagent.agent.md. You will see:
- YAML frontmatter —
description,tools,model,model_role. - ## Prompt — mission, scope, contracts, state machine.
- ## Archive — context compaction, memory, state tracking.
- ## Resources — canonical schemas and docs.
- ## Tools — allowed and disallowed tools.
This is the P.A.R.T. structure — every *.agent.md follows it in exactly this order. → Chapter 04
Task: "Add CSV export to the orders page."
Here is a simplified walkthrough of what happens:
- User invokes
@Plannerwith the task description. - Planner conducts an idea interview if the scope is ambiguous (format? which endpoint? auth required?).
- Planner runs a clarification gate — checks for scope ambiguity, architecture forks, destructive risks.
- Planner classifies complexity — likely
SMALLorMEDIUM(one domain, ~5 files). - Planner selects skills — e.g.,
tdd-patterns.md,error-handling-patterns.md. - Planner decomposes into phases — e.g., Phase 1: add service layer; Phase 2: add endpoint; Phase 3: add tests.
- Planner hands off to Orchestrator via
plan_path. - Orchestrator evaluates PLAN_REVIEW triggers — if
MEDIUM, dispatches PlanAuditor + AssumptionVerifier. - Reviewers return verdicts — if approved, Orchestrator requests user approval.
- User approves — Orchestrator enters
ACTING. - Phase 1 dispatched to
CoreImplementer-subagent. - CoreImplementer returns an execution report with changes, tests, build state.
- CodeReviewer dispatched — validates implementation against phase scope.
- CodeReviewer returns
APPROVED(assuming no blocking issues). - User approves phase — Orchestrator advances to Phase 2.
- Repeat for remaining phases.
- Orchestrator emits completion summary — user reviews and approves commit.
| Goal | Chapter |
|---|---|
| Understand the 13 agents | Chapter 03 |
| Understand orchestration states | Chapter 05 |
| Understand plan structure | Chapter 06 |
| Understand the review pipeline | Chapter 07 |
| Understand schemas | Chapter 09 |
| Understand governance | Chapter 10 |
- (beginner) Open
Planner.agent.md. Identify the boundary between each of the four P.A.R.T. sections. Note the line numbers. - (beginner) Run
cd evals && npm test. How many checks passed? How long did it take? - (intermediate) Open
governance/runtime-policy.json. Findreview_pipeline_by_tier. Which reviewers are active forMEDIUM? - (intermediate) Open
schemas/planner.plan.schema.json. Find thecomplexity_tierenum. What are the four allowed values?
If you are using the Cursor IDE, ControlFlow includes a .cursor/rules/ directory with version-controlled Project Rules (.mdc files). Cursor loads these rules automatically when you open the project — no installation or extra configuration required. The rules give Cursor's AI agent high-level instructions about this repository's conventions, agent roles, and architectural principles.
This helps the agent provide more relevant assistance, but it does not enable Cursor to run the full multi-agent orchestration system. For authoritative details, see docs/agent-engineering/CURSOR-SUPPORT.md.
- What is the canonical verification command?
- How many agents are in the system and which file describes them all?
- Name the four P.A.R.T. sections in order.
- What happens when a plan is handed off from Planner to Orchestrator — is it auto-approved?