beads-orchestration 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +214 -0
  3. package/SKILL.md +263 -0
  4. package/bootstrap.py +928 -0
  5. package/package.json +37 -0
  6. package/scripts/cli.js +64 -0
  7. package/scripts/postinstall.js +71 -0
  8. package/skills/create-beads-orchestration/SKILL.md +263 -0
  9. package/skills/subagents-discipline/SKILL.md +158 -0
  10. package/templates/CLAUDE.md +326 -0
  11. package/templates/agents/architect.md +121 -0
  12. package/templates/agents/code-reviewer.md +248 -0
  13. package/templates/agents/detective.md +101 -0
  14. package/templates/agents/discovery.md +492 -0
  15. package/templates/agents/merge-supervisor.md +119 -0
  16. package/templates/agents/scout.md +100 -0
  17. package/templates/agents/scribe.md +96 -0
  18. package/templates/beads-workflow-injection-api.md +116 -0
  19. package/templates/beads-workflow-injection-git.md +108 -0
  20. package/templates/beads-workflow-injection.md +111 -0
  21. package/templates/frontend-reviews-requirement.md +61 -0
  22. package/templates/hooks/block-orchestrator-tools.sh +98 -0
  23. package/templates/hooks/clarify-vague-request.sh +39 -0
  24. package/templates/hooks/enforce-bead-for-supervisor.sh +32 -0
  25. package/templates/hooks/enforce-branch-before-edit.sh +47 -0
  26. package/templates/hooks/enforce-concise-response.sh +41 -0
  27. package/templates/hooks/enforce-sequential-dispatch.sh +63 -0
  28. package/templates/hooks/inject-discipline-reminder.sh +28 -0
  29. package/templates/hooks/log-dispatch-prompt.sh +39 -0
  30. package/templates/hooks/memory-capture.sh +104 -0
  31. package/templates/hooks/remind-inprogress.sh +14 -0
  32. package/templates/hooks/session-start.sh +121 -0
  33. package/templates/hooks/validate-completion.sh +131 -0
  34. package/templates/hooks/validate-epic-close.sh +84 -0
  35. package/templates/mcp.json.template +12 -0
  36. package/templates/memory/recall.sh +121 -0
  37. package/templates/settings.json +74 -0
  38. package/templates/skills/react-best-practices/SKILL.md +487 -0
  39. package/templates/skills/subagents-discipline/SKILL.md +127 -0
  40. package/templates/ui-constraints.md +76 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aviv Kaplan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,214 @@
1
+ # Beads Orchestration
2
+
3
+ Multi-agent orchestration for Claude Code. A co-pilot architect that investigates issues, discusses approach with you, then delegates implementation to specialized supervisors.
4
+
5
+ **[Beads Kanban UI](https://github.com/AvivK5498/Beads-Kanban-UI)** — Visual task management fully compatible with this workflow. Supports tasks, epics, subtasks, dependencies, and design docs.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npx skills add AvivK5498/Claude-Code-Beads-Orchestration
11
+ ```
12
+
13
+ Or via npm:
14
+
15
+ ```bash
16
+ npm install -g beads-orchestration
17
+ ```
18
+
19
+ > macOS and Linux only.
20
+
21
+ ## Quick Start
22
+
23
+ ```bash
24
+ # In any Claude Code session
25
+ /create-beads-orchestration
26
+ ```
27
+
28
+ The skill walks you through setup, runs the bootstrap via `npx`, then creates tech-specific supervisors based on your codebase.
29
+
30
+ ### Requirements
31
+
32
+ - Claude Code with hooks support
33
+ - Node.js (for npx)
34
+ - Python 3 (for bootstrap)
35
+ - beads CLI (installed automatically by bootstrap)
36
+
37
+ ## Key Features
38
+
39
+ 🧭 **Co-pilot architect** — Investigates, presents trade-offs, waits for your confirmation before dispatching. Constructive skeptic, not a blind executor.
40
+
41
+ ⚡ **Quick fix path** — Trivial single-file changes skip the bead/worktree/PR overhead. Just dispatch, edit, commit, done.
42
+
43
+ 🌳 **Worktree isolation** — Every task gets its own worktree. Main stays clean. Parallel work without conflicts.
44
+
45
+ 📋 **Auto task tracking** — [Beads](https://github.com/steveyegge/beads) create, track, and close tasks automatically.
46
+
47
+ 🔗 **Epics & dependencies** — Cross-domain work becomes epics with enforced child dependencies. Independent children dispatch in parallel.
48
+
49
+ 📝 **Dispatch auto-logging** — Every supervisor dispatch prompt is automatically captured as a bead comment. Full audit trail, zero manual effort.
50
+
51
+ 🔁 **Follow-up traceability** — Closed beads stay closed. Bug fixes become new beads linked via `bd dep relate` — full history, no reopening.
52
+
53
+ 🧠 **Knowledge base** — Agents voluntarily capture conventions and gotchas into `.beads/memory/`. Searchable, surfaced at session start.
54
+
55
+ 🔒 **13 enforcement hooks** — Every workflow step is guarded. See [Hooks](#hooks).
56
+
57
+ 🔎 **Tech stack discovery** — Scans your codebase, creates the right supervisors with best practices injected.
58
+
59
+ ## How It Works
60
+
61
+ ```
62
+ ┌─────────────────────────────────────────┐
63
+ │ ORCHESTRATOR (Co-Pilot) │
64
+ │ Investigates with Grep/Read/Glob │
65
+ │ Discusses approach with user │
66
+ │ Delegates implementation via Task() │
67
+ └──────────────────┬──────────────────────┘
68
+
69
+ ┌───────────┼───────────┐
70
+ ▼ ▼ ▼
71
+ ┌─────────┐ ┌─────────┐ ┌─────────┐
72
+ │ react- │ │ python- │ │ nextjs- │
73
+ │supervisor│ │supervisor│ │supervisor│
74
+ └────┬────┘ └────┬────┘ └────┬────┘
75
+ │ │ │
76
+ .worktrees/ .worktrees/ .worktrees/
77
+ bd-BD-001 bd-BD-002 bd-BD-003
78
+ ```
79
+
80
+ **Orchestrator:** Investigates the issue, discusses with user, proposes a plan. Dispatch prompts are auto-logged to the bead as `DISPATCH_PROMPT` comments.
81
+
82
+ **Supervisors:** Read bead comments for context, create isolated worktrees, execute the fix confidently. Created by discovery agent based on your tech stack.
83
+
84
+ ### Workflow Modes
85
+
86
+ **Quick Fix** — Single file, obvious fix, fully reversible. No bead, no worktree, no PR. Git commit = audit trail.
87
+
88
+ **Full Workflow** — Multi-file or uncertain changes. Investigate → discuss → confirm → create bead → dispatch supervisor → worktree → PR → merge.
89
+
90
+ Default to full workflow when in doubt.
91
+
92
+ ## Knowledge Base
93
+
94
+ Agents build a persistent knowledge base as they work. No extra steps — it piggybacks on `bd comment`.
95
+
96
+ ```bash
97
+ # Agent records a useful insight (voluntary)
98
+ bd comment BD-001 "LEARNED: TaskGroup requires @Sendable closures in strict concurrency mode."
99
+ ```
100
+
101
+ An async hook intercepts `LEARNED:` comments and extracts them into `.beads/memory/knowledge.jsonl`. Each entry is auto-tagged by keyword and attributed to its source.
102
+
103
+ **Why this works:**
104
+ - Zero friction — agents already use `bd comment`, they just add a prefix
105
+ - No database, no embeddings, no external services — one JSONL file, grep + jq to search
106
+ - Voluntary — agents log insights when they discover something worth remembering
107
+ - Surfaces automatically — session start shows recent knowledge so agents don't re-investigate solved problems
108
+
109
+ ```bash
110
+ # Search the knowledge base
111
+ .beads/memory/recall.sh "concurrency"
112
+ .beads/memory/recall.sh --recent 10
113
+ .beads/memory/recall.sh --stats
114
+ ```
115
+
116
+ See [docs/memory-architecture.md](docs/memory-architecture.md) for the full design.
117
+
118
+ ## Bug Fixes & Follow-Up Work
119
+
120
+ Closed beads are immutable. When a bug is found after a task was completed, a new bead is created and linked to the original:
121
+
122
+ ```bash
123
+ bd create "Fix: button click handler race condition" -d "Follow-up to BD-001"
124
+ # Returns: BD-005
125
+
126
+ bd dep relate BD-005 BD-001 # Bidirectional "see also" — no dependency
127
+ ```
128
+
129
+ The `relates_to` link gives full traceability without reopening anything. A PreToolUse hook enforces this — dispatching a supervisor to a closed or done bead is blocked automatically, with instructions to create a new bead instead.
130
+
131
+ **Why this matters:**
132
+ - Merged branches don't get reused — avoids SHA conflicts from squash/rebase merges
133
+ - Each fix gets its own worktree and PR
134
+ - Audit trail stays clean — one bead = one unit of work
135
+
136
+ ## What Gets Installed
137
+
138
+ ```
139
+ .claude/
140
+ ├── agents/ # Supervisors (discovery creates tech-specific ones)
141
+ ├── hooks/ # Workflow enforcement (13 hooks)
142
+ ├── skills/ # subagents-discipline, react-best-practices
143
+ └── settings.json
144
+ CLAUDE.md # Orchestrator instructions
145
+ .beads/ # Task database
146
+ memory/ # Knowledge base (knowledge.jsonl + recall.sh)
147
+ .worktrees/ # Isolated worktrees for each task (created dynamically)
148
+ ```
149
+
150
+ ## Hooks
151
+
152
+ 13 hooks enforce the workflow at every step. Grouped by lifecycle event:
153
+
154
+ **PreToolUse** — Block before action happens:
155
+
156
+ | Hook | Trigger | Purpose |
157
+ |------|---------|---------|
158
+ | `block-orchestrator-tools.sh` | Edit, Write | Orchestrator can't modify code directly |
159
+ | `enforce-bead-for-supervisor.sh` | Task | Supervisors require BEAD_ID in prompt |
160
+ | `enforce-branch-before-edit.sh` | Edit, Write | Must be in a worktree, not main |
161
+ | `enforce-sequential-dispatch.sh` | Task | Blocks closed/done beads and epic children with unresolved deps |
162
+ | `validate-epic-close.sh` | Bash | Blocks bead close without merged PR; blocks epic close with open children |
163
+ | `inject-discipline-reminder.sh` | Task | Injects discipline skill context |
164
+ | `remind-inprogress.sh` | Task | Warns about existing in-progress beads |
165
+
166
+ **PostToolUse** — React after action completes:
167
+
168
+ | Hook | Trigger | Purpose |
169
+ |------|---------|---------|
170
+ | `enforce-concise-response.sh` | Task | Limits supervisor response verbosity |
171
+ | `log-dispatch-prompt.sh` | Task | Auto-logs dispatch prompts as DISPATCH_PROMPT bead comments |
172
+ | `memory-capture.sh` | Bash | Captures LEARNED comments into knowledge base |
173
+
174
+ **SubagentStop** — Validate before supervisor exits:
175
+
176
+ | Hook | Trigger | Purpose |
177
+ |------|---------|---------|
178
+ | `validate-completion.sh` | Any | Verifies worktree, push, bead status |
179
+
180
+ **SessionStart** — Run when a new session begins:
181
+
182
+ | Hook | Trigger | Purpose |
183
+ |------|---------|---------|
184
+ | `session-start.sh` | Any | Shows task status, recent knowledge, cleanup suggestions |
185
+
186
+ **UserPromptSubmit** — Filter user input:
187
+
188
+ | Hook | Trigger | Purpose |
189
+ |------|---------|---------|
190
+ | `clarify-vague-request.sh` | Any | Prompts for clarification on ambiguous requests |
191
+
192
+ ## Advanced: External Providers
193
+
194
+ By default, all agents run via Claude's Task(). If you want to delegate read-only agents (scout, detective, etc.) to Codex/Gemini instead:
195
+
196
+ ```bash
197
+ /create-beads-orchestration --external-providers
198
+ ```
199
+
200
+ **Additional requirements:**
201
+ - Codex CLI: `codex login`
202
+ - Gemini CLI (optional fallback)
203
+ - uv: [install](https://github.com/astral-sh/uv)
204
+
205
+ This creates `.mcp.json` with provider-delegator config.
206
+
207
+ ## License
208
+
209
+ MIT
210
+
211
+ ## Credits
212
+
213
+ - [beads](https://github.com/steveyegge/beads) - Git-native task tracking by Steve Yegge
214
+ - [sub-agents.directory](https://github.com/ayush-that/sub-agents.directory) - External agent templates
package/SKILL.md ADDED
@@ -0,0 +1,263 @@
1
+ ---
2
+ name: create-beads-orchestration
3
+ description: Bootstrap lean multi-agent orchestration with beads task tracking. Use for projects needing agent delegation without heavy MCP overhead.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Create Beads Orchestration
8
+
9
+ Set up lightweight multi-agent orchestration with git-native task tracking for Claude Code.
10
+
11
+ ## What This Skill Does
12
+
13
+ This skill bootstraps a complete multi-agent workflow where:
14
+
15
+ - **Orchestrator** (you) investigates issues, manages tasks, delegates implementation
16
+ - **Supervisors** (specialized agents) execute fixes in isolated worktrees
17
+ - **Beads CLI** tracks all work with git-native task management
18
+ - **Hooks** enforce workflow discipline automatically
19
+
20
+ Each task gets its own worktree at `.worktrees/bd-{BEAD_ID}/`, keeping main clean and enabling parallel work.
21
+
22
+ ## Beads Kanban UI
23
+
24
+ The setup will auto-detect [Beads Kanban UI](https://github.com/AvivK5498/Beads-Kanban-UI) and configure accordingly. If not found, you'll be offered to install it.
25
+
26
+ ---
27
+
28
+ ## Step 0: Detect Setup State (ALWAYS RUN FIRST)
29
+
30
+ <detection-phase>
31
+ **Before doing anything else, detect if this is a fresh setup or a resume after restart.**
32
+
33
+ Check for bootstrap artifacts:
34
+ ```bash
35
+ ls .claude/agents/scout.md 2>/dev/null && echo "BOOTSTRAP_COMPLETE" || echo "FRESH_SETUP"
36
+ ```
37
+
38
+ **If `BOOTSTRAP_COMPLETE`:**
39
+ - Bootstrap already ran in a previous session
40
+ - Skip directly to **Step 4: Run Discovery**
41
+ - Do NOT ask for project info or run bootstrap again
42
+
43
+ **If `FRESH_SETUP`:**
44
+ - This is a new installation
45
+ - Proceed to **Step 1: Get Project Info**
46
+ </detection-phase>
47
+
48
+ ---
49
+
50
+ ## Workflow Overview
51
+
52
+ <mandatory-workflow>
53
+ | Step | Action | When to Run |
54
+ |------|--------|-------------|
55
+ | 0 | Detect setup state | **ALWAYS** (determines path) |
56
+ | 1 | Get project info from user | Fresh setup only |
57
+ | 2 | Run bootstrap | Fresh setup only |
58
+ | 3 | **STOP** - Instruct user to restart | Fresh setup only |
59
+ | 4 | Run discovery agent | After restart OR if bootstrap already complete |
60
+
61
+ **The setup is NOT complete until Step 4 (discovery) has run.**
62
+ </mandatory-workflow>
63
+
64
+ ---
65
+
66
+ ## Step 1: Get Project Info (Fresh Setup Only)
67
+
68
+ <critical-step1>
69
+ **YOU MUST GET PROJECT INFO AND DETECT/ASK ABOUT KANBAN UI BEFORE PROCEEDING TO STEP 2.**
70
+
71
+ 1. **Project directory**: Where to install (default: current working directory)
72
+ 2. **Project name**: For agent templates (will auto-infer from package.json/pyproject.toml if not provided)
73
+ 3. **Kanban UI**: Auto-detect, or ask the user to install
74
+ </critical-step1>
75
+
76
+ ### 1.1 Get Project Directory and Name
77
+
78
+ Ask the user or auto-detect from package.json/pyproject.toml.
79
+
80
+ ### 1.2 Detect or Install Kanban UI
81
+
82
+ ```bash
83
+ which bead-kanban 2>/dev/null && echo "KANBAN_FOUND" || echo "KANBAN_NOT_FOUND"
84
+ ```
85
+
86
+ **If KANBAN_FOUND** → Use `--with-kanban-ui` flag. Tell the user:
87
+ > Detected Beads Kanban UI. Configuring worktree management via API.
88
+
89
+ **If KANBAN_NOT_FOUND** → Ask:
90
+
91
+ ```
92
+ AskUserQuestion(
93
+ questions=[
94
+ {
95
+ "question": "Beads Kanban UI not detected. It adds a visual kanban board with dependency graphs and API-driven worktree management. Install it?",
96
+ "header": "Kanban UI",
97
+ "options": [
98
+ {"label": "Yes, install it (Recommended)", "description": "Runs: npm install -g beads-kanban-ui"},
99
+ {"label": "Skip", "description": "Use git worktrees directly. You can install later."}
100
+ ],
101
+ "multiSelect": false
102
+ }
103
+ ]
104
+ )
105
+ ```
106
+
107
+ - If "Yes" → Run `npm install -g beads-kanban-ui`, then use `--with-kanban-ui` flag
108
+ - If "Skip" → do NOT use `--with-kanban-ui` flag
109
+
110
+ ---
111
+
112
+ ## Step 2: Run Bootstrap
113
+
114
+ ```bash
115
+ # With Kanban UI:
116
+ npx beads-orchestration@latest bootstrap \
117
+ --project-name "{{PROJECT_NAME}}" \
118
+ --project-dir "{{PROJECT_DIR}}" \
119
+ --with-kanban-ui
120
+
121
+ # Without Kanban UI (git worktrees only):
122
+ npx beads-orchestration@latest bootstrap \
123
+ --project-name "{{PROJECT_NAME}}" \
124
+ --project-dir "{{PROJECT_DIR}}"
125
+ ```
126
+
127
+ The bootstrap script will:
128
+ 1. Install beads CLI (via brew, npm, or go)
129
+ 2. Initialize `.beads/` directory
130
+ 3. Copy agent templates to `.claude/agents/`
131
+ 4. Copy hooks to `.claude/hooks/`
132
+ 5. Configure `.claude/settings.json`
133
+ 6. Create `CLAUDE.md` with orchestrator instructions
134
+ 7. Update `.gitignore`
135
+
136
+ **Verify bootstrap completed successfully before proceeding.**
137
+
138
+ ---
139
+
140
+ ## Step 3: STOP - User Must Restart
141
+
142
+ <critical>
143
+ **YOU MUST STOP HERE AND INSTRUCT THE USER TO RESTART CLAUDE CODE.**
144
+
145
+ Tell the user:
146
+
147
+ > **Setup phase complete. You MUST restart Claude Code now.**
148
+ >
149
+ > The new hooks and MCP configuration will only load after restart.
150
+ >
151
+ > After restarting:
152
+ > 1. Open this same project directory
153
+ > 2. Tell me "Continue orchestration setup" or run `/create-beads-orchestration` again
154
+ > 3. I will run the discovery agent to complete setup
155
+ >
156
+ > **Do not skip this restart - the orchestration will not work without it.**
157
+
158
+ **DO NOT proceed to Step 4 in this session. The restart is mandatory.**
159
+ </critical>
160
+
161
+ ---
162
+
163
+ ## Step 4: Run Discovery (After Restart OR Detection)
164
+
165
+ <post-restart>
166
+ **Run this step if:**
167
+ - Step 0 detected `BOOTSTRAP_COMPLETE`, OR
168
+ - User returned after restart and said "continue setup" or ran `/create-beads-orchestration` again
169
+
170
+ 1. Verify bootstrap completed (check for `.claude/agents/scout.md`) - already done in Step 0
171
+ 2. Run the discovery agent:
172
+
173
+ ```python
174
+ Task(
175
+ subagent_type="discovery",
176
+ prompt="Detect tech stack and create supervisors for this project"
177
+ )
178
+ ```
179
+
180
+ Discovery will:
181
+ - Scan package.json, requirements.txt, Dockerfile, etc.
182
+ - Fetch specialist agents from external directory
183
+ - Inject beads workflow into each supervisor
184
+ - Write supervisors to `.claude/agents/`
185
+
186
+ 3. After discovery completes, tell the user:
187
+
188
+ > **Orchestration setup complete!**
189
+ >
190
+ > Created supervisors: [list what discovery created]
191
+ >
192
+ > You can now use the orchestration workflow:
193
+ > - Create tasks with `bd create "Task name" -d "Description"`
194
+ > - The orchestrator will delegate to appropriate supervisors
195
+ > - All work requires code review before completion
196
+ </post-restart>
197
+
198
+ ---
199
+
200
+ ## What This Creates
201
+
202
+ - **Beads CLI** for git-native task tracking (one bead = one worktree = one task)
203
+ - **Core agents**: scout, detective, architect, scribe, code-reviewer (all run via Claude Task)
204
+ - **Discovery agent**: Auto-detects tech stack and creates specialized supervisors
205
+ - **Hooks**: Enforce orchestrator discipline, code review gates, concise responses
206
+ - **Worktree-per-task workflow**: Isolated development in `.worktrees/bd-{BEAD_ID}/`
207
+
208
+ **With `--with-kanban-ui`:**
209
+ - Worktrees created via API (localhost:3008) with git fallback
210
+ - Requires [Beads Kanban UI](https://github.com/AvivK5498/Beads-Kanban-UI) running
211
+
212
+ **Without `--with-kanban-ui`:**
213
+ - Worktrees created via raw git commands
214
+
215
+ ## Epic Workflow (Cross-Domain Features)
216
+
217
+ For features requiring multiple supervisors (e.g., DB + API + Frontend), use the **epic workflow**:
218
+
219
+ ### When to Use Epics
220
+
221
+ | Task Type | Workflow |
222
+ |-----------|----------|
223
+ | Single-domain (one supervisor) | Standalone bead |
224
+ | Cross-domain (multiple supervisors) | Epic with children |
225
+
226
+ ### Epic Workflow Steps
227
+
228
+ 1. **Create epic**: `bd create "Feature name" -d "Description" --type epic`
229
+ 2. **Create design doc** (if needed): Dispatch architect to create `.designs/{EPIC_ID}.md`
230
+ 3. **Link design**: `bd update {EPIC_ID} --design ".designs/{EPIC_ID}.md"`
231
+ 4. **Create children with dependencies**:
232
+ ```bash
233
+ bd create "DB schema" -d "..." --parent {EPIC_ID} # BD-001.1
234
+ bd create "API endpoints" -d "..." --parent {EPIC_ID} --deps BD-001.1 # BD-001.2
235
+ bd create "Frontend" -d "..." --parent {EPIC_ID} --deps BD-001.2 # BD-001.3
236
+ ```
237
+ 5. **Dispatch sequentially**: Use `bd ready` to find unblocked tasks (each child gets own worktree)
238
+ 6. **User merges each PR**: Wait for child's PR to merge before dispatching next
239
+ 7. **Close epic**: `bd close {EPIC_ID}` after all children merged
240
+
241
+ ### Design Docs
242
+
243
+ Design docs ensure consistency across epic children:
244
+ - Schema definitions (exact column names, types)
245
+ - API contracts (endpoints, request/response shapes)
246
+ - Shared constants/enums
247
+ - Data flow between layers
248
+
249
+ **Key rule**: Orchestrator dispatches architect to create design docs. Orchestrator never writes design docs directly.
250
+
251
+ ### Hooks Enforce Epic Workflow
252
+
253
+ - **enforce-sequential-dispatch.sh**: Blocks dispatch if task has unresolved blockers
254
+ - **enforce-bead-for-supervisor.sh**: Requires BEAD_ID for all supervisors
255
+ - **validate-completion.sh**: Verifies worktree, push, bead status before supervisor completes
256
+
257
+ ## Requirements
258
+
259
+ - **beads CLI**: Installed automatically by bootstrap (via brew, npm, or go)
260
+
261
+ ## More Information
262
+
263
+ See the full documentation: https://github.com/AvivK5498/Claude-Code-Beads-Orchestration