claude-raid 0.1.1 → 0.1.3

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 (51) hide show
  1. package/README.md +298 -196
  2. package/bin/cli.js +45 -18
  3. package/package.json +1 -1
  4. package/src/descriptions.js +57 -0
  5. package/src/detect-browser.js +164 -0
  6. package/src/detect-package-manager.js +107 -0
  7. package/src/detect-project.js +44 -6
  8. package/src/doctor.js +12 -188
  9. package/src/init.js +192 -17
  10. package/src/merge-settings.js +63 -7
  11. package/src/remove.js +28 -4
  12. package/src/setup.js +405 -0
  13. package/src/ui.js +168 -0
  14. package/src/update.js +62 -5
  15. package/src/version-check.js +130 -0
  16. package/template/.claude/agents/archer.md +46 -51
  17. package/template/.claude/agents/rogue.md +43 -49
  18. package/template/.claude/agents/warrior.md +48 -53
  19. package/template/.claude/agents/wizard.md +65 -67
  20. package/template/.claude/hooks/raid-lib.sh +182 -0
  21. package/template/.claude/hooks/raid-pre-compact.sh +41 -0
  22. package/template/.claude/hooks/raid-session-end.sh +116 -0
  23. package/template/.claude/hooks/raid-session-start.sh +52 -0
  24. package/template/.claude/hooks/raid-stop.sh +68 -0
  25. package/template/.claude/hooks/raid-task-completed.sh +37 -0
  26. package/template/.claude/hooks/raid-task-created.sh +40 -0
  27. package/template/.claude/hooks/raid-teammate-idle.sh +28 -0
  28. package/template/.claude/hooks/validate-browser-cleanup.sh +36 -0
  29. package/template/.claude/hooks/validate-browser-tests-exist.sh +52 -0
  30. package/template/.claude/hooks/validate-commit.sh +130 -0
  31. package/template/.claude/hooks/validate-dungeon.sh +114 -0
  32. package/template/.claude/hooks/validate-file-naming.sh +13 -27
  33. package/template/.claude/hooks/validate-no-placeholders.sh +11 -21
  34. package/template/.claude/hooks/validate-write-gate.sh +60 -0
  35. package/template/.claude/raid-rules.md +27 -18
  36. package/template/.claude/skills/raid-browser/SKILL.md +186 -0
  37. package/template/.claude/skills/raid-browser-chrome/SKILL.md +189 -0
  38. package/template/.claude/skills/raid-browser-playwright/SKILL.md +163 -0
  39. package/template/.claude/skills/raid-debugging/SKILL.md +6 -6
  40. package/template/.claude/skills/raid-design/SKILL.md +10 -10
  41. package/template/.claude/skills/raid-finishing/SKILL.md +11 -3
  42. package/template/.claude/skills/raid-implementation/SKILL.md +26 -11
  43. package/template/.claude/skills/raid-implementation-plan/SKILL.md +15 -4
  44. package/template/.claude/skills/raid-protocol/SKILL.md +57 -32
  45. package/template/.claude/skills/raid-review/SKILL.md +42 -13
  46. package/template/.claude/skills/raid-tdd/SKILL.md +45 -3
  47. package/template/.claude/skills/raid-verification/SKILL.md +12 -1
  48. package/template/.claude/hooks/validate-commit-message.sh +0 -78
  49. package/template/.claude/hooks/validate-phase-gate.sh +0 -60
  50. package/template/.claude/hooks/validate-tests-pass.sh +0 -43
  51. package/template/.claude/hooks/validate-verification.sh +0 -70
package/README.md CHANGED
@@ -1,8 +1,29 @@
1
1
  # claude-raid
2
2
 
3
- **Adversarial multi-agent development system for [Claude Code](https://claude.ai/code).**
3
+ ```ansi
4
+ [33m ⚔ ═══════════════════════════════════════════════════════ ⚔[0m
5
+
6
+ [1;33m ██████╗██╗ █████╗ ██╗ ██╗██████╗ ███████╗[0m
7
+ [1;33m ██╔════╝██║ ██╔══██╗██║ ██║██╔══██╗██╔════╝[0m
8
+ [33m ██║ ██║ ███████║██║ ██║██║ ██║█████╗ [0m
9
+ [33m ██║ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝ [0m
10
+ [33m ╚██████╗███████╗██║ ██║╚██████╔╝██████╔╝███████╗[0m
11
+ [1;31m ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝[0m
12
+ [1;31m ██████╗ █████╗ ██╗██████╗ [0m
13
+ [1;31m ██╔══██╗██╔══██╗██║██╔══██╗[0m
14
+ [31m ██████╔╝███████║██║██║ ██║[0m
15
+ [31m ██╔══██╗██╔══██║██║██║ ██║[0m
16
+ [31m ██║ ██║██║ ██║██║██████╔╝[0m
17
+ [2;31m ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═════╝ [0m
18
+
19
+ [90m Adversarial multi-agent development for Claude Code[0m
20
+
21
+ [33m ⚔ ═══════════════════════════════════════════════════════ ⚔[0m
22
+ ```
23
+
24
+ Four AI agents work through a strict 4-phase workflow where every design decision, implementation choice, and code review is stress-tested by competing perspectives before it ships.
4
25
 
5
- Four agents -- Wizard, Warrior, Archer, Rogue -- work through a strict 4-phase workflow where every decision, implementation, and review is stress-tested by competing agents who learn from each other's mistakes and push every finding to its edges.
26
+ Built for [Claude Code](https://claude.ai/claude-code). Zero dependencies. One command to install.
6
27
 
7
28
  Adapted from [obra/superpowers](https://github.com/obra/superpowers) by Jesse Vincent.
8
29
 
@@ -11,184 +32,260 @@ Adapted from [obra/superpowers](https://github.com/obra/superpowers) by Jesse Vi
11
32
  ## Quick Start
12
33
 
13
34
  ```bash
14
- npx claude-raid init
35
+ # Install into any project
36
+ npx claude-raid summon
37
+
38
+ # Preview what gets installed (no changes made)
39
+ npx claude-raid summon --dry-run
40
+
41
+ # Start a Raid
15
42
  claude --agent wizard
16
43
  ```
17
44
 
18
- That's it. The installer auto-detects your project type, generates configuration, and merges with your existing Claude Code setup. Nothing is overwritten.
45
+ Describe your task. The Wizard assesses complexity, recommends a mode, and opens the first phase. That's it.
19
46
 
20
- For split-pane mode (recommended for watching agents interact):
47
+ ### Prerequisites
21
48
 
22
- ```bash
23
- claude --agent wizard --teammate-mode tmux
24
- ```
49
+ | Requirement | Why | Auto-configured? |
50
+ |---|---|---|
51
+ | **Node.js** 18+ | Runs the installer | No |
52
+ | **Claude Code** v2.1.32+ | Agent teams support | No |
53
+ | **jq** | Hook config parsing | Pre-installed on macOS |
54
+ | **teammateMode** | Agent display mode | Yes (wizard prompts) |
25
55
 
26
- ## How It Works
56
+ The setup wizard checks all of these during `summon` and offers to fix what it can.
27
57
 
28
- You describe your task. The Wizard assesses complexity, recommends a mode, and opens the Dungeon:
58
+ ---
29
59
 
30
- ```
31
- Phase 1: DESIGN Wizard opens the Dungeon, dispatches with angles.
32
- Agents explore freely, challenge each other directly,
33
- roast weak findings, build on discoveries.
34
- Verified findings pinned to the Dungeon.
35
- Wizard closes when design is battle-tested.
36
-
37
- Phase 2: PLAN Agents decompose the design into tasks.
38
- They fight directly over compliance, naming,
39
- test coverage, and ordering.
40
- Agreed tasks pinned to the Dungeon.
41
-
42
- Phase 3: IMPLEMENTATION One agent implements each task. The others attack
43
- directly — and attack each other's reviews too.
44
- TDD enforced. Every task earns approval.
45
-
46
- Phase 4: REVIEW Independent reviews, then agents fight over findings
47
- AND missing findings. Issues pinned by severity.
48
- Critical and Important must be fixed.
49
-
50
- FINISHING Agents debate completeness directly.
51
- Wizard presents merge options. Dungeon cleaned up.
52
- ```
60
+ ## How It Works
53
61
 
54
- Every phase follows the same pattern: Wizard opens the Dungeon and dispatches with angles, agents self-organize and interact directly (challenge, roast, build on each other's work), pin verified findings to the Dungeon, and the Wizard closes with a binding ruling. No phase is skipped. No work passes unchallenged.
62
+ You describe a task. The Wizard assesses complexity, recommends a mode, and opens the Dungeon a shared knowledge artifact where agents pin verified findings throughout each phase.
55
63
 
56
- ## The Team
64
+ ```
65
+ Phase 1: DESIGN Agents explore the problem from competing angles.
66
+ Challenge each other's findings. Pin what survives.
67
+ Wizard closes when the design is battle-tested.
57
68
 
58
- ### Wizard (Dungeon Master)
69
+ Phase 2: PLAN Decompose the design into testable tasks.
70
+ Fight over naming, ordering, coverage, compliance.
71
+ Pin the agreed task list.
59
72
 
60
- Purple. Model: Opus 4.6. Observes 90%, acts 10%.
73
+ Phase 3: IMPLEMENTATION One agent builds each task (TDD enforced).
74
+ The others attack the implementation directly.
75
+ Every task earns approval before moving on.
61
76
 
62
- The Wizard doesn't write code -- it thinks. Every response has been turned over 3, 4, 5 times before a single word is committed. It reads the full prompt three times, identifies the real problem beneath the stated one, maps the blast radius, and only then opens the Dungeon and dispatches the team with precise angles.
77
+ Phase 4: REVIEW Independent reviews against design and plan.
78
+ Agents fight over findings AND missing findings.
79
+ Critical and Important issues must be fixed.
63
80
 
64
- After dispatch, the Wizard goes silent. Agents own the phase -- they interact directly, challenge each other, build on discoveries, and pin verified findings to the Dungeon. The Wizard watches, intervening only on destructive loops, drift, deadlock, laziness, ego, or misinformation. When the phase objective is met, the Wizard closes with a binding ruling citing Dungeon evidence.
81
+ FINISHING Agents debate completeness. Wizard presents
82
+ merge options: merge, PR, keep branch, or discard.
83
+ ```
65
84
 
66
- ### Warrior
85
+ No phase is skipped. No work passes unchallenged.
67
86
 
68
- Red. Aggressive thoroughness. Stress-tests to destruction.
87
+ ---
69
88
 
70
- The Warrior doesn't skim -- it rips things apart. When @Archer or @Rogue present findings, its first instinct is: *"Where is this wrong?"* It demands evidence, proposes counter-examples, and pushes until things break. Race conditions, null input, scale, memory pressure -- nothing passes unchecked. It builds on teammates' discoveries and roasts weak analysis. Every move counts, and it concedes instantly when proven wrong.
89
+ ## The Team
71
90
 
72
- **Signals:** `🔍 FINDING:` / `⚔️ CHALLENGE:` / `🔥 ROAST:` / `🔗 BUILDING ON @Name:` / `📌 DUNGEON:` / `🆘 WIZARD:` / `✅ CONCEDE:`
91
+ ### Wizard Dungeon Master
73
92
 
74
- ### Archer
93
+ Thinks 5 times before speaking. Opens phases, dispatches the team with precise angles, observes silently (90% of the time), and closes each phase with a binding ruling citing Dungeon evidence. The Wizard doesn't write code — it ensures the process produces the best possible outcome.
75
94
 
76
- Green. Precision over brute force. Pattern recognition.
95
+ ### Warrior Stress Tester
77
96
 
78
- The Archer finds what brute force misses. It spots naming mismatches, violated conventions, and design drift. It traces ripple effects -- changing X in module A silently breaks Y in module C through an implicit contract in Z. It challenges @Warrior and @Rogue from unexpected angles, building on their discoveries with surgical precision. Every finding includes the exact location and the exact consequence.
97
+ Rips things apart. Race conditions, null input, scale, memory pressure nothing passes unchecked. Demands evidence, proposes counter-examples, and pushes until things break. Concedes instantly when proven wrong.
79
98
 
80
- **Signals:** `🎯 FINDING:` / `🏹 CHALLENGE:` / `🔥 ROAST:` / `🔗 BUILDING ON @Name:` / `📌 DUNGEON:` / `🆘 WIZARD:` / `✅ CONCEDE:`
99
+ ### Archer Pattern Seeker
81
100
 
82
- ### Rogue
101
+ Finds what brute force misses. Naming mismatches, violated conventions, design drift. Traces ripple effects — changing X in module A silently breaks Y in module C through an implicit contract in Z. Every finding includes the exact location and the exact consequence.
83
102
 
84
- Orange. Adversarial mindset. Assumption destroyer.
103
+ ### Rogue Assumption Destroyer
85
104
 
86
- The Rogue thinks like a malicious user, a failing network, a corrupted database, a race condition at 3 AM. *"This will never be null."* Oh really? *"Users won't do that."* Watch me. It constructs the exact sequence of events that turns a minor oversight into a critical failure. It weaponizes @Warrior and @Archer's findings to build nastier scenarios. Every finding is a concrete attack scenario, not a theoretical concern.
105
+ Thinks like a malicious user, a failing network, a corrupted database, a race condition at 3 AM. Constructs the exact sequence of events that turns a minor oversight into a critical failure. Every finding is a concrete attack scenario, not a theoretical concern.
87
106
 
88
- **Signals:** `💀 FINDING:` / `🗡️ CHALLENGE:` / `🔥 ROAST:` / `🔗 BUILDING ON @Name:` / `📌 DUNGEON:` / `🆘 WIZARD:` / `✅ CONCEDE:`
107
+ ---
89
108
 
90
109
  ## Modes
91
110
 
92
- Not every task needs all four agents. The Wizard recommends a mode based on complexity, or you can specify one directly.
111
+ Not every task needs all four agents. The Wizard recommends a mode based on complexity, or you can override directly.
93
112
 
94
113
  | | Full Raid | Skirmish | Scout |
95
114
  |---|---|---|---|
96
- | **Agents** | 3 | 2 | 1 |
97
- | **Design phase** | Full adversarial | Lightweight | Skip (inline) |
98
- | **Plan phase** | Full adversarial | Merged with design | Skip (inline) |
115
+ | **Agents** | 3 + Wizard | 2 + Wizard | 1 + Wizard |
116
+ | **Design** | Full adversarial | Lightweight | Inline |
117
+ | **Planning** | Full adversarial | Merged with design | Inline |
99
118
  | **Implementation** | 1 builds, 2 attack | 1 builds, 1 attacks | 1 builds, Wizard reviews |
100
119
  | **Review** | 3 independent reviews | 1 review + Wizard | Wizard only |
101
- | **TDD** | **Enforced** | **Enforced** | **Enforced** |
102
- | **Verification** | Triple | Double | Single + Wizard |
120
+ | **TDD** | Enforced | Enforced | Enforced |
103
121
 
104
- **When to use:**
122
+ **When to use each:**
105
123
 
106
- - **Full Raid** -- Complex features, architecture decisions, critical security reviews, major refactors, cross-layer changes
107
- - **Skirmish** -- Medium features, non-trivial bugfixes, multi-file changes
108
- - **Scout** -- Simple bugfixes, config changes, documentation, single-file changes
124
+ - **Full Raid** Architecture decisions, security-critical code, major refactors, cross-layer changes
125
+ - **Skirmish** Medium features, non-trivial bugfixes, multi-file changes
126
+ - **Scout** Config changes, documentation, single-file fixes
109
127
 
110
128
  Override the Wizard's recommendation: *"Full Raid this"*, *"Skirmish this bugfix"*, *"Scout this"*.
111
129
 
112
130
  The Wizard can escalate mid-task (Scout to Skirmish, Skirmish to Full Raid) with your approval. It cannot de-escalate without asking.
113
131
 
114
- **TDD is non-negotiable in all modes.** No production code without a failing test first.
132
+ ---
115
133
 
116
134
  ## The Dungeon
117
135
 
118
- The Dungeon (`.claude/raid-dungeon.md`) is the team's shared knowledge artifact -- a curated board where agents pin verified findings during each phase.
136
+ The Dungeon (`.claude/raid-dungeon.md`) is the team's shared knowledge artifact a curated board where agents pin verified findings during each phase.
119
137
 
120
- **What goes in the Dungeon:** Findings that survived challenge, active unresolved battles, shared knowledge verified by 2+ agents, key decisions, escalation points.
138
+ **What goes in:** Findings that survived challenge from 2+ agents, active unresolved battles, key decisions, escalation points.
121
139
 
122
140
  **What stays in conversation:** The back-and-forth of challenges and roasts, exploratory thinking, concessions. The conversation is the sparring ring. The Dungeon is the scoreboard.
123
141
 
124
- **Lifecycle:** Wizard creates the Dungeon when opening a phase, agents pin findings with `📌 DUNGEON:`, Wizard archives it when closing (`.claude/raid-dungeon-phase-N.md`), and agents can reference archived Dungeons from prior phases. All Dungeon files are cleaned up when the session ends.
142
+ **Lifecycle:** Wizard creates it when opening a phase, agents pin findings with `DUNGEON:` prefix, Wizard archives it when closing (`raid-dungeon-phase-N.md`), and all Dungeon files are cleaned up when the session ends.
125
143
 
126
- **Direct interaction:** Agents talk to each other directly (`@Name`), build on discoveries (`🔗 BUILDING ON @Name:`), roast weak analysis (`🔥 ROAST:`), and escalate to the Wizard only when genuinely stuck (`🆘 WIZARD:`). The Wizard observes silently and intervenes only on destructive loops, drift, deadlock, laziness, ego, or misinformation.
144
+ Agents interact directly `@Name` mentions, building on each other's discoveries, roasting weak analysis. The Wizard observes silently, intervening only on destructive loops, drift, deadlock, or misinformation.
127
145
 
128
- ## Skills
146
+ ---
129
147
 
130
- 10 specialized skills guide agent behavior at each stage:
148
+ ## What Gets Installed
131
149
 
132
- | Skill | When It's Used | What It Does |
133
- |---|---|---|
134
- | `raid-protocol` | Session start | Establishes workflow, modes, team rules, reference tables. The Wizard's operating manual. |
135
- | `raid-design` | Phase 1 | Read-only exploration. Agents cover performance, robustness, testability, edge cases, architecture, DRY. Produces design specification. |
136
- | `raid-implementation-plan` | Phase 2 | Collaborative decomposition with compliance testing. Every requirement gets a task, every task gets tests, naming is consistent, ordering is correct. |
137
- | `raid-implementation` | Phase 3 | One implements, others attack, rotate. Task tracking via Claude Code's built-in system. Implementer rotation enforced. |
138
- | `raid-review` | Phase 4 | Independent reviews against design doc and plan. Issues classified as Critical (must fix), Important (must fix), or Minor (note). |
139
- | `raid-finishing` | After Phase 4 | Completeness debate. Tests verified. Four options: merge, PR, keep branch, discard. |
140
- | `raid-tdd` | During implementation | Strict RED-GREEN-REFACTOR. Challengers attack test quality. Rationalization table prevents shortcuts. |
141
- | `raid-debugging` | On bugs | Competing hypotheses in parallel. No fixes without root cause. 3+ failed fixes triggers architecture discussion. |
142
- | `raid-verification` | Before completion claims | Evidence before assertions. Fresh test run required. Forbidden phrases without evidence: "done", "working", "fixed". |
143
- | `raid-git-worktrees` | Before implementation | Isolated workspace with safety verification and clean test baseline. |
150
+ ```
151
+ .claude/
152
+ ├── raid.json # Project config (auto-detected, editable)
153
+ ├── raid-rules.md # 17 team rules across 3 pillars (editable)
154
+ ├── settings.json # Hooks merged with existing (backup created)
155
+ ├── agents/
156
+ │ ├── wizard.md # Dungeon master
157
+ │ ├── warrior.md # Stress tester
158
+ │ ├── archer.md # Pattern seeker
159
+ │ └── rogue.md # Assumption destroyer
160
+ ├── hooks/
161
+ │ ├── raid-lib.sh # Shared config and session state
162
+ │ ├── raid-session-start.sh # Session activation
163
+ │ ├── raid-session-end.sh # Archive and cleanup
164
+ │ ├── raid-stop.sh # Phase transition backup
165
+ │ ├── raid-pre-compact.sh # Pre-compaction backup
166
+ │ ├── raid-task-created.sh # Task subject validation
167
+ │ ├── raid-task-completed.sh # Test evidence gate
168
+ │ ├── raid-teammate-idle.sh # Idle agent nudge
169
+ │ ├── validate-commit.sh # Conventional commits + test gate
170
+ │ ├── validate-write-gate.sh # Design doc before implementation
171
+ │ ├── validate-file-naming.sh # Naming convention enforcement
172
+ │ ├── validate-no-placeholders.sh # No TBD/TODO in specs
173
+ │ ├── validate-dungeon.sh # Multi-agent verification on pins
174
+ │ ├── validate-browser-tests-exist.sh # Playwright test detection
175
+ │ └── validate-browser-cleanup.sh # Browser process cleanup
176
+ └── skills/
177
+ ├── raid-protocol/ # Session lifecycle and team rules
178
+ ├── raid-design/ # Phase 1: adversarial exploration
179
+ ├── raid-implementation-plan/ # Phase 2: task decomposition
180
+ ├── raid-implementation/ # Phase 3: TDD with direct challenge
181
+ ├── raid-review/ # Phase 4: independent review + fighting
182
+ ├── raid-finishing/ # Completeness debate + merge options
183
+ ├── raid-tdd/ # RED-GREEN-REFACTOR enforcement
184
+ ├── raid-debugging/ # Root-cause investigation
185
+ ├── raid-verification/ # Evidence-before-claims gate
186
+ ├── raid-git-worktrees/ # Isolated workspace creation
187
+ ├── raid-browser/ # Browser startup discovery
188
+ ├── raid-browser-playwright/ # Playwright test authoring
189
+ └── raid-browser-chrome/ # Live browser inspection
190
+ ```
191
+
192
+ Dungeon files (`raid-dungeon.md`, `raid-dungeon-phase-*.md`) and session state (`raid-session`) are created at runtime during Raid sessions and cleaned up automatically.
193
+
194
+ ---
144
195
 
145
196
  ## Hooks
146
197
 
147
- 6 quality gates enforced automatically. All hooks are POSIX-compatible (work on macOS and Linux), read configuration from `.claude/raid.json`, and use `#claude-raid` markers so they never collide with your existing hooks.
198
+ Hooks enforce workflow discipline automatically. They split into two categories:
199
+
200
+ ### Lifecycle Hooks
201
+
202
+ Manage session state without manual intervention. These activate and deactivate as sessions begin and end.
203
+
204
+ | Hook | Trigger | Purpose |
205
+ |---|---|---|
206
+ | **raid-session-start** | SessionStart | Activates Raid workflow, checks Vault for past quests |
207
+ | **raid-session-end** | SessionEnd | Archives Dungeon, drafts Vault entry, removes session |
208
+ | **raid-stop** | Stop | Backs up Dungeon on phase transitions |
209
+ | **raid-pre-compact** | PreCompact | Backs up Dungeon before message compaction |
210
+ | **raid-task-created** | TaskCreated | Validates task subjects are meaningful |
211
+ | **raid-task-completed** | TaskCompleted | Blocks task completion without test evidence |
212
+ | **raid-teammate-idle** | TeammateIdle | Nudges idle agents to participate |
213
+
214
+ ### Quality Gates
148
215
 
149
- Hooks that enforce workflow discipline (phase-gate, test-pass, verification) only activate during Raid sessions -- they won't interfere with normal coding outside of a Raid.
216
+ Enforce code standards and workflow compliance. Quality gates only activate during Raid sessions they won't interfere with normal coding.
150
217
 
151
- | Hook | Trigger | What It Does |
218
+ | Hook | Trigger | Purpose |
152
219
  |---|---|---|
153
- | **validate-file-naming.sh** | After Write/Edit | Enforces configured naming convention (kebab-case, snake_case, camelCase). Always blocks spaces in filenames. Blocks files nested deeper than configured max depth (default 8). |
154
- | **validate-commit-message.sh** | Before Bash (git commit) | Enforces conventional commit format: `type(scope): description`. Blocks messages shorter than 15 characters. Blocks generic messages (update, fix, wip). Handles heredoc and quoted commit messages. |
155
- | **validate-tests-pass.sh** | Before Bash (git commit) | Runs your test command before allowing commits. Writes a timestamp to `.claude/raid-last-test-run` on success (used by the verification hook). Only active during Raid sessions. |
156
- | **validate-phase-gate.sh** | Before Write | Blocks writing implementation files when no design doc exists in the specs path. Full Raid: blocks. Skirmish: warns. Scout: skips. Only active during Raid sessions. |
157
- | **validate-no-placeholders.sh** | After Write/Edit | Scans specs and plans for placeholder text: TBD, TODO, FIXME, "implement later", "add appropriate", "similar to Task", "handle edge cases". Blocks with line numbers. |
158
- | **validate-verification.sh** | Before Bash (git commit) | Blocks commits that claim completion ("complete", "done", "final") unless tests were run within the last 10 minutes. Enforces the verification Iron Law. Only active during Raid sessions. |
220
+ | **validate-commit** | PreToolUse (Bash) | Conventional commit format + test gate before commits |
221
+ | **validate-write-gate** | PreToolUse (Write) | Blocks implementation files before design doc exists |
222
+ | **validate-file-naming** | PostToolUse (Write) | Enforces naming convention (kebab-case, snake_case, etc.) |
223
+ | **validate-no-placeholders** | PostToolUse (Write) | Blocks TBD/TODO/FIXME in specs and plans |
224
+ | **validate-dungeon** | PostToolUse (Write) | Requires 2+ agents verified on Dungeon pins |
225
+ | **validate-browser-tests-exist** | PreToolUse (Bash) | Checks Playwright tests exist before commits |
226
+ | **validate-browser-cleanup** | PostToolUse (Bash) | Verifies browser processes cleaned up properly |
227
+
228
+ All hooks are POSIX-compatible, read configuration from `raid.json`, and use `#claude-raid` markers to avoid collisions with your existing hooks.
229
+
230
+ **Exit codes:** `0` = pass, `2` = block with message (agent sees the error and must fix it).
231
+
232
+ ---
233
+
234
+ ## Skills
235
+
236
+ 13 specialized skills guide agent behavior at each stage of the workflow.
237
+
238
+ ### Phase Skills
239
+
240
+ | Skill | Purpose |
241
+ |---|---|
242
+ | **raid-protocol** | Master orchestration. Session lifecycle, team composition, modes, rules, reference tables. Loaded at session start. |
243
+ | **raid-design** | Phase 1. Agents independently explore from assigned angles, challenge findings, pin discoveries. Produces a battle-tested design spec. |
244
+ | **raid-implementation-plan** | Phase 2. Decompose design into testable tasks. Agents debate naming, ordering, coverage, compliance. |
245
+ | **raid-implementation** | Phase 3. One implements (TDD), others attack. Rotate implementer per task. No task passes without all issues resolved. |
246
+ | **raid-review** | Phase 4. Independent reviews against design and plan. Issues classified as Critical (must fix), Important (must fix), or Minor (note). |
247
+ | **raid-finishing** | Completeness debate. Agents argue whether work is done. Four merge options: merge, PR, keep branch, discard. |
248
+
249
+ ### Discipline Skills
159
250
 
160
- ### Hook exit codes
251
+ | Skill | Purpose |
252
+ |---|---|
253
+ | **raid-tdd** | Strict RED-GREEN-REFACTOR. No production code before a failing test. Challengers attack test quality. |
254
+ | **raid-debugging** | Competing hypotheses in parallel. No fixes without confirmed root cause. 3+ failed fixes triggers architecture rethink. |
255
+ | **raid-verification** | Evidence before assertions. Fresh test run required. Forbidden phrases without evidence: "done", "working", "fixed". |
256
+ | **raid-git-worktrees** | Isolated workspace creation with safety verification and clean test baseline. |
257
+
258
+ ### Browser Skills
161
259
 
162
- - `0` -- pass, no issues
163
- - `2` -- block with message (agent sees the error and must fix it)
260
+ | Skill | Purpose |
261
+ |---|---|
262
+ | **raid-browser** | Browser startup discovery. Detects dev server, auth requirements, startup steps. |
263
+ | **raid-browser-playwright** | Playwright MCP test authoring with network and console assertions. |
264
+ | **raid-browser-chrome** | Live browser inspection via Claude-in-Chrome MCP. Angle-driven investigation. |
265
+
266
+ ---
164
267
 
165
268
  ## Team Rules
166
269
 
167
- 17 non-negotiable rules that every agent follows, stored in `.claude/raid-rules.md`:
168
-
169
- 1. **No subagents** -- agent teams only
170
- 2. **No laziness** -- every challenge carries evidence
171
- 3. **No trust without verification** -- verify independently, reports lie
172
- 4. **Learn from mistakes** -- yours and others'
173
- 5. **Make every move count** -- no endless disputes
174
- 6. **Share knowledge** -- competitors but a team
175
- 7. **No ego** -- evidence or concede, instantly
176
- 8. **Stay active** -- all assigned agents participate
177
- 9. **Wizard is the human interface** -- agents ask the Wizard, Wizard asks you
178
- 10. **Wizard is impartial** -- judges by evidence, not source
179
- 11. **Wizard observes 90%, acts 10%** -- speaks when 90% confident
180
- 12. **Maximum effort, always**
181
- 13. **No hallucination** -- say "I don't know" when uncertain
182
- 14. **Dungeon discipline** -- only pin verified findings, don't spam
183
- 15. **Direct engagement** -- address agents by name, build on each other's work
184
- 16. **Escalate wisely** -- pull the Wizard only when genuinely stuck
185
- 17. **Roast with evidence** -- every critique carries proof
186
-
187
- Edit this file to add project-specific rules. Updates via `claude-raid update` will overwrite it, so keep a backup if you've customized it.
270
+ 17 non-negotiable rules organized into 3 pillars. Stored in `.claude/raid-rules.md` (editable).
271
+
272
+ ### Pillar 1: Intellectual Honesty
273
+
274
+ Every claim has evidence you gathered yourself. If you haven't read the code or run the command this turn, you don't know what it says. Never fabricate evidence, certainty, or findings.
275
+
276
+ ### Pillar 2: Zero Ego Collaboration
277
+
278
+ When proven wrong, concede instantly. Defend with evidence, never with authority. A teammate catching your mistake is a gift. Build on each other's work — the best findings come from combining perspectives.
279
+
280
+ ### Pillar 3: Discipline and Efficiency
281
+
282
+ Maximum effort on every task. Every interaction carries work forward. Agents talk directly to each other — the Wizard is not a relay. Escalate to the Wizard only after you've tried to resolve it yourself.
283
+
284
+ ---
188
285
 
189
286
  ## Configuration
190
287
 
191
- `npx claude-raid init` auto-detects your project and generates `.claude/raid.json`:
288
+ `claude-raid summon` auto-detects your project and generates `.claude/raid.json`:
192
289
 
193
290
  ```json
194
291
  {
@@ -209,136 +306,141 @@ Edit this file to add project-specific rules. Updates via `claude-raid update` w
209
306
  "commits": "conventional"
210
307
  },
211
308
  "raid": {
212
- "defaultMode": "full"
309
+ "defaultMode": "full",
310
+ "vault": { "path": ".claude/vault", "enabled": true },
311
+ "lifecycle": {
312
+ "autoSessionManagement": true,
313
+ "testWindowMinutes": 10
314
+ }
213
315
  }
214
316
  }
215
317
  ```
216
318
 
217
- ### Auto-detected languages
319
+ ### Auto-Detection
218
320
 
219
- | Marker File | Language | Test Command | Lint Command | Build Command |
220
- |---|---|---|---|---|
221
- | `package.json` | JavaScript | `npm test` | `npm run lint` | `npm run build` |
222
- | `Cargo.toml` | Rust | `cargo test` | `cargo clippy` | `cargo build` |
223
- | `pyproject.toml` | Python | `pytest` / `poetry run pytest` | `ruff check .` | `python -m build` / `poetry build` |
224
- | `requirements.txt` | Python | `pytest` | `ruff check .` | -- |
225
- | `go.mod` | Go | `go test ./...` | `go vet ./...` | `go build ./...` |
321
+ | Marker File | Language | Test Command | Lint Command |
322
+ |---|---|---|---|
323
+ | `package.json` | JavaScript | `npm test` | `npm run lint` |
324
+ | `Cargo.toml` | Rust | `cargo test` | `cargo clippy` |
325
+ | `pyproject.toml` | Python | `pytest` / `poetry run pytest` | `ruff check .` |
326
+ | `requirements.txt` | Python | `pytest` | `ruff check .` |
327
+ | `go.mod` | Go | `go test ./...` | `go vet ./...` |
226
328
 
227
- Commands are auto-detected from your project files (e.g., `scripts.test` in `package.json`). Edit `raid.json` to override.
329
+ Commands are extracted from your project files (e.g., `scripts.test` in `package.json`). Package manager is auto-detected (npm, pnpm, yarn, bun, uv, poetry). Edit `raid.json` to override any value.
228
330
 
229
- ### Configuration reference
331
+ ### Configuration Reference
230
332
 
231
333
  | Key | Default | Description |
232
334
  |---|---|---|
233
335
  | `project.testCommand` | auto-detected | Command to run tests |
234
336
  | `project.lintCommand` | auto-detected | Command to run linting |
235
337
  | `project.buildCommand` | auto-detected | Command to build |
236
- | `paths.specs` | `docs/raid/specs` | Where design specs are saved |
237
- | `paths.plans` | `docs/raid/plans` | Where implementation plans are saved |
238
- | `paths.worktrees` | `.worktrees` | Where git worktrees are created |
239
- | `conventions.fileNaming` | `none` | Naming convention: `kebab-case`, `snake_case`, `camelCase`, `none` |
240
- | `conventions.commits` | `conventional` | Commit format |
338
+ | `paths.specs` | `docs/raid/specs` | Design spec output directory |
339
+ | `paths.plans` | `docs/raid/plans` | Implementation plan output directory |
340
+ | `paths.worktrees` | `.worktrees` | Git worktree directory |
341
+ | `conventions.fileNaming` | `none` | `kebab-case`, `snake_case`, `camelCase`, or `none` |
342
+ | `conventions.commits` | `conventional` | Commit message format |
241
343
  | `conventions.commitMinLength` | `15` | Minimum commit message length |
242
344
  | `conventions.maxDepth` | `8` | Maximum file nesting depth |
243
345
  | `raid.defaultMode` | `full` | Default mode: `full`, `skirmish`, `scout` |
346
+ | `raid.lifecycle.testWindowMinutes` | `10` | Max age (minutes) of test run for verification |
244
347
 
245
- ## CLI Commands
348
+ ### Browser Testing
246
349
 
247
- ```bash
248
- npx claude-raid init # Install into current project
249
- npx claude-raid update # Update agents, skills, hooks (preserves raid.json)
250
- npx claude-raid remove # Uninstall and restore original settings
350
+ When a browser framework is detected (Next.js, Vite, Angular, etc.), a `browser` section is added to `raid.json`:
351
+
352
+ ```json
353
+ {
354
+ "browser": {
355
+ "enabled": true,
356
+ "framework": "next",
357
+ "devCommand": "npm run dev",
358
+ "baseUrl": "http://localhost:3000",
359
+ "defaultPort": 3000,
360
+ "playwrightConfig": "playwright.config.ts"
361
+ }
362
+ }
251
363
  ```
252
364
 
253
- ### `init`
365
+ This enables browser-specific hooks and skills — Playwright test detection, browser process cleanup, and live browser inspection during reviews.
366
+
367
+ ---
254
368
 
255
- - Creates `.claude/` if absent
256
- - Auto-detects project type and generates `raid.json`
257
- - Copies agents, hooks, skills, and `raid-rules.md`
258
- - Merges settings into existing `settings.json` (with backup)
259
- - Makes hooks executable
260
- - Adds session files to `.gitignore`
261
- - **Never overwrites** existing files with the same name
369
+ ## CLI Commands
370
+
371
+ | Command | Purpose |
372
+ |---|---|
373
+ | `claude-raid summon` | Install Raid into your project |
374
+ | `claude-raid summon --dry-run` | Preview what would be installed |
375
+ | `claude-raid update` | Upgrade hooks, skills, and rules to latest version |
376
+ | `claude-raid dismantle` | Remove all Raid files, restore original settings |
377
+ | `claude-raid heal` | Check environment health, show reference card |
378
+
379
+ Old names (`init`, `remove`, `doctor`) still work as aliases.
380
+
381
+ ### `summon`
382
+
383
+ Installs the full Raid system into your project. Auto-detects project type, copies agents/hooks/skills, generates `raid.json`, merges settings (with backup), and runs the setup wizard.
384
+
385
+ - Never overwrites existing files — customized agents are preserved
386
+ - Idempotent — safe to run multiple times
387
+ - `--dry-run` shows exactly what would be created without touching disk
262
388
 
263
389
  ### `update`
264
390
 
265
- - Overwrites hooks, skills, and `raid-rules.md` with latest versions
266
- - **Skips customized agents** (warns you which ones were preserved)
267
- - Does **not** touch `raid.json` (your project config)
268
- - Re-runs settings merge to add any new hooks
391
+ Upgrades hooks, skills, and `raid-rules.md` to the latest version. Skips customized agents (warns which ones were preserved). Does not touch `raid.json` — your project config stays intact.
269
392
 
270
- ### `remove`
393
+ ### `dismantle`
271
394
 
272
- - Removes all Raid agents, hooks, skills, and config files
273
- - Restores `settings.json` from backup (if backup exists)
274
- - Preserves non-Raid files in `.claude/`
395
+ Removes all Raid agents, hooks, skills, and config files. Restores `settings.json` from the backup created during install. Preserves non-Raid files in `.claude/`.
275
396
 
276
- ## What Gets Installed
397
+ ### `heal`
277
398
 
278
- ```
279
- .claude/
280
- ├── raid.json # Project config (auto-generated, editable)
281
- ├── raid-rules.md # Team rules (editable)
282
- ├── settings.json # Merged with existing (backup at .pre-raid-backup)
283
- ├── agents/
284
- │ ├── wizard.md # Lead coordinator
285
- │ ├── warrior.md # Aggressive explorer
286
- │ ├── archer.md # Precision pattern-seeker
287
- │ └── rogue.md # Adversarial assumption-destroyer
288
- ├── hooks/
289
- │ ├── validate-file-naming.sh # Naming conventions
290
- │ ├── validate-commit-message.sh # Conventional commits
291
- │ ├── validate-tests-pass.sh # Test gate before commits
292
- │ ├── validate-phase-gate.sh # Design doc before implementation
293
- │ ├── validate-no-placeholders.sh # No TBD/TODO in specs
294
- │ └── validate-verification.sh # Test evidence before completion
295
- └── skills/
296
- ├── raid-protocol/ # Master orchestration
297
- ├── raid-design/ # Phase 1
298
- ├── raid-implementation-plan/ # Phase 2
299
- ├── raid-implementation/ # Phase 3
300
- ├── raid-review/ # Phase 4
301
- ├── raid-finishing/ # Completeness + merge
302
- ├── raid-tdd/ # Test-driven development
303
- ├── raid-debugging/ # Root cause analysis
304
- ├── raid-verification/ # Evidence before claims
305
- └── raid-git-worktrees/ # Isolated workspaces
306
- ```
399
+ Checks Node.js, Claude Code, jq, teammateMode, and split-pane support. Offers to fix missing configuration interactively. Shows the "How It Works" reference card with modes, phases, hook enforcement, and controls.
400
+
401
+ ---
402
+
403
+ ## Controls
404
+
405
+ | Shortcut | Action |
406
+ |---|---|
407
+ | **Shift+Down** | Cycle through teammates |
408
+ | **Enter** | View a teammate's session |
409
+ | **Escape** | Interrupt a teammate's turn |
410
+ | **Ctrl+T** | Toggle the shared task list |
307
411
 
308
- **Note:** Dungeon files (`.claude/raid-dungeon.md`, `.claude/raid-dungeon-phase-*.md`) are created at runtime during Raid sessions, not during installation. They are session artifacts and are automatically cleaned up.
412
+ In split-pane mode (tmux/iTerm2), click a pane to interact directly with a specific agent.
413
+
414
+ ---
309
415
 
310
416
  ## Non-Invasive Design
311
417
 
312
418
  The Raid is a tool in your toolkit, not your project's operating system.
313
419
 
314
- - **Never touches your `CLAUDE.md`** -- your project instructions stay yours
420
+ - **Never touches your `CLAUDE.md`** your project instructions stay yours
315
421
  - **Merges settings** alongside your existing config, with automatic backup
316
422
  - **Won't overwrite** existing agents, hooks, or skills that share a name
317
- - **Session-scoped hooks** -- workflow hooks only activate during Raid sessions (`.claude/raid-session`), never during normal coding
423
+ - **Session-scoped hooks** workflow hooks only activate during Raid sessions, never during normal coding
318
424
  - **Clean removal** restores your original `settings.json` from backup
319
- - **Zero npm dependencies** -- pure Node.js stdlib, fast `npx` cold-start
320
-
321
- ## Requirements
425
+ - **Zero npm dependencies** pure Node.js stdlib, fast `npx` cold-start
322
426
 
323
- - [Claude Code](https://claude.ai/code) v2.1.32+
324
- - Node.js 18+ (for installation only -- the installed files are language-agnostic)
325
- - `jq` (for hooks -- pre-installed on macOS, available via `apt install jq` on Linux)
427
+ ---
326
428
 
327
429
  ## Inherited from Superpowers
328
430
 
329
431
  The Raid inherits and adapts the [Superpowers](https://github.com/obra/superpowers) behavioral harness:
330
432
 
331
- | Concept | How The Raid Uses It |
433
+ | Concept | How the Raid Uses It |
332
434
  |---|---|
333
435
  | HARD-GATEs | No code before design approval. No implementation before plan approval. |
334
436
  | TDD Iron Law | No production code without a failing test first. Enforced in all modes. |
335
437
  | Verification Iron Law | No completion claims without fresh test evidence. |
336
- | No Placeholders | Plans must contain complete code, not "TBD" or "implement later". |
337
- | Red Flags / Rationalization tables | Built into TDD, debugging, and verification skills. |
338
- | YAGNI / DRY | Remove unnecessary features. Don't duplicate logic. |
339
- | Conventional commits | Enforced via hook: `type(scope): description`. |
438
+ | No Placeholders | Specs and plans must contain complete content, not "TBD" or "implement later". |
439
+ | Conventional Commits | Enforced via hook: `type(scope): description`. |
440
+
441
+ **What's different:** Superpowers uses a single agent with subagent delegation. The Raid uses 4 agents in an agent team with adversarial cross-testing, direct interaction, and collaborative learning. Agents talk to each other (not through the Wizard), pin verified findings to a shared Dungeon, and self-organize within phases. Every decision is stress-tested from multiple angles before it passes.
340
442
 
341
- **What's different:** Superpowers uses a single agent with subagent delegation. The Raid uses 4 agents in an agent team with adversarial cross-testing, competitive exploration, and collaborative learning. Agents interact directly with each other (not through the Wizard), pin verified findings to a shared Dungeon, and self-organize within phases. The Wizard observes 90%, acts 10% -- opening and closing phases, but never mediating every exchange. Every decision is stress-tested from multiple angles before it passes.
443
+ ---
342
444
 
343
445
  ## License
344
446