0-orchestration — Claude Code rule: what it does, how to install
The 0-orchestration rule sets boundaries for TypeScript orchestrators: one dependency per area crossed and a cap of four other use cases.
MIT ★ 571 updated 2026-10-29
.claude/rules/0-orchestration.mdWhat 0-orchestration does
The rule applies to files matching src/contexts/*/application/**/*.ts. An orchestrator must depend on an area's entry point and keep that area's steps inside it. If it needs a second collaborator from the same area, that area is missing an entry point. The limit is firm: an orchestrator can call up to four other use cases.
The orchestrator-deps.arch.test.ts test counts injected dependencies and new XUseCase(...) calls, deduplicating by class. When an orchestrator exceeds the limit, the rule requires recording its baseline count and the reason. To use it in Claude Code, save the rule at .claude/rules/0-orchestration.md.
What it helps with
- cap the number of use cases called by an orchestrator
- route dependencies through each area's entry point
- prevent multiple collaborators from one area
- check injections and
new XUseCase(...)calls - record why an orchestrator exceeds its limit
Example prompts for the agent
- Check the orchestrator in
src/contexts/orders/applicationagainst0-orchestration. - Add orchestration for this use case while following
0-orchestration. - Check whether this orchestrator exceeds the dependency limit in
0-orchestration.
How to install 0-orchestration
Manually: put the files in place
.claude/rules/0-orchestration.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/0-orchestration.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/0-orchestration.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/0-orchestration.mdManually: put the files in place
.clinerules/0-orchestration.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about 0-orchestration
How do I install 0-orchestration in Claude Code?
Save the rule file at .claude/rules/0-orchestration.md. Claude Code applies it to files matching src/contexts/*/application/**/*.ts.
What does 0-orchestration do?
It limits orchestrators to one dependency per area crossed and at most four other use cases. It also defines what the architecture test counts.
How does the rule count orchestrator dependencies?
orchestrator-deps.arch.test.ts counts injected dependencies and new XUseCase(...) calls, with duplicate classes counted once.
Source text
0-orchestration.md · MIT
--- description: Apply to a use case spanning several areas; one dependency per area crossed, four at most. paths: - "src/contexts/*/application/**/*.ts" --- # Orchestration - Depend on an area's entry point. - One dependency per area crossed. - Four other use cases at most. - `orchestrator-deps.arch.test.ts` counts injections and `new XUseCase(...)`, deduped by class. - Keep an area's steps inside it. - A second collaborator from one area means its entry point is missing. - Baseline an oversize orchestrator with its count and reason.
© ai-driven-dev · MIT · ai-driven-dev/framework