claude-raid 0.2.5 → 0.2.7

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/README.md CHANGED
@@ -1,104 +1,135 @@
1
1
  <div align="center">
2
2
 
3
- ```
4
- ⚔ ══════════════════════════════════════════════════════════ ⚔
5
-
6
- ██████╗██╗ █████╗ ██╗ ██╗██████╗ ███████╗
7
- ██╔════╝██║ ██╔══██╗██║ ██║██╔══██╗██╔════╝
8
- ██║ ██║ ███████║██║ ██║██║ ██║█████╗
9
- ██║ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝
10
- ╚██████╗███████╗██║ ██║╚██████╔╝██████╔╝███████╗
11
- ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝
12
- ██████╗ █████╗ ██╗██████╗
13
- ██╔══██╗██╔══██╗██║██╔══██╗
14
- ██████╔╝███████║██║██║ ██║
15
- ██╔══██╗██╔══██║██║██║ ██║
16
- ██║ ██║██║ ██║██║██████╔╝
17
- ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═════╝
18
-
19
- Round-based Adversarial Intelligence Dungeon
20
- for Claude Code
21
-
22
- ⚔ ══════════════════════════════════════════════════════════ ⚔
23
- ```
3
+ <img src="assets/banner.png" alt="Claude Raid — Round-based Adversarial Intelligence Dungeon for Claude Code" width="700" />
24
4
 
25
- **Four AI agents. One shared dungeon. Every decision stress-tested before it ships.**
5
+ <br />
26
6
 
27
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
28
8
  [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](#)
29
9
  [![Node.js 18+](https://img.shields.io/badge/node-18%2B-blue.svg)](#prerequisites)
10
+ [![294 Tests](https://img.shields.io/badge/tests-294_passing-brightgreen.svg)](#)
30
11
 
31
- [Quick Start](#quick-start) &bull; [How It Works](#how-it-works) &bull; [The Team](#the-team) &bull; [Configuration](#configuration) &bull; [CLI Reference](#cli-reference)
12
+ > **Beta** This project is in active development. Multi-agent sessions are **token-usage intensive** a full Canonical Quest consumes significantly more tokens than a single-agent workflow. Monitor your usage and start with small tasks to calibrate.
13
+
14
+ [Quick Start](#quick-start) · [The Canonical Quest](#the-canonical-quest) · [The Party](#the-party) · [The Dungeon](#the-dungeon) · [Configuration](#configuration) · [CLI Reference](#cli-reference)
32
15
 
33
16
  </div>
34
17
 
35
18
  ---
36
19
 
20
+ ## What is Claude Raid?
21
+
22
+ Claude Raid turns a single Claude Code session into a **4-agent adversarial team** that designs, plans, builds, reviews, and ships code through structured phases. Instead of one AI guessing at a solution, four agents challenge each other's work until only battle-tested decisions survive.
23
+
24
+ The **Wizard** orchestrates. The **Warrior**, **Archer**, and **Rogue** each bring a different lens — stress tolerance, pattern coherence, and assumption destruction. They work in rounds, pin verified findings to a shared **Dungeon**, and no phase closes until the Wizard rules.
25
+
26
+ One command installs the system. One command starts a quest.
27
+
28
+ ---
29
+
37
30
  ## Quick Start
38
31
 
39
32
  ```bash
33
+ # Install the Raid into your project
40
34
  npx claude-raid summon
35
+
36
+ # Start a quest
37
+ claude-raid start
41
38
  ```
42
39
 
43
- That's it. One command installs the full system into any project.
40
+ `summon` installs agents, hooks, skills, and config into your project's `.claude/` directory.
41
+
42
+ `start` opens a tmux session with mouse support and launches the Wizard — one command does it all. The Wizard greets you, you describe your task, and the quest begins.
44
43
 
45
44
  ```bash
46
- # Preview what gets installed (no changes made)
45
+ # Preview what gets installed (no changes)
47
46
  npx claude-raid summon --dry-run
48
-
49
- # Start a raid
50
- tmux new-session -s raid
51
- claude --agent wizard
52
47
  ```
53
48
 
54
- Each agent gets its own tmux pane. Click into any pane to observe or talk to that agent directly. Describe your task and the Wizard takes over.
55
-
56
49
  ### Prerequisites
57
50
 
58
- | Requirement | Why | Auto-configured? |
59
- |:--|:--|:--|
60
- | **Node.js** 18+ | Runs the installer | No |
61
- | **Claude Code** v2.1.32+ | Agent teams support | No |
62
- | **tmux** | Multi-pane agent display | No — `brew install tmux` |
63
- | **jq** | Hook config parsing | Pre-installed on macOS |
64
- | **teammateMode** | Set to `tmux` in `~/.claude.json` | Yes (wizard prompts) |
51
+ | Requirement | Why |
52
+ |:--|:--|
53
+ | **Node.js** 18+ | Runs the CLI |
54
+ | **Claude Code** v2.1.32+ | Agent teams support |
55
+ | **tmux** | Multi-pane agent display (`brew install tmux`) |
56
+ | **jq** | Config parsing (pre-installed on macOS) |
65
57
 
66
- > **tmux is required for the multi-pane experience.** Each agent runs in its own pane so you can observe and interact with them independently. Without tmux, agents run in-process (single pane, cycle with `Shift+Down`).
58
+ > **tmux** gives each agent its own pane `claude-raid start` handles the tmux session automatically. Click into any pane to observe or talk to that agent directly.
67
59
 
68
60
  The setup wizard checks all prerequisites during `summon` and offers to fix what it can.
69
61
 
70
62
  ---
71
63
 
72
- ## How It Works
64
+ ## The Canonical Quest
65
+
66
+ The Canonical Quest is a 6-phase development cycle. Every feature, refactor, or system built through the Raid follows this sequence.
67
+
68
+ ```mermaid
69
+ flowchart LR
70
+ PRD["Phase 1\nPRD"]
71
+ Design["Phase 2\nDesign"]
72
+ Plan["Phase 3\nPlan"]
73
+ Impl["Phase 4\nImplementation"]
74
+ Review["Phase 5\nReview"]
75
+ Wrap["Phase 6\nWrap Up"]
76
+
77
+ PRD -->|"optional"| Design
78
+ Design --> Plan
79
+ Plan --> Impl
80
+ Impl --> Review
81
+ Review -->|"optional"| Wrap
82
+ Impl -->|"skip review"| Wrap
83
+
84
+ style PRD fill:#6c5ce7,color:#fff
85
+ style Design fill:#6c5ce7,color:#fff
86
+ style Plan fill:#6c5ce7,color:#fff
87
+ style Impl fill:#e17055,color:#fff
88
+ style Review fill:#00b894,color:#fff
89
+ style Wrap fill:#fdcb6e,color:#000
90
+ ```
91
+
92
+ ### Phase 1 — PRD *(optional)*
73
93
 
74
- You describe a task. The Wizard assesses complexity, recommends a mode, and opens the **Dungeon** a shared artifact where agents pin verified findings throughout each phase.
94
+ Agents research the problem space and produce a complete Product Requirements Document. No code. The Wizard mediates questions between agents and the human.
75
95
 
76
- ```
77
- DESIGN Agents explore the problem from competing angles.
78
- Challenge each other's findings. Pin what survives.
79
- Wizard closes when the design is battle-tested.
96
+ **Output:** `phase-1-prd.md`
80
97
 
81
- PLAN Decompose the design into testable tasks.
82
- Fight over naming, ordering, coverage, compliance.
83
- Pin the agreed task list.
98
+ ### Phase 2 Design
84
99
 
85
- IMPLEMENTATION One agent builds each task (TDD enforced).
86
- The others attack the implementation directly.
87
- Every task earns approval before moving on.
100
+ Agents explore design approaches from competing angles. Each brings their lens — the Warrior stress-tests architecture choices, the Archer traces ripple effects, the Rogue attacks assumptions. The design survives only if it withstands all three.
88
101
 
89
- REVIEW Independent reviews against design and plan.
90
- Agents fight over findings AND missing findings.
91
- Critical and Important issues must be fixed.
102
+ **Output:** `phase-2-design.md` with mermaid diagrams and battle-tested decisions
92
103
 
93
- FINISHING Agents debate completeness. Wizard presents
94
- merge options: merge, PR, keep branch, or discard.
95
- ```
104
+ ### Phase 3 Plan
105
+
106
+ Agents decompose the approved design into discrete, testable tasks. They fight over ordering, scope boundaries, naming, and test coverage until the plan earns consensus.
107
+
108
+ **Output:** `phase-3-plan.md` + individual task files (`phase-3-plan-task-01.md`, etc.)
109
+
110
+ ### Phase 4 — Implementation
111
+
112
+ The Wizard assigns tasks in batches. One agent builds each task using strict **TDD** (RED-GREEN-REFACTOR). The others cross-test the implementation — reading code, running tests, and challenging decisions. Every task earns approval before the next batch starts.
113
+
114
+ **Output:** `phase-4-implementation.md` + committed, tested code
96
115
 
97
- No phase is skipped. No work passes unchallenged.
116
+ ### Phase 5 Review *(optional)*
117
+
118
+ Two sub-phases: **Pinning** (find issues) and **Fixing** (resolve them). Agents review independently, then fight over findings *and* missing findings. Critical and Important issues must be fixed. The **Black Card** system handles breaking architectural concerns.
119
+
120
+ **Output:** `phase-5-review.md`
121
+
122
+ ### Phase 6 — Wrap Up
123
+
124
+ The Wizard generates a quest storyboard summarizing what was built and why. Creates the PR, archives the dungeon to the vault, and dismisses the party.
125
+
126
+ **Output:** `phase-6-wrap-up.md` + PR + vault archive
98
127
 
99
128
  ---
100
129
 
101
- ## The Team
130
+ ## The Party
131
+
132
+ Four agents, each with a distinct lens. They collaborate through rigor, not agreement.
102
133
 
103
134
  <table>
104
135
  <tr>
@@ -108,37 +139,43 @@ No phase is skipped. No work passes unchallenged.
108
139
  <td width="25%" align="center"><h3>Rogue</h3><em>Assumption Destroyer</em></td>
109
140
  </tr>
110
141
  <tr>
111
- <td valign="top">Thinks 5 times before speaking. Opens phases, dispatches the team, observes silently, and closes with binding rulings citing Dungeon evidence. <strong>Never writes code.</strong></td>
112
- <td valign="top">Race conditions, null input, scale, memory pressure nothing passes unchecked. Demands evidence, proposes counter-examples, pushes until things break. Concedes instantly when proven wrong.</td>
113
- <td valign="top">Finds what brute force misses. Naming mismatches, violated conventions, design drift. Traces ripple effects across modules through implicit contracts.</td>
114
- <td valign="top">Thinks like a malicious user, a failing network, a corrupted database. Constructs the exact sequence of events that turns a minor oversight into a critical failure.</td>
142
+ <td valign="top">Thinks 5 times before speaking. Opens phases, dispatches the team, observes, and closes with binding rulings. The bridge between agents, dungeon, and human. <strong>Never writes code.</strong></td>
143
+ <td valign="top">Does this hold under pressure? Tests boundaries, load, edge cases, and failure modes. Brings the exact scenario that breaks it not just "this is wrong."</td>
144
+ <td valign="top">Does this fit? Traces how changes ripple through the system. Catches naming drift, contract violations, and implicit dependencies that break silently.</td>
145
+ <td valign="top">What did everyone assume that isn't guaranteed? Thinks like a failing system, a malicious input, a race condition. Constructs the attack sequence that turns oversight into failure.</td>
115
146
  </tr>
116
147
  </table>
117
148
 
118
- ---
119
-
120
- ## Modes
121
-
122
- Not every task needs all four agents. The Wizard recommends a mode based on complexity — or you can override directly.
123
-
124
- | | Full Raid | Skirmish | Scout |
125
- |:--|:--|:--|:--|
126
- | **Agents** | 3 + Wizard | 2 + Wizard | 1 + Wizard |
127
- | **Design** | Full adversarial | Lightweight | Inline |
128
- | **Planning** | Full adversarial | Merged with design | Inline |
129
- | **Implementation** | 1 builds, 2 attack | 1 builds, 1 attacks | 1 builds, Wizard reviews |
130
- | **Review** | 3 independent reviews | 1 review + Wizard | Wizard only |
131
- | **TDD** | Enforced | Enforced | Enforced |
149
+ ### How They Work Together
150
+
151
+ ```mermaid
152
+ sequenceDiagram
153
+ participant W as Wizard
154
+ participant Party as Warrior / Archer / Rogue
155
+
156
+ W->>Party: Dispatch tasks + angles
157
+ Note over Party: Parallel independent work
158
+ Party->>W: ROUND_COMPLETE
159
+ W->>Party: Cross-test each other's work
160
+ Note over Party: Challenge, verify, concede or escalate
161
+ Party->>W: Findings + evidence
162
+ W->>W: Pin verified findings to Dungeon
163
+ Note over W: Next round or phase close
164
+ ```
132
165
 
133
- **When to use each:**
166
+ **Round-based, not real-time.** Agents work independently, flag completion, then cross-test. No mid-thinking interruptions. Each message carries evidence and a conclusion. Converge in 2-3 exchanges per finding — escalate to the Wizard after 3.
134
167
 
135
- - **Full Raid** — Architecture decisions, security-critical code, major refactors, cross-layer changes
136
- - **Skirmish** — Medium features, non-trivial bugfixes, multi-file changes
137
- - **Scout** — Config changes, documentation, single-file fixes
168
+ ### Seven Pillars
138
169
 
139
- Override the Wizard's recommendation: *"Full Raid this"*, *"Skirmish this bugfix"*, *"Scout this"*.
170
+ Every agent, every phase, every interaction:
140
171
 
141
- > The Wizard can escalate mid-task (Scout to Skirmish, Skirmish to Full Raid) with your approval. It cannot de-escalate without asking.
172
+ 1. **Intellectual Honesty** Every claim backed by evidence gathered this turn. No guessing.
173
+ 2. **Zero Ego** — Concede instantly when proven wrong. A teammate catching your mistake is a gift.
174
+ 3. **Discipline** — Every interaction carries work forward. If you're not adding information, stop talking.
175
+ 4. **Round-Based Interaction** — Turn-based work, flag completion, cross-test on dispatch.
176
+ 5. **Question Chain** — Agents never ask the human directly. All questions flow through the Wizard.
177
+ 6. **Phase Spoils** — Every phase produces a detailed markdown artifact. No exceptions.
178
+ 7. **Black Cards** — Architecture-breaking findings that cannot be fixed within the current design. Escalated to the human with rollback options.
142
179
 
143
180
  ---
144
181
 
@@ -146,11 +183,36 @@ Override the Wizard's recommendation: *"Full Raid this"*, *"Skirmish this bugfix
146
183
 
147
184
  The Dungeon is the team's shared knowledge artifact — a curated board where agents pin verified findings during each phase.
148
185
 
149
- **What goes in:** Findings that survived challenge from 2+ agents, active unresolved battles, key decisions, escalation points.
186
+ | Concept | What It Means |
187
+ |:--|:--|
188
+ | **Quest** | A complete session — from greeting to PR |
189
+ | **Dungeon** | The quest's artifact directory: phase files, task files, findings |
190
+ | **Vault** | Archive of completed quests for institutional memory |
191
+ | **Phase Spoils** | Mandatory output of each phase: a detailed markdown report |
192
+ | **Black Card** | A finding that fundamentally breaks the architecture — requires human decision |
193
+ | **Pin** | A verified finding that survived challenge from 2+ agents |
194
+
195
+ ### Dungeon Filesystem
196
+
197
+ ```
198
+ .claude/dungeon/{quest-slug}/ # Active quest artifacts
199
+ ├── phase-1-prd.md # PRD (optional)
200
+ ├── phase-2-design.md # Battle-tested design
201
+ ├── phase-3-plan.md # Task index
202
+ ├── phase-3-plan-task-01.md # Individual task specs
203
+ ├── phase-4-implementation.md # Implementation log
204
+ ├── phase-5-review.md # Review board (optional)
205
+ ├── phase-6-wrap-up.md # Quest storyboard
206
+ ├── teambuff-01.md # Team retrospective reports (on-demand)
207
+ └── teambuff-rulings.md # Active rulings from teambuffs
208
+
209
+ .claude/vault/{quest-slug}/ # Archived completed quests
210
+ .claude/raid-session # Active session state
211
+ ```
150
212
 
151
- **What stays in conversation:** The back-and-forth of challenges, exploratory thinking, concessions. The conversation is the sparring ring. The Dungeon is the scoreboard.
213
+ **What goes in the Dungeon:** Findings that survived challenge from 2+ agents, key decisions, escalation points.
152
214
 
153
- **Lifecycle:** The Wizard creates it when opening a phase. Agents pin findings with `DUNGEON:` prefix. The Wizard archives it when closing. All Dungeon files are cleaned up when the session ends.
215
+ **What stays in conversation:** Back-and-forth challenges, exploratory thinking, concessions. The conversation is the sparring ring. The Dungeon is the scoreboard.
154
216
 
155
217
  ---
156
218
 
@@ -172,12 +234,12 @@ The Dungeon is the team's shared knowledge artifact — a curated board where ag
172
234
  │ └── rogue.md # Assumption destroyer
173
235
  ├── hooks/
174
236
  │ ├── raid-lib.sh # Shared config and session state
175
- │ ├── raid-session-start.sh # Session activation
176
- │ ├── raid-session-end.sh # Archive and cleanup
177
- │ ├── raid-pre-compact.sh # Pre-compaction backup
237
+ │ ├── raid-session-start.sh # Session activation + quest directory
238
+ │ ├── raid-session-end.sh # Archive to vault + cleanup
239
+ │ ├── raid-pre-compact.sh # Pre-compaction dungeon backup
178
240
  │ ├── raid-task-created.sh # Task subject validation
179
- │ ├── validate-commit.sh # Conventional commits + test gate
180
- │ ├── validate-write-gate.sh # Design doc before implementation
241
+ │ ├── validate-commit.sh # Conventional commits
242
+ │ ├── validate-write-gate.sh # Phase-based write protection
181
243
  │ ├── validate-file-naming.sh # Naming convention enforcement
182
244
  │ ├── validate-no-placeholders.sh # No TBD/TODO in specs
183
245
  │ ├── validate-dungeon.sh # Multi-agent verification on pins
@@ -191,82 +253,42 @@ The Dungeon is the team's shared knowledge artifact — a curated board where ag
191
253
  ├── raid-canonical-implementation-plan/ # Phase 3: Task decomposition
192
254
  ├── raid-canonical-implementation/ # Phase 4: TDD + cross-testing
193
255
  ├── raid-canonical-review/ # Phase 5: Pinning + fixing
194
- ├── raid-wrap-up/ # Phase 6: Storyboard + PR
256
+ ├── raid-wrap-up/ # Phase 6: Storyboard + PR + vault
195
257
  ├── raid-tdd/ # RED-GREEN-REFACTOR enforcement
196
258
  ├── raid-verification/ # Evidence-before-claims gate
197
259
  ├── raid-debugging/ # Root-cause investigation
198
260
  ├── raid-browser/ # Browser orchestration
199
- ├── raid-browser-playwright/ # Playwright test authoring
200
- └── raid-browser-chrome/ # Live Chrome inspection
261
+ ├── raid-browser-chrome/ # Live Chrome inspection
262
+ └── raid-teambuff/ # Emergency team retrospective
201
263
  ```
202
264
 
203
265
  </details>
204
266
 
205
- Runtime files (dungeon artifacts, session state) are created during Raid sessions and cleaned up automatically.
206
-
207
- ---
208
-
209
- ## Hooks
267
+ ### Agents (4)
210
268
 
211
- Hooks enforce workflow discipline automatically. They only activate during Raid sessions they never interfere with normal coding.
269
+ The Wizard orchestrates. Warrior, Archer, and Rogue each bring a specialized lens. All agents run on Claude Opus 4.6.
212
270
 
213
- ### Lifecycle
271
+ ### Hooks (12)
214
272
 
215
- | Hook | Trigger | Purpose |
216
- |:--|:--|:--|
217
- | `raid-session-start` | SessionStart | Activates Raid workflow, checks Vault for past quests |
218
- | `raid-session-end` | SessionEnd | Archives Dungeon, drafts Vault entry, removes session |
219
- | `raid-pre-compact` | PreCompact | Backs up Dungeon before message compaction |
220
- | `raid-task-created` | TaskCreated | Validates task subjects are meaningful |
221
-
222
- ### Quality Gates
273
+ Hooks enforce workflow discipline automatically and **only activate during Raid sessions** — they never interfere with normal coding.
223
274
 
224
- | Hook | Trigger | Purpose |
225
- |:--|:--|:--|
226
- | `validate-commit` | PreToolUse (Bash) | Conventional commit format + test gate |
227
- | `validate-write-gate` | PreToolUse (Write) | Blocks implementation before design doc exists |
228
- | `validate-file-naming` | PostToolUse (Write) | Enforces naming conventions |
229
- | `validate-no-placeholders` | PostToolUse (Write) | Blocks TBD/TODO/FIXME in specs and plans |
230
- | `validate-dungeon` | PostToolUse (Write) | Requires 2+ agents verified on Dungeon pins |
231
- | `validate-browser-tests-exist` | PreToolUse (Bash) | Checks Playwright tests exist before commits |
232
- | `validate-browser-cleanup` | PostToolUse (Bash) | Verifies browser processes cleaned up |
275
+ **Lifecycle hooks** manage session start/end, quest directory creation, vault archival, and context compaction backup.
233
276
 
234
- All hooks are POSIX-compatible, read config from `raid.json`, and use `#claude-raid` markers to avoid collisions with your existing hooks. Exit code `0` = pass, `2` = block with message.
277
+ **Quality gate hooks** enforce conventional commits, phase-based write protection, naming conventions, placeholder blocking, multi-agent verification on dungeon pins, and browser test detection.
235
278
 
236
- ---
279
+ All hooks are POSIX-compatible and use `#claude-raid` markers to coexist safely with your existing hooks.
237
280
 
238
- ## Skills
281
+ ### Skills (14)
239
282
 
240
- 14 specialized skills guide agent behavior across the workflow.
283
+ Skills guide agent behavior across the workflow. Four categories:
241
284
 
242
- ### Phase Skills
243
-
244
- | Skill | Purpose |
245
- |:--|:--|
246
- | `raid-init` | Quest selection, greeting, session setup |
247
- | `raid-canonical-protocol` | Canonical Quest rules, signals, phase gates |
248
- | `raid-canonical-prd` | Phase 1PRD creation (optional) |
249
- | `raid-canonical-design` | Phase 2 — Adversarial design exploration |
250
- | `raid-canonical-implementation-plan` | Phase 3 — Task decomposition |
251
- | `raid-canonical-implementation` | Phase 4 — TDD implementation + cross-testing |
252
- | `raid-canonical-review` | Phase 5 — Pinning, fixing, black cards |
253
- | `raid-wrap-up` | Phase 6 — Storyboard, PR, vault archival |
254
-
255
- ### Discipline Skills
256
-
257
- | Skill | Purpose |
258
- |:--|:--|
259
- | `raid-tdd` | Strict RED-GREEN-REFACTOR. No production code before a failing test. |
260
- | `raid-debugging` | Competing hypotheses in parallel. No fixes without confirmed root cause. |
261
- | `raid-verification` | Evidence before assertions. Fresh test run required before any completion claim. |
262
-
263
- ### Browser Skills
264
-
265
- | Skill | Purpose |
266
- |:--|:--|
267
- | `raid-browser` | Browser startup discovery — dev server, auth, startup steps |
268
- | `raid-browser-playwright` | Playwright MCP test authoring with network and console assertions |
269
- | `raid-browser-chrome` | Live browser inspection via Claude-in-Chrome MCP |
285
+ | Category | Skills | Purpose |
286
+ |:--|:--|:--|
287
+ | **Core** | `raid-init` | Quest selection, greeting, session bootstrap |
288
+ | **Canonical Quest** | 7 phase skills | One skill per phase, chained in order |
289
+ | **Discipline** | `raid-tdd`, `raid-verification`, `raid-debugging` | Quest-agnostic enforcement invoked within any phase |
290
+ | **Browser** | `raid-browser`, `raid-browser-chrome` | Browser orchestration and live inspection |
291
+ | **Team** | `raid-teambuff` | Emergency team retrospective freezes quest, all agents reflect on dysfunction, produces binding rulings |
270
292
 
271
293
  ---
272
294
 
@@ -307,13 +329,13 @@ All hooks are POSIX-compatible, read config from `raid.json`, and use `#claude-r
307
329
 
308
330
  | Marker File | Language | Test Command | Lint Command |
309
331
  |:--|:--|:--|:--|
310
- | `package.json` | JavaScript | `npm test` | `npm run lint` |
332
+ | `package.json` | JavaScript/TypeScript | `npm test` | `npm run lint` |
311
333
  | `Cargo.toml` | Rust | `cargo test` | `cargo clippy` |
312
334
  | `pyproject.toml` | Python | `pytest` / `poetry run pytest` | `ruff check .` |
313
335
  | `requirements.txt` | Python | `pytest` | `ruff check .` |
314
336
  | `go.mod` | Go | `go test ./...` | `go vet ./...` |
315
337
 
316
- 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.
338
+ Package manager is auto-detected (npm, pnpm, yarn, bun, uv, poetry). Commands are extracted from your project files where possible. Edit `raid.json` to override any value.
317
339
 
318
340
  <details>
319
341
  <summary><strong>Full configuration reference</strong></summary>
@@ -330,7 +352,6 @@ Commands are extracted from your project files (e.g., `scripts.test` in `package
330
352
  | `conventions.commits` | `conventional` | Commit message format |
331
353
  | `conventions.commitMinLength` | `15` | Minimum commit message length |
332
354
  | `conventions.maxDepth` | `8` | Maximum file nesting depth |
333
- | `raid.defaultMode` | `full` | Default mode: `full`, `skirmish`, `scout` |
334
355
  | `raid.lifecycle.testWindowMinutes` | `10` | Max age (minutes) of test run for verification |
335
356
 
336
357
  </details>
@@ -352,7 +373,7 @@ When a browser framework is detected (Next.js, Vite, Angular, etc.), a `browser`
352
373
  }
353
374
  ```
354
375
 
355
- This enables browser-specific hooks and skills — Playwright test detection, browser process cleanup, and live inspection during reviews.
376
+ This enables browser-specific hooks and skills — Playwright test detection, browser process cleanup, and live Chrome inspection during reviews.
356
377
 
357
378
  ---
358
379
 
@@ -360,14 +381,22 @@ This enables browser-specific hooks and skills — Playwright test detection, br
360
381
 
361
382
  | Command | Alias | Purpose |
362
383
  |:--|:--|:--|
384
+ | `claude-raid start` | — | Launch the Wizard and begin a quest |
363
385
  | `claude-raid summon` | `init` | Install Raid into your project |
364
386
  | `claude-raid update` | — | Upgrade hooks, skills, and rules to latest |
365
387
  | `claude-raid dismantle` | `remove` | Remove all Raid files, restore original settings |
366
388
  | `claude-raid heal` | `doctor` | Check environment health |
389
+ | `claude-raid sync` | — | Git pull + re-summon |
367
390
 
368
391
  <details>
369
392
  <summary><strong>Command details</strong></summary>
370
393
 
394
+ ### `start`
395
+
396
+ One command does it all — opens a tmux session with mouse support and launches the Wizard with full permissions. If you're already inside tmux, it enables mouse mode and launches the Wizard directly. If tmux isn't installed, it falls back to launching the Wizard without it.
397
+
398
+ This is the primary entry point for running a quest.
399
+
371
400
  ### `summon`
372
401
 
373
402
  Installs the full Raid system. Auto-detects project type, copies agents/hooks/skills, generates `raid.json`, merges settings (with backup), and runs the setup wizard.
@@ -378,7 +407,7 @@ Installs the full Raid system. Auto-detects project type, copies agents/hooks/sk
378
407
 
379
408
  ### `update`
380
409
 
381
- Upgrades hooks, skills, and rules to the latest version. Skips customized agents (warns which ones were preserved). Does not touch `raid.json`.
410
+ Upgrades hooks, skills, and rules to the latest version. Skips customized agents and warns which ones were preserved. Does not touch `raid.json`.
382
411
 
383
412
  ### `dismantle`
384
413
 
@@ -386,7 +415,11 @@ Removes all Raid agents, hooks, skills, and config files. Restores `settings.jso
386
415
 
387
416
  ### `heal`
388
417
 
389
- Checks Node.js, Claude Code, jq, teammateMode, and split-pane support. Offers to fix missing configuration interactively.
418
+ Checks Node.js, Claude Code, jq, tmux, and teammateMode. Offers to fix missing configuration interactively.
419
+
420
+ ### `sync`
421
+
422
+ Pulls latest from remote and re-runs summon to pick up any template changes. Useful after CI bumps the version.
390
423
 
391
424
  </details>
392
425
 
@@ -394,47 +427,43 @@ Checks Node.js, Claude Code, jq, teammateMode, and split-pane support. Offers to
394
427
 
395
428
  ## Controls
396
429
 
397
- **tmux pane navigation (recommended):**
430
+ `claude-raid start` opens tmux with mouse mode enabled. All panes are visible simultaneously.
398
431
 
399
432
  | Action | How |
400
433
  |:--|:--|
401
- | Switch to agent pane | Click the pane, or `Ctrl+B` then arrow key |
434
+ | Switch to agent pane | Click the pane |
435
+ | Navigate between panes | `Ctrl+B` then arrow key |
436
+ | Scroll output | Mouse wheel |
402
437
  | Talk to an agent | Click their pane and type |
403
- | View all agents | All panes visible simultaneously |
404
-
405
- **In-process mode (no tmux):**
406
-
407
- | Shortcut | Action |
408
- |:--|:--|
409
- | `Shift+Down` | Cycle through teammates |
410
- | `Enter` | View a teammate's session |
411
- | `Escape` | Interrupt a teammate's turn |
412
- | `Ctrl+T` | Toggle the shared task list |
413
438
 
414
439
  ---
415
440
 
416
441
  ## Design Principles
417
442
 
418
443
  - **Non-invasive** — Never touches your `CLAUDE.md`. Merges settings alongside your existing config with automatic backup. Clean removal restores originals.
419
- - **Session-scoped** — Quality gate hooks only activate during Raid sessions. They never interfere with normal coding.
444
+ - **Session-scoped** — Quality gate hooks only activate during Raid sessions. Normal coding is never affected.
420
445
  - **Zero dependencies** — Pure Node.js stdlib. Fast `npx` cold-start.
421
- - **Safe by default** — Never overwrites existing files. Customized agents are always preserved.
446
+ - **Safe by default** — Never overwrites existing files. Customized agents and rules are always preserved.
447
+ - **Round-based discipline** — Agents work in parallel, flag completion, then cross-test. No mid-thinking interruptions.
448
+ - **Question chain** — Agents never ask the human directly. All questions flow through the Wizard.
449
+ - **Wizard never implements** — Dispatches, observes, digests, rules. The party writes code.
450
+ - **Phase commits** — The Wizard commits at every phase transition with the quest name, phase, and summary.
422
451
 
423
452
  ---
424
453
 
425
- ## Inherited from Superpowers
454
+ ## Heritage
426
455
 
427
- Adapted from [obra/superpowers](https://github.com/obra/superpowers) by Jesse Vincent.
456
+ Adapted from [obra/superpowers](https://github.com/obra/superpowers) by Jesse Vincent. The Raid inherits five core enforcement principles:
428
457
 
429
- | Concept | How the Raid Uses It |
458
+ | Principle | How the Raid Enforces It |
430
459
  |:--|:--|
431
- | HARD-GATEs | No code before design approval. No implementation before plan approval. |
432
- | TDD Iron Law | No production code without a failing test first. Enforced in all modes. |
433
- | Verification Iron Law | No completion claims without fresh test evidence. |
434
- | No Placeholders | Specs and plans must contain complete content, not "TBD" or "implement later". |
435
- | Conventional Commits | Enforced via hook: `type(scope): description`. |
460
+ | **HARD-GATEs** | No code before design approval. No implementation before plan approval. |
461
+ | **TDD Iron Law** | No production code without a failing test first. Enforced in every phase. |
462
+ | **Verification Iron Law** | No completion claims without fresh test evidence. |
463
+ | **No Placeholders** | Specs and plans must contain complete content no "TBD" or "implement later". |
464
+ | **Conventional Commits** | Enforced via hook: `type(scope): description`. |
436
465
 
437
- **What's different:** Superpowers uses a single agent with subagent delegation. The Raid uses 4 persistent agents with adversarial cross-testing and direct interaction. Agents talk to each other, pin verified findings to a shared Dungeon, and self-organize within phases. Every decision is stress-tested from multiple angles before it passes.
466
+ **What's different:** Superpowers uses a single agent with subagent delegation. The Raid uses 4 persistent agents with adversarial cross-testing. Agents challenge each other directly, pin verified findings to a shared Dungeon, and self-organize within phases. Every decision is stress-tested from three angles before it passes.
438
467
 
439
468
  ---
440
469
 
package/bin/cli.js CHANGED
@@ -10,16 +10,47 @@ const versionCheck = require('../src/version-check');
10
10
  const showUpdateNotice = versionCheck.start();
11
11
 
12
12
  const COMMANDS = {
13
- // Start a Raid quest — launches wizard with full permissions
13
+ // Start a Raid quest — launches tmux + wizard in one shot
14
14
  start: () => {
15
- const { spawn } = require('child_process');
15
+ const { spawn, execSync } = require('child_process');
16
16
  console.log('\n' + banner());
17
- console.log(header('Summoning the Wizard...') + '\n');
18
- const child = spawn('claude', ['--dangerously-skip-permissions', '--agent', 'wizard'], {
19
- stdio: 'inherit',
20
- env: process.env,
21
- });
22
- child.on('exit', (code) => process.exit(code || 0));
17
+
18
+ // Check if already inside a tmux session
19
+ if (process.env.TMUX) {
20
+ console.log(header('Already in tmux — launching Wizard...') + '\n');
21
+ try { execSync('tmux set -g mouse on', { stdio: 'ignore' }); } catch {}
22
+ const child = spawn('claude', ['--dangerously-skip-permissions', '--agent', 'wizard'], {
23
+ stdio: 'inherit',
24
+ env: process.env,
25
+ });
26
+ child.on('exit', (code) => process.exit(code || 0));
27
+ return;
28
+ }
29
+
30
+ // Check if tmux is available
31
+ let hasTmux = false;
32
+ try { execSync('command -v tmux', { stdio: 'pipe' }); hasTmux = true; } catch {}
33
+
34
+ if (hasTmux) {
35
+ console.log(header('Opening tmux session + Wizard...') + '\n');
36
+ const child = spawn('tmux', [
37
+ 'new-session', '-s', 'raid', ';',
38
+ 'set', '-g', 'mouse', 'on', ';',
39
+ 'send-keys', 'claude --dangerously-skip-permissions --agent wizard', 'Enter',
40
+ ], {
41
+ stdio: 'inherit',
42
+ env: process.env,
43
+ });
44
+ child.on('exit', (code) => process.exit(code || 0));
45
+ } else {
46
+ console.log(colors.dim(' tmux not found — launching Wizard directly.'));
47
+ console.log(colors.dim(' Install tmux for multi-pane agent display: brew install tmux') + '\n');
48
+ const child = spawn('claude', ['--dangerously-skip-permissions', '--agent', 'wizard'], {
49
+ stdio: 'inherit',
50
+ env: process.env,
51
+ });
52
+ child.on('exit', (code) => process.exit(code || 0));
53
+ }
23
54
  },
24
55
  // Sync local with remote after CI version bump
25
56
  sync: async () => {
@@ -64,7 +95,7 @@ if (!command || !COMMANDS[command]) {
64
95
  console.log('\n' + banner());
65
96
  console.log(header('Commands') + '\n');
66
97
  const cmds = [
67
- ['start', 'Begin the Raid (launches Wizard)'],
98
+ ['start', 'Begin the Raid (tmux + Wizard in one shot)'],
68
99
  ['summon', 'Summon the party into this realm'],
69
100
  ['update', 'Reforge the party\'s arsenal'],
70
101
  ['dismantle', 'Dismantle the camp and retreat'],
@@ -76,6 +107,9 @@ if (!command || !COMMANDS[command]) {
76
107
  }
77
108
  console.log(header('Begin the Raid') + '\n');
78
109
  console.log(' claude-raid start\n');
110
+ console.log(colors.amber(' Beta') + colors.dim(' — This project is in active development and can be'));
111
+ console.log(colors.dim(' token-usage intensive. Multi-agent sessions consume significantly'));
112
+ console.log(colors.dim(' more tokens than single-agent workflows. Use with caution.') + '\n');
79
113
  console.log(colors.dim(' github.com/pedropicardi/claude-raid') + '\n');
80
114
  process.exit(command ? 1 : 0);
81
115
  }