@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.
Files changed (70) hide show
  1. package/README.md +378 -0
  2. package/dist/bin/cli.d.ts +3 -0
  3. package/dist/bin/cli.d.ts.map +1 -0
  4. package/dist/bin/cli.js +28 -0
  5. package/dist/bin/cli.js.map +1 -0
  6. package/dist/commands/doctor.d.ts +2 -0
  7. package/dist/commands/doctor.d.ts.map +1 -0
  8. package/dist/commands/doctor.js +128 -0
  9. package/dist/commands/doctor.js.map +1 -0
  10. package/dist/commands/generate.d.ts +7 -0
  11. package/dist/commands/generate.d.ts.map +1 -0
  12. package/dist/commands/generate.js +165 -0
  13. package/dist/commands/generate.js.map +1 -0
  14. package/dist/commands/init.d.ts +7 -0
  15. package/dist/commands/init.d.ts.map +1 -0
  16. package/dist/commands/init.js +160 -0
  17. package/dist/commands/init.js.map +1 -0
  18. package/dist/generator/claude-cli.d.ts +19 -0
  19. package/dist/generator/claude-cli.d.ts.map +1 -0
  20. package/dist/generator/claude-cli.js +168 -0
  21. package/dist/generator/claude-cli.js.map +1 -0
  22. package/dist/generator/prompt-builder.d.ts +18 -0
  23. package/dist/generator/prompt-builder.d.ts.map +1 -0
  24. package/dist/generator/prompt-builder.js +122 -0
  25. package/dist/generator/prompt-builder.js.map +1 -0
  26. package/dist/index.d.ts +13 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +15 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/scaffold/copy-core-agents.d.ts +2 -0
  31. package/dist/scaffold/copy-core-agents.d.ts.map +1 -0
  32. package/dist/scaffold/copy-core-agents.js +74 -0
  33. package/dist/scaffold/copy-core-agents.js.map +1 -0
  34. package/dist/scaffold/create-config.d.ts +12 -0
  35. package/dist/scaffold/create-config.d.ts.map +1 -0
  36. package/dist/scaffold/create-config.js +154 -0
  37. package/dist/scaffold/create-config.js.map +1 -0
  38. package/dist/scaffold/create-project-description.d.ts +12 -0
  39. package/dist/scaffold/create-project-description.d.ts.map +1 -0
  40. package/dist/scaffold/create-project-description.js +104 -0
  41. package/dist/scaffold/create-project-description.js.map +1 -0
  42. package/dist/scaffold/create-structure.d.ts +2 -0
  43. package/dist/scaffold/create-structure.d.ts.map +1 -0
  44. package/dist/scaffold/create-structure.js +146 -0
  45. package/dist/scaffold/create-structure.js.map +1 -0
  46. package/dist/utils/detect-project.d.ts +11 -0
  47. package/dist/utils/detect-project.d.ts.map +1 -0
  48. package/dist/utils/detect-project.js +124 -0
  49. package/dist/utils/detect-project.js.map +1 -0
  50. package/dist/utils/logger.d.ts +10 -0
  51. package/dist/utils/logger.d.ts.map +1 -0
  52. package/dist/utils/logger.js +30 -0
  53. package/dist/utils/logger.js.map +1 -0
  54. package/dist/utils/validate-config.d.ts +23 -0
  55. package/dist/utils/validate-config.d.ts.map +1 -0
  56. package/dist/utils/validate-config.js +109 -0
  57. package/dist/utils/validate-config.js.map +1 -0
  58. package/package.json +59 -0
  59. package/templates/ARCHAI_README.md +326 -0
  60. package/templates/PROMPTS.md +480 -0
  61. package/templates/core-agents/cleanup-agent.md +132 -0
  62. package/templates/core-agents/code-reviewer.md +191 -0
  63. package/templates/core-agents/deep-analyst.md +170 -0
  64. package/templates/core-agents/finalization-agent.md +175 -0
  65. package/templates/core-agents/implementation-agent.md +173 -0
  66. package/templates/core-agents/iteration-controller.md +320 -0
  67. package/templates/core-agents/plan-validator.md +125 -0
  68. package/templates/core-agents/task-orchestrator.md +191 -0
  69. package/templates/core-agents/tdd-designer.md +205 -0
  70. package/templates/specialist-meta.md +275 -0
@@ -0,0 +1,326 @@
1
+ # archai Agent System
2
+
3
+ This project uses **archai** - a multi-agent AI development workflow powered by Claude Code.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # Open Claude Code in this project
9
+ claude
10
+
11
+ # Start with the full workflow
12
+ > "Use iteration-controller for: [your task description]"
13
+ ```
14
+
15
+ ## How It Works
16
+
17
+ ### The Three-Phase Workflow
18
+
19
+ ```
20
+ Phase 1: PLANNING (requires your approval)
21
+
22
+ ├── deep-analyst → Analyzes the task deeply
23
+ ├── plan-validator → Challenges the plan, finds gaps
24
+ └── tdd-designer → Designs tests BEFORE code
25
+
26
+
27
+ 🛑 STOP: Review plan → Say "APPROVE" or "REVISE: [feedback]"
28
+
29
+
30
+ Phase 2: IMPLEMENTATION (autonomous after approval)
31
+
32
+ ├── implementation-agent → Writes code following the plan
33
+ └── code-reviewer → Verifies the implementation
34
+
35
+
36
+ 🛑 STOP: Review implementation → Say "APPROVE" to finalize
37
+
38
+
39
+ Phase 3: FINALIZATION
40
+
41
+ ├── cleanup-agent → Cleans temporary files
42
+ └── finalization-agent → Commits, pushes, verifies CI
43
+ ```
44
+
45
+ ### Key Principle: Think Before Coding
46
+
47
+ **No code is written until you approve the plan.** This prevents:
48
+ - Implementing the wrong thing
49
+ - Missing edge cases
50
+ - Rewriting code due to poor planning
51
+
52
+ ## Launching Tasks
53
+
54
+ ### For New Features (Full Workflow)
55
+
56
+ ```
57
+ Use iteration-controller for: Add user authentication with JWT
58
+
59
+ Run Phase 1 with at least 2 iterations.
60
+ Write plan to .claude/plans/jwt-auth.md.
61
+ STOP and wait for my APPROVE before implementing.
62
+ ```
63
+
64
+ ### For Quick Fixes (Skip Planning)
65
+
66
+ ```
67
+ Use implementation-agent for: Fix the typo in Header.tsx
68
+ ```
69
+
70
+ ### For Analysis Only
71
+
72
+ ```
73
+ Use deep-analyst for: Analyze how the caching layer works
74
+ ```
75
+
76
+ ## Prompting Guide
77
+
78
+ ### Starting a Task
79
+
80
+ | What you want | Prompt |
81
+ |---------------|--------|
82
+ | New feature | `Use iteration-controller for: [feature]` |
83
+ | Bug fix (complex) | `Use iteration-controller for: [bug description]` |
84
+ | Bug fix (simple) | `Use implementation-agent for: [fix]` |
85
+ | Code analysis | `Use deep-analyst for: [what to analyze]` |
86
+ | Test design | `Use tdd-designer for: [feature to test]` |
87
+ | Code review | `Use code-reviewer for: [what to review]` |
88
+
89
+ ### Controlling the Workflow
90
+
91
+ | Action | Say |
92
+ |--------|-----|
93
+ | Approve plan/implementation | `APPROVE` |
94
+ | Request changes | `REVISE: [specific feedback]` |
95
+ | Stop completely | `REJECT: [reason]` |
96
+
97
+ ### Tips for Good Prompts
98
+
99
+ **Be specific:**
100
+ ```
101
+ # BAD
102
+ "Add authentication"
103
+
104
+ # GOOD
105
+ "Add JWT authentication with:
106
+ - Login endpoint returning access + refresh tokens
107
+ - Token refresh endpoint
108
+ - Middleware for protected routes
109
+ - 15 minute access token expiry"
110
+ ```
111
+
112
+ **Include constraints:**
113
+ ```
114
+ "Use iteration-controller for: Add rate limiting
115
+
116
+ Constraints:
117
+ - 100 requests per minute per IP
118
+ - Use Redis for distributed counting
119
+ - Return 429 with Retry-After header"
120
+ ```
121
+
122
+ ## Using Tasks & Epics
123
+
124
+ ### Task Directory Structure
125
+
126
+ ```
127
+ .tasks/
128
+ ├── inbox/ # New tasks waiting to be picked up
129
+ ├── epics/ # Active work in progress
130
+ ├── review/ # Completed, awaiting review/merge
131
+ └── done/ # Completed and merged
132
+ ```
133
+
134
+ ### Creating a Task
135
+
136
+ 1. Create a folder in `.tasks/inbox/`:
137
+ ```
138
+ .tasks/inbox/TASK-001/epic.md
139
+ ```
140
+
141
+ 2. Use the epic template:
142
+ ```markdown
143
+ ---
144
+ id: TASK-001
145
+ title: "Add user authentication"
146
+ type: epic
147
+ priority: high
148
+ status: inbox
149
+ created: 2024-01-15
150
+ ---
151
+
152
+ ## Description
153
+ Add JWT-based authentication to the API.
154
+
155
+ ## Acceptance Criteria
156
+ - [ ] Users can register with email/password
157
+ - [ ] Users can login and receive tokens
158
+ - [ ] Protected routes require valid token
159
+ - [ ] Tokens expire and can be refreshed
160
+ ```
161
+
162
+ ### Working with Tasks
163
+
164
+ ```
165
+ # Pick up next task from inbox
166
+ Use task-orchestrator for: Pick up the next task from inbox
167
+
168
+ # Create a new epic
169
+ Use task-orchestrator for: Create an epic for user authentication
170
+ ```
171
+
172
+ ### Task Lifecycle
173
+
174
+ ```
175
+ inbox/ → epics/ → review/ → done/
176
+ │ │ │
177
+ │ │ └── Merged to main
178
+ │ └── Implementation complete, PR created
179
+ └── Claimed and work started
180
+ ```
181
+
182
+ ## Core Principles
183
+
184
+ ### 1. Plan First, Code Second
185
+
186
+ Every feature goes through planning:
187
+ - What exactly needs to be built?
188
+ - What are the edge cases?
189
+ - How will we test it?
190
+ - What could go wrong?
191
+
192
+ ### 2. Tests Define Done
193
+
194
+ Tests are designed BEFORE implementation:
195
+ - Use concrete values, not "valid input"
196
+ - Tests should FAIL if code is broken
197
+ - Cover edge cases and error states
198
+
199
+ ### 3. Human Approval Gates
200
+
201
+ You control when to proceed:
202
+ - Review plans before implementation starts
203
+ - Review implementation before it's committed
204
+ - Nothing happens without your explicit `APPROVE`
205
+
206
+ ### 4. Adversarial Validation
207
+
208
+ The `plan-validator` agent exists to find problems:
209
+ - Challenges assumptions
210
+ - Finds missing edge cases
211
+ - Rejects vague plans
212
+ - Expects 2-4 planning iterations
213
+
214
+ ### 5. Autonomous Execution
215
+
216
+ Once approved, implementation runs without interruption:
217
+ - Implements step by step
218
+ - Runs tests after each change
219
+ - Fixes failures automatically
220
+ - Only stops when done or truly blocked
221
+
222
+ ## Directory Structure
223
+
224
+ ```
225
+ your-project/
226
+ ├── .claude/
227
+ │ ├── agents/ # Agent instruction files
228
+ │ ├── plans/ # Approved implementation plans
229
+ │ │ └── archived/ # Completed plans
230
+ │ └── state/ # Working state (auto-cleaned)
231
+ ├── .knowledge/
232
+ │ ├── context/ # Project description (READ THIS)
233
+ │ ├── decisions/ # Architecture decision records
234
+ │ └── learnings/ # Patterns learned during development
235
+ ├── .tasks/
236
+ │ ├── inbox/ # New tasks
237
+ │ ├── epics/ # Active work
238
+ │ ├── review/ # Awaiting merge
239
+ │ └── done/ # Completed
240
+ ├── PROMPTS.md # Full prompt reference
241
+ └── archai.config.md # Configuration
242
+ ```
243
+
244
+ ## Common Workflows
245
+
246
+ ### Starting Your Day
247
+
248
+ ```
249
+ # Check for pending tasks
250
+ ls .tasks/inbox/
251
+
252
+ # Or pick up the next one
253
+ Use task-orchestrator for: Pick up the next task from inbox
254
+ ```
255
+
256
+ ### Feature Development
257
+
258
+ ```
259
+ # 1. Start with full workflow
260
+ Use iteration-controller for: [feature description]
261
+
262
+ # 2. Review the plan when presented
263
+ # Read .claude/plans/[feature].md
264
+
265
+ # 3. Approve or revise
266
+ APPROVE
267
+ # or
268
+ REVISE: Add error handling for network failures
269
+
270
+ # 4. Let implementation run
271
+
272
+ # 5. Approve final implementation
273
+ APPROVE
274
+ ```
275
+
276
+ ### Quick Bug Fix
277
+
278
+ ```
279
+ Use implementation-agent for: Fix null pointer in getUserById when user not found
280
+
281
+ The function should return null instead of throwing.
282
+ ```
283
+
284
+ ### Code Investigation
285
+
286
+ ```
287
+ Use deep-analyst for: Trace how authentication tokens flow through the system
288
+
289
+ I need to understand:
290
+ 1. Where tokens are created
291
+ 2. How they're validated
292
+ 3. Where they're stored
293
+ ```
294
+
295
+ ## Troubleshooting
296
+
297
+ ### "Agent isn't following the plan"
298
+
299
+ Make sure the plan was specific enough. Vague plans lead to interpretation.
300
+
301
+ ### "Tests are too shallow"
302
+
303
+ Ask `tdd-designer` to include:
304
+ - Edge cases with specific values
305
+ - Error conditions
306
+ - Boundary values
307
+
308
+ ### "Phase 1 keeps iterating"
309
+
310
+ After 4 iterations, the requirements might be unclear. Provide more context or simplify the task.
311
+
312
+ ### "Implementation keeps failing"
313
+
314
+ 1. Check if the plan covered the failing scenario
315
+ 2. Let it retry (up to 5 attempts)
316
+ 3. If still failing, it will escalate to you
317
+
318
+ ## Need Help?
319
+
320
+ - **PROMPTS.md** - Full prompt reference with examples
321
+ - **.knowledge/context/project-description.md** - Project context (fill this in!)
322
+ - **archai.config.md** - Configuration options
323
+
324
+ ---
325
+
326
+ *Powered by archai - Multi-agent AI development workflow*