@zik000/archai 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.
- package/README.md +378 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +28 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +128 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/generate.d.ts +7 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +165 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +160 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/generator/claude-cli.d.ts +19 -0
- package/dist/generator/claude-cli.d.ts.map +1 -0
- package/dist/generator/claude-cli.js +168 -0
- package/dist/generator/claude-cli.js.map +1 -0
- package/dist/generator/prompt-builder.d.ts +18 -0
- package/dist/generator/prompt-builder.d.ts.map +1 -0
- package/dist/generator/prompt-builder.js +122 -0
- package/dist/generator/prompt-builder.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/scaffold/copy-core-agents.d.ts +2 -0
- package/dist/scaffold/copy-core-agents.d.ts.map +1 -0
- package/dist/scaffold/copy-core-agents.js +74 -0
- package/dist/scaffold/copy-core-agents.js.map +1 -0
- package/dist/scaffold/create-config.d.ts +12 -0
- package/dist/scaffold/create-config.d.ts.map +1 -0
- package/dist/scaffold/create-config.js +154 -0
- package/dist/scaffold/create-config.js.map +1 -0
- package/dist/scaffold/create-project-description.d.ts +12 -0
- package/dist/scaffold/create-project-description.d.ts.map +1 -0
- package/dist/scaffold/create-project-description.js +104 -0
- package/dist/scaffold/create-project-description.js.map +1 -0
- package/dist/scaffold/create-structure.d.ts +2 -0
- package/dist/scaffold/create-structure.d.ts.map +1 -0
- package/dist/scaffold/create-structure.js +146 -0
- package/dist/scaffold/create-structure.js.map +1 -0
- package/dist/utils/detect-project.d.ts +11 -0
- package/dist/utils/detect-project.d.ts.map +1 -0
- package/dist/utils/detect-project.js +124 -0
- package/dist/utils/detect-project.js.map +1 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +30 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validate-config.d.ts +23 -0
- package/dist/utils/validate-config.d.ts.map +1 -0
- package/dist/utils/validate-config.js +109 -0
- package/dist/utils/validate-config.js.map +1 -0
- package/package.json +59 -0
- package/templates/ARCHAI_README.md +326 -0
- package/templates/PROMPTS.md +480 -0
- package/templates/core-agents/cleanup-agent.md +132 -0
- package/templates/core-agents/code-reviewer.md +191 -0
- package/templates/core-agents/deep-analyst.md +170 -0
- package/templates/core-agents/finalization-agent.md +175 -0
- package/templates/core-agents/implementation-agent.md +173 -0
- package/templates/core-agents/iteration-controller.md +320 -0
- package/templates/core-agents/plan-validator.md +125 -0
- package/templates/core-agents/task-orchestrator.md +191 -0
- package/templates/core-agents/tdd-designer.md +205 -0
- package/templates/specialist-meta.md +275 -0
package/README.md
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
# archai
|
|
2
|
+
|
|
3
|
+
**Multi-agent AI development workflow for any project.**
|
|
4
|
+
|
|
5
|
+
archai sets up a sophisticated multi-agent system for Claude Code that transforms how you build software. Instead of one AI assistant, you get a team of specialized agents working together through a structured three-phase workflow.
|
|
6
|
+
|
|
7
|
+
## Philosophy: Think Before Acting
|
|
8
|
+
|
|
9
|
+
This agent system implements a **three-phase iteration architecture**:
|
|
10
|
+
|
|
11
|
+
1. **Phase 1: Planning Loop** - Think, validate, design tests, validate tests, rethink (2-4 iterations)
|
|
12
|
+
2. **Phase 2: Implementation Loop** - Implement, test, review (only after Phase 1 approved)
|
|
13
|
+
3. **Phase 3: Finalization** - Verify, cleanup, commit, push, CI/CD verification
|
|
14
|
+
|
|
15
|
+
**Key Insight**: The cost of thinking is much lower than the cost of re-implementing. Most bugs come from insufficient planning, not insufficient coding skill.
|
|
16
|
+
|
|
17
|
+
## The Three-Phase Architecture
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
21
|
+
│ PHASE 1: PLANNING LOOP │
|
|
22
|
+
│ (Think deeply BEFORE any code) │
|
|
23
|
+
│ │
|
|
24
|
+
│ ┌─────────┐ ┌───────────┐ ┌───────────┐ ┌──────────┐ ┌─────────┐ │
|
|
25
|
+
│ │ THINK │──▶│ VALIDATE │──▶│ TEST │──▶│ VALIDATE │──▶│ RETHINK │ │
|
|
26
|
+
│ │ (deep- │ │ (plan- │ │ DESIGN │ │ TESTS │ │ (deep- │ │
|
|
27
|
+
│ │ analyst)│ │ validator)│ │ (tdd- │ │ (critic) │ │ analyst)│ │
|
|
28
|
+
│ └─────────┘ └───────────┘ │ designer) │ └──────────┘ └─────────┘ │
|
|
29
|
+
│ ▲ └───────────┘ │ │
|
|
30
|
+
│ │ ◀─── ITERATE 2-4x ───────────────────────┘ │
|
|
31
|
+
│ │
|
|
32
|
+
│ EXIT: Plan + Tests validated + All questions answered │
|
|
33
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
34
|
+
│
|
|
35
|
+
▼
|
|
36
|
+
╔═══════════════════════════════════════════╗
|
|
37
|
+
║ 🛑 AWAIT USER PLAN APPROVAL 🛑 ║
|
|
38
|
+
╚═══════════════════════════════════════════╝
|
|
39
|
+
│
|
|
40
|
+
▼ (only on APPROVE)
|
|
41
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
42
|
+
│ PHASE 2: IMPLEMENTATION LOOP │
|
|
43
|
+
│ (Only after user approves plan) │
|
|
44
|
+
│ │
|
|
45
|
+
│ ┌──────────────┐ ┌─────────┐ ┌────────────┐ │
|
|
46
|
+
│ │ IMPLEMENT │───▶│ TEST │───▶│ REVIEW │ │
|
|
47
|
+
│ │(implement- │ │ (run) │ │ (code- │ │
|
|
48
|
+
│ │ation-agent) │ │ │ │ reviewer) │ │
|
|
49
|
+
│ └──────────────┘ └─────────┘ └────────────┘ │
|
|
50
|
+
│ ▲ │ │
|
|
51
|
+
│ │ ◀─── ITERATE ───────────┘ │
|
|
52
|
+
│ │
|
|
53
|
+
│ EXIT: Tests pass + Review approved │
|
|
54
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
55
|
+
│
|
|
56
|
+
▼
|
|
57
|
+
╔═══════════════════════════════════════════╗
|
|
58
|
+
║ 🛑 AWAIT USER FINAL APPROVAL 🛑 ║
|
|
59
|
+
╚═══════════════════════════════════════════╝
|
|
60
|
+
│
|
|
61
|
+
▼ (only on APPROVE)
|
|
62
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
63
|
+
│ PHASE 3: FINALIZATION │
|
|
64
|
+
│ (finalization-agent handles) │
|
|
65
|
+
│ │
|
|
66
|
+
│ ┌──────────┐ ┌─────────┐ ┌────────┐ ┌────────┐ ┌─────────────┐ │
|
|
67
|
+
│ │ VERIFY │──▶│ QUALITY │──▶│CLEANUP │──▶│ COMMIT │──▶│ WAIT FOR │ │
|
|
68
|
+
│ │ CRITERIA │ │ CHECKS │ │ │ │ + PUSH │ │ CI/CD │ │
|
|
69
|
+
│ └──────────┘ └─────────┘ └────────┘ └────────┘ └─────────────┘ │
|
|
70
|
+
│ │
|
|
71
|
+
│ EXIT: CI passes + All verified │
|
|
72
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
73
|
+
│
|
|
74
|
+
▼
|
|
75
|
+
┌──────────────┐
|
|
76
|
+
│ COMPLETE │
|
|
77
|
+
└──────────────┘
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Features
|
|
81
|
+
|
|
82
|
+
- **9 Core Agents** - Pre-built orchestration agents for planning, implementation, and quality assurance
|
|
83
|
+
- **Dynamic Specialists** - Claude Code generates project-specific specialists based on your tech stack
|
|
84
|
+
- **Three-Phase Workflow** - Planning Loop → Implementation Loop → Finalization
|
|
85
|
+
- **Language Agnostic** - Works with any language, framework, or tech stack
|
|
86
|
+
- **Task Management** - Built-in epic/task tracking system
|
|
87
|
+
|
|
88
|
+
## Quick Start
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Install globally
|
|
92
|
+
npm install -g archai
|
|
93
|
+
|
|
94
|
+
# Initialize in your project
|
|
95
|
+
cd your-project
|
|
96
|
+
archai init
|
|
97
|
+
|
|
98
|
+
# Fill in the generated files:
|
|
99
|
+
# - archai.config.md (your tech stack and specialists)
|
|
100
|
+
# - .knowledge/context/project-description.md (project context)
|
|
101
|
+
|
|
102
|
+
# Generate specialist agents
|
|
103
|
+
archai generate
|
|
104
|
+
|
|
105
|
+
# Start using with Claude Code
|
|
106
|
+
claude
|
|
107
|
+
> "Use iteration-controller for: [your task]"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Requirements
|
|
111
|
+
|
|
112
|
+
- **Node.js 18+**
|
|
113
|
+
- **Claude Code CLI** - Install from [claude.ai/code](https://claude.ai/code)
|
|
114
|
+
- Claude Code must be authenticated
|
|
115
|
+
|
|
116
|
+
## Commands
|
|
117
|
+
|
|
118
|
+
### archai init
|
|
119
|
+
|
|
120
|
+
Initialize archai in your project. Runs an interactive wizard to gather project information.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
archai init # Interactive wizard
|
|
124
|
+
archai init --skip-wizard # Use detected defaults
|
|
125
|
+
archai init --force # Overwrite existing setup
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Creates:
|
|
129
|
+
- `.claude/agents/` - Agent definitions
|
|
130
|
+
- `.claude/state/` - Working state (gitignored)
|
|
131
|
+
- `.knowledge/` - Permanent knowledge base
|
|
132
|
+
- `.tasks/` - Task management
|
|
133
|
+
- `archai.config.md` - Configuration file
|
|
134
|
+
- `PROMPTS.md` - Quick reference for all prompts
|
|
135
|
+
|
|
136
|
+
### archai generate
|
|
137
|
+
|
|
138
|
+
Generate specialist agents based on your configuration.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
archai generate # Generate all specialists
|
|
142
|
+
archai generate --dry-run # Preview without writing
|
|
143
|
+
archai generate -y # Skip confirmation
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
This command:
|
|
147
|
+
1. Reads your `archai.config.md`
|
|
148
|
+
2. Calls Claude Code CLI to generate each specialist
|
|
149
|
+
3. Writes specialists to `.claude/agents/`
|
|
150
|
+
|
|
151
|
+
### archai doctor
|
|
152
|
+
|
|
153
|
+
Validate your archai setup.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
archai doctor
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Checks:
|
|
160
|
+
- Configuration file exists and is valid
|
|
161
|
+
- Required directories exist
|
|
162
|
+
- Core agents are installed
|
|
163
|
+
- Claude Code CLI is available
|
|
164
|
+
|
|
165
|
+
## Agent Roles
|
|
166
|
+
|
|
167
|
+
### Phase 1 Agents (Planning)
|
|
168
|
+
|
|
169
|
+
| Agent | Purpose | Focus |
|
|
170
|
+
|-------|---------|-------|
|
|
171
|
+
| `deep-analyst` | Deep analysis, initial planning, rethinking | Understanding the REAL problem |
|
|
172
|
+
| `plan-validator` | Challenge plans, find gaps | Breaking assumptions |
|
|
173
|
+
| `tdd-designer` | Design tests BEFORE code | Real user workflows |
|
|
174
|
+
|
|
175
|
+
### Phase 2 Agents (Implementation)
|
|
176
|
+
|
|
177
|
+
| Agent | Purpose | Focus |
|
|
178
|
+
|-------|---------|-------|
|
|
179
|
+
| `implementation-agent` | Execute the validated plan | Following specs exactly |
|
|
180
|
+
| `code-reviewer` | Verify implementation | Finding problems |
|
|
181
|
+
|
|
182
|
+
### Phase 3 Agents (Finalization)
|
|
183
|
+
|
|
184
|
+
| Agent | Purpose | Focus |
|
|
185
|
+
|-------|---------|-------|
|
|
186
|
+
| `cleanup-agent` | Clean temporary work files | Before committing |
|
|
187
|
+
| `finalization-agent` | Post-implementation finalization | Verify, cleanup, commit, push, CI/CD |
|
|
188
|
+
|
|
189
|
+
### Orchestrator
|
|
190
|
+
|
|
191
|
+
| Agent | Purpose |
|
|
192
|
+
|-------|---------|
|
|
193
|
+
| `iteration-controller` | Manages all three phases, handles escalation |
|
|
194
|
+
| `task-orchestrator` | Manages epic/task lifecycle from `.tasks/inbox/` |
|
|
195
|
+
|
|
196
|
+
### Specialist Agents (Generated)
|
|
197
|
+
|
|
198
|
+
Specialists are generated dynamically by Claude Code based on your project. They understand:
|
|
199
|
+
- Your specific tech stack and versions
|
|
200
|
+
- Actual file paths in your codebase
|
|
201
|
+
- Existing patterns and conventions
|
|
202
|
+
- Testing frameworks you use
|
|
203
|
+
|
|
204
|
+
Example specialists:
|
|
205
|
+
- `frontend-specialist` - React/Vue/Angular expertise
|
|
206
|
+
- `backend-specialist` - Express/FastAPI/Django expertise
|
|
207
|
+
- `database-specialist` - SQL/NoSQL optimization
|
|
208
|
+
- `auth-specialist` - Authentication/authorization
|
|
209
|
+
|
|
210
|
+
## Key Principles
|
|
211
|
+
|
|
212
|
+
### 1. No Code Without Validated Plan
|
|
213
|
+
|
|
214
|
+
Never skip Phase 1. Every implementation must have:
|
|
215
|
+
- Dependency analysis
|
|
216
|
+
- Risk assessment
|
|
217
|
+
- Test design with concrete values
|
|
218
|
+
- All questions answered
|
|
219
|
+
|
|
220
|
+
### 2. Human Approval Gate
|
|
221
|
+
|
|
222
|
+
Phase 1 outputs a **plan document** to `.claude/plans/{task}.md`. The workflow **STOPS** and waits for user to:
|
|
223
|
+
- **APPROVE** → Proceed to Phase 2
|
|
224
|
+
- **REVISE** → Return to Phase 1 with feedback
|
|
225
|
+
- **REJECT** → Stop entirely
|
|
226
|
+
|
|
227
|
+
**No code is written until the user explicitly approves the plan.**
|
|
228
|
+
|
|
229
|
+
### 3. Tests Define Done
|
|
230
|
+
|
|
231
|
+
Tests are designed FIRST, in Phase 1. Implementation follows. Tests must:
|
|
232
|
+
- Reflect real user workflows
|
|
233
|
+
- Use concrete values
|
|
234
|
+
- FAIL when code is wrong
|
|
235
|
+
- NOT mock core logic
|
|
236
|
+
|
|
237
|
+
### 4. Validation Is Adversarial
|
|
238
|
+
|
|
239
|
+
`plan-validator` exists to find problems, not approve plans. Expect:
|
|
240
|
+
- 2-4 planning iterations minimum
|
|
241
|
+
- Questions that force deeper thinking
|
|
242
|
+
- Rejection of vague plans
|
|
243
|
+
|
|
244
|
+
### 5. Iterate Until Right
|
|
245
|
+
|
|
246
|
+
Phase 1: Iterate until plan is specific, validated, and tests designed
|
|
247
|
+
Phase 2: Iterate until tests pass and review approves
|
|
248
|
+
|
|
249
|
+
## Directory Structure
|
|
250
|
+
|
|
251
|
+
After initialization:
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
your-project/
|
|
255
|
+
├── .claude/
|
|
256
|
+
│ ├── agents/ # Agent definitions
|
|
257
|
+
│ ├── plans/ # Approved plans (per task)
|
|
258
|
+
│ │ └── archived/ # Completed task plans
|
|
259
|
+
│ └── state/ # Working state (gitignored)
|
|
260
|
+
├── .knowledge/
|
|
261
|
+
│ ├── context/
|
|
262
|
+
│ │ └── project-description.md
|
|
263
|
+
│ ├── decisions/ # Architecture decisions
|
|
264
|
+
│ └── learnings/ # Learned patterns
|
|
265
|
+
├── .tasks/
|
|
266
|
+
│ ├── inbox/ # New tasks
|
|
267
|
+
│ ├── epics/ # Active work
|
|
268
|
+
│ ├── review/ # Awaiting merge
|
|
269
|
+
│ └── done/ # Completed
|
|
270
|
+
├── archai.config.md # Configuration
|
|
271
|
+
└── PROMPTS.md # Quick reference prompts
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## When to Use Which Agent
|
|
275
|
+
|
|
276
|
+
| Situation | Start With |
|
|
277
|
+
|-----------|------------|
|
|
278
|
+
| New feature | `iteration-controller` |
|
|
279
|
+
| Bug fix (complex) | `iteration-controller` |
|
|
280
|
+
| Bug fix (simple, <10 lines) | Direct fix, no agents |
|
|
281
|
+
| Understanding code | `deep-analyst` only |
|
|
282
|
+
| Test quality review | `tdd-designer` only |
|
|
283
|
+
| Before committing | `cleanup-agent` |
|
|
284
|
+
| Managing epics | `task-orchestrator` |
|
|
285
|
+
|
|
286
|
+
## Why This Architecture?
|
|
287
|
+
|
|
288
|
+
### Problem: Incomplete Plans
|
|
289
|
+
|
|
290
|
+
"Handle edge cases" leads to implementation guessing.
|
|
291
|
+
|
|
292
|
+
**Solution**: `plan-validator` rejects vague plans, forces specificity.
|
|
293
|
+
|
|
294
|
+
### Problem: Code First, Think Later
|
|
295
|
+
|
|
296
|
+
Jumping to code before understanding leads to rewrites.
|
|
297
|
+
|
|
298
|
+
**Solution**: Three-phase architecture enforces 2-4 thinking iterations BEFORE any code.
|
|
299
|
+
|
|
300
|
+
### Problem: Tests Written To Pass
|
|
301
|
+
|
|
302
|
+
Tests written after code tend to validate the implementation, not the requirement.
|
|
303
|
+
|
|
304
|
+
**Solution**: Tests designed BEFORE implementation, based on user stories, not code.
|
|
305
|
+
|
|
306
|
+
### Problem: Agents Cut Corners
|
|
307
|
+
|
|
308
|
+
Without enforcement, agents skip steps and produce low-quality work.
|
|
309
|
+
|
|
310
|
+
**Solution**: Explicit phase gates, required artifacts, adversarial validation.
|
|
311
|
+
|
|
312
|
+
## Common Mistakes to Avoid
|
|
313
|
+
|
|
314
|
+
### Mistake 1: Skipping to implementation
|
|
315
|
+
```
|
|
316
|
+
# BAD
|
|
317
|
+
"Just implement the auth feature"
|
|
318
|
+
|
|
319
|
+
# GOOD
|
|
320
|
+
"Use iteration-controller to implement the auth feature.
|
|
321
|
+
Run Phase 1 first and wait for my APPROVE."
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Mistake 2: Approving vague plans
|
|
325
|
+
```
|
|
326
|
+
# BAD plan that should be REVISED
|
|
327
|
+
"Step 3: Handle edge cases"
|
|
328
|
+
|
|
329
|
+
# GOOD plan that can be APPROVED
|
|
330
|
+
"Step 3: Handle boundary values
|
|
331
|
+
- Empty input: Return validation error 'input_required'
|
|
332
|
+
- Input > 1000 chars: Truncate with warning
|
|
333
|
+
- Invalid characters: Reject with 'invalid_chars'"
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Mistake 3: Interrupting Phase 2
|
|
337
|
+
```
|
|
338
|
+
# BAD
|
|
339
|
+
[Agent implementing step 2]
|
|
340
|
+
You: "How's it going? Should I help?"
|
|
341
|
+
|
|
342
|
+
# GOOD
|
|
343
|
+
[Let it run until DONE or BLOCKED]
|
|
344
|
+
[Only interrupt if truly necessary]
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Troubleshooting
|
|
348
|
+
|
|
349
|
+
### Agent isn't following instructions
|
|
350
|
+
1. Check if agent file content was passed in prompt
|
|
351
|
+
2. Verify output location is specified
|
|
352
|
+
3. Make task boundaries explicit
|
|
353
|
+
|
|
354
|
+
### Tests are too shallow
|
|
355
|
+
1. Check if tdd-designer used all test categories (correctness, edge, boundary)
|
|
356
|
+
2. Verify concrete values used (not "test with valid input")
|
|
357
|
+
|
|
358
|
+
### Phase 1 keeps iterating
|
|
359
|
+
1. After 4 iterations, check if requirements are unclear
|
|
360
|
+
2. May need to escalate to human for clarification
|
|
361
|
+
3. Check if plan-validator is rejecting for valid reasons
|
|
362
|
+
|
|
363
|
+
### Implementation keeps failing
|
|
364
|
+
1. Check if plan was specific enough
|
|
365
|
+
2. Review test design - were edge cases covered?
|
|
366
|
+
3. After 5 attempts on same error, escalate
|
|
367
|
+
|
|
368
|
+
## License
|
|
369
|
+
|
|
370
|
+
MIT
|
|
371
|
+
|
|
372
|
+
## Contributing
|
|
373
|
+
|
|
374
|
+
Contributions welcome!
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
Built with Claude Code.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":""}
|
package/dist/bin/cli.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { init } from '../commands/init.js';
|
|
4
|
+
import { generate } from '../commands/generate.js';
|
|
5
|
+
import { doctor } from '../commands/doctor.js';
|
|
6
|
+
const program = new Command();
|
|
7
|
+
program
|
|
8
|
+
.name('archai')
|
|
9
|
+
.description('Multi-agent AI development workflow setup for any project')
|
|
10
|
+
.version('0.1.0');
|
|
11
|
+
program
|
|
12
|
+
.command('init')
|
|
13
|
+
.description('Initialize archai agent system in current directory')
|
|
14
|
+
.option('--force', 'Overwrite existing configuration')
|
|
15
|
+
.option('--skip-wizard', 'Skip interactive wizard, use defaults')
|
|
16
|
+
.action(init);
|
|
17
|
+
program
|
|
18
|
+
.command('generate')
|
|
19
|
+
.description('Generate specialist agents based on configuration')
|
|
20
|
+
.option('--dry-run', 'Show what would be generated without writing files')
|
|
21
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
22
|
+
.action(generate);
|
|
23
|
+
program
|
|
24
|
+
.command('doctor')
|
|
25
|
+
.description('Validate archai setup and check for issues')
|
|
26
|
+
.action(doctor);
|
|
27
|
+
program.parse();
|
|
28
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,2DAA2D,CAAC;KACxE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,qDAAqD,CAAC;KAClE,MAAM,CAAC,SAAS,EAAE,kCAAkC,CAAC;KACrD,MAAM,CAAC,eAAe,EAAE,uCAAuC,CAAC;KAChE,MAAM,CAAC,IAAI,CAAC,CAAC;AAEhB,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,mDAAmD,CAAC;KAChE,MAAM,CAAC,WAAW,EAAE,oDAAoD,CAAC;KACzE,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC;KAC/C,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,4CAA4C,CAAC;KACzD,MAAM,CAAC,MAAM,CAAC,CAAC;AAElB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAUA,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CA4H5C"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import { logger } from '../utils/logger.js';
|
|
5
|
+
export async function doctor() {
|
|
6
|
+
logger.banner();
|
|
7
|
+
logger.section('System Health Check');
|
|
8
|
+
console.log('');
|
|
9
|
+
const checks = [
|
|
10
|
+
{
|
|
11
|
+
name: 'Node.js version',
|
|
12
|
+
check: async () => {
|
|
13
|
+
const version = process.version;
|
|
14
|
+
const major = parseInt(version.slice(1).split('.')[0]);
|
|
15
|
+
return {
|
|
16
|
+
pass: major >= 18,
|
|
17
|
+
message: major >= 18 ? `${version} (OK)` : `${version} (requires 18+)`,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Claude Code CLI',
|
|
23
|
+
check: async () => {
|
|
24
|
+
try {
|
|
25
|
+
execSync('claude --version', { stdio: 'pipe' });
|
|
26
|
+
return { pass: true, message: 'Installed' };
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return { pass: false, message: 'Not found - install from https://claude.ai/code' };
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'Folder structure',
|
|
35
|
+
check: async () => {
|
|
36
|
+
const required = [
|
|
37
|
+
'.claude/agents',
|
|
38
|
+
'.knowledge/context',
|
|
39
|
+
'.tasks/templates',
|
|
40
|
+
'.supervisor',
|
|
41
|
+
'.agents',
|
|
42
|
+
];
|
|
43
|
+
const missing = [];
|
|
44
|
+
for (const dir of required) {
|
|
45
|
+
if (!(await fs.pathExists(dir))) {
|
|
46
|
+
missing.push(dir);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
pass: missing.length === 0,
|
|
51
|
+
message: missing.length === 0 ? 'Complete' : `Missing: ${missing.join(', ')}`,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Configuration file',
|
|
57
|
+
check: async () => {
|
|
58
|
+
const exists = await fs.pathExists('archai.config.md');
|
|
59
|
+
return {
|
|
60
|
+
pass: exists,
|
|
61
|
+
message: exists ? 'Found' : 'Not found - run "archai init"',
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'Project description',
|
|
67
|
+
check: async () => {
|
|
68
|
+
const path = '.knowledge/context/project-description.md';
|
|
69
|
+
const exists = await fs.pathExists(path);
|
|
70
|
+
if (!exists) {
|
|
71
|
+
return { pass: false, message: 'Not found' };
|
|
72
|
+
}
|
|
73
|
+
const content = await fs.readFile(path, 'utf-8');
|
|
74
|
+
const hasPlaceholders = content.includes('[Project Name]') || content.includes('[What does this');
|
|
75
|
+
return {
|
|
76
|
+
pass: !hasPlaceholders,
|
|
77
|
+
message: hasPlaceholders ? 'Found but needs to be filled in' : 'Configured',
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Core agents',
|
|
83
|
+
check: async () => {
|
|
84
|
+
const coreAgents = [
|
|
85
|
+
'iteration-controller',
|
|
86
|
+
'deep-analyst',
|
|
87
|
+
'plan-validator',
|
|
88
|
+
'tdd-designer',
|
|
89
|
+
'implementation-agent',
|
|
90
|
+
'code-reviewer',
|
|
91
|
+
'cleanup-agent',
|
|
92
|
+
'finalization-agent',
|
|
93
|
+
'task-orchestrator',
|
|
94
|
+
];
|
|
95
|
+
const missing = [];
|
|
96
|
+
for (const agent of coreAgents) {
|
|
97
|
+
if (!(await fs.pathExists(`.claude/agents/${agent}.md`))) {
|
|
98
|
+
missing.push(agent);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
pass: missing.length === 0,
|
|
103
|
+
message: missing.length === 0 ? `${coreAgents.length} agents installed` : `Missing: ${missing.join(', ')}`,
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
let allPassed = true;
|
|
109
|
+
for (const check of checks) {
|
|
110
|
+
const result = await check.check();
|
|
111
|
+
const icon = result.pass ? chalk.green('✓') : chalk.red('✗');
|
|
112
|
+
const status = result.pass ? chalk.green(result.message) : chalk.red(result.message);
|
|
113
|
+
console.log(` ${icon} ${check.name}: ${status}`);
|
|
114
|
+
if (!result.pass)
|
|
115
|
+
allPassed = false;
|
|
116
|
+
}
|
|
117
|
+
console.log('');
|
|
118
|
+
logger.divider();
|
|
119
|
+
console.log('');
|
|
120
|
+
if (allPassed) {
|
|
121
|
+
logger.success('All checks passed! Your archai setup is healthy.');
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
logger.warn('Some checks failed. Fix the issues above and run "archai doctor" again.');
|
|
125
|
+
}
|
|
126
|
+
console.log('');
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAO5C,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,MAAM,CAAC,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,MAAM,MAAM,GAAY;QACtB;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,KAAK,IAAI,EAAE;gBAChB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;gBAChC,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvD,OAAO;oBACL,IAAI,EAAE,KAAK,IAAI,EAAE;oBACjB,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,iBAAiB;iBACvE,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,KAAK,IAAI,EAAE;gBAChB,IAAI,CAAC;oBACH,QAAQ,CAAC,kBAAkB,EAAE,EAA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