@zik000/archai 0.1.4 → 0.2.1
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 +217 -486
- package/dist/bin/cli.js +52 -1
- package/dist/bin/cli.js.map +1 -1
- package/dist/commands/cleanup.d.ts +16 -0
- package/dist/commands/cleanup.d.ts.map +1 -0
- package/dist/commands/cleanup.js +245 -0
- package/dist/commands/cleanup.js.map +1 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +14 -6
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/generate.d.ts +1 -5
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +15 -13
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts +7 -4
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +593 -90
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/rollback.d.ts +13 -0
- package/dist/commands/rollback.d.ts.map +1 -0
- package/dist/commands/rollback.js +186 -0
- package/dist/commands/rollback.js.map +1 -0
- package/dist/commands/setup-config.js +109 -107
- package/dist/commands/setup-config.js.map +1 -1
- package/dist/commands/setup-project.d.ts.map +1 -1
- package/dist/commands/setup-project.js +78 -76
- package/dist/commands/setup-project.js.map +1 -1
- package/dist/commands/uninstall.d.ts +3 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +173 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +10 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +374 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/generator/claude-cli.d.ts +5 -0
- package/dist/generator/claude-cli.d.ts.map +1 -1
- package/dist/generator/claude-cli.js +74 -3
- package/dist/generator/claude-cli.js.map +1 -1
- package/dist/generator/prompt-builder.d.ts +6 -17
- package/dist/generator/prompt-builder.d.ts.map +1 -1
- package/dist/generator/prompt-builder.js +131 -109
- package/dist/generator/prompt-builder.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/scaffold/copy-core-agents.d.ts.map +1 -1
- package/dist/scaffold/copy-core-agents.js +3 -1
- package/dist/scaffold/copy-core-agents.js.map +1 -1
- package/dist/scaffold/create-claude-settings.d.ts.map +1 -1
- package/dist/scaffold/create-claude-settings.js +34 -21
- package/dist/scaffold/create-claude-settings.js.map +1 -1
- package/dist/scaffold/create-config.d.ts +6 -6
- package/dist/scaffold/create-config.d.ts.map +1 -1
- package/dist/scaffold/create-config.js +85 -87
- package/dist/scaffold/create-config.js.map +1 -1
- package/dist/scaffold/create-project-description.d.ts +4 -4
- package/dist/scaffold/create-project-description.d.ts.map +1 -1
- package/dist/scaffold/create-project-description.js +97 -97
- package/dist/types/index.d.ts +116 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/analyze-files.d.ts +7 -0
- package/dist/utils/analyze-files.d.ts.map +1 -0
- package/dist/utils/analyze-files.js +27 -0
- package/dist/utils/analyze-files.js.map +1 -0
- package/dist/utils/backup.d.ts +102 -0
- package/dist/utils/backup.d.ts.map +1 -0
- package/dist/utils/backup.js +352 -0
- package/dist/utils/backup.js.map +1 -0
- package/dist/utils/detect-project.d.ts +1 -9
- package/dist/utils/detect-project.d.ts.map +1 -1
- package/dist/utils/detect-project.js +9 -4
- package/dist/utils/detect-project.js.map +1 -1
- package/dist/utils/file-comparison.d.ts +89 -0
- package/dist/utils/file-comparison.d.ts.map +1 -0
- package/dist/utils/file-comparison.js +301 -0
- package/dist/utils/file-comparison.js.map +1 -0
- package/dist/utils/file-merger.d.ts +74 -0
- package/dist/utils/file-merger.d.ts.map +1 -0
- package/dist/utils/file-merger.js +350 -0
- package/dist/utils/file-merger.js.map +1 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +43 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/migration.d.ts +74 -0
- package/dist/utils/migration.d.ts.map +1 -0
- package/dist/utils/migration.js +343 -0
- package/dist/utils/migration.js.map +1 -0
- package/dist/utils/validate-config.d.ts +1 -21
- package/dist/utils/validate-config.d.ts.map +1 -1
- package/dist/utils/validate-config.js.map +1 -1
- package/dist/utils/version-tracker.d.ts +130 -0
- package/dist/utils/version-tracker.d.ts.map +1 -0
- package/dist/utils/version-tracker.js +298 -0
- package/dist/utils/version-tracker.js.map +1 -0
- package/package.json +7 -1
- package/templates/CLAUDE.md +27 -0
- package/templates/core-agents/code-reviewer.md +36 -138
- package/templates/core-agents/deep-analyst.md +10 -25
- package/templates/core-agents/finalization-agent.md +10 -88
- package/templates/core-agents/implementation-agent.md +30 -112
- package/templates/core-agents/iteration-controller.md +183 -584
- package/templates/core-agents/plan-validator.md +1 -1
- package/templates/core-agents/quick-fix.md +56 -0
- package/templates/core-agents/task-orchestrator.md +20 -132
- package/templates/core-agents/tdd-designer.md +45 -139
- package/templates/specialist-meta.md +3 -3
package/README.md
CHANGED
|
@@ -1,486 +1,217 @@
|
|
|
1
|
-
# archai
|
|
2
|
-
|
|
3
|
-
**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
archai
|
|
150
|
-
archai generate
|
|
151
|
-
archai
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
archai
|
|
165
|
-
archai
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
### Phase 2 Agents (Implementation)
|
|
219
|
-
|
|
220
|
-
| Agent | Purpose | Focus |
|
|
221
|
-
|-------|---------|-------|
|
|
222
|
-
| `implementation-agent` | Execute the validated plan | Following specs exactly |
|
|
223
|
-
| `code-reviewer` | Verify implementation | Finding problems |
|
|
224
|
-
|
|
225
|
-
### Phase 3 Agents (Finalization)
|
|
226
|
-
|
|
227
|
-
| Agent | Purpose | Focus |
|
|
228
|
-
|-------|---------|-------|
|
|
229
|
-
| `cleanup-agent` | Clean temporary work files | Before committing |
|
|
230
|
-
| `finalization-agent` | Post-implementation finalization | Verify, cleanup, commit, push, CI/CD |
|
|
231
|
-
|
|
232
|
-
### Orchestrator
|
|
233
|
-
|
|
234
|
-
| Agent | Purpose |
|
|
235
|
-
|-------|---------|
|
|
236
|
-
| `iteration-controller` | Manages all three phases, handles escalation |
|
|
237
|
-
| `task-orchestrator` | Manages epic/task lifecycle from `.tasks/inbox/` |
|
|
238
|
-
|
|
239
|
-
### Specialist Agents (Generated)
|
|
240
|
-
|
|
241
|
-
Specialists are generated dynamically by Claude Code based on your project. They understand:
|
|
242
|
-
- Your specific tech stack and versions
|
|
243
|
-
- Actual file paths in your codebase
|
|
244
|
-
- Existing patterns and conventions
|
|
245
|
-
- Testing frameworks you use
|
|
246
|
-
|
|
247
|
-
Example specialists:
|
|
248
|
-
- `frontend-specialist` - React/Vue/Angular expertise
|
|
249
|
-
- `backend-specialist` - Express/FastAPI/Django expertise
|
|
250
|
-
- `database-specialist` - SQL/NoSQL optimization
|
|
251
|
-
- `auth-specialist` - Authentication/authorization
|
|
252
|
-
|
|
253
|
-
## Key Principles
|
|
254
|
-
|
|
255
|
-
### 1. No Code Without Validated Plan
|
|
256
|
-
|
|
257
|
-
Never skip Phase 1. Every implementation must have:
|
|
258
|
-
- Dependency analysis
|
|
259
|
-
- Risk assessment
|
|
260
|
-
- Test design with concrete values
|
|
261
|
-
- All questions answered
|
|
262
|
-
|
|
263
|
-
### 2. Approval Gates (Two Modes)
|
|
264
|
-
|
|
265
|
-
Phase 1 outputs a **plan document** to `.claude/plans/{task}.md`. What happens next depends on the mode:
|
|
266
|
-
|
|
267
|
-
**Manual Mode** (default):
|
|
268
|
-
- Workflow **STOPS** and waits for user to: APPROVE / REVISE / REJECT
|
|
269
|
-
- User reviews plan before any code is written
|
|
270
|
-
- User reviews implementation before finalization
|
|
271
|
-
|
|
272
|
-
**Critical Review Mode** (`with critical-review`):
|
|
273
|
-
- Spawns a **separate SDK session** to critically review the plan
|
|
274
|
-
- Fresh perspective catches blind spots the planning agent missed
|
|
275
|
-
- Up to 2 review iterations with plan revisions
|
|
276
|
-
- Auto-proceeds if review passes (no CRITICAL/HIGH issues)
|
|
277
|
-
- Falls back to manual if unresolved issues after 2 iterations
|
|
278
|
-
|
|
279
|
-
| Mode | Plan Gate | Final Gate | Best For |
|
|
280
|
-
|------|-----------|------------|----------|
|
|
281
|
-
| Manual | User approval | User approval | High-stakes changes, learning |
|
|
282
|
-
| Critical Review | Auto (if passed) | Auto (if passed) | Routine tasks, trusted workflows |
|
|
283
|
-
|
|
284
|
-
### 3. Tests Define Done
|
|
285
|
-
|
|
286
|
-
Tests are designed FIRST, in Phase 1. Implementation follows. Tests must:
|
|
287
|
-
- Reflect real user workflows
|
|
288
|
-
- Use concrete values
|
|
289
|
-
- FAIL when code is wrong
|
|
290
|
-
- NOT mock core logic
|
|
291
|
-
|
|
292
|
-
### 4. Validation Is Adversarial
|
|
293
|
-
|
|
294
|
-
`plan-validator` exists to find problems, not approve plans. Expect:
|
|
295
|
-
- 2-4 planning iterations minimum
|
|
296
|
-
- Questions that force deeper thinking
|
|
297
|
-
- Rejection of vague plans
|
|
298
|
-
|
|
299
|
-
### 5. Iterate Until Right
|
|
300
|
-
|
|
301
|
-
Phase 1: Iterate until plan is specific, validated, and tests designed
|
|
302
|
-
Phase 2: Iterate until tests pass and review approves
|
|
303
|
-
|
|
304
|
-
## Permission Presets
|
|
305
|
-
|
|
306
|
-
archai configures Claude Code permissions via `.claude/settings.local.json`. Three presets available:
|
|
307
|
-
|
|
308
|
-
### Permissive (Default)
|
|
309
|
-
|
|
310
|
-
Close to `--dangerously-skip-permissions` but with safety guardrails. Allows most operations while blocking irreversible actions:
|
|
311
|
-
|
|
312
|
-
**Always Denied** (even in permissive mode):
|
|
313
|
-
- Destructive file ops: `rm -rf *`, `rmdir /s`
|
|
314
|
-
- Force git: `git push --force`, `git reset --hard`
|
|
315
|
-
- System damage: `sudo *`, `chmod 777`, `mkfs*`
|
|
316
|
-
- Credentials: `cat ~/.ssh/*`, `echo $*SECRET*`
|
|
317
|
-
- Remote code exec: `curl * | bash`, `wget * | sh`
|
|
318
|
-
- Database destruction: `DROP DATABASE`, `TRUNCATE TABLE`
|
|
319
|
-
|
|
320
|
-
### Strict
|
|
321
|
-
|
|
322
|
-
Production-safe preset. Only allows read-only operations and controlled writes:
|
|
323
|
-
|
|
324
|
-
**Allowed**:
|
|
325
|
-
- Package management: `npm install`, `pip install`, etc.
|
|
326
|
-
- Build/test: `tsc`, `eslint`, `jest`, `pytest`
|
|
327
|
-
- Read operations: `cat`, `grep`, `ls`, `git status`, `git diff`
|
|
328
|
-
- Safe git: `git add`, `git commit`, `git checkout -b`
|
|
329
|
-
|
|
330
|
-
**Denied** (in addition to Always Denied):
|
|
331
|
-
- Network: `curl`, `wget`, `ssh`, `scp`
|
|
332
|
-
- Publish: `npm publish`, `pip upload`
|
|
333
|
-
- Push: `git push` (any form)
|
|
334
|
-
- Process control: `kill`, `pkill`
|
|
335
|
-
|
|
336
|
-
### Custom
|
|
337
|
-
|
|
338
|
-
Define your own allow/deny lists via the wizard. Useful for specific project requirements.
|
|
339
|
-
|
|
340
|
-
### Command Chaining
|
|
341
|
-
|
|
342
|
-
Permissions validate **each segment** of chained commands:
|
|
343
|
-
```bash
|
|
344
|
-
npm install && npm test # Both validated separately
|
|
345
|
-
git add . && git push # Would fail in strict mode (push denied)
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
## Directory Structure
|
|
349
|
-
|
|
350
|
-
After initialization:
|
|
351
|
-
|
|
352
|
-
```
|
|
353
|
-
your-project/
|
|
354
|
-
├── .claude/
|
|
355
|
-
│ ├── agents/ # Agent definitions
|
|
356
|
-
│ ├── plans/ # Approved plans (per task)
|
|
357
|
-
│ │ └── archived/ # Completed task plans
|
|
358
|
-
│ └── state/ # Working state (gitignored)
|
|
359
|
-
├── .knowledge/
|
|
360
|
-
│ ├── context/
|
|
361
|
-
│ │ └── project-description.md
|
|
362
|
-
│ ├── decisions/ # Architecture decisions
|
|
363
|
-
│ └── learnings/ # Learned patterns
|
|
364
|
-
├── .tasks/
|
|
365
|
-
│ ├── inbox/ # New tasks
|
|
366
|
-
│ ├── epics/ # Active work
|
|
367
|
-
│ ├── review/ # Awaiting merge
|
|
368
|
-
│ └── done/ # Completed
|
|
369
|
-
├── archai.config.md # Configuration
|
|
370
|
-
└── PROMPTS.md # Quick reference prompts
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
## When to Use Which Agent
|
|
374
|
-
|
|
375
|
-
| Situation | Start With |
|
|
376
|
-
|-----------|------------|
|
|
377
|
-
| New feature | `iteration-controller` |
|
|
378
|
-
| Bug fix (complex) | `iteration-controller` |
|
|
379
|
-
| Bug fix (simple, <10 lines) | Direct fix, no agents |
|
|
380
|
-
| Understanding code | `deep-analyst` only |
|
|
381
|
-
| Test quality review | `tdd-designer` only |
|
|
382
|
-
| Before committing | `cleanup-agent` |
|
|
383
|
-
| Managing epics | `task-orchestrator` |
|
|
384
|
-
|
|
385
|
-
### When to Use Critical Review Mode
|
|
386
|
-
|
|
387
|
-
| Situation | Mode | Why |
|
|
388
|
-
|-----------|------|-----|
|
|
389
|
-
| Learning the workflow | Manual | See how planning works |
|
|
390
|
-
| High-stakes feature | Manual | Want full control |
|
|
391
|
-
| Security-sensitive code | Manual | Extra human review |
|
|
392
|
-
| Routine refactoring | Critical Review | Trust the review process |
|
|
393
|
-
| Well-understood feature | Critical Review | Faster iteration |
|
|
394
|
-
| Batch of similar tasks | Critical Review | Efficiency at scale |
|
|
395
|
-
|
|
396
|
-
## Why This Architecture?
|
|
397
|
-
|
|
398
|
-
### Problem: Incomplete Plans
|
|
399
|
-
|
|
400
|
-
"Handle edge cases" leads to implementation guessing.
|
|
401
|
-
|
|
402
|
-
**Solution**: `plan-validator` rejects vague plans, forces specificity.
|
|
403
|
-
|
|
404
|
-
### Problem: Code First, Think Later
|
|
405
|
-
|
|
406
|
-
Jumping to code before understanding leads to rewrites.
|
|
407
|
-
|
|
408
|
-
**Solution**: Three-phase architecture enforces 2-4 thinking iterations BEFORE any code.
|
|
409
|
-
|
|
410
|
-
### Problem: Tests Written To Pass
|
|
411
|
-
|
|
412
|
-
Tests written after code tend to validate the implementation, not the requirement.
|
|
413
|
-
|
|
414
|
-
**Solution**: Tests designed BEFORE implementation, based on user stories, not code.
|
|
415
|
-
|
|
416
|
-
### Problem: Agents Cut Corners
|
|
417
|
-
|
|
418
|
-
Without enforcement, agents skip steps and produce low-quality work.
|
|
419
|
-
|
|
420
|
-
**Solution**: Explicit phase gates, required artifacts, adversarial validation.
|
|
421
|
-
|
|
422
|
-
## Common Mistakes to Avoid
|
|
423
|
-
|
|
424
|
-
### Mistake 1: Skipping to implementation
|
|
425
|
-
```
|
|
426
|
-
# BAD
|
|
427
|
-
"Just implement the auth feature"
|
|
428
|
-
|
|
429
|
-
# GOOD
|
|
430
|
-
"Use iteration-controller to implement the auth feature.
|
|
431
|
-
Run Phase 1 first and wait for my APPROVE."
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
### Mistake 2: Approving vague plans
|
|
435
|
-
```
|
|
436
|
-
# BAD plan that should be REVISED
|
|
437
|
-
"Step 3: Handle edge cases"
|
|
438
|
-
|
|
439
|
-
# GOOD plan that can be APPROVED
|
|
440
|
-
"Step 3: Handle boundary values
|
|
441
|
-
- Empty input: Return validation error 'input_required'
|
|
442
|
-
- Input > 1000 chars: Truncate with warning
|
|
443
|
-
- Invalid characters: Reject with 'invalid_chars'"
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
### Mistake 3: Interrupting Phase 2
|
|
447
|
-
```
|
|
448
|
-
# BAD
|
|
449
|
-
[Agent implementing step 2]
|
|
450
|
-
You: "How's it going? Should I help?"
|
|
451
|
-
|
|
452
|
-
# GOOD
|
|
453
|
-
[Let it run until DONE or BLOCKED]
|
|
454
|
-
[Only interrupt if truly necessary]
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
## Troubleshooting
|
|
458
|
-
|
|
459
|
-
### Agent isn't following instructions
|
|
460
|
-
1. Check if agent file content was passed in prompt
|
|
461
|
-
2. Verify output location is specified
|
|
462
|
-
3. Make task boundaries explicit
|
|
463
|
-
|
|
464
|
-
### Tests are too shallow
|
|
465
|
-
1. Check if tdd-designer used all test categories (correctness, edge, boundary)
|
|
466
|
-
2. Verify concrete values used (not "test with valid input")
|
|
467
|
-
|
|
468
|
-
### Phase 1 keeps iterating
|
|
469
|
-
1. After 4 iterations, check if requirements are unclear
|
|
470
|
-
2. May need to escalate to human for clarification
|
|
471
|
-
3. Check if plan-validator is rejecting for valid reasons
|
|
472
|
-
|
|
473
|
-
### Implementation keeps failing
|
|
474
|
-
1. Check if plan was specific enough
|
|
475
|
-
2. Review test design - were edge cases covered?
|
|
476
|
-
3. After 5 attempts on same error, escalate
|
|
477
|
-
|
|
478
|
-
## License
|
|
479
|
-
|
|
480
|
-
MIT
|
|
481
|
-
|
|
482
|
-
## Contributing
|
|
483
|
-
|
|
484
|
-
Contributions welcome!
|
|
485
|
-
|
|
486
|
-
---
|
|
1
|
+
# archai
|
|
2
|
+
|
|
3
|
+
**A team of AI agents for Claude Code — not just one assistant, but a full development workflow.**
|
|
4
|
+
|
|
5
|
+
Archai scaffolds a multi-agent system that plans before it codes, validates before it implements, and tests before it ships. One command sets it up. Claude Code does the rest.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Plan → Implement → Finalize
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
[Join our Discord](https://discord.gg/J3wgDb4YJv)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Why archai?
|
|
16
|
+
|
|
17
|
+
Without structure, AI assistants jump straight to code — skipping analysis, missing edge cases, and producing work that needs reworking. archai fixes this with a **three-phase workflow**:
|
|
18
|
+
|
|
19
|
+
1. **Planning Loop** — Analyze the problem, validate the plan, design tests (2-4 iterations)
|
|
20
|
+
2. **Implementation Loop** — Code, test, review (only after you approve the plan)
|
|
21
|
+
3. **Finalization** — Quality checks, cleanup, commit, push, CI verification
|
|
22
|
+
|
|
23
|
+
You stay in control with approval gates between phases. Or use **critical review mode** to let a separate AI session review the plan automatically.
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g @zik000/archai
|
|
29
|
+
cd your-project
|
|
30
|
+
archai init
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That's it. archai detects your tech stack and creates everything you need. Now open Claude Code:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
claude
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
And tell it what to build:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
> Use iteration-controller for: add user authentication with JWT
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The agent system takes over — plans the work, waits for your approval, implements it, runs tests, and commits.
|
|
46
|
+
|
|
47
|
+
### For small fixes
|
|
48
|
+
|
|
49
|
+
Skip the full workflow:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
> Use quick-fix for: rename the userId variable to accountId
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Optional setup wizards
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
archai setup-project # Describe your project architecture
|
|
59
|
+
archai setup-config # Configure commands, specialists, permissions
|
|
60
|
+
archai generate # Generate project-specific specialist agents
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## How to Use
|
|
64
|
+
|
|
65
|
+
### The Main Workflow
|
|
66
|
+
|
|
67
|
+
For any non-trivial task, use `iteration-controller`. It orchestrates the entire three-phase workflow:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
> Use iteration-controller for: [describe your task]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**What happens:**
|
|
74
|
+
1. `deep-analyst` analyzes your codebase and creates an implementation plan
|
|
75
|
+
2. `plan-validator` challenges the plan and finds gaps
|
|
76
|
+
3. `tdd-designer` designs tests before any code is written
|
|
77
|
+
4. **You review and approve the plan** (or request revisions)
|
|
78
|
+
5. `implementation-agent` builds it, `code-reviewer` verifies it
|
|
79
|
+
6. `finalization-agent` runs quality checks, commits, and pushes
|
|
80
|
+
|
|
81
|
+
### Critical Review Mode
|
|
82
|
+
|
|
83
|
+
For routine tasks where you trust the process, skip manual plan approval:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
> Use iteration-controller with critical-review for: [your task]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
A separate Claude session reviews the plan for blind spots. If it passes, implementation starts automatically. If issues are found, it falls back to asking you.
|
|
90
|
+
|
|
91
|
+
| Mode | When to use | Plan approval |
|
|
92
|
+
|------|-------------|---------------|
|
|
93
|
+
| Manual (default) | Learning, high-stakes, security-sensitive | You approve |
|
|
94
|
+
| Critical review | Routine tasks, well-understood features | Auto if review passes |
|
|
95
|
+
|
|
96
|
+
### Quick Fix
|
|
97
|
+
|
|
98
|
+
For small, obvious changes (typos, renames, config tweaks, 1-3 files):
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
> Use quick-fix for: [small change]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
No planning docs, no approval gates. If the change turns out to be bigger than expected, it tells you to use `iteration-controller` instead.
|
|
105
|
+
|
|
106
|
+
### Task Management
|
|
107
|
+
|
|
108
|
+
For managing multiple tasks across an epic:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
> Use task-orchestrator for: work through the tasks in .tasks/inbox/
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
It claims tasks, creates branches, spawns the workflow, and tracks progress.
|
|
115
|
+
|
|
116
|
+
### Standalone Agents
|
|
117
|
+
|
|
118
|
+
You can use any agent directly:
|
|
119
|
+
|
|
120
|
+
| Agent | Use for |
|
|
121
|
+
|-------|---------|
|
|
122
|
+
| `deep-analyst` | Understanding code, analyzing a problem |
|
|
123
|
+
| `tdd-designer` | Designing test suites |
|
|
124
|
+
| `cleanup-agent` | Cleaning temp files before committing |
|
|
125
|
+
|
|
126
|
+
## Agents (11 Core)
|
|
127
|
+
|
|
128
|
+
| Agent | Phase | Role |
|
|
129
|
+
|-------|-------|------|
|
|
130
|
+
| `iteration-controller` | Orchestrator | Manages all three phases with iteration limits |
|
|
131
|
+
| `deep-analyst` | Planning | Deep analysis and implementation planning |
|
|
132
|
+
| `plan-validator` | Planning | Adversarial plan review — finds gaps |
|
|
133
|
+
| `tdd-designer` | Planning | Designs tests before code, with concrete values |
|
|
134
|
+
| `critical-reviewer` | Planning | Blind review via separate SDK session |
|
|
135
|
+
| `implementation-agent` | Implementation | Autonomous execution of approved plan |
|
|
136
|
+
| `code-reviewer` | Implementation | Verifies against acceptance criteria |
|
|
137
|
+
| `cleanup-agent` | Finalization | Removes temp files, archives state |
|
|
138
|
+
| `finalization-agent` | Finalization | Quality checks, commit, push, CI/CD |
|
|
139
|
+
| `task-orchestrator` | Workflow | Epic/task lifecycle management |
|
|
140
|
+
| `quick-fix` | Standalone | Fast single-pass for small changes |
|
|
141
|
+
|
|
142
|
+
**Specialist agents** are generated from your config with `archai generate` — they understand your specific tech stack, file paths, and conventions.
|
|
143
|
+
|
|
144
|
+
## Commands
|
|
145
|
+
|
|
146
|
+
| Command | Purpose |
|
|
147
|
+
|---------|---------|
|
|
148
|
+
| `archai init` | Initialize archai in your project (smart — handles existing setups) |
|
|
149
|
+
| `archai update` | Update agents/templates with smart file comparison |
|
|
150
|
+
| `archai generate` | Generate specialist agents from your config |
|
|
151
|
+
| `archai setup-project` | Interactive wizard for project description |
|
|
152
|
+
| `archai setup-config` | Interactive wizard for config, commands, permissions |
|
|
153
|
+
| `archai doctor` | Validate your setup |
|
|
154
|
+
| `archai rollback` | Restore from automatic backup |
|
|
155
|
+
| `archai cleanup` | Remove deprecated files and old backups |
|
|
156
|
+
| `archai uninstall` | Remove archai from your project |
|
|
157
|
+
|
|
158
|
+
All commands support `--dry-run` to preview changes and `-y` for non-interactive CI mode.
|
|
159
|
+
|
|
160
|
+
### Key flags
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
archai init --skip-wizard # Use detected defaults
|
|
164
|
+
archai init --force # Re-initialize with file comparison
|
|
165
|
+
archai update --all # Force update all files
|
|
166
|
+
archai rollback --list # Show available backups
|
|
167
|
+
archai cleanup --all # Remove deprecated files + prune backups
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Permission Presets
|
|
171
|
+
|
|
172
|
+
archai configures Claude Code permissions via `.claude/settings.local.json`:
|
|
173
|
+
|
|
174
|
+
| Preset | Description |
|
|
175
|
+
|--------|-------------|
|
|
176
|
+
| **Permissive** (default) | Allows most operations. Blocks destructive actions: `rm -rf`, `git push --force`, `sudo`, credential access, database drops. |
|
|
177
|
+
| **Strict** | Read-only + controlled writes. No network, no push, no publish. Good for production environments. |
|
|
178
|
+
| **Custom** | Define your own allow/deny lists via the wizard. |
|
|
179
|
+
|
|
180
|
+
## Project Structure
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
your-project/
|
|
184
|
+
├── .claude/
|
|
185
|
+
│ ├── agents/ # Core + specialist agent definitions
|
|
186
|
+
│ ├── plans/ # Approved implementation plans
|
|
187
|
+
│ ├── state/ # Working state (gitignored)
|
|
188
|
+
│ └── version.json # Version tracking for smart updates
|
|
189
|
+
├── .knowledge/ # Project context, decisions, learnings
|
|
190
|
+
├── .tasks/ # Task inbox, epics, review, done
|
|
191
|
+
├── archai.config.md # Project configuration
|
|
192
|
+
├── CLAUDE.md # Agentic behavior guidelines (auto-generated)
|
|
193
|
+
└── PROMPTS.md # Quick reference for all prompts
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Requirements
|
|
197
|
+
|
|
198
|
+
- **Node.js 18+**
|
|
199
|
+
- **Claude Code CLI** — [claude.ai/code](https://claude.ai/code)
|
|
200
|
+
|
|
201
|
+
## Troubleshooting
|
|
202
|
+
|
|
203
|
+
**Agent not following instructions?** Make sure agent file content is being passed and output locations are specified.
|
|
204
|
+
|
|
205
|
+
**Planning keeps iterating?** After 4 iterations, it stops automatically. If requirements are unclear, it escalates to you.
|
|
206
|
+
|
|
207
|
+
**Implementation failing?** After 5 fix attempts on the same step, it reports BLOCKED and stops. Check if the plan was specific enough.
|
|
208
|
+
|
|
209
|
+
**Tests too shallow?** Verify `tdd-designer` used concrete values and covered edge cases, not just happy paths.
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
MIT
|
|
214
|
+
|
|
215
|
+
## Contributing
|
|
216
|
+
|
|
217
|
+
Contributions welcome! Join the [Discord](https://discord.gg/J3wgDb4YJv) to discuss ideas.
|