Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/0-orchestration.md
Open on GitHub

What 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/application against 0-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.md

The paths frontmatter field limits the files

Step 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

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set80

The whole set →
0-folder-size The 0-folder-size rule keeps directories from growing past ten direct .ts files. It also records why an oversized directory exists instead of encouraging file shuffling. CX Codex +1 ★ 571repo stars rule.generated The rule.generated rule requires adding the comment // Team reviewed domain change above every newly declared exported function in src/domain/. It tracks which domain changes have passed team review. CX Codex +1 ★ 571repo stars 1-type-honesty 1-type-honesty prevents dangerous TypeScript casts like any and eliminates compiler error suppressions in source code. CX Codex +1 ★ 571repo stars 1-comments 1-comments — a rule that keeps AI-written comments to facts the code cannot express and bans pointers to tickets, PRs and dates. CX Codex +1 ★ 571repo stars 01-ticket-info 01-ticket-info is a Claude Code skill that fetches ticket details from a configured issue tracker and displays its fields in the agent chat. It reads the ticket identified in the prompt or conversation context. CX Codex +1 ★ 571repo stars 0-shared-modules The 0-shared-modules rule sets a bar for moving code into shared/: callers must come from two application areas. Use it when reviewing modules under src/contexts/. CX Codex +1 ★ 571repo stars 01-hello 01-hello is a Claude Code skill that runs the greet action to confirm the aidd-ui plugin is loaded. It checks plugin availability. CX Codex +1 ★ 571repo stars 7-auth 7-auth governs how assistant code reads and saves auth credentials: lazy GitHub token lookup, tight file permissions, and delayed error handling. CX Codex +1 ★ 571repo stars

Project sponsors

Companies that keep this analytics open