azclaude-copilot 0.4.33 → 0.4.35
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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +64 -8
- package/bin/cli.js +2 -2
- package/package.json +2 -2
- package/templates/CLAUDE.md +12 -1
- package/templates/agents/milestone-builder.md +23 -1
- package/templates/agents/orchestrator.md +26 -6
- package/templates/agents/problem-architect.md +6 -0
- package/templates/capabilities/shared/parallel-coordination.md +176 -0
- package/templates/capabilities/shared/plan-tracker.md +18 -1
- package/templates/commands/add.md +6 -0
- package/templates/commands/blueprint.md +83 -9
- package/templates/commands/fix.md +6 -0
- package/templates/commands/mcp.md +22 -0
- package/templates/commands/parallel.md +175 -0
- package/templates/commands/setup.md +18 -0
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
10
10
|
"name": "azclaude",
|
|
11
|
-
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs
|
|
12
|
-
"version": "0.4.
|
|
11
|
+
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 36 commands, 9 auto-invoked skills, 15 specialized agents, 4 hooks, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 111-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
|
|
12
|
+
"version": "0.4.35",
|
|
13
13
|
"source": {
|
|
14
14
|
"source": "github",
|
|
15
15
|
"repo": "haytamAroui/AZ-CLAUDE-COPILOT",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azclaude",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs
|
|
3
|
+
"version": "0.4.35",
|
|
4
|
+
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 36 commands, 9 auto-invoked skills, 15 specialized agents, 4 hooks, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 111-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "haytamAroui",
|
|
7
7
|
"url": "https://github.com/haytamAroui"
|
package/README.md
CHANGED
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
<a href="#spec-driven-workflow">Spec-Driven</a> ·
|
|
16
16
|
<a href="#memory-system">Memory</a> ·
|
|
17
17
|
<a href="#self-improving-loop">Self-Improving Loop</a> ·
|
|
18
|
-
<a href="#all-
|
|
18
|
+
<a href="#all-36-commands">Commands</a> ·
|
|
19
|
+
<a href="#parallel-execution">Parallel</a> ·
|
|
20
|
+
<a href="#mcp-integration">MCP</a> ·
|
|
19
21
|
<a href="#autonomous-mode">Autonomous Mode</a> ·
|
|
20
22
|
<a href="DOCS.md">Full Docs</a>
|
|
21
23
|
</p>
|
|
@@ -61,7 +63,7 @@ AZCLAUDE inverts this. **You start with almost nothing. The environment builds i
|
|
|
61
63
|
npx azclaude-copilot@latest # one command. that's it.
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
No agent files to write. No skills to configure. No prompt engineering. `npx azclaude-copilot` installs
|
|
66
|
+
No agent files to write. No skills to configure. No prompt engineering. `npx azclaude-copilot` installs 36 commands, 4 hooks, memory structure, and a manifest. The rest is generated from your actual codebase as you work. Run the same command again later — it auto-detects whether to skip, install, or upgrade.
|
|
65
67
|
|
|
66
68
|
**What the environment looks like across sessions:**
|
|
67
69
|
|
|
@@ -117,7 +119,7 @@ npx azclaude-copilot@latest
|
|
|
117
119
|
```
|
|
118
120
|
|
|
119
121
|
That's it. One command, no flags. Auto-detects whether this is a fresh install or an upgrade:
|
|
120
|
-
- **First time** → full install (
|
|
122
|
+
- **First time** → full install (36 commands, 4 hooks, 15 agents, 10 skills, memory, reflexes)
|
|
121
123
|
- **Already installed, older version** → auto-upgrades everything to latest templates
|
|
122
124
|
- **Already up to date** → verifies, no overwrites
|
|
123
125
|
|
|
@@ -129,12 +131,12 @@ npx azclaude-copilot@latest doctor # 32 checks — verify everything is wired
|
|
|
129
131
|
|
|
130
132
|
## What You Get
|
|
131
133
|
|
|
132
|
-
**
|
|
134
|
+
**36 commands** · **9 auto-invoked skills** · **15 agents** · **4 hooks** · **memory across sessions** · **learned reflexes** · **self-evolving environment**
|
|
133
135
|
|
|
134
136
|
```
|
|
135
137
|
.claude/
|
|
136
138
|
├── CLAUDE.md ← dispatch table: conventions, stack, routing
|
|
137
|
-
├── commands/ ←
|
|
139
|
+
├── commands/ ← 36 slash commands (/add, /fix, /copilot, /parallel, /mcp, /sentinel...)
|
|
138
140
|
├── skills/ ← 10 skills (test-first, security, architecture-advisor, frontend-design...)
|
|
139
141
|
├── agents/ ← 15 agents (orchestrator, spec-reviewer, constitution-guard...)
|
|
140
142
|
├── capabilities/ ← 37 files, lazy-loaded via manifest.md (~380 tokens/task)
|
|
@@ -265,6 +267,8 @@ Node.js runner restarts Claude Code sessions in a loop until `COPILOT_COMPLETE`.
|
|
|
265
267
|
/snapshot # save WHY you made decisions — auto-injected next session
|
|
266
268
|
/reflect # find and fix stale/missing rules in CLAUDE.md
|
|
267
269
|
/reflexes # view learned behavioral patterns with confidence scores
|
|
270
|
+
/parallel M2 M3 # run multiple milestones simultaneously (worktree isolation + auto-merge)
|
|
271
|
+
/mcp # recommend and install MCP servers based on your stack
|
|
268
272
|
```
|
|
269
273
|
|
|
270
274
|
---
|
|
@@ -623,7 +627,57 @@ Session 4: /evolve → /analyze → /audit → /ship → COPILOT_COMPLETE
|
|
|
623
627
|
|
|
624
628
|
---
|
|
625
629
|
|
|
626
|
-
##
|
|
630
|
+
## Parallel Execution
|
|
631
|
+
|
|
632
|
+
AZCLAUDE runs multiple Claude Code agents simultaneously on the same codebase — without file corruption or test interference. Each agent works in an isolated git worktree on its own branch. Changes merge sequentially after all agents complete.
|
|
633
|
+
|
|
634
|
+
```
|
|
635
|
+
M1 (schema) → done
|
|
636
|
+
↓
|
|
637
|
+
┌────────────┬────────────┬────────────┐
|
|
638
|
+
M2 (auth) M3 (profile) M4 (email) M5 (dashboard) ← all run simultaneously
|
|
639
|
+
↓ ↓ ↓ ↓
|
|
640
|
+
└────────────┴────────────┴────────────┘
|
|
641
|
+
↓
|
|
642
|
+
M6 (E2E tests)
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
**Automatic — via `/copilot`:** The orchestrator reads `Wave:` fields in plan.md (written by `/blueprint`), dispatches same-wave milestones with `isolation: "worktree"` in a single message, then merges sequentially.
|
|
646
|
+
|
|
647
|
+
**Manual — via `/parallel`:**
|
|
648
|
+
```bash
|
|
649
|
+
/parallel M2 M3 M4 M5 # dispatch these milestones simultaneously
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
**Three-layer safety:** `/blueprint` checks directory isolation + shared-utility imports before writing plan.md (Layer 1 — no agents spawned). `problem-architect` returns exact `Files Written:` and `Parallel Safe:` per milestone after plan.md (Layer 2). The orchestrator checks file overlap again at dispatch time (Layer 3 — final gate, cannot be bypassed).
|
|
653
|
+
|
|
654
|
+
See `docs/parallel-feature.md` for the complete reference.
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## MCP Integration
|
|
659
|
+
|
|
660
|
+
AZCLAUDE recommends MCP servers based on your stack and wires them into daily-use commands.
|
|
661
|
+
|
|
662
|
+
```bash
|
|
663
|
+
/mcp # detect stack → recommend universal MCPs → show install commands
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
**Universal (free, no API key — recommended for every project):**
|
|
667
|
+
- `Context7` — `/add` fetches live library docs before writing any library calls. Prevents stale API usage.
|
|
668
|
+
- `Sequential Thinking` — `/blueprint` and `/copilot` use iterative reasoning for milestone planning.
|
|
669
|
+
|
|
670
|
+
**Stack-specific:**
|
|
671
|
+
- `GitHub MCP` — any GitHub repo: richer `/ship` and PR creation
|
|
672
|
+
- `Playwright MCP` — any web project: E2E testing with qa-engineer
|
|
673
|
+
- `Supabase MCP` — Supabase in deps: schema introspection, migrations
|
|
674
|
+
- `Brave Search` — `/fix` looks up external library errors before guessing root cause
|
|
675
|
+
|
|
676
|
+
`/setup` checks MCP status at the end and nudges if none are configured.
|
|
677
|
+
|
|
678
|
+
---
|
|
679
|
+
|
|
680
|
+
## All 36 Commands
|
|
627
681
|
|
|
628
682
|
### Build and Ship
|
|
629
683
|
|
|
@@ -653,6 +707,8 @@ Session 4: /evolve → /analyze → /audit → /ship → COPILOT_COMPLETE
|
|
|
653
707
|
| `/analyze` | Cross-artifact consistency check. Finds ghost milestones (marked done, files missing), spec vs. code drift, plan vs. reality gaps. Read-only. |
|
|
654
708
|
| `/tasks` | Build dependency graph from plan.md. Shows parallelizable wave groups and critical path. Tells orchestrator which milestones can run simultaneously. |
|
|
655
709
|
| `/issues` | Convert plan.md milestones to GitHub Issues. Deduplicates, creates labels, writes issue numbers back to plan.md for traceability. |
|
|
710
|
+
| `/parallel` | Run multiple milestones simultaneously. Worktree isolation per agent. Auto-merges after all complete. Three-layer file collision safety. |
|
|
711
|
+
| `/mcp` | Recommend and install MCP servers based on detected stack. Wires Context7, Sequential Thinking, GitHub, Playwright, Brave Search, Supabase. |
|
|
656
712
|
|
|
657
713
|
### Think and Improve
|
|
658
714
|
|
|
@@ -807,11 +863,11 @@ Run `/level-up` at any time to see your current level and build the next one.
|
|
|
807
863
|
|
|
808
864
|
## Verified
|
|
809
865
|
|
|
810
|
-
|
|
866
|
+
1526 tests. Every template, command, capability, agent, hook, and CLI feature verified.
|
|
811
867
|
|
|
812
868
|
```bash
|
|
813
869
|
bash tests/test-features.sh
|
|
814
|
-
# Results:
|
|
870
|
+
# Results: 1526 passed, 0 failed, 1526 total
|
|
815
871
|
```
|
|
816
872
|
|
|
817
873
|
---
|
package/bin/cli.js
CHANGED
|
@@ -8,8 +8,8 @@ const { execSync } = require('child_process');
|
|
|
8
8
|
|
|
9
9
|
const TEMPLATE_DIR = path.join(__dirname, '..', 'templates');
|
|
10
10
|
const CORE_COMMANDS = ['setup', 'fix', 'add', 'audit', 'test', 'blueprint', 'ship', 'pulse', 'explain', 'snapshot', 'persist'];
|
|
11
|
-
const EXTENDED_COMMANDS = ['dream', 'refactor', 'doc', 'loop', 'migrate', 'deps', 'find', 'create', 'reflect', 'hookify', 'sentinel', 'clarify', 'spec', 'analyze', 'constitute', 'tasks', 'issues', 'driven'];
|
|
12
|
-
const ADVANCED_COMMANDS = ['evolve', 'debate', 'level-up', 'copilot', 'reflexes'];
|
|
11
|
+
const EXTENDED_COMMANDS = ['dream', 'refactor', 'doc', 'loop', 'migrate', 'deps', 'find', 'create', 'reflect', 'hookify', 'sentinel', 'clarify', 'spec', 'analyze', 'constitute', 'tasks', 'issues', 'driven', 'mcp'];
|
|
12
|
+
const ADVANCED_COMMANDS = ['evolve', 'debate', 'level-up', 'copilot', 'reflexes', 'parallel'];
|
|
13
13
|
const COMMANDS = [...CORE_COMMANDS, ...EXTENDED_COMMANDS, ...ADVANCED_COMMANDS];
|
|
14
14
|
|
|
15
15
|
function ok(msg) { console.log(` ✓ ${msg}`); }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azclaude-copilot",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "AI coding environment —
|
|
3
|
+
"version": "0.4.35",
|
|
4
|
+
"description": "AI coding environment — 36 commands, 10 skills, 15 agents, memory, reflexes, evolution. Install: npx azclaude-copilot@latest, then open Claude Code.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"azclaude": "bin/cli.js",
|
|
7
7
|
"azclaude-copilot": "bin/copilot.js"
|
package/templates/CLAUDE.md
CHANGED
|
@@ -40,9 +40,20 @@ Extended (load command file on use):
|
|
|
40
40
|
- /tasks: dependency graph + parallel wave groups from plan.md
|
|
41
41
|
- /issues: convert plan.md milestones to GitHub Issues
|
|
42
42
|
- Standards: /driven → generates .claude/code-rules.md (coding contract for /add and /fix)
|
|
43
|
+
- MCP: /mcp → recommends and installs MCP servers based on your stack
|
|
43
44
|
|
|
44
45
|
Advanced (Level 5+):
|
|
45
46
|
- /evolve · /debate · /level-up
|
|
47
|
+
- Parallel execution: /parallel → dispatch multiple milestones simultaneously (worktree isolation + auto-merge)
|
|
48
|
+
- /tasks → shows which milestones can run in parallel (wave groups)
|
|
49
|
+
|
|
50
|
+
## Parallel Agent Rules
|
|
51
|
+
When running parallel agents (/copilot with parallel waves, or /parallel):
|
|
52
|
+
1. **Own your scope** — only write files in your declared directories. Touch nothing outside.
|
|
53
|
+
2. **Errors in files you didn't modify** → do not fix them. Report "scope violation: {file}" to orchestrator.
|
|
54
|
+
3. **Never push from a worktree** — commit locally only. Orchestrator merges after all agents complete.
|
|
55
|
+
4. **Test in isolation** — run `{test framework} tests/{your-area}/` not the full suite. Cross-cutting failures are expected during parallel execution.
|
|
56
|
+
5. **Report your branch** — always end completion report with "Branch: parallel/{slug}".
|
|
46
57
|
|
|
47
58
|
Unknown capability → grep manifest.md by description, load match
|
|
48
59
|
|
|
@@ -53,4 +64,4 @@ When priorities conflict:
|
|
|
53
64
|
3. {{PRIORITY_3}}
|
|
54
65
|
|
|
55
66
|
## Available Commands
|
|
56
|
-
/dream · /setup · /fix · /add · /audit · /test · /blueprint · /evolve · /debate · /snapshot · /persist · /level-up · /ship · /pulse · /explain · /loop · /refactor · /doc · /migrate · /deps · /find · /create · /reflect · /hookify · /spec · /clarify · /analyze · /constitute · /tasks · /issues · /driven
|
|
67
|
+
/dream · /setup · /fix · /add · /audit · /test · /blueprint · /evolve · /debate · /snapshot · /persist · /level-up · /ship · /pulse · /explain · /loop · /refactor · /doc · /migrate · /deps · /find · /create · /reflect · /hookify · /spec · /clarify · /analyze · /constitute · /tasks · /issues · /driven · /mcp · /parallel
|
|
@@ -111,8 +111,21 @@ Tests must PASS before reporting done. Show actual output — never summarize.
|
|
|
111
111
|
|
|
112
112
|
### Step 5: Commit and Report Back
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
**Detect execution mode:**
|
|
115
|
+
```bash
|
|
116
|
+
# Am I in a worktree (parallel mode)?
|
|
117
|
+
git worktree list 2>/dev/null | grep -c "$(pwd)" | grep -q "^1$" \
|
|
118
|
+
&& echo "WORKTREE_MODE" || echo "MAIN_MODE"
|
|
119
|
+
```
|
|
115
120
|
|
|
121
|
+
**If WORKTREE_MODE** (parallel dispatch with worktree isolation):
|
|
122
|
+
```bash
|
|
123
|
+
git add {files changed}
|
|
124
|
+
git commit -m "{type}: {what} — {why}"
|
|
125
|
+
# DO NOT push — orchestrator merges all parallel branches after wave completes
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**If MAIN_MODE** (sequential dispatch):
|
|
116
129
|
```bash
|
|
117
130
|
git add {files changed}
|
|
118
131
|
git commit -m "{type}: {what} — {why}"
|
|
@@ -124,6 +137,10 @@ Report to orchestrator:
|
|
|
124
137
|
```
|
|
125
138
|
## Milestone {N} — {title}: COMPLETE
|
|
126
139
|
|
|
140
|
+
### Execution Mode
|
|
141
|
+
WORKTREE | MAIN
|
|
142
|
+
Branch: {current branch name} ← required for orchestrator merge tracking
|
|
143
|
+
|
|
127
144
|
### Files Changed
|
|
128
145
|
- {file}: {create|modify} — {one-line description}
|
|
129
146
|
|
|
@@ -138,6 +155,11 @@ PASS — {N} tests passing
|
|
|
138
155
|
{anti-pattern description} — or "none"
|
|
139
156
|
```
|
|
140
157
|
|
|
158
|
+
**Worktree coordination errors** (errors in files outside your declared scope):
|
|
159
|
+
- DO NOT attempt to fix them
|
|
160
|
+
- Report: "Scope violation detected: {file} outside my directories — possible parallel agent interference"
|
|
161
|
+
- Orchestrator handles resolution
|
|
162
|
+
|
|
141
163
|
---
|
|
142
164
|
|
|
143
165
|
## Rules
|
|
@@ -35,13 +35,21 @@ If CLAUDE.md unfilled → run `/setup` with intent from copilot-intent.md first.
|
|
|
35
35
|
|
|
36
36
|
### Step 2: Select Next Milestone Wave
|
|
37
37
|
|
|
38
|
+
**If plan.md has `Wave:` fields** (blueprint wrote them — read directly):
|
|
39
|
+
```bash
|
|
40
|
+
grep "Wave:" .claude/plan.md
|
|
41
|
+
```
|
|
42
|
+
Find the lowest wave number where all milestones have `status = pending` and all `Depends:` are `done`.
|
|
43
|
+
This is the next wave to dispatch.
|
|
44
|
+
|
|
45
|
+
**If plan.md has NO `Wave:` fields** (older plan format — compute from scratch):
|
|
38
46
|
Find milestones where `status = pending` AND all dependencies have `status = done`.
|
|
39
47
|
|
|
40
|
-
**Parallel candidates:** milestones with independent
|
|
48
|
+
**Parallel candidates:** milestones in the same wave with `Parallel: yes` (or computed as independent).
|
|
41
49
|
|
|
42
|
-
**REQUIRED parallel safety check:**
|
|
43
|
-
|
|
44
|
-
→ dispatch sequentially. Silent file corruption otherwise.
|
|
50
|
+
**REQUIRED parallel safety check:** Even if `Parallel: yes`, verify `Files Written` from problem-architect
|
|
51
|
+
for each candidate don't overlap. `Files Written` is more precise than `Files:` — use it.
|
|
52
|
+
If any two candidates share a written file → dispatch sequentially. Silent file corruption otherwise.
|
|
45
53
|
|
|
46
54
|
- All done → SHIP
|
|
47
55
|
- All remaining blocked → BLOCKER RECOVERY
|
|
@@ -93,6 +101,18 @@ If verdict is `APPROVED` or `APPROVED (no constitution found)`: proceed to Step
|
|
|
93
101
|
|
|
94
102
|
### Step 4: Dispatch Milestone Builder(s)
|
|
95
103
|
|
|
104
|
+
**Parallel dispatch (2+ milestones in wave with disjoint Files Written):**
|
|
105
|
+
|
|
106
|
+
Load `capabilities/shared/parallel-coordination.md` first.
|
|
107
|
+
|
|
108
|
+
1. Write `.claude/ownership.md` table (branch, directories, status) for every agent in this wave
|
|
109
|
+
2. Spawn each builder via Task with `isolation: "worktree"` in the same message (true parallel)
|
|
110
|
+
3. Include worktree rules in every parallel prompt (see parallel-coordination.md Step 3)
|
|
111
|
+
4. Wait for ALL agents in the wave before merging
|
|
112
|
+
5. Merge branches sequentially (simplest milestone first) following the Merge Protocol
|
|
113
|
+
|
|
114
|
+
**Sequential dispatch (single milestone OR overlapping files):**
|
|
115
|
+
|
|
96
116
|
Spawn milestone-builder via Task with fully packaged context:
|
|
97
117
|
|
|
98
118
|
```
|
|
@@ -123,8 +143,8 @@ Fix attempts: {2 for SIMPLE/MEDIUM, 3 for COMPLEX}
|
|
|
123
143
|
When done, report: files changed + test status + new patterns/anti-patterns.
|
|
124
144
|
```
|
|
125
145
|
|
|
126
|
-
Independent milestones with disjoint `Files Written` → spawn in parallel.
|
|
127
|
-
Dependent milestones
|
|
146
|
+
Independent milestones with disjoint `Files Written` AND `Parallel Safe: YES` → spawn in parallel with worktree isolation.
|
|
147
|
+
Dependent milestones, overlapping `Files Written`, or `Parallel Safe: NO` → spawn sequentially.
|
|
128
148
|
|
|
129
149
|
---
|
|
130
150
|
|
|
@@ -128,6 +128,12 @@ If YES: topic = {what orchestrator must /debate before dispatching}
|
|
|
128
128
|
### Estimated Complexity
|
|
129
129
|
SIMPLE (< 3 files) | MEDIUM (3-8 files) | COMPLEX (8+ files)
|
|
130
130
|
COMPLEX → orchestrator gives builder 3 fix attempts instead of 2
|
|
131
|
+
|
|
132
|
+
### Parallel Safe
|
|
133
|
+
YES | NO
|
|
134
|
+
If NO: reason = {specific conflict — shared file, schema dependency, runtime ordering}
|
|
135
|
+
The orchestrator uses this to decide whether to use worktree isolation or sequential dispatch.
|
|
136
|
+
Parallel Safe = YES requires: isolated directories, no shared config/schema, no runtime dependency on a sibling milestone.
|
|
131
137
|
```
|
|
132
138
|
|
|
133
139
|
---
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Parallel Agent Coordination
|
|
2
|
+
|
|
3
|
+
This file is loaded by the orchestrator when dispatching milestone-builder agents in parallel.
|
|
4
|
+
It defines the worktree isolation protocol, ownership map format, and merge sequence.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Why Worktrees Are Required for Parallel Dispatch
|
|
9
|
+
|
|
10
|
+
Without worktree isolation, two agents writing to the same repo simultaneously cause:
|
|
11
|
+
- **File corruption**: agent A's partial write is read by agent B mid-implementation
|
|
12
|
+
- **Test interference**: A's failing tests pollute B's test run, causing false failures
|
|
13
|
+
- **Commit races**: both agents commit, one overwrites the other's changes on push
|
|
14
|
+
|
|
15
|
+
Worktree isolation gives each parallel agent a private copy of the repo on its own branch.
|
|
16
|
+
The orchestrator merges completed branches sequentially once all agents report done.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Ownership Map
|
|
21
|
+
|
|
22
|
+
The orchestrator maintains `.claude/ownership.md` during parallel sessions.
|
|
23
|
+
Format — one entry per active parallel agent:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
## Active Parallel Session — {ISO timestamp}
|
|
27
|
+
|
|
28
|
+
| Agent Slot | Milestone | Branch | Directories Owned | Status |
|
|
29
|
+
|------------|-----------|--------|-------------------|--------|
|
|
30
|
+
| P1 | M3 — Auth endpoints | parallel/m3-auth | src/auth/, tests/auth/ | running |
|
|
31
|
+
| P2 | M4 — User profile | parallel/m4-profile | src/users/, tests/users/ | running |
|
|
32
|
+
| P3 | M5 — Email service | parallel/m5-email | src/email/, tests/email/ | done |
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Rules:
|
|
36
|
+
- Two agents cannot share a directory in "Directories Owned"
|
|
37
|
+
- Orchestrator writes this table before dispatching; builders do NOT modify it
|
|
38
|
+
- `parallel/{milestone-slug}` is the branch naming convention
|
|
39
|
+
- Delete the table when the wave is merged (replace with "Wave N merged — {timestamp}")
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Dispatch Protocol (Orchestrator)
|
|
44
|
+
|
|
45
|
+
### Step 1: Confirm Parallel Safety
|
|
46
|
+
|
|
47
|
+
Before spawning any parallel agents for a wave, verify from problem-architect Team Specs:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
For each pair (A, B) in the wave:
|
|
51
|
+
- Files Written(A) ∩ Files Written(B) = empty set? → safe
|
|
52
|
+
- Parent directories of A and B do not overlap? → safe
|
|
53
|
+
- No shared schema/config files (prisma.schema, package.json, tsconfig)? → safe
|
|
54
|
+
- No runtime dependency (A's output is B's input)? → safe
|
|
55
|
+
|
|
56
|
+
If any check fails → remove the conflicting milestone from the wave, dispatch sequentially
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Step 2: Write Ownership Map
|
|
60
|
+
|
|
61
|
+
Write `.claude/ownership.md` before spawning any agents.
|
|
62
|
+
|
|
63
|
+
### Step 3: Dispatch with Worktree Isolation
|
|
64
|
+
|
|
65
|
+
Spawn each agent via Task with `isolation: "worktree"`:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Task: Implement Milestone {N} — {title}
|
|
69
|
+
|
|
70
|
+
[worktree mode]
|
|
71
|
+
Branch: parallel/{milestone-slug}
|
|
72
|
+
Do NOT push to origin. Commit locally only.
|
|
73
|
+
Report branch name in completion message.
|
|
74
|
+
|
|
75
|
+
{standard milestone context from orchestrator Step 4}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Include in every parallel dispatch:
|
|
79
|
+
```
|
|
80
|
+
Worktree rules:
|
|
81
|
+
- You are in an isolated git worktree on branch: parallel/{slug}
|
|
82
|
+
- Run all tests — they test YOUR changes in isolation only
|
|
83
|
+
- If you see errors in files outside your owned directories: STOP, report to orchestrator
|
|
84
|
+
- Do NOT run git push — commit locally only
|
|
85
|
+
- Your completion message MUST include: "Branch: parallel/{slug}" for merge tracking
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Step 4: Wait for All Agents in the Wave
|
|
89
|
+
|
|
90
|
+
Do NOT start the merge until ALL parallel agents in this wave have reported:
|
|
91
|
+
- `COMPLETE` → proceed with merge
|
|
92
|
+
- `FAILED` → merge all completed branches first, then handle the failure as a blocked milestone
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Merge Protocol (Orchestrator)
|
|
97
|
+
|
|
98
|
+
After all parallel agents report done, merge sequentially:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Step 1: Return to main branch
|
|
102
|
+
git checkout main # or master / development
|
|
103
|
+
|
|
104
|
+
# Step 2: Merge each branch in completion order
|
|
105
|
+
git merge parallel/m3-auth --no-ff -m "merge: M3 auth endpoints [parallel wave N]"
|
|
106
|
+
git merge parallel/m4-profile --no-ff -m "merge: M4 user profile [parallel wave N]"
|
|
107
|
+
|
|
108
|
+
# Step 3: If merge conflict on step N:
|
|
109
|
+
# - Identify which files conflict
|
|
110
|
+
# - Read both versions
|
|
111
|
+
# - Apply the correct merge (usually: keep both feature additions, not one-or-other)
|
|
112
|
+
# - Mark conflict resolved, continue with remaining branches
|
|
113
|
+
|
|
114
|
+
# Step 4: Run full test suite on merged main
|
|
115
|
+
npm test 2>&1 | tail -20
|
|
116
|
+
|
|
117
|
+
# Step 5: If tests pass → push
|
|
118
|
+
git push origin main
|
|
119
|
+
|
|
120
|
+
# Step 6: Clean up worktree branches
|
|
121
|
+
git branch -d parallel/m3-auth parallel/m4-profile parallel/m5-email
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Merge order matters**: merge the branch with the fewest cross-dependencies first.
|
|
125
|
+
When uncertain: sort by `Estimated Complexity` ascending (simpler merges first).
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Agent Coordination Rules (for Milestone Builder in Parallel Mode)
|
|
130
|
+
|
|
131
|
+
These rules are injected by orchestrator into every parallel milestone-builder prompt:
|
|
132
|
+
|
|
133
|
+
1. **Own your scope** — only write files in your declared "Directories Owned". If the task requires touching a file outside your scope, STOP and report to orchestrator.
|
|
134
|
+
|
|
135
|
+
2. **Never push** — commit locally on your worktree branch. Do not run `git push`.
|
|
136
|
+
|
|
137
|
+
3. **Test in isolation** — your test run should only test what you changed. If the test suite has cross-cutting failures, filter to your files: `pytest tests/auth/ -v` not `pytest .`
|
|
138
|
+
|
|
139
|
+
4. **Errors outside your files = not your problem** — if you see compilation errors or test failures in files you didn't modify, that's a parallel agent's in-progress state. Report to orchestrator: "Test failures in {file} — outside my scope, may be parallel agent interference."
|
|
140
|
+
|
|
141
|
+
5. **Report branch on completion** — always end your report with: `Branch: parallel/{slug}`
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Conflict Resolution Ladder
|
|
146
|
+
|
|
147
|
+
| Conflict type | Resolution |
|
|
148
|
+
|---------------|-----------|
|
|
149
|
+
| Two agents wrote to the same file (despite safety check) | Orchestrator reads both versions, applies correct merge manually |
|
|
150
|
+
| Merge conflict on shared config (package.json, tsconfig) | Merge both dependency lists; the second merge wins on formatting |
|
|
151
|
+
| Merge conflict on shared schema | STOP — run /debate before merging; schema changes are architectural |
|
|
152
|
+
| Test suite broken after merge | Identify which merge introduced the break; revert that branch, add to blocked |
|
|
153
|
+
| Agent reports "errors in files outside my scope" | Orchestrator pauses that agent, lets the other agent stabilize first |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## When NOT to Use Parallel Dispatch
|
|
158
|
+
|
|
159
|
+
| Condition | Reason |
|
|
160
|
+
|-----------|--------|
|
|
161
|
+
| Milestone touches `package.json` / `requirements.txt` | Dependency changes affect the full build — sequential only |
|
|
162
|
+
| Milestone touches database schema | Schema migrations must run in order |
|
|
163
|
+
| Milestone has `Structural Decision Required: YES` | Architecture must be resolved before implementation |
|
|
164
|
+
| Project has < 3 milestones total | Sequential is simpler; parallel overhead exceeds gain |
|
|
165
|
+
| No worktree support (bare repo, certain CI environments) | Falls back to sequential automatically |
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Ownership Map Cleanup
|
|
170
|
+
|
|
171
|
+
After wave merge is complete:
|
|
172
|
+
```bash
|
|
173
|
+
# Remove ownership.md entries for the completed wave
|
|
174
|
+
# (or replace the table with a merge record)
|
|
175
|
+
echo "## Wave {N} merged — {timestamp}" >> .claude/ownership.md
|
|
176
|
+
```
|
|
@@ -18,14 +18,20 @@ Every plan.md must follow this structure exactly. The copilot runner parses it.
|
|
|
18
18
|
|
|
19
19
|
### M1: {title}
|
|
20
20
|
- Status: {pending|in-progress|done|blocked|skipped}
|
|
21
|
-
-
|
|
21
|
+
- Wave: {1|2|3|...} — execution wave (same wave = runs in parallel)
|
|
22
|
+
- Files: {expected files to create/modify — be specific, e.g. src/auth/login.ts}
|
|
23
|
+
- Dirs: {top-level directories this milestone owns — e.g. src/auth/, tests/auth/}
|
|
22
24
|
- Depends: {M-numbers this depends on, or "none"}
|
|
25
|
+
- Parallel: {yes|no} — yes = safe to run alongside other same-wave milestones
|
|
23
26
|
- Commit: {expected commit message}
|
|
24
27
|
|
|
25
28
|
### M2: {title}
|
|
26
29
|
- Status: pending
|
|
30
|
+
- Wave: 2
|
|
27
31
|
- Files: ...
|
|
32
|
+
- Dirs: src/users/, tests/users/
|
|
28
33
|
- Depends: M1
|
|
34
|
+
- Parallel: yes
|
|
29
35
|
- Commit: ...
|
|
30
36
|
|
|
31
37
|
## Summary
|
|
@@ -33,8 +39,19 @@ Total: {N} milestones
|
|
|
33
39
|
Done: {N}/{total}
|
|
34
40
|
In progress: {N}/{total}
|
|
35
41
|
Blocked: {N}/{total}
|
|
42
|
+
Waves: {N} (max parallel in one wave: {N})
|
|
36
43
|
```
|
|
37
44
|
|
|
45
|
+
### Field Definitions
|
|
46
|
+
|
|
47
|
+
| Field | Purpose |
|
|
48
|
+
|-------|---------|
|
|
49
|
+
| `Wave:` | Which execution wave. Same number = can run simultaneously. Wave 1 always first. |
|
|
50
|
+
| `Dirs:` | Directories this milestone exclusively owns. Two milestones in the same wave MUST have non-overlapping `Dirs:`. |
|
|
51
|
+
| `Files:` | Expected file paths to create/modify. Blueprint's estimate — problem-architect refines to `Files Written:`. |
|
|
52
|
+
| `Parallel: yes` | Orchestrator may dispatch with worktree isolation alongside other Wave N milestones. |
|
|
53
|
+
| `Parallel: no` | Reasons: touches shared config, schema change, or has runtime dep on sibling milestone. |
|
|
54
|
+
|
|
38
55
|
## Status Values
|
|
39
56
|
|
|
40
57
|
| Status | Meaning |
|
|
@@ -29,8 +29,14 @@ Load: shared/tdd.md + shared/completion-rule.md
|
|
|
29
29
|
|
|
30
30
|
# Check if $ARGUMENTS is a spec file
|
|
31
31
|
[ -f "$ARGUMENTS" ] && grep -q "Acceptance Criteria" "$ARGUMENTS" && echo "spec-mode" || echo "inline-mode"
|
|
32
|
+
|
|
33
|
+
# Check if Context7 MCP is available (live library docs — prevents stale API usage)
|
|
34
|
+
claude mcp list 2>/dev/null | grep -q "context7" && echo "context7=active" || echo "context7=inactive"
|
|
32
35
|
```
|
|
33
36
|
|
|
37
|
+
**If context7=active**: before writing any library calls, use `mcp__context7__resolve-library-id` then `mcp__context7__get-library-docs` to fetch current docs. Pass `use context7` in the tool call.
|
|
38
|
+
**If context7=inactive**: proceed normally — consider running `/mcp` after this task to prevent stale API usage in future sessions.
|
|
39
|
+
|
|
34
40
|
**If constitution found:**
|
|
35
41
|
Read `## Non-Negotiables` and `## Required Patterns` before implementing.
|
|
36
42
|
Keep these rules visible throughout Phases 2-4. Flag any implementation choice that would violate them.
|
|
@@ -191,14 +191,76 @@ When running inside `/copilot` (detected by: `.claude/copilot-intent.md` exists)
|
|
|
191
191
|
- Include `Commit:` with conventional commit format
|
|
192
192
|
- Write `## Summary` with counts at the bottom
|
|
193
193
|
|
|
194
|
-
###
|
|
194
|
+
### Parallel Optimization Pass — Layer 1 (REQUIRED before writing plan.md)
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
**Design note — two-layer safety model:**
|
|
197
|
+
This pass is Layer 1: fast, directory-level, runs before plan.md is written.
|
|
198
|
+
Layer 2 is problem-architect (after plan.md): exact file paths, catches shared utilities.
|
|
199
|
+
Layer 3 is the orchestrator at dispatch: final `Files Written:` overlap check.
|
|
200
|
+
|
|
201
|
+
Layer 1 catches ~80% of conflicts cheaply. Layer 2 catches the rest (shared utils, shared config).
|
|
202
|
+
Layer 1 does NOT spawn agents — it uses grep only.
|
|
203
|
+
|
|
204
|
+
**Step 1: Assign waves**
|
|
205
|
+
```
|
|
206
|
+
Wave 1 = milestones with Depends: none
|
|
207
|
+
Wave 2 = milestones that only depend on Wave 1
|
|
208
|
+
Wave N = milestones that only depend on waves 1..N-1
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Step 2: Directory-level isolation check (Layer 1a)**
|
|
212
|
+
|
|
213
|
+
For each wave with 2+ milestones:
|
|
214
|
+
- Does each milestone own a distinct top-level directory? (e.g., `src/auth/` vs `src/users/` vs `src/email/`)
|
|
215
|
+
- Does any milestone touch shared config (`package.json`, `prisma/schema.prisma`, `tsconfig.json`, `go.mod`, `Cargo.toml`)?
|
|
216
|
+
|
|
217
|
+
If two milestones share a top-level directory → add `Depends:` to split them into different waves.
|
|
218
|
+
|
|
219
|
+
**Step 3: Shared-utility grep (Layer 1b)**
|
|
220
|
+
|
|
221
|
+
For each same-wave pair, check if they likely share utility files:
|
|
222
|
+
```bash
|
|
223
|
+
# Find shared utility dirs that multiple features import from
|
|
224
|
+
grep -r "from.*utils\|import.*utils\|require.*utils\|from.*shared\|from.*common\|from.*lib" \
|
|
225
|
+
src/ --include="*.ts" --include="*.py" --include="*.js" -l 2>/dev/null | head -20
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
If a `utils/`, `shared/`, `common/`, or `lib/` directory exists AND two parallel milestones
|
|
229
|
+
both need to CREATE or MODIFY files there → set `Parallel: no` for both and add a Depends: relationship.
|
|
230
|
+
|
|
231
|
+
**Do NOT spawn problem-architect here.** The grep is sufficient for Layer 1. Problem-architect
|
|
232
|
+
runs after plan.md is written and handles the cases Layer 1 misses.
|
|
233
|
+
|
|
234
|
+
**Step 4: Set Dirs: and Parallel: fields, write plan.md**
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
- Dirs: top-level directories this milestone exclusively owns
|
|
238
|
+
- Parallel: yes — safe at directory level + no shared utility writes
|
|
239
|
+
- Parallel: no — touches shared config, shared utility, schema, or depends on sibling
|
|
240
|
+
- Wave: {N}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
A well-designed plan for a 6-feature product:
|
|
244
|
+
```
|
|
245
|
+
Wave 1: M1 (foundation/schema) — Parallel: no
|
|
246
|
+
Wave 2: M2, M3, M4, M5 (independent features) — Parallel: yes (4 agents simultaneously)
|
|
247
|
+
Wave 3: M6 (integration/E2E) — Parallel: no
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### Problem-Architect Validation — Layer 2 (after plan.md is written)
|
|
253
|
+
|
|
254
|
+
Layer 2 refines Layer 1 with exact file-level analysis. Catches shared utilities that
|
|
255
|
+
Layer 1's directory check missed (e.g., `src/utils/jwt.ts` shared by M2 and M3 even though
|
|
256
|
+
their `Dirs:` are `src/auth/` and `src/users/`).
|
|
257
|
+
|
|
258
|
+
Check if problem-architect is available:
|
|
197
259
|
```bash
|
|
198
260
|
ls .claude/agents/problem-architect.md 2>/dev/null
|
|
199
261
|
```
|
|
200
262
|
|
|
201
|
-
If
|
|
263
|
+
If available, spawn it for EACH milestone:
|
|
202
264
|
```
|
|
203
265
|
Analyze this milestone for the Team Spec:
|
|
204
266
|
Milestone: {description from plan.md}
|
|
@@ -207,16 +269,28 @@ Available agents: {list of .claude/agents/}
|
|
|
207
269
|
Available skills: {list of .claude/skills/}
|
|
208
270
|
```
|
|
209
271
|
|
|
210
|
-
For each milestone, append the returned Team Spec fields
|
|
272
|
+
For each milestone, append the returned Team Spec fields to plan.md:
|
|
273
|
+
- `Files Written:` exact paths (this is the authoritative list — supersedes `Files:`)
|
|
274
|
+
- `Parallel Safe:` YES/NO with reason
|
|
211
275
|
- `Complexity:` SIMPLE / MEDIUM / COMPLEX
|
|
212
|
-
- `
|
|
213
|
-
- `Pre-conditions:` checklist before starting
|
|
276
|
+
- `Pre-conditions:` checklist
|
|
214
277
|
- `Risks:` and mitigation
|
|
215
|
-
- `Structural Decision:` YES/NO
|
|
278
|
+
- `Structural Decision:` YES/NO
|
|
279
|
+
|
|
280
|
+
**Correction pass — when Layer 2 contradicts Layer 1:**
|
|
281
|
+
|
|
282
|
+
If problem-architect returns `Parallel Safe: NO` for milestone M_X but Layer 1 wrote `Parallel: yes`:
|
|
216
283
|
|
|
217
|
-
|
|
284
|
+
1. Read the reason: `Parallel Safe: NO — reason: {both M_X and M_Y write src/utils/jwt.ts}`
|
|
285
|
+
2. Identify the conflicting pair (M_X and M_Y)
|
|
286
|
+
3. Update plan.md:
|
|
287
|
+
- Add `Depends: M_X` to M_Y (or vice versa — whichever is simpler first)
|
|
288
|
+
- Update `Wave:` for M_Y to the next wave
|
|
289
|
+
- Change `Parallel: yes` → `Parallel: no` for affected milestones
|
|
290
|
+
- Update `## Summary` wave count
|
|
291
|
+
4. This is a plan.md correction, not a failure — blueprint is refining its initial estimate
|
|
218
292
|
|
|
219
|
-
After all milestones annotated
|
|
293
|
+
After all milestones annotated and corrections applied → return control to /copilot.
|
|
220
294
|
|
|
221
295
|
---
|
|
222
296
|
|
|
@@ -67,6 +67,12 @@ Read the code. Do not guess.
|
|
|
67
67
|
- Check recent changes: `git log --oneline -10 -- {file}`
|
|
68
68
|
- Read test framework config: `package.json` / `requirements.txt` / `Cargo.toml`
|
|
69
69
|
|
|
70
|
+
**If the error involves an external library or unknown error code**: check if Brave Search MCP is available:
|
|
71
|
+
```bash
|
|
72
|
+
claude mcp list 2>/dev/null | grep -q "brave" && echo "brave=active" || echo "brave=inactive"
|
|
73
|
+
```
|
|
74
|
+
If active: use `mcp__brave-search__brave_web_search` to look up the exact error message — often finds GitHub issues, Stack Overflow answers, or library changelogs that resolve ambiguity before you guess at a root cause.
|
|
75
|
+
|
|
70
76
|
Antipattern check — if `antipatterns.md` exists, read it before proceeding.
|
|
71
77
|
|
|
72
78
|
Rules:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcp
|
|
3
|
+
description: >
|
|
4
|
+
MCP server recommendations and setup for Claude Code projects. Use when the user
|
|
5
|
+
asks "what MCP should I use", "add MCP", "set up MCP", "improve Claude Code",
|
|
6
|
+
"Context7", "sequential thinking", "GitHub MCP", "Playwright MCP", "Supabase MCP",
|
|
7
|
+
"Brave Search", "add web search", "add browser control", "add database access",
|
|
8
|
+
"Claude doesn't know the latest API", "wrong library version", "stale docs",
|
|
9
|
+
"hallucinating API", or "which MCP works best for my stack".
|
|
10
|
+
argument-hint: "[optional: stack or specific MCP name]"
|
|
11
|
+
disable-model-invocation: true
|
|
12
|
+
allowed-tools: Read, Bash, Glob
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# /mcp — MCP Integration
|
|
16
|
+
|
|
17
|
+
$ARGUMENTS
|
|
18
|
+
|
|
19
|
+
Load skill: `skills/mcp/SKILL.md`
|
|
20
|
+
|
|
21
|
+
Follow all steps in the skill: detect stack → recommend universal MCPs → recommend
|
|
22
|
+
stack-specific MCPs → show install commands → apply security rules → verify.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: parallel
|
|
3
|
+
description: >
|
|
4
|
+
Dispatch multiple milestones simultaneously using git worktree isolation.
|
|
5
|
+
Each agent runs on its own branch, changes are merged sequentially after all complete.
|
|
6
|
+
Use when: "run these milestones in parallel", "build M1 M2 M3 simultaneously",
|
|
7
|
+
"parallel execution", "spawn multiple agents", "run agents in parallel",
|
|
8
|
+
"dispatch in parallel", "work on multiple milestones at once", "parallel build",
|
|
9
|
+
"run simultaneously", "multiple agents at once".
|
|
10
|
+
Do NOT trigger for: a single milestone, sequential work, or when milestones share files.
|
|
11
|
+
argument-hint: "[M1 M2 M3 — milestone IDs from plan.md]"
|
|
12
|
+
disable-model-invocation: true
|
|
13
|
+
allowed-tools: Read, Bash, Glob, Grep, Task
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# /parallel — Parallel Milestone Execution
|
|
17
|
+
|
|
18
|
+
$ARGUMENTS
|
|
19
|
+
|
|
20
|
+
Load: `capabilities/shared/parallel-coordination.md`
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 1: Parse Targets
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Read plan.md to find the specified milestones
|
|
28
|
+
cat .claude/plan.md 2>/dev/null | head -200
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
From $ARGUMENTS, extract milestone IDs (e.g., "M1 M2 M3" or "1 2 3").
|
|
32
|
+
If no arguments → show current pending milestones and ask which to parallelize.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step 2: Safety Check
|
|
37
|
+
|
|
38
|
+
For each pair of target milestones, verify they are safe to parallelize:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Check Files: fields in plan.md for each milestone
|
|
42
|
+
grep -A5 "^## M{N}" .claude/plan.md | grep "^Files:"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Reject and abort if any two milestones:**
|
|
46
|
+
- Share a file in their `Files:` field
|
|
47
|
+
- Both touch `package.json`, `requirements.txt`, `Cargo.toml`, `go.mod`, or any schema file
|
|
48
|
+
- Have a `Depends:` relationship between them (one depends on the other)
|
|
49
|
+
- Either has status `blocked` or `done`
|
|
50
|
+
|
|
51
|
+
If safety check fails: show which pairs conflict and suggest sequential order instead.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Step 3: Consult Problem Architect
|
|
56
|
+
|
|
57
|
+
For each milestone, spawn problem-architect to get Team Spec + `Parallel Safe` verdict:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Task: Analyze milestone for parallel dispatch
|
|
61
|
+
Milestone: {description from plan.md}
|
|
62
|
+
Current state: {what exists}
|
|
63
|
+
Available agents: {list .claude/agents/}
|
|
64
|
+
Return Team Spec with Parallel Safe field.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If any milestone returns `Parallel Safe: NO` → exclude from parallel wave, run sequentially after.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step 4: Write Ownership Map
|
|
72
|
+
|
|
73
|
+
Create or update `.claude/ownership.md`:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
## Active Parallel Session — {ISO timestamp}
|
|
77
|
+
Milestones: {M1, M2, ...}
|
|
78
|
+
Initiated by: /parallel command
|
|
79
|
+
|
|
80
|
+
| Agent Slot | Milestone | Branch | Directories Owned | Status |
|
|
81
|
+
|------------|-----------|--------|-------------------|--------|
|
|
82
|
+
| P1 | M{N} — {title} | parallel/m{n}-{slug} | {dirs from spec} | pending |
|
|
83
|
+
| P2 | M{N} — {title} | parallel/m{n}-{slug} | {dirs from spec} | pending |
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Step 5: Dispatch All Agents Simultaneously
|
|
89
|
+
|
|
90
|
+
Spawn all milestone-builder agents **in a single message** (true parallel — one Task call per agent in the same response):
|
|
91
|
+
|
|
92
|
+
For each milestone, Task with `isolation: "worktree"`:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
Task: Implement Milestone {N} — {title}
|
|
96
|
+
|
|
97
|
+
[PARALLEL MODE — WORKTREE ISOLATED]
|
|
98
|
+
Branch: parallel/{milestone-slug}
|
|
99
|
+
|
|
100
|
+
Agent role: {from Team Spec}
|
|
101
|
+
Directories owned: {from Team Spec}
|
|
102
|
+
|
|
103
|
+
{standard context from orchestrator Step 4}
|
|
104
|
+
|
|
105
|
+
Worktree rules (MANDATORY):
|
|
106
|
+
- Only write files within your "Directories owned"
|
|
107
|
+
- DO NOT run git push — commit locally only
|
|
108
|
+
- If you see errors in files outside your directories: STOP, report "scope violation"
|
|
109
|
+
- End your report with: "Branch: parallel/{slug}"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Step 6: Wait and Monitor
|
|
115
|
+
|
|
116
|
+
After all agents complete:
|
|
117
|
+
- Collect all completion reports
|
|
118
|
+
- Mark each as COMPLETE or FAILED in ownership.md
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Step 7: Merge Sequentially
|
|
123
|
+
|
|
124
|
+
Follow the Merge Protocol from `capabilities/shared/parallel-coordination.md`:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
git checkout main
|
|
128
|
+
|
|
129
|
+
# Merge branches one at a time (simplest first)
|
|
130
|
+
git merge parallel/{slug-1} --no-ff -m "merge: M{N} {title} [parallel wave]"
|
|
131
|
+
# Run tests after each merge
|
|
132
|
+
{test command} 2>&1 | tail -10
|
|
133
|
+
|
|
134
|
+
git merge parallel/{slug-2} --no-ff -m "merge: M{N} {title} [parallel wave]"
|
|
135
|
+
{test command} 2>&1 | tail -10
|
|
136
|
+
|
|
137
|
+
# Push once all merges pass
|
|
138
|
+
git push origin main
|
|
139
|
+
|
|
140
|
+
# Cleanup
|
|
141
|
+
git branch -d parallel/{slug-1} parallel/{slug-2}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**If merge conflict**: read both versions, apply correct merge (keep both feature additions), continue.
|
|
145
|
+
**If tests fail after a merge**: identify which merge broke it → revert that branch → add milestone to blocked.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Step 8: Update Plan + Report
|
|
150
|
+
|
|
151
|
+
Update `.claude/plan.md` — set merged milestones to `status: done`.
|
|
152
|
+
Update `.claude/ownership.md` — replace active table with merge record.
|
|
153
|
+
|
|
154
|
+
Show final report:
|
|
155
|
+
```
|
|
156
|
+
/parallel — Wave Complete
|
|
157
|
+
═══════════════════════════════════════
|
|
158
|
+
Milestones dispatched: {N}
|
|
159
|
+
✓ M{N} — {title} (merged, tests pass)
|
|
160
|
+
✓ M{N} — {title} (merged, tests pass)
|
|
161
|
+
✗ M{N} — {title} (merge conflict → added to blocked)
|
|
162
|
+
|
|
163
|
+
Tests: PASS — {N} passing after merge
|
|
164
|
+
Time saved vs sequential: ~{N} build cycles
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Completion Rule
|
|
170
|
+
|
|
171
|
+
Do not say "parallel complete" without showing:
|
|
172
|
+
1. Each agent's completion status
|
|
173
|
+
2. Merge result for each branch (pass/conflict)
|
|
174
|
+
3. Final test output after all merges
|
|
175
|
+
4. Updated plan.md milestone statuses
|
|
@@ -209,6 +209,24 @@ If all three exist:
|
|
|
209
209
|
✓ Constitution, coding rules, and specs found. Ready for /copilot.
|
|
210
210
|
```
|
|
211
211
|
|
|
212
|
+
Always append MCP check (regardless of other states):
|
|
213
|
+
```bash
|
|
214
|
+
claude mcp list 2>/dev/null | grep -c "." || echo "0"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
· MCP servers configured: {N}
|
|
219
|
+
Run: /mcp
|
|
220
|
+
Why: Context7 fixes stale API docs in /add and /copilot.
|
|
221
|
+
Sequential Thinking improves /blueprint and /copilot planning.
|
|
222
|
+
Both are free — no API key needed.
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
If N ≥ 1, show instead:
|
|
226
|
+
```
|
|
227
|
+
· {N} MCP server(s) active. Run /mcp to check stack-specific recommendations.
|
|
228
|
+
```
|
|
229
|
+
|
|
212
230
|
---
|
|
213
231
|
|
|
214
232
|
## If Running Again on an Existing Project
|