autodev-cli 1.4.96 → 1.4.101

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 (52) hide show
  1. package/media/profile/00-identity.md +8 -20
  2. package/media/profile/01-learning.md +12 -19
  3. package/media/profile/02-memory-mcp.md +4 -44
  4. package/media/profile/03-living-docs.md +10 -13
  5. package/media/profile/04-skill-files.md +3 -5
  6. package/media/profile/05-skill-creation.md +3 -14
  7. package/media/profile/06-core-rules.md +10 -47
  8. package/media/profile/07-core-loop.md +8 -25
  9. package/media/profile/08-thinking.md +10 -23
  10. package/media/profile/09-parallel-panel.md +9 -24
  11. package/media/profile/10-codebase-verification.md +7 -16
  12. package/media/profile/11-git-debug-security.md +5 -10
  13. package/media/profile/12-todo-format.md +3 -16
  14. package/media/profile/13-workflow-principles.md +3 -7
  15. package/media/profile/14-contracts.md +9 -12
  16. package/media/profile/15-soul.md +6 -8
  17. package/media/profile/16-journal.md +5 -32
  18. package/media/profile/17-issue-tracking.md +9 -14
  19. package/media/profile/18-knowledgebase.md +6 -9
  20. package/media/profile/19-subagent-context-management.md +11 -496
  21. package/media/profile/20-project-graph.md +23 -49
  22. package/out/commands/mcpOperate.js +150 -32
  23. package/out/commands/mcpOperate.js.map +1 -1
  24. package/out/core/controlSpec.d.ts +56 -0
  25. package/out/core/controlSpec.js +267 -0
  26. package/out/core/controlSpec.js.map +1 -0
  27. package/out/dispatcher.js +3 -1
  28. package/out/dispatcher.js.map +1 -1
  29. package/out/graphRender.d.ts +87 -0
  30. package/out/graphRender.js +279 -0
  31. package/out/graphRender.js.map +1 -0
  32. package/out/graphStore.d.ts +377 -2
  33. package/out/graphStore.js +1240 -64
  34. package/out/graphStore.js.map +1 -1
  35. package/out/journal.d.ts +35 -0
  36. package/out/journal.js +167 -0
  37. package/out/journal.js.map +1 -0
  38. package/out/messageBuilder.d.ts +1 -1
  39. package/out/messageBuilder.js +29 -29
  40. package/out/messageBuilder.js.map +1 -1
  41. package/out/openCodeHooksManager.js +41 -1
  42. package/out/openCodeHooksManager.js.map +1 -1
  43. package/out/periodicActions.d.ts +18 -0
  44. package/out/periodicActions.js +49 -0
  45. package/out/periodicActions.js.map +1 -1
  46. package/out/profileBuilder.d.ts +1 -1
  47. package/out/profileBuilder.js +31 -4
  48. package/out/profileBuilder.js.map +1 -1
  49. package/out/taskLoop.d.ts +19 -0
  50. package/out/taskLoop.js +227 -4
  51. package/out/taskLoop.js.map +1 -1
  52. package/package.json +2 -2
@@ -1,19 +1,14 @@
1
1
  ## 0.7 Issue Tracking — `.autodev/issues/ISSUE-NNN-kebab-title.md`
2
2
 
3
- **Each issue gets its own living document.** Create before any work. It is the single record from description through decisions, work log, artifacts, and resolution — readable alone, no external lookups needed.
4
-
5
- **Create when:** Jira/GitHub issue assigned · email with issue number · multi-session problem needs stable reference.
6
-
7
- **Naming:** `ISSUE-{NUMBER}-{kebab-case-title}.md` (use `0` if no external number). Example: `ISSUE-123-user-login-timeout.md`.
8
-
9
- **Sections:** Status · Created/Updated · Owner · Link · User Story & Goal · Acceptance Criteria · Related Issues · Technical Approach (prepend, never overwrite) · Work Log (append-only) · Artifacts · Resolution.
10
- *(Full skeleton: skill `issue-tracking-reference`)*
3
+ Each issue is its own living document, created **before any work**; a self-contained record from description decisions work log artifacts resolution.
4
+ **Create when:** an issue is assigned (Jira/GitHub) · an email carries an issue number · a multi-session problem needs a stable reference. **Name:** `ISSUE-{NUMBER}-{kebab-title}.md` (`0` if no external number).
5
+ **Sections:** Status · Created/Updated · Owner · Link · User Story & Goal · Acceptance Criteria · Related Issues · Technical Approach · Work Log · Artifacts · Resolution.
11
6
 
12
7
  **Update rules:**
13
- - Starting work → `Status: In Progress` + Work Log entry.
14
- - New finding → prepend to Technical Approach; never overwrite.
15
- - Artifact produced → add to Artifacts immediately (screenshots, logs, diffs, test output).
16
- - Blocker → `Status: Blocked` + email relevant agent per `CONTRACTS.md`.
17
- - Resolved → fill Resolution + `Status: Resolved` + attach verification artifacts.
8
+ - Start work → `Status: In Progress` + Work Log entry.
9
+ - New finding → prepend to Technical Approach (never overwrite).
10
+ - Artifact produced → add to Artifacts immediately.
11
+ - Blocker → `Status: Blocked` + email the relevant agent per `CONTRACTS.md`.
12
+ - Resolved → fill Resolution + `Status: Resolved` + attach 1+ verification artifact.
18
13
 
19
- **Rules:** Create before working · Append-only log and artifacts · One file per issue (cross-reference, never merge) · Self-contained · Every resolved issue needs 1+ artifact · Cross-references bidirectional · Never delete.
14
+ Append-only log/artifacts · one file per issue (cross-reference bidirectionally, never merge or delete). Full skeleton: skill `issue-tracking-reference`.
@@ -1,13 +1,10 @@
1
1
  ## 0.8 Knowledge Base — `.autodev/knowledgebase/KB-NNN-kebab-title.md`
2
2
 
3
- **Evergreen reference material** — architectural decisions, domain rules, patterns, integration quirks, gotchas. Outlive any individual task. Written when insight is confirmed, never when "there's time later."
3
+ Evergreen reference (architectural decisions, domain rules, patterns, integration quirks, gotchas) that outlives any task written the moment an insight is confirmed, not "later".
4
+ **Create when:** an architectural decision is made · a pattern applies in 2+ places · an integration quirk is confirmed · a recurring question is definitively answered · a JOURNAL `keep` yields a transferable insight · a TROUBLESHOOTING entry generalises to a class of problem.
5
+ **Name:** `KB-{NUMBER}-{kebab-title}.md` (sequential; `0` for local).
6
+ **Sections:** Status · Created/Updated · Summary (≤3 sentences) · Context · Detail · Examples · Caveats · References · Change History.
4
7
 
5
- **Create when:** Architectural decision made · pattern applies in 2+ places · integration quirk confirmed · recurring question definitively answered · JOURNAL.md `keep` produces transferable insight · TROUBLESHOOTING.md entry generalises to class of problem.
8
+ **Rules:** update Detail in place + append Change History as knowledge evolves; superseded `Status: Deprecated` + `Superseded by:` link; cross-reference bidirectionally with issues; one concept per entry; self-contained; never delete.
6
9
 
7
- **Naming:** `KB-{NUMBER}-{kebab-case-title}.md` Sequential number (check existing). Use `0` for local. Example: `KB-001-auth-token-refresh-flow.md`
8
-
9
- **Sections:** Status · Created/Updated · Summary (≤3 sentences) · Context · Detail · Examples · Caveats · References · Change History (append-only).
10
-
11
- **Rules:** Update Detail in place + append Change History when knowledge evolves. Superseded entry → `Status: Deprecated` + `Superseded by:` link. Cross-ref bidirectionally with issues. Never delete. One concept per entry. Self-contained.
12
-
13
- **Complete skeleton, all sections, update rules:** skill `kb-reference`
10
+ Full skeleton + update rules: skill `kb-reference`.
@@ -5,506 +5,21 @@ description: "When and how to spawn subagents; how to maintain context during de
5
5
 
6
6
  # Subagent Context Management
7
7
 
8
- ## Critical Principle: You Own Context
8
+ **Full decision tree, CONTEXT.md template, and briefing template: skill `subagent-context`.**
9
9
 
10
- **YOU (the Orchestrator) manage your own context.** Subagents are NOT for:
11
- - Compacting your context (they compact theirs, not yours = infinite loop)
12
- - Figuring out what to do next (you decide, then hand off)
13
- - Running commands (tests, lints, builds)
14
- - Reading files or parsing output
10
+ **You own your context.** Subagents are NOT for compacting your context (they compact their own empty context infinite loop), deciding what to do next, running commands (tests/lints/builds), or reading/parsing files. Those are all YOU.
15
11
 
16
- **Subagents ARE for:**
17
- - Scoped implementation work with clean context
18
- - Complex creative tasks that benefit from fresh context
19
- - Parallel specialist work (Code, QA, Reviewer)
12
+ **Subagents ARE for:** scoped implementation (Code), writing new tests (QA), diff review (Reviewer), architectural design (Architect), or a context handoff when your own context is unwieldy AND you have already made the decisions.
20
13
 
21
- ---
22
-
23
- ## When to Spawn a Subagent: Decision Tree
24
-
25
- ```
26
- ┌─────────────────────────────────────────────────────────────┐
27
- │ IS THE TASK... │
28
- └─────────────────────────────────────────────────────────────┘
29
-
30
-
31
- ┌────────────────────────────────────┐
32
- │ A shell command that returns text? │ → YES → YOU RUN IT (no subagent)
33
- └────────────────────────────────────┘
34
- │ NO
35
-
36
- ┌────────────────────────────────────┐
37
- │ Reading/parsing files or output? │ → YES → YOU DO IT (no subagent)
38
- └────────────────────────────────────┘
39
- │ NO
40
-
41
- ┌────────────────────────────────────┐
42
- │ A judgment call or decision? │ → YES → YOU DECIDE (no subagent)
43
- └────────────────────────────────────┘
44
- │ NO
45
-
46
- ┌────────────────────────────────────┐
47
- │ "Manage my context" or "compact"? │ → YES → YOU HANDLE (never subagent!)
48
- └────────────────────────────────────┘
49
- │ NO
50
-
51
- ┌────────────────────────────────────┐
52
- │ Implementation (editing files)? │ → YES → Spawn Code Agent
53
- └────────────────────────────────────┘
54
- │ NO
55
-
56
- ┌────────────────────────────────────┐
57
- │ Writing new test files? │ → YES → Spawn QA Agent
58
- └────────────────────────────────────┘
59
- │ NO
60
-
61
- ┌────────────────────────────────────┐
62
- │ Reviewing code/diff? │ → YES → Spawn Reviewer Agent
63
- └────────────────────────────────────┘
64
- │ NO
65
-
66
- ┌────────────────────────────────────┐
67
- │ Architectural design? │ → YES → Spawn Architect Agent
68
- └────────────────────────────────────┘
69
- │ NO
70
-
71
- ┌──────────────────────────────────────────────────────────┐
72
- │ Deep multi-step implementation requiring fresh context? │
73
- │ (your context is unwieldy/circular) │ → YES → See "Context Handoff" below
74
- └──────────────────────────────────────────────────────────┘
75
- │ NO
76
-
77
- [YOU DO IT DIRECTLY]
78
- ```
79
-
80
- ---
81
-
82
- ## Context Handoff: When Your Context Is Unwieldy
83
-
84
- ### Signs You Need a Context Handoff
85
-
86
- - ✅ You've been working on the same task for 20+ exchanges
87
- - ✅ You're going in circles (repeating same analysis)
88
- - ✅ Your context is full of irrelevant exploration from earlier
89
- - ✅ You need to implement a complex multi-file change
90
- - ✅ You've made the key decisions and need clean context to execute
91
-
92
- ### Signs You DON'T Need a Context Handoff
93
-
94
- - ❌ You just need to run a test (`npm test` → run it yourself)
95
- - ❌ You need to decide what to do next (you decide, don't delegate)
96
- - ❌ You want to "compact" your context (manage it yourself)
97
- - ❌ The task is 1-3 simple file edits (do it yourself or use Code Agent)
98
- - ❌ You haven't decided on the approach yet (decide first, then hand off)
99
-
100
- ### How to Do a Context Handoff
101
-
102
- **BEFORE spawning subagent:**
103
-
104
- 1. **Update CONTEXT.md** (see template below) with:
105
- - Main task goal
106
- - Key decisions made
107
- - Files/modules involved
108
- - Current status
109
- - What remains
110
-
111
- 2. **Decide the EXACT next action** — never hand off "figure out what to do"
112
-
113
- 3. **Write a detailed subagent brief** (see "Briefing Template" below)
114
-
115
- 4. **Spawn subagent with scoped task** — not "do everything" but "implement X using Y"
116
-
117
- **AFTER subagent returns:**
118
-
119
- 1. **Update CONTEXT.md** with what was completed
120
- 2. **Verify the result yourself** (run tests, check diffs)
121
- 3. **Continue to next step** or mark task [x]
122
-
123
- ---
124
-
125
- ## CONTEXT.md Template
126
-
127
- Create `CONTEXT.md` in your workspace root when starting complex multi-step tasks:
128
-
129
- ```markdown
130
- # CONTEXT.md — Main Task Tracking
131
-
132
- > **Purpose:** Keep track of the main task goal and prevent getting lost in deep subtasks.
133
- > **Update:** After every major decision, subagent spawn, or context shift.
134
-
135
- ---
136
-
137
- ## Main Task
138
-
139
- **Goal:** [One-sentence description of the main task]
140
-
141
- **Status:** [Not Started / In Progress / Blocked / Completed]
142
-
143
- **TODO.md Task Line:**
144
- ```
145
- - [~] feat: implement user authentication system
146
- ```
147
-
148
- ---
149
-
150
- ## Key Decisions Made
151
-
152
- 1. **[Date/Time]** Decision: [What was decided]
153
- - Reasoning: [Why this choice]
154
- - Alternative considered: [What was rejected and why]
155
-
156
- 2. **[Date/Time]** Decision: ...
157
-
158
- ---
159
-
160
- ## Architecture/Approach
161
-
162
- [High-level description of the chosen approach]
163
-
164
- **Files/Modules Involved:**
165
- - `src/auth/login.ts` — handles login flow
166
- - `src/auth/session.ts` — manages session state
167
- - `src/api/auth-routes.ts` — API endpoints
168
-
169
- **Key Patterns/Conventions:**
170
- - Using JWT for tokens
171
- - Sessions stored in Redis
172
- - Following existing error handling pattern from `src/errors/`
173
-
174
- ---
175
-
176
- ## Progress Tracker
177
-
178
- ### Completed
179
- - [x] 2026-05-25 Researched existing auth patterns in codebase
180
- - [x] 2026-05-25 Decided on JWT + Redis approach
181
- - [x] 2026-05-25 Spawned Code Agent to implement login.ts
182
-
183
- ### In Progress
184
- - [~] Verify login.ts implementation
185
- - [~] Run integration tests
186
-
187
- ### Remaining
188
- - [ ] Implement session.ts
189
- - [ ] Implement auth-routes.ts
190
- - [ ] Add integration tests
191
- - [ ] Update documentation
192
-
193
- ---
194
-
195
- ## Subagent Spawns
196
-
197
- ### Spawn 1: Code Agent — Implement login.ts
198
- **When:** 2026-05-25 14:30
199
- **Brief:** [See full brief below]
200
- **Result:** Implemented login.ts with JWT generation
201
- **Verified:** ✅ Tests pass, linter clean
202
-
203
- ### Spawn 2: QA Agent — Write integration tests
204
- **When:** 2026-05-25 15:00
205
- **Brief:** [See full brief below]
206
- **Result:** [Pending]
207
- **Verified:** [Pending]
208
-
209
- ---
210
-
211
- ## Blockers / Issues
212
-
213
- - **[Date]** Blocker: [Description]
214
- - Status: [Open / Resolved]
215
- - Resolution: [How it was resolved]
216
-
217
- ---
218
-
219
- ## Context Checkpoints
220
-
221
- Use these checkpoints to verify you're still on track:
222
-
223
- 1. **Can you state the main goal in one sentence?** [Yes/No - if no, re-read above]
224
- 2. **Do you know the next concrete action?** [Yes/No - if no, review Progress Tracker]
225
- 3. **Have you strayed into unrelated work?** [Yes/No - if yes, refocus on main goal]
226
- 4. **Is there a clearer path than current approach?** [Yes/No - if yes, update Decisions]
227
-
228
- ---
229
-
230
- ## Notes / Learnings
231
-
232
- [Add any important discoveries, gotchas, or learnings that should be remembered]
233
-
234
- ```
235
-
236
- ---
237
-
238
- ## Subagent Briefing Template
239
-
240
- When spawning a subagent for a complex task, use this template:
241
-
242
- ```markdown
243
- # Subagent Brief: [Agent Type] — [Task Summary]
244
-
245
- ## MISSION (one sentence)
246
- [Exactly what this subagent must accomplish]
247
-
248
- ## CONTEXT
249
- [Only the relevant context — not your entire history]
250
-
251
- **Main Task:** [Link back to the overall goal]
252
-
253
- **Decisions Already Made:**
254
- - [Key decision 1]
255
- - [Key decision 2]
256
-
257
- **Files/Modules Relevant to This Subtask:**
258
- - `path/to/file.ts` — [why relevant]
259
- - `path/to/test.ts` — [why relevant]
260
-
261
- ## WHAT TO IMPLEMENT
262
-
263
- **Goal:** [Specific implementation goal]
264
-
265
- **Approach:** [The exact approach to use — no ambiguity]
266
- - Step 1: [Concrete action]
267
- - Step 2: [Concrete action]
268
- - Step 3: [Concrete action]
269
-
270
- **Files to Edit:**
271
- 1. `path/to/file1.ts`
272
- - Add: [specific functionality]
273
- - Modify: [specific section]
274
- - Use pattern: [reference to existing pattern]
275
-
276
- 2. `path/to/file2.ts`
277
- - Add: [specific functionality]
278
-
279
- **Patterns to Follow:**
280
- - Error handling: Use `src/errors/AppError.ts` pattern
281
- - Testing: Follow `__tests__/example.test.ts` structure
282
- - Imports: Use absolute paths from `src/`
283
-
284
- **DO:**
285
- - Follow existing code style in the files
286
- - Add JSDoc comments for public functions
287
- - Write type-safe TypeScript (no `any`)
288
- - Handle errors explicitly
289
-
290
- **DON'T:**
291
- - Change unrelated code
292
- - Add libraries without checking existing stack
293
- - Skip edge case handling
294
- - Leave TODOs in production code
295
-
296
- ## DONE CRITERIA
297
-
298
- This subtask is complete when:
299
- 1. [Specific criterion 1]
300
- 2. [Specific criterion 2]
301
- 3. [Specific criterion 3]
302
- 4. All edits are syntactically valid (no compilation errors)
303
-
304
- ## AFTER YOU'RE DONE
305
-
306
- Return:
307
- 1. **Files changed:** List of file paths
308
- 2. **Summary:** What was implemented (2-3 sentences)
309
- 3. **Any issues:** Blockers, ambiguities, or decisions made
310
-
311
- DO NOT:
312
- - Run tests (orchestrator does this)
313
- - Run linters (orchestrator does this)
314
- - Verify the full feature (orchestrator does this)
315
- - Update TODO.md (orchestrator does this)
316
- ```
317
-
318
- ---
319
-
320
- ## Anti-Patterns: NEVER Do These
321
-
322
- ### ❌ WRONG: Spawning subagent to compact context
323
-
324
- ```
325
- ❌ "My context is full. Let me spawn a subagent to continue."
326
- ```
327
-
328
- **Why wrong:** The subagent starts with EMPTY context. It will compact its own empty context, not yours. Infinite loop.
329
-
330
- **✅ RIGHT:** YOU decide what to keep. Update CONTEXT.md. Summarize decisions. THEN spawn subagent with scoped task.
331
-
332
- ---
333
-
334
- ### ❌ WRONG: Spawning subagent to decide next step
335
-
336
- ```
337
- ❌ "I'm not sure what to do next. Let me spawn a subagent to figure it out."
338
- ```
339
-
340
- **Why wrong:** YOU are the orchestrator. YOU make decisions. Subagents execute scoped tasks.
341
-
342
- **✅ RIGHT:** Re-read CONTEXT.md. Review Progress Tracker. Decide next action. THEN spawn subagent with specific task.
343
-
344
- ---
345
-
346
- ### ❌ WRONG: Spawning subagent to run tests
347
-
348
- ```
349
- ❌ "Let me spawn a subagent to run `npm test` and tell me the results."
350
- ```
351
-
352
- **Why wrong:** Running tests is a deterministic shell command. You run it directly.
353
-
354
- **✅ RIGHT:** Run `npm test` yourself. Analyze output yourself. Decide on fix. THEN spawn Code Agent to implement fix.
355
-
356
- ---
357
-
358
- ### ❌ WRONG: Vague subagent brief
359
-
360
- ```
361
- ❌ "Implement the authentication feature. Figure out the best approach."
362
- ```
363
-
364
- **Why wrong:** Subagent doesn't have your context. It will re-explore everything you already researched. Wastes tokens and time.
365
-
366
- **✅ RIGHT:**
367
- - YOU decide the approach (JWT + Redis)
368
- - YOU identify files to edit (`login.ts`, `session.ts`)
369
- - YOU specify the pattern to follow (existing error handling)
370
- - THEN spawn subagent with detailed brief (see template above)
371
-
372
- ---
373
-
374
- ## Workflow: Managing Context in Complex Tasks
375
-
376
- ```
377
- ┌────────────────────────────────────────────────────────────────┐
378
- │ START: Complex multi-step task │
379
- └────────────────────────────────────────────────────────────────┘
380
-
381
-
382
- ┌────────────────────────────────────────────────────────────────┐
383
- │ 1. CREATE CONTEXT.md │
384
- │ - Write main goal │
385
- │ - Set up Progress Tracker │
386
- └────────────────────────────────────────────────────────────────┘
387
-
388
-
389
- ┌────────────────────────────────────────────────────────────────┐
390
- │ 2. RESEARCH & DECIDE │
391
- │ - Read relevant files │
392
- │ - Explore codebase │
393
- │ - Make key decisions │
394
- │ - UPDATE CONTEXT.md with decisions │
395
- └────────────────────────────────────────────────────────────────┘
396
-
397
-
398
- ┌────────────────────────────────────────────────────────────────┐
399
- │ 3. BREAK DOWN INTO SUBTASKS │
400
- │ - Write subtasks in TODO.md │
401
- │ - Update CONTEXT.md Progress Tracker │
402
- └────────────────────────────────────────────────────────────────┘
403
-
404
-
405
- ┌────────────────────────────────────────────────────────────────┐
406
- │ 4. FOR EACH SUBTASK: │
407
- │ ┌─────────────────────────────────────────────────────┐ │
408
- │ │ 4a. Check: Can I do this directly? (1-3 file edits) │ │
409
- │ │ → YES: Do it yourself │ │
410
- │ │ → NO: Continue to 4b │ │
411
- │ └─────────────────────────────────────────────────────┘ │
412
- │ ┌─────────────────────────────────────────────────────┐ │
413
- │ │ 4b. Write detailed subagent brief (use template) │ │
414
- │ └─────────────────────────────────────────────────────┘ │
415
- │ ┌─────────────────────────────────────────────────────┐ │
416
- │ │ 4c. Spawn subagent with scoped task │ │
417
- │ └─────────────────────────────────────────────────────┘ │
418
- │ ┌─────────────────────────────────────────────────────┐ │
419
- │ │ 4d. UPDATE CONTEXT.md with spawn details │ │
420
- │ └─────────────────────────────────────────────────────┘ │
421
- │ ┌─────────────────────────────────────────────────────┐ │
422
- │ │ 4e. Receive result from subagent │ │
423
- │ └─────────────────────────────────────────────────────┘ │
424
- │ ┌─────────────────────────────────────────────────────┐ │
425
- │ │ 4f. YOU verify (tests, lint, build) │ │
426
- │ └─────────────────────────────────────────────────────┘ │
427
- │ ┌─────────────────────────────────────────────────────┐ │
428
- │ │ 4g. UPDATE CONTEXT.md Progress Tracker │ │
429
- │ └─────────────────────────────────────────────────────┘ │
430
- └────────────────────────────────────────────────────────────────┘
431
-
432
-
433
- ┌────────────────────────────────────────────────────────────────┐
434
- │ 5. CHECKPOINT: Review CONTEXT.md │
435
- │ - Am I still on track for main goal? │
436
- │ - Have I strayed into unrelated work? │
437
- │ - Is the approach still valid? │
438
- └────────────────────────────────────────────────────────────────┘
439
-
440
-
441
- ┌────────────────────────────────────────────────────────────────┐
442
- │ 6. COMPLETE: All subtasks done │
443
- │ - Mark main task [x] │
444
- │ - Archive CONTEXT.md → DONE_CONTEXT_YYYY-MM-DD.md │
445
- │ - Commit │
446
- └────────────────────────────────────────────────────────────────┘
447
- ```
448
-
449
- ---
450
-
451
- ## Quick Reference: Subagent Dispatch Rules
452
-
453
- | Task Type | Who Does It | Notes |
454
- |-----------|-------------|-------|
455
- | Run `npm test` | **YOU** | Never spawn subagent for shell commands |
456
- | Run `eslint` | **YOU** | Never spawn subagent for linters |
457
- | Run `npm run build` | **YOU** | Never spawn subagent for builds |
458
- | Read files | **YOU** | Never spawn subagent to read/parse |
459
- | Grep/search codebase | **YOU** | Use grep_search/semantic_search directly |
460
- | Analyze test output | **YOU** | Never spawn subagent to interpret output |
461
- | Decide what to do next | **YOU** | Never spawn subagent to make decisions |
462
- | Manage context | **YOU** | Never spawn subagent to compact YOUR context |
463
- | Edit 1-3 files (simple) | **YOU** | Direct edits faster than subagent |
464
- | Edit 5+ files (complex) | **Code Agent** | Spawn with detailed brief |
465
- | Multi-file refactor | **Code Agent** | One file at a time, or spawn with full context |
466
- | Write new test files | **QA Agent** | Spawn with spec and patterns to follow |
467
- | Review code/diff | **Reviewer Agent** | Spawn after changes complete |
468
- | Architectural design | **Architect Agent** | Spawn with requirements and constraints |
469
- | Context handoff | **Code Agent** | When YOUR context unwieldy + decisions made |
470
-
471
- ---
472
-
473
- ## Success Metrics
474
-
475
- You're using subagents correctly when:
476
-
477
- ✅ Subagents receive detailed, specific briefs (not "figure it out")
478
- ✅ You update CONTEXT.md before and after subagent spawns
479
- ✅ You never spawn subagents to run commands or read files
480
- ✅ You verify all subagent work yourself (tests, lint, diff review)
481
- ✅ You stay on track with the main goal (no context drift)
482
- ✅ Subagents work on scoped tasks with clean context
483
- ✅ You make all decisions; subagents execute decisions
484
-
485
- You're doing it WRONG when:
486
-
487
- ❌ Spawning subagent to "compact my context"
488
- ❌ Spawning subagent to "figure out what to do"
489
- ❌ Spawning subagent to run tests or linters
490
- ❌ Giving vague briefs like "implement feature X"
491
- ❌ Losing track of main goal after deep subtasks
492
- ❌ Forgetting to update CONTEXT.md
493
- ❌ Repeating research that you already did
494
-
495
- ---
496
-
497
- ## Integration with Core Loop
498
-
499
- This skill integrates with the **autodev-core-loop** skill:
14
+ **Before spawning any subagent:**
15
+ 1. Decide the EXACT next action yourself — never hand off "figure out what to do".
16
+ 2. Write a detailed brief: MISSION (one sentence) · CONTEXT (only what's relevant: main goal, decisions already made, relevant files + why) · WHAT TO IMPLEMENT (exact approach, files to edit, patterns to follow, DO/DON'T) · DONE CRITERIA.
17
+ 3. Tell the subagent NOT to run tests/lints/builds or update `TODO.md` — the Orchestrator does that.
500
18
 
501
- - **Before Step 4 (THINK & PLAN):** Check if this is a context-heavy task create CONTEXT.md
502
- - **During Step 4 (THINK & PLAN):** Make decisions, update CONTEXT.md
503
- - **During Step 5 (DISPATCH):** Use briefing template for complex tasks
504
- - **After Step 6 (RECEIVE):** Update CONTEXT.md with result
505
- - **During Step 7 (VERIFY):** Reference CONTEXT.md to ensure main goal still on track
506
- - **After Step 8 (RE-READ TODO.md):** Check CONTEXT.md before picking next task
19
+ **After it returns:** YOU verify (tests, lint, diff review) and update state.
507
20
 
508
- **Never let subagent management override the core loop. The loop is primary.**
21
+ **Context handoff** spawn only when: 20+ exchanges on one task · going in circles · context full of stale exploration · a complex multi-file change with decisions already made. NOT for: running a test, deciding the next step, "compacting", or 1–3 simple edits (do those yourself).
509
22
 
23
+ **CONTEXT.md** — for complex multi-step tasks create `CONTEXT.md` (main goal · key decisions · files/approach · progress tracker · subagent spawns · blockers) to avoid losing the main goal during deep work. Update it before/after every spawn; checkpoint against it (can I state the goal in one sentence? do I know the next action? have I strayed?). Archive to `DONE_CONTEXT_YYYY-MM-DD.md` when done.
510
24
 
25
+ Integrates with skill `autodev-core-loop` — the loop stays primary; never let subagent management override it.
@@ -1,56 +1,30 @@
1
1
  ## 0.20 Project Graph — Durable Shared Memory (`.autodev/graph/`)
2
2
 
3
- **The agent forgets, the graph does not.** The project graph is a typed, queryable
4
- graph of the project's facts and work, persisted at `.autodev/graph/graph.jsonl`
5
- **relative to the project dir**. It survives your session and is **shared by every
6
- agent** in the workspace what one agent learns, the swarm can read.
7
-
8
- > **Graph ≠ memory.** The file memory (`.autodev/memories/`, §0.2) is prose recall
9
- > for *you*. The graph is *structured, sourced, versioned* facts for *everyone*,
10
- > across sessions. Use both: memory for narrative, the graph for the shared world model.
11
-
12
- ### Tools (in the mcp-operate tool list available to every provider)
13
-
14
- | Tool | Use it to |
15
- |---|---|
16
- | `graph_neighbors` | **At task start** resolve an entity/node by id or name and expand 1–3 hops to recall what's already known *before* acting. This is context construction, not a dump. |
17
- | `graph_query` | Search nodes by type and/or text; returns ids to expand or link. |
18
- | `graph_add_node` | Record a typed fact and get its id. |
19
- | `graph_add_edge` | Link two nodes with a typed, sourced relationship. |
20
- | `graph_supersede` | Version a fact that changed (old node stays addressable). |
21
- | `graph_stats` | Health check — gaps, isolated nodes, contradictions, open questions. |
3
+ **The agent forgets, the graph does not.** A typed, sourced, versioned graph of the
4
+ project's facts/work at `.autodev/graph/graph.jsonl` — **shared by every agent**,
5
+ surviving sessions. **Graph memory** (§0.2): memory is prose recall for *you*; the
6
+ graph is the structured world model for *everyone*. Full tool docs live in each tool's
7
+ own description — this is the when/why.
8
+
9
+ ### Tools (mcp-operate every provider)
10
+ - `graph_map` **cold start, no id in hand.** Pinned core + top hubs + open questions + fresh decisions + live contradictions. "Where do I start."
11
+ - `graph_toc` — navigable table-of-contents tree (spine = `parent_of`, auto-built from `file:line` sources); `root=<id>` drills a branch.
12
+ - `graph_search` reasoning-based, citable retrieval: give an `intent`, get a ranked bundle each citing `[id]` + why. *You* reason over the summaries.
13
+ - `graph_neighbors` — at task start, expand an id/name 1–3 hops (ranked, token-budgeted, contradictions flagged). `summarize:true` returns a branch's rollup.
14
+ - `graph_query` relevance-ranked search by type/text (vectorless; `mode:'recent'` for pure recency).
15
+ - `graph_add_node` — record a typed fact; **pass a one-line `summary`** on substantial nodes; cite a `file:line` `source` (auto-builds the tree); `pinned:true`/`props.area` optional.
16
+ - `graph_add_edge` — typed, sourced link (validated against the edge ontology).
17
+ - `graph_supersede` version a changed fact (old stays addressable). `graph_rollup` summary node for a cluster. `graph_pin` — mark a core invariant. `graph_stats` — health/telemetry.
22
18
 
23
19
  ### Schema
20
+ Nodes: entity · claim · source · artifact · agent_run · evaluation · task · commit · metric · note · question · decision. Entities dedupe by a canonical token-set key (`UsageService` = `usage-service` = `usage service`). Edges: mentions · supports · contradicts · derived_from · produced · evaluates · revises · supersedes · depends_on · parent_of · resolved_to · relates_to.
24
21
 
25
- **Node types:** `entity` · `claim` · `source` · `artifact` · `agent_run` ·
26
- `evaluation` · `task` · `commit` · `metric` · `note` · `question` · `decision`.
27
- Entities dedupe by name (idempotent — re-adding merges aliases), so resolve real
28
- things (services, files, people, modules) as entities.
29
-
30
- **Edge types:** `mentions` · `supports` · `contradicts` · `derived_from` ·
31
- `produced` · `evaluates` · `revises` · `supersedes` · `depends_on` · `parent_of` ·
32
- `resolved_to` · `relates_to`.
33
-
34
- ### Invariants (enforced on write — a rejected write tells you what to add)
35
-
36
- 1. Every **claim** has a `source` (`"file:line"` / url / source-node id) **or** `inference: true`.
37
- 2. Every **artifact** has a `version`.
38
- 3. Every **evaluation** names the `rubric` it judged against.
39
- 4. **Superseded nodes are never deleted** — they stay addressable; `graph_supersede` links the replacement with a `supersedes` edge.
40
-
41
- Provenance (your run id + agent id + timestamp) is attached to every write automatically.
42
-
43
- ### How it folds into the core loop
22
+ ### Invariants (enforced on write)
23
+ 1. A **claim** needs a `source` (`file:line`/url/id) or `inference:true`. 2. An **artifact** needs a `version`. 3. An **evaluation** needs a `rubric`. 4. Superseded nodes are **never deleted** (stay addressable). Provenance (run+agent+ts) is auto-attached.
44
24
 
45
- - **Start of a non-trivial task:** `graph_neighbors` on the entities in the task to
46
- load prior claims, decisions, and artifacts. Don't rebuild the world from scratch.
47
- - **While working:** record what you learn as you learn it
48
- `claim`s (with a source), `decision`s (what/why), `artifact`s (with version),
49
- `evaluation`s (with rubric), and the `entity`s/`task`s they concern. Link them
50
- (`supports`, `contradicts`, `depends_on`, `produced`, `derived_from`, …).
51
- - **When a fact changes:** `graph_supersede` rather than overwrite — keep the history.
52
- - **Open questions & conflicts:** add a `question` node, or a `contradicts` edge, so
53
- the next agent picks it up. Run `graph_stats` to find isolated/unlinked facts.
25
+ ### Loop-fold
26
+ - **Task start:** know the entity → `graph_neighbors`; don't `graph_map` or `graph_search <intent>`. Recall before acting.
27
+ - **While working:** record facts as you learn them claims (with source), decisions (what/why), artifacts (with version), evaluations (with rubric) and link them. Cite `file:line` so the tree fills itself; pass a `summary`.
28
+ - **Changed fact:** `graph_supersede`, don't overwrite. **Conflicts/unknowns:** add a `question` node or a `contradicts` edge. Pin a *few* core invariants.
54
29
 
55
- **Goal:** every important output is traceable to an objective, a source, a graph path,
56
- an evaluation, and a run. When that holds, the swarm's memory compounds instead of resetting.
30
+ **Goal:** every important output traces to an objective, a source, a graph path, an evaluation, and a run — so the swarm's memory compounds instead of resetting.