claude-raid 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +345 -0
  3. package/bin/cli.js +34 -0
  4. package/package.json +37 -0
  5. package/src/detect-project.js +112 -0
  6. package/src/doctor.js +201 -0
  7. package/src/init.js +138 -0
  8. package/src/merge-settings.js +119 -0
  9. package/src/remove.js +92 -0
  10. package/src/update.js +110 -0
  11. package/template/.claude/agents/archer.md +115 -0
  12. package/template/.claude/agents/rogue.md +116 -0
  13. package/template/.claude/agents/warrior.md +114 -0
  14. package/template/.claude/agents/wizard.md +206 -0
  15. package/template/.claude/hooks/validate-commit-message.sh +78 -0
  16. package/template/.claude/hooks/validate-file-naming.sh +73 -0
  17. package/template/.claude/hooks/validate-no-placeholders.sh +67 -0
  18. package/template/.claude/hooks/validate-phase-gate.sh +60 -0
  19. package/template/.claude/hooks/validate-tests-pass.sh +43 -0
  20. package/template/.claude/hooks/validate-verification.sh +70 -0
  21. package/template/.claude/raid-rules.md +21 -0
  22. package/template/.claude/skills/raid-debugging/SKILL.md +159 -0
  23. package/template/.claude/skills/raid-design/SKILL.md +208 -0
  24. package/template/.claude/skills/raid-finishing/SKILL.md +123 -0
  25. package/template/.claude/skills/raid-git-worktrees/SKILL.md +96 -0
  26. package/template/.claude/skills/raid-implementation/SKILL.md +155 -0
  27. package/template/.claude/skills/raid-implementation-plan/SKILL.md +173 -0
  28. package/template/.claude/skills/raid-protocol/SKILL.md +288 -0
  29. package/template/.claude/skills/raid-review/SKILL.md +133 -0
  30. package/template/.claude/skills/raid-tdd/SKILL.md +147 -0
  31. package/template/.claude/skills/raid-verification/SKILL.md +113 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pedro Picardi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,345 @@
1
+ # claude-raid
2
+
3
+ **Adversarial multi-agent development system for [Claude Code](https://claude.ai/code).**
4
+
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.
6
+
7
+ Adapted from [obra/superpowers](https://github.com/obra/superpowers) by Jesse Vincent.
8
+
9
+ ---
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ npx claude-raid init
15
+ claude --agent wizard
16
+ ```
17
+
18
+ That's it. The installer auto-detects your project type, generates configuration, and merges with your existing Claude Code setup. Nothing is overwritten.
19
+
20
+ For split-pane mode (recommended for watching agents interact):
21
+
22
+ ```bash
23
+ claude --agent wizard --teammate-mode tmux
24
+ ```
25
+
26
+ ## How It Works
27
+
28
+ You describe your task. The Wizard assesses complexity, recommends a mode, and opens the Dungeon:
29
+
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
+ ```
53
+
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.
55
+
56
+ ## The Team
57
+
58
+ ### Wizard (Dungeon Master)
59
+
60
+ Purple. Model: Opus 4.6. Observes 90%, acts 10%.
61
+
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.
63
+
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.
65
+
66
+ ### Warrior
67
+
68
+ Red. Aggressive thoroughness. Stress-tests to destruction.
69
+
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.
71
+
72
+ **Signals:** `🔍 FINDING:` / `⚔️ CHALLENGE:` / `🔥 ROAST:` / `🔗 BUILDING ON @Name:` / `📌 DUNGEON:` / `🆘 WIZARD:` / `✅ CONCEDE:`
73
+
74
+ ### Archer
75
+
76
+ Green. Precision over brute force. Pattern recognition.
77
+
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.
79
+
80
+ **Signals:** `🎯 FINDING:` / `🏹 CHALLENGE:` / `🔥 ROAST:` / `🔗 BUILDING ON @Name:` / `📌 DUNGEON:` / `🆘 WIZARD:` / `✅ CONCEDE:`
81
+
82
+ ### Rogue
83
+
84
+ Orange. Adversarial mindset. Assumption destroyer.
85
+
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.
87
+
88
+ **Signals:** `💀 FINDING:` / `🗡️ CHALLENGE:` / `🔥 ROAST:` / `🔗 BUILDING ON @Name:` / `📌 DUNGEON:` / `🆘 WIZARD:` / `✅ CONCEDE:`
89
+
90
+ ## Modes
91
+
92
+ Not every task needs all four agents. The Wizard recommends a mode based on complexity, or you can specify one directly.
93
+
94
+ | | Full Raid | Skirmish | Scout |
95
+ |---|---|---|---|
96
+ | **Agents** | 3 | 2 | 1 |
97
+ | **Design phase** | Full adversarial | Lightweight | Skip (inline) |
98
+ | **Plan phase** | Full adversarial | Merged with design | Skip (inline) |
99
+ | **Implementation** | 1 builds, 2 attack | 1 builds, 1 attacks | 1 builds, Wizard reviews |
100
+ | **Review** | 3 independent reviews | 1 review + Wizard | Wizard only |
101
+ | **TDD** | **Enforced** | **Enforced** | **Enforced** |
102
+ | **Verification** | Triple | Double | Single + Wizard |
103
+
104
+ **When to use:**
105
+
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
109
+
110
+ Override the Wizard's recommendation: *"Full Raid this"*, *"Skirmish this bugfix"*, *"Scout this"*.
111
+
112
+ The Wizard can escalate mid-task (Scout to Skirmish, Skirmish to Full Raid) with your approval. It cannot de-escalate without asking.
113
+
114
+ **TDD is non-negotiable in all modes.** No production code without a failing test first.
115
+
116
+ ## The Dungeon
117
+
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.
119
+
120
+ **What goes in the Dungeon:** Findings that survived challenge, active unresolved battles, shared knowledge verified by 2+ agents, key decisions, escalation points.
121
+
122
+ **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
+
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.
125
+
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.
127
+
128
+ ## Skills
129
+
130
+ 10 specialized skills guide agent behavior at each stage:
131
+
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. |
144
+
145
+ ## Hooks
146
+
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.
148
+
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.
150
+
151
+ | Hook | Trigger | What It Does |
152
+ |---|---|---|
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. |
159
+
160
+ ### Hook exit codes
161
+
162
+ - `0` -- pass, no issues
163
+ - `2` -- block with message (agent sees the error and must fix it)
164
+
165
+ ## Team Rules
166
+
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.
188
+
189
+ ## Configuration
190
+
191
+ `npx claude-raid init` auto-detects your project and generates `.claude/raid.json`:
192
+
193
+ ```json
194
+ {
195
+ "project": {
196
+ "name": "my-project",
197
+ "language": "typescript",
198
+ "testCommand": "npm test",
199
+ "lintCommand": "npm run lint",
200
+ "buildCommand": "npm run build"
201
+ },
202
+ "paths": {
203
+ "specs": "docs/raid/specs",
204
+ "plans": "docs/raid/plans",
205
+ "worktrees": ".worktrees"
206
+ },
207
+ "conventions": {
208
+ "fileNaming": "kebab-case",
209
+ "commits": "conventional"
210
+ },
211
+ "raid": {
212
+ "defaultMode": "full"
213
+ }
214
+ }
215
+ ```
216
+
217
+ ### Auto-detected languages
218
+
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 ./...` |
226
+
227
+ Commands are auto-detected from your project files (e.g., `scripts.test` in `package.json`). Edit `raid.json` to override.
228
+
229
+ ### Configuration reference
230
+
231
+ | Key | Default | Description |
232
+ |---|---|---|
233
+ | `project.testCommand` | auto-detected | Command to run tests |
234
+ | `project.lintCommand` | auto-detected | Command to run linting |
235
+ | `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 |
241
+ | `conventions.commitMinLength` | `15` | Minimum commit message length |
242
+ | `conventions.maxDepth` | `8` | Maximum file nesting depth |
243
+ | `raid.defaultMode` | `full` | Default mode: `full`, `skirmish`, `scout` |
244
+
245
+ ## CLI Commands
246
+
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
251
+ ```
252
+
253
+ ### `init`
254
+
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
262
+
263
+ ### `update`
264
+
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
269
+
270
+ ### `remove`
271
+
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/`
275
+
276
+ ## What Gets Installed
277
+
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
+ ```
307
+
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.
309
+
310
+ ## Non-Invasive Design
311
+
312
+ The Raid is a tool in your toolkit, not your project's operating system.
313
+
314
+ - **Never touches your `CLAUDE.md`** -- your project instructions stay yours
315
+ - **Merges settings** alongside your existing config, with automatic backup
316
+ - **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
318
+ - **Clean removal** restores your original `settings.json` from backup
319
+ - **Zero npm dependencies** -- pure Node.js stdlib, fast `npx` cold-start
320
+
321
+ ## Requirements
322
+
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)
326
+
327
+ ## Inherited from Superpowers
328
+
329
+ The Raid inherits and adapts the [Superpowers](https://github.com/obra/superpowers) behavioral harness:
330
+
331
+ | Concept | How The Raid Uses It |
332
+ |---|---|
333
+ | HARD-GATEs | No code before design approval. No implementation before plan approval. |
334
+ | TDD Iron Law | No production code without a failing test first. Enforced in all modes. |
335
+ | 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`. |
340
+
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.
342
+
343
+ ## License
344
+
345
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ const command = process.argv[2];
6
+
7
+ const COMMANDS = {
8
+ init: () => require('../src/init').run(),
9
+ update: () => require('../src/update').run(),
10
+ remove: () => require('../src/remove').run(),
11
+ doctor: () => require('../src/doctor').run(),
12
+ };
13
+
14
+ if (!command || !COMMANDS[command]) {
15
+ console.log(`
16
+ claude-raid — Adversarial multi-agent development for Claude Code
17
+
18
+ Usage:
19
+ claude-raid init Install The Raid into the current project
20
+ claude-raid update Update to the latest version
21
+ claude-raid remove Uninstall The Raid
22
+ claude-raid doctor Check prerequisites and show quick start guide
23
+
24
+ Learn more: https://github.com/pedropicardi/claude-raid
25
+ `);
26
+ process.exit(command ? 1 : 0);
27
+ }
28
+
29
+ try {
30
+ COMMANDS[command]();
31
+ } catch (err) {
32
+ console.error(`\nclaude-raid: ${err.message}\n`);
33
+ process.exit(1);
34
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "claude-raid",
3
+ "version": "0.1.0",
4
+ "type": "commonjs",
5
+ "description": "Adversarial multi-agent development system for Claude Code",
6
+ "author": "Pedro Picardi",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/pedropicardi/claude-raid",
9
+ "bugs": "https://github.com/pedropicardi/claude-raid/issues",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pedropicardi/claude-raid.git"
13
+ },
14
+ "bin": {
15
+ "claude-raid": "./bin/cli.js"
16
+ },
17
+ "files": [
18
+ "bin/",
19
+ "src/",
20
+ "template/"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18.0.0"
24
+ },
25
+ "scripts": {
26
+ "test": "node --test tests/**/*.test.js"
27
+ },
28
+ "keywords": [
29
+ "claude",
30
+ "claude-code",
31
+ "agent",
32
+ "multi-agent",
33
+ "adversarial",
34
+ "tdd",
35
+ "code-quality"
36
+ ]
37
+ }
@@ -0,0 +1,112 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const DETECTORS = [
7
+ {
8
+ file: 'package.json',
9
+ language: 'javascript',
10
+ detect(cwd) {
11
+ const pkgPath = path.join(cwd, 'package.json');
12
+ try {
13
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
14
+ const scripts = pkg.scripts || {};
15
+ return {
16
+ language: 'javascript',
17
+ testCommand: scripts.test ? 'npm test' : '',
18
+ lintCommand: scripts.lint ? 'npm run lint' : '',
19
+ buildCommand: scripts.build ? 'npm run build' : '',
20
+ name: pkg.name || path.basename(cwd),
21
+ };
22
+ } catch {
23
+ return { language: 'javascript', testCommand: '', lintCommand: '', buildCommand: '', name: path.basename(cwd) };
24
+ }
25
+ },
26
+ },
27
+ {
28
+ file: 'Cargo.toml',
29
+ language: 'rust',
30
+ detect(cwd) {
31
+ return {
32
+ language: 'rust',
33
+ testCommand: 'cargo test',
34
+ lintCommand: 'cargo clippy',
35
+ buildCommand: 'cargo build',
36
+ name: path.basename(cwd),
37
+ };
38
+ },
39
+ },
40
+ {
41
+ file: 'pyproject.toml',
42
+ language: 'python',
43
+ detect(cwd) {
44
+ try {
45
+ const content = fs.readFileSync(path.join(cwd, 'pyproject.toml'), 'utf8');
46
+ const usesPoetry = content.includes('[tool.poetry]');
47
+ return {
48
+ language: 'python',
49
+ testCommand: usesPoetry ? 'poetry run pytest' : 'pytest',
50
+ lintCommand: usesPoetry ? 'poetry run ruff check .' : 'ruff check .',
51
+ buildCommand: usesPoetry ? 'poetry build' : 'python -m build',
52
+ name: path.basename(cwd),
53
+ };
54
+ } catch {
55
+ return { language: 'python', testCommand: 'pytest', lintCommand: 'ruff check .', buildCommand: 'python -m build', name: path.basename(cwd) };
56
+ }
57
+ },
58
+ },
59
+ {
60
+ file: 'requirements.txt',
61
+ language: 'python',
62
+ detect(cwd) {
63
+ return {
64
+ language: 'python',
65
+ testCommand: 'pytest',
66
+ lintCommand: 'ruff check .',
67
+ buildCommand: '',
68
+ name: path.basename(cwd),
69
+ };
70
+ },
71
+ },
72
+ {
73
+ file: 'go.mod',
74
+ language: 'go',
75
+ detect(cwd) {
76
+ return {
77
+ language: 'go',
78
+ testCommand: 'go test ./...',
79
+ lintCommand: 'go vet ./...',
80
+ buildCommand: 'go build ./...',
81
+ name: path.basename(cwd),
82
+ };
83
+ },
84
+ },
85
+ ];
86
+
87
+ function detectProject(cwd) {
88
+ const detected = [];
89
+
90
+ for (const detector of DETECTORS) {
91
+ if (fs.existsSync(path.join(cwd, detector.file))) {
92
+ detected.push(detector.detect(cwd));
93
+ }
94
+ }
95
+
96
+ if (detected.length === 0) {
97
+ return {
98
+ language: 'unknown',
99
+ testCommand: '',
100
+ lintCommand: '',
101
+ buildCommand: '',
102
+ name: path.basename(cwd),
103
+ detected: [],
104
+ };
105
+ }
106
+
107
+ const primary = detected[0];
108
+ primary.detected = detected;
109
+ return primary;
110
+ }
111
+
112
+ module.exports = { detectProject };