claude-raid 0.2.6 → 0.2.8

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 (39) hide show
  1. package/README.md +108 -66
  2. package/bin/cli.js +47 -11
  3. package/package.json +1 -1
  4. package/src/descriptions.js +11 -7
  5. package/src/init.js +37 -6
  6. package/src/merge-settings.js +43 -1
  7. package/src/remove.js +2 -2
  8. package/src/setup.js +33 -1
  9. package/src/ui.js +24 -19
  10. package/src/update.js +26 -3
  11. package/template/.claude/agents/archer.md +18 -4
  12. package/template/.claude/agents/rogue.md +18 -4
  13. package/template/.claude/agents/warrior.md +18 -4
  14. package/template/.claude/agents/wizard.md +32 -5
  15. package/template/.claude/dungeon-master-rules.md +132 -37
  16. package/template/.claude/hooks/raid-lib.sh +45 -4
  17. package/template/.claude/hooks/raid-pre-compact.sh +8 -4
  18. package/template/.claude/hooks/raid-session-end.sh +2 -2
  19. package/template/.claude/hooks/raid-session-start.sh +2 -0
  20. package/template/.claude/hooks/rtk-bridge.sh +46 -0
  21. package/template/.claude/hooks/validate-dungeon.sh +11 -3
  22. package/template/.claude/hooks/validate-file-naming.sh +6 -1
  23. package/template/.claude/hooks/validate-no-placeholders.sh +13 -2
  24. package/template/.claude/hooks/validate-write-gate.sh +7 -2
  25. package/template/.claude/party-rules.md +93 -64
  26. package/template/.claude/skills/raid-browser/SKILL.md +4 -6
  27. package/template/.claude/skills/raid-browser-chrome/SKILL.md +2 -2
  28. package/template/.claude/skills/raid-canonical-design/SKILL.md +306 -166
  29. package/template/.claude/skills/raid-canonical-implementation/SKILL.md +161 -133
  30. package/template/.claude/skills/raid-canonical-implementation-plan/SKILL.md +200 -142
  31. package/template/.claude/skills/raid-canonical-prd/SKILL.md +101 -78
  32. package/template/.claude/skills/raid-canonical-protocol/SKILL.md +30 -124
  33. package/template/.claude/skills/raid-canonical-review/SKILL.md +296 -149
  34. package/template/.claude/skills/raid-debugging/SKILL.md +1 -7
  35. package/template/.claude/skills/raid-init/SKILL.md +19 -29
  36. package/template/.claude/skills/raid-tdd/SKILL.md +5 -5
  37. package/template/.claude/skills/raid-teambuff/SKILL.md +281 -0
  38. package/template/.claude/skills/raid-verification/SKILL.md +0 -6
  39. package/template/.claude/skills/raid-wrap-up/SKILL.md +36 -32
package/README.md CHANGED
@@ -1,33 +1,15 @@
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)
30
- [![294 Tests](https://img.shields.io/badge/tests-294_passing-brightgreen.svg)](#)
10
+ [![325 Tests](https://img.shields.io/badge/tests-325_passing-brightgreen.svg)](#)
11
+
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.
31
13
 
32
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)
33
15
 
@@ -48,21 +30,25 @@ One command installs the system. One command starts a quest.
48
30
  ## Quick Start
49
31
 
50
32
  ```bash
33
+ # Install the Raid into your project
51
34
  npx claude-raid summon
35
+
36
+ # Start a quest
37
+ claude-raid start
52
38
  ```
53
39
 
54
- That's it. One command installs agents, hooks, skills, and config into your project's `.claude/` directory.
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.
55
43
 
56
44
  ```bash
57
45
  # Preview what gets installed (no changes)
58
46
  npx claude-raid summon --dry-run
59
47
 
60
- # Start a quest
61
- claude-raid start
48
+ # Install with RTK token compression (optional)
49
+ npx claude-raid summon --rtk
62
50
  ```
63
51
 
64
- The Wizard greets you, you describe your task, and the quest begins.
65
-
66
52
  ### Prerequisites
67
53
 
68
54
  | Requirement | Why |
@@ -72,7 +58,7 @@ The Wizard greets you, you describe your task, and the quest begins.
72
58
  | **tmux** | Multi-pane agent display (`brew install tmux`) |
73
59
  | **jq** | Config parsing (pre-installed on macOS) |
74
60
 
75
- > **tmux** gives each agent its own pane — click into any pane to observe or talk to that agent directly. Without tmux, agents run in-process and you cycle between them with `Shift+Down`.
61
+ > **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.
76
62
 
77
63
  The setup wizard checks all prerequisites during `summon` and offers to fix what it can.
78
64
 
@@ -110,31 +96,31 @@ flowchart LR
110
96
 
111
97
  Agents research the problem space and produce a complete Product Requirements Document. No code. The Wizard mediates questions between agents and the human.
112
98
 
113
- **Output:** `phase-1-prd.md`
99
+ **Output:** `spoils/prd.md`
114
100
 
115
101
  ### Phase 2 — Design
116
102
 
117
103
  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.
118
104
 
119
- **Output:** `phase-2-design.md` with mermaid diagrams and battle-tested decisions
105
+ **Output:** `phases/phase-2-design.md` (evolution log) + `spoils/design.md` (polished deliverable)
120
106
 
121
107
  ### Phase 3 — Plan
122
108
 
123
109
  Agents decompose the approved design into discrete, testable tasks. They fight over ordering, scope boundaries, naming, and test coverage until the plan earns consensus.
124
110
 
125
- **Output:** `phase-3-plan.md` + individual task files (`phase-3-plan-task-01.md`, etc.)
111
+ **Output:** `phases/phase-3-plan.md` + `spoils/tasks/phase-3-plan-task-NN.md`
126
112
 
127
113
  ### Phase 4 — Implementation
128
114
 
129
115
  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.
130
116
 
131
- **Output:** `phase-4-implementation.md` + committed, tested code
117
+ **Output:** `phases/phase-4-implementation.md` + committed, tested code
132
118
 
133
119
  ### Phase 5 — Review *(optional)*
134
120
 
135
121
  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.
136
122
 
137
- **Output:** `phase-5-review.md`
123
+ **Output:** `phases/phase-5-review.md` + `spoils/review.md`
138
124
 
139
125
  ### Phase 6 — Wrap Up
140
126
 
@@ -163,6 +149,8 @@ Four agents, each with a distinct lens. They collaborate through rigor, not agre
163
149
  </tr>
164
150
  </table>
165
151
 
152
+ All agents run on Claude Opus 4.6.
153
+
166
154
  ### How They Work Together
167
155
 
168
156
  ```mermaid
@@ -213,13 +201,22 @@ The Dungeon is the team's shared knowledge artifact — a curated board where ag
213
201
 
214
202
  ```
215
203
  .claude/dungeon/{quest-slug}/ # Active quest artifacts
216
- ├── phase-1-prd.md # PRD (optional)
217
- ├── phase-2-design.md # Battle-tested design
218
- ├── phase-3-plan.md # Task index
219
- ├── phase-3-plan-task-01.md # Individual task specs
220
- ├── phase-4-implementation.md # Implementation log
221
- ├── phase-5-review.md # Review board (optional)
222
- └── phase-6-wrap-up.md # Quest storyboard
204
+ ├── phases/ # Evolution logs (scoreboards)
205
+ ├── phase-2-design.md
206
+ ├── phase-3-plan.md
207
+ ├── phase-4-implementation.md
208
+ │ └── phase-5-review.md
209
+ ├── spoils/ # Polished deliverables
210
+ │ ├── prd.md
211
+ │ ├── design.md
212
+ │ ├── review.md
213
+ │ └── tasks/
214
+ │ └── phase-3-plan-task-NN.md
215
+ ├── backups/ # Pre-compact safety copies
216
+ │ └── phase-N-{name}-backup.md
217
+ ├── phase-6-wrap-up.md # Quest storyboard
218
+ ├── teambuff-NN.md # Team retrospective reports (on-demand)
219
+ └── teambuff-rulings.md # Active rulings from teambuffs
223
220
 
224
221
  .claude/vault/{quest-slug}/ # Archived completed quests
225
222
  .claude/raid-session # Active session state
@@ -259,7 +256,8 @@ The Dungeon is the team's shared knowledge artifact — a curated board where ag
259
256
  │ ├── validate-no-placeholders.sh # No TBD/TODO in specs
260
257
  │ ├── validate-dungeon.sh # Multi-agent verification on pins
261
258
  │ ├── validate-browser-tests-exist.sh # Playwright test detection
262
- └── validate-browser-cleanup.sh # Browser process cleanup
259
+ ├── validate-browser-cleanup.sh # Browser process cleanup
260
+ │ └── rtk-bridge.sh # Token compression via RTK (opt-in)
263
261
  └── skills/
264
262
  ├── raid-init/ # Quest selection and session setup
265
263
  ├── raid-canonical-protocol/ # Canonical Quest rules and signals
@@ -273,7 +271,8 @@ The Dungeon is the team's shared knowledge artifact — a curated board where ag
273
271
  ├── raid-verification/ # Evidence-before-claims gate
274
272
  ├── raid-debugging/ # Root-cause investigation
275
273
  ├── raid-browser/ # Browser orchestration
276
- └── raid-browser-chrome/ # Live Chrome inspection
274
+ ├── raid-browser-chrome/ # Live Chrome inspection
275
+ └── raid-teambuff/ # Emergency team retrospective
277
276
  ```
278
277
 
279
278
  </details>
@@ -282,26 +281,30 @@ The Dungeon is the team's shared knowledge artifact — a curated board where ag
282
281
 
283
282
  The Wizard orchestrates. Warrior, Archer, and Rogue each bring a specialized lens. All agents run on Claude Opus 4.6.
284
283
 
285
- ### Hooks (12)
284
+ ### Hooks (13)
286
285
 
287
286
  Hooks enforce workflow discipline automatically and **only activate during Raid sessions** — they never interfere with normal coding.
288
287
 
289
- **Lifecycle hooks** manage session start/end, quest directory creation, vault archival, and context compaction backup.
288
+ **Lifecycle hooks** (5) manage session start/end, quest directory creation, vault archival, context compaction backup, and task validation. All source `raid-lib.sh` for shared config.
290
289
 
291
- **Quality gate hooks** enforce conventional commits, phase-based write protection, naming conventions, placeholder blocking, multi-agent verification on dungeon pins, and browser test detection.
290
+ **Quality gate hooks** (7) enforce conventional commits, phase-based write protection, naming conventions, placeholder blocking, multi-agent verification on dungeon pins, browser test detection, and browser process cleanup.
291
+
292
+ **Optional hooks** (1): `rtk-bridge.sh` provides token compression via RTK — enabled with `--rtk` during summon.
292
293
 
293
294
  All hooks are POSIX-compatible and use `#claude-raid` markers to coexist safely with your existing hooks.
294
295
 
295
- ### Skills (13)
296
+ ### Skills (14)
296
297
 
297
- Skills guide agent behavior across the workflow. Three categories:
298
+ Skills guide agent behavior across the workflow. Five categories:
298
299
 
299
300
  | Category | Skills | Purpose |
300
301
  |:--|:--|:--|
301
302
  | **Core** | `raid-init` | Quest selection, greeting, session bootstrap |
302
- | **Canonical Quest** | 7 phase skills | One skill per phase, chained in order |
303
+ | **Protocol** | `raid-canonical-protocol` | Phase lifecycle rules, transition gates, signals |
304
+ | **Canonical Quest** | 6 phase skills | One skill per phase, chained in order |
303
305
  | **Discipline** | `raid-tdd`, `raid-verification`, `raid-debugging` | Quest-agnostic enforcement — invoked within any phase |
304
306
  | **Browser** | `raid-browser`, `raid-browser-chrome` | Browser orchestration and live inspection |
307
+ | **Team** | `raid-teambuff` | Emergency team retrospective — freezes quest, all agents reflect on dysfunction, produces binding rulings |
305
308
 
306
309
  ---
307
310
 
@@ -314,6 +317,10 @@ Skills guide agent behavior across the workflow. Three categories:
314
317
  "project": {
315
318
  "name": "my-project",
316
319
  "language": "typescript",
320
+ "packageManager": "npm",
321
+ "runCommand": "npm run",
322
+ "execCommand": "npx",
323
+ "installCommand": "npm add",
317
324
  "testCommand": "npm test",
318
325
  "lintCommand": "npm run lint",
319
326
  "buildCommand": "npm run build"
@@ -324,14 +331,20 @@ Skills guide agent behavior across the workflow. Three categories:
324
331
  "worktrees": ".worktrees"
325
332
  },
326
333
  "conventions": {
327
- "fileNaming": "kebab-case",
334
+ "fileNaming": "none",
328
335
  "commits": "conventional"
329
336
  },
330
337
  "raid": {
331
338
  "defaultMode": "full",
339
+ "agentEffort": "medium",
332
340
  "vault": { "path": ".claude/vault", "enabled": true },
333
341
  "lifecycle": {
334
342
  "autoSessionManagement": true,
343
+ "teammateNudge": true,
344
+ "taskValidation": true,
345
+ "completionGate": true,
346
+ "phaseTransitionConfirm": true,
347
+ "compactBackup": true,
335
348
  "testWindowMinutes": 10
336
349
  }
337
350
  }
@@ -355,6 +368,9 @@ Package manager is auto-detected (npm, pnpm, yarn, bun, uv, poetry). Commands ar
355
368
 
356
369
  | Key | Default | Description |
357
370
  |:--|:--|:--|
371
+ | `project.name` | auto-detected | Project name |
372
+ | `project.language` | auto-detected | Primary language |
373
+ | `project.packageManager` | auto-detected | npm, pnpm, yarn, bun, uv, or poetry |
358
374
  | `project.testCommand` | auto-detected | Command to run tests |
359
375
  | `project.lintCommand` | auto-detected | Command to run linting |
360
376
  | `project.buildCommand` | auto-detected | Command to build |
@@ -363,8 +379,18 @@ Package manager is auto-detected (npm, pnpm, yarn, bun, uv, poetry). Commands ar
363
379
  | `paths.worktrees` | `.worktrees` | Git worktree directory |
364
380
  | `conventions.fileNaming` | `none` | `kebab-case`, `snake_case`, `camelCase`, or `none` |
365
381
  | `conventions.commits` | `conventional` | Commit message format |
366
- | `conventions.commitMinLength` | `15` | Minimum commit message length |
367
- | `conventions.maxDepth` | `8` | Maximum file nesting depth |
382
+ | `conventions.commitMinLength` | `15` | Minimum commit message length (set manually) |
383
+ | `conventions.maxDepth` | `8` | Maximum file nesting depth (set manually) |
384
+ | `raid.defaultMode` | `full` | Default quest mode |
385
+ | `raid.agentEffort` | `medium` | Agent reasoning effort level |
386
+ | `raid.vault.enabled` | `true` | Archive completed quests to vault |
387
+ | `raid.vault.path` | `.claude/vault` | Vault directory path |
388
+ | `raid.lifecycle.autoSessionManagement` | `true` | Auto-manage session start/end |
389
+ | `raid.lifecycle.teammateNudge` | `true` | Nudge agents to use teammate mode |
390
+ | `raid.lifecycle.taskValidation` | `true` | Validate task subjects are meaningful |
391
+ | `raid.lifecycle.completionGate` | `true` | Require verification before completion claims |
392
+ | `raid.lifecycle.phaseTransitionConfirm` | `true` | Confirm before phase transitions |
393
+ | `raid.lifecycle.compactBackup` | `true` | Back up dungeon before context compaction |
368
394
  | `raid.lifecycle.testWindowMinutes` | `10` | Max age (minutes) of test run for verification |
369
395
 
370
396
  </details>
@@ -381,13 +407,34 @@ When a browser framework is detected (Next.js, Vite, Angular, etc.), a `browser`
381
407
  "devCommand": "npm run dev",
382
408
  "baseUrl": "http://localhost:3000",
383
409
  "defaultPort": 3000,
384
- "playwrightConfig": "playwright.config.ts"
410
+ "portRange": [3001, 3005],
411
+ "playwrightConfig": "playwright.config.ts",
412
+ "auth": null,
413
+ "startup": null
385
414
  }
386
415
  }
387
416
  ```
388
417
 
389
418
  This enables browser-specific hooks and skills — Playwright test detection, browser process cleanup, and live Chrome inspection during reviews.
390
419
 
420
+ ### RTK Token Compression
421
+
422
+ When installed with `--rtk`, an `rtk` section is added to `raid.json`:
423
+
424
+ ```json
425
+ {
426
+ "rtk": {
427
+ "enabled": true,
428
+ "bypass": {
429
+ "phases": [],
430
+ "commands": []
431
+ }
432
+ }
433
+ }
434
+ ```
435
+
436
+ RTK compresses token usage via a fail-open bridge hook. Bypass specific phases or command prefixes by editing the arrays. Requires the `rtk` binary to be installed separately.
437
+
391
438
  ---
392
439
 
393
440
  ## CLI Reference
@@ -406,7 +453,9 @@ This enables browser-specific hooks and skills — Playwright test detection, br
406
453
 
407
454
  ### `start`
408
455
 
409
- Launches `claude --agent wizard` with full permissions. The Wizard loads its rules, greets you, and begins quest selection. This is the primary entry point for running a quest.
456
+ 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.
457
+
458
+ This is the primary entry point for running a quest.
410
459
 
411
460
  ### `summon`
412
461
 
@@ -415,6 +464,7 @@ Installs the full Raid system. Auto-detects project type, copies agents/hooks/sk
415
464
  - Never overwrites existing files — customized agents are preserved
416
465
  - Idempotent — safe to run multiple times
417
466
  - `--dry-run` shows exactly what would be created without touching disk
467
+ - `--rtk` enables RTK token compression bridge
418
468
 
419
469
  ### `update`
420
470
 
@@ -438,22 +488,14 @@ Pulls latest from remote and re-runs summon to pick up any template changes. Use
438
488
 
439
489
  ## Controls
440
490
 
441
- **tmux pane navigation (recommended):**
491
+ `claude-raid start` opens tmux with mouse mode enabled. All panes are visible simultaneously.
442
492
 
443
493
  | Action | How |
444
494
  |:--|:--|
445
- | Switch to agent pane | Click the pane, or `Ctrl+B` then arrow key |
495
+ | Switch to agent pane | Click the pane |
496
+ | Navigate between panes | `Ctrl+B` then arrow key |
497
+ | Scroll output | Mouse wheel |
446
498
  | Talk to an agent | Click their pane and type |
447
- | View all agents | All panes visible simultaneously |
448
-
449
- **In-process mode (no tmux):**
450
-
451
- | Shortcut | Action |
452
- |:--|:--|
453
- | `Shift+Down` | Cycle through teammates |
454
- | `Enter` | View a teammate's session |
455
- | `Escape` | Interrupt a teammate's turn |
456
- | `Ctrl+T` | Toggle the shared task list |
457
499
 
458
500
  ---
459
501
 
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 () => {
@@ -42,7 +73,8 @@ const COMMANDS = {
42
73
  console.log(require('../src/init').dryRun(process.cwd()));
43
74
  return;
44
75
  }
45
- return require('../src/init').run();
76
+ const rtkFlag = process.argv.includes('--rtk');
77
+ return require('../src/init').run({ rtkEnabled: rtkFlag });
46
78
  },
47
79
  update: () => require('../src/update').run(),
48
80
  dismantle: () => require('../src/remove').run(),
@@ -54,7 +86,8 @@ const COMMANDS = {
54
86
  console.log(require('../src/init').dryRun(process.cwd()));
55
87
  return;
56
88
  }
57
- return require('../src/init').run();
89
+ const rtkFlag = process.argv.includes('--rtk');
90
+ return require('../src/init').run({ rtkEnabled: rtkFlag });
58
91
  },
59
92
  remove: () => require('../src/remove').run(),
60
93
  doctor: () => require('../src/doctor').run(),
@@ -64,7 +97,7 @@ if (!command || !COMMANDS[command]) {
64
97
  console.log('\n' + banner());
65
98
  console.log(header('Commands') + '\n');
66
99
  const cmds = [
67
- ['start', 'Begin the Raid (launches Wizard)'],
100
+ ['start', 'Begin the Raid (tmux + Wizard in one shot)'],
68
101
  ['summon', 'Summon the party into this realm'],
69
102
  ['update', 'Reforge the party\'s arsenal'],
70
103
  ['dismantle', 'Dismantle the camp and retreat'],
@@ -76,6 +109,9 @@ if (!command || !COMMANDS[command]) {
76
109
  }
77
110
  console.log(header('Begin the Raid') + '\n');
78
111
  console.log(' claude-raid start\n');
112
+ console.log(colors.amber(' Beta') + colors.dim(' — This project is in active development and can be'));
113
+ console.log(colors.dim(' token-usage intensive. Multi-agent sessions consume significantly'));
114
+ console.log(colors.dim(' more tokens than single-agent workflows. Use with caution.') + '\n');
79
115
  console.log(colors.dim(' github.com/pedropicardi/claude-raid') + '\n');
80
116
  process.exit(command ? 1 : 0);
81
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-raid",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "type": "commonjs",
5
5
  "description": "Adversarial multi-agent development system for Claude Code",
6
6
  "author": "Pedro Picardi",
@@ -4,15 +4,15 @@
4
4
  // Keep descriptions under 80 chars — they appear in terminal columns.
5
5
 
6
6
  const AGENTS = {
7
- 'wizard.md': 'Dungeon master — opens phases, dispatches team, closes with rulings',
8
- 'warrior.md': 'Stress-tester — breaks things under load, edge cases, pressure',
9
- 'archer.md': 'Pattern-seeker — traces ripple effects, naming drift, contract violations',
10
- 'rogue.md': 'Assumption-destroyer — thinks like a failing system, malicious input',
7
+ 'wizard.md': 'Dungeon Master — opens phases, dispatches team, closes with rulings',
8
+ 'warrior.md': 'Stress-tester — tests boundaries, load, edge cases, failure modes',
9
+ 'archer.md': 'Pattern-seeker — ripple effects, naming drift, contract violations, dependencies',
10
+ 'rogue.md': 'Assumption-destroyer — failing systems, malicious input, race conditions',
11
11
  };
12
12
 
13
13
  const HOOKS = {
14
14
  lifecycle: [
15
- { name: 'raid-lib.sh', desc: 'Shared config — reads raid.json, exports session state' },
15
+ { name: 'raid-lib.sh', desc: 'Shared config — reads raid.json, exports quest state' },
16
16
  { name: 'raid-session-start.sh', desc: 'Activates Raid workflow, creates quest directory' },
17
17
  { name: 'raid-session-end.sh', desc: 'Archives quest dungeon to vault, cleans up' },
18
18
  { name: 'raid-pre-compact.sh', desc: 'Backs up Dungeon before message compaction' },
@@ -20,18 +20,21 @@ const HOOKS = {
20
20
  ],
21
21
  gates: [
22
22
  { name: 'validate-commit.sh', desc: 'Enforces conventional commit format' },
23
- { name: 'validate-write-gate.sh', desc: 'Protects session files, allows quest dir writes' },
23
+ { name: 'validate-write-gate.sh', desc: 'Protects raid-session file, allows quest dir writes' },
24
24
  { name: 'validate-file-naming.sh', desc: 'Enforces naming convention (kebab-case, etc.)' },
25
25
  { name: 'validate-no-placeholders.sh', desc: 'Blocks TBD/TODO in specs, plans, and quest docs' },
26
26
  { name: 'validate-dungeon.sh', desc: 'Validates dungeon entries and black cards' },
27
27
  { name: 'validate-browser-tests-exist.sh', desc: 'Checks Playwright tests exist before commits' },
28
28
  { name: 'validate-browser-cleanup.sh', desc: 'Verifies browser processes cleaned up properly' },
29
29
  ],
30
+ optional: [
31
+ { name: 'rtk-bridge.sh', desc: 'Token compression via RTK (optional, opt-in)' },
32
+ ],
30
33
  };
31
34
 
32
35
  const SKILLS = {
33
36
  // Core
34
- 'raid-init': 'Quest selection, greeting, session setup',
37
+ 'raid-init': 'Quest selection, greeting, raid initialization',
35
38
  // Canonical Quest chain
36
39
  'raid-canonical-protocol': 'Canonical Quest protocol and rules',
37
40
  'raid-canonical-prd': 'Phase 1: PRD creation (optional)',
@@ -46,6 +49,7 @@ const SKILLS = {
46
49
  'raid-debugging': 'Root-cause investigation',
47
50
  'raid-browser': 'Browser startup discovery',
48
51
  'raid-browser-chrome': 'Live browser inspection',
52
+ 'raid-teambuff': 'Emergency team retrospective + rulings',
49
53
  };
50
54
 
51
55
  const CONFIG = {
package/src/init.js CHANGED
@@ -32,7 +32,7 @@ function copyRecursive(src, dest, skipped) {
32
32
  }
33
33
  }
34
34
 
35
- function install(cwd) {
35
+ function install(cwd, opts = {}) {
36
36
  const claudeDir = path.join(cwd, '.claude');
37
37
  const result = { skipped: [], alreadyInstalled: false, detected: null };
38
38
 
@@ -131,6 +131,15 @@ function install(cwd) {
131
131
  startup: null,
132
132
  };
133
133
  }
134
+ if (opts.rtkEnabled) {
135
+ raidConfig.rtk = {
136
+ enabled: true,
137
+ bypass: {
138
+ phases: [],
139
+ commands: [],
140
+ },
141
+ };
142
+ }
134
143
  fs.writeFileSync(raidConfigPath, JSON.stringify(raidConfig, null, 2) + '\n');
135
144
  }
136
145
 
@@ -161,14 +170,14 @@ function install(cwd) {
161
170
  return result;
162
171
  }
163
172
 
164
- async function run() {
173
+ async function run(opts = {}) {
165
174
  const cwd = process.cwd();
166
175
  const { bold, dim } = colors;
167
176
 
168
177
  console.log('\n' + banner());
169
178
  console.log(header('Summoning the Party...') + '\n');
170
179
 
171
- const result = install(cwd);
180
+ const result = install(cwd, opts);
172
181
 
173
182
  if (result.alreadyInstalled) {
174
183
  console.log(' The party is already here. Use ' + bold('claude-raid update') + ' to reforge.');
@@ -189,7 +198,7 @@ async function run() {
189
198
  console.log(' ' + header('Agents') + dim(` ${result.counts.agents} files`));
190
199
  console.log(' Copied wizard.md, warrior.md, archer.md, rogue.md');
191
200
  console.log(dim(' Each agent gets its own tmux pane. Start with:'));
192
- console.log(dim(' tmux new-session -s raid && claude --agent wizard'));
201
+ console.log(dim(' claude-raid start'));
193
202
 
194
203
  // Hooks
195
204
  console.log('');
@@ -222,7 +231,20 @@ async function run() {
222
231
  }
223
232
 
224
233
  // Setup wizard
225
- await runSetup();
234
+ const setupResult = await runSetup(opts);
235
+
236
+ // Apply RTK config if enabled interactively
237
+ if (setupResult.actions.includes('rtk-enabled')) {
238
+ const raidConfigPath = path.join(cwd, '.claude', 'raid.json');
239
+ if (fs.existsSync(raidConfigPath)) {
240
+ const config = JSON.parse(fs.readFileSync(raidConfigPath, 'utf8'));
241
+ if (!config.rtk) {
242
+ config.rtk = { enabled: true, bypass: { phases: [], commands: [] } };
243
+ fs.writeFileSync(raidConfigPath, JSON.stringify(config, null, 2) + '\n');
244
+ mergeSettings(cwd);
245
+ }
246
+ }
247
+ }
226
248
 
227
249
  // Reference card
228
250
  const { referenceCard } = require('./ui');
@@ -273,6 +295,15 @@ function dryRun(cwd) {
273
295
  }
274
296
  lines.push('');
275
297
 
298
+ // Hooks — Optional
299
+ if (HOOKS.optional && HOOKS.optional.length > 0) {
300
+ lines.push(header('Hooks \u2014 Optional') + '\n');
301
+ for (const h of HOOKS.optional) {
302
+ lines.push(' ' + colors.bold(h.name.padEnd(28)) + h.desc + tag('hooks/' + h.name));
303
+ }
304
+ lines.push('');
305
+ }
306
+
276
307
  // Skills
277
308
  lines.push(header('Skills') + '\n');
278
309
  for (const [folder, desc] of Object.entries(SKILLS)) {
@@ -301,7 +332,7 @@ function dryRun(cwd) {
301
332
  }
302
333
  lines.push('');
303
334
 
304
- lines.push(' Run without --dry-run to install.');
335
+ lines.push(' Run without --dry-run to summon.');
305
336
 
306
337
  return lines.join('\n');
307
338
  }