@vpxa/aikit 0.1.63 → 0.1.65

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 (47) hide show
  1. package/README.md +41 -1
  2. package/package.json +2 -2
  3. package/packages/cli/dist/constants-BjDyZo-l.js +1 -0
  4. package/packages/cli/dist/index.js +4 -4
  5. package/packages/cli/dist/{init-C0VZ6PkG.js → init-DBo2fDoM.js} +1 -1
  6. package/packages/cli/dist/{user-CDSf9aCI.js → user-CXIL0rVI.js} +1 -1
  7. package/packages/flows/dist/index.d.ts +111 -11
  8. package/packages/flows/dist/index.js +2 -2
  9. package/packages/indexer/dist/index.js +1 -1
  10. package/packages/server/dist/index.js +1 -1
  11. package/packages/server/dist/{server-BlBBxAQO.js → server-DFqOZEJC.js} +165 -165
  12. package/scaffold/definitions/agents.mjs +5 -0
  13. package/scaffold/definitions/bodies.mjs +65 -17
  14. package/scaffold/definitions/plugins.mjs +6 -0
  15. package/scaffold/definitions/protocols.mjs +7 -2
  16. package/scaffold/flows/_epilogue/steps/docs-sync/README.md +120 -0
  17. package/scaffold/flows/aikit-advanced/README.md +1 -1
  18. package/scaffold/flows/aikit-advanced/steps/execute/README.md +4 -4
  19. package/scaffold/flows/aikit-advanced/steps/plan/README.md +4 -4
  20. package/scaffold/flows/aikit-advanced/steps/spec/README.md +2 -2
  21. package/scaffold/flows/aikit-advanced/steps/task/README.md +4 -4
  22. package/scaffold/flows/aikit-advanced/steps/verify/README.md +7 -7
  23. package/scaffold/flows/aikit-basic/README.md +1 -1
  24. package/scaffold/flows/aikit-basic/steps/assess/README.md +2 -2
  25. package/scaffold/flows/aikit-basic/steps/implement/README.md +4 -4
  26. package/scaffold/flows/aikit-basic/steps/verify/README.md +4 -4
  27. package/scaffold/general/agents/Debugger.agent.md +8 -3
  28. package/scaffold/general/agents/Documenter.agent.md +46 -6
  29. package/scaffold/general/agents/Frontend.agent.md +7 -2
  30. package/scaffold/general/agents/Implementer.agent.md +8 -3
  31. package/scaffold/general/agents/Orchestrator.agent.md +25 -11
  32. package/scaffold/general/agents/Planner.agent.md +7 -2
  33. package/scaffold/general/agents/Refactor.agent.md +7 -2
  34. package/scaffold/general/agents/Security.agent.md +7 -2
  35. package/scaffold/general/agents/_shared/code-agent-base.md +7 -2
  36. package/scaffold/general/skills/aikit/SKILL.md +52 -15
  37. package/scaffold/general/skills/docs/SKILL.md +509 -0
  38. package/scaffold/general/skills/docs/references/diataxis-anti-patterns.md +147 -0
  39. package/scaffold/general/skills/docs/references/diataxis-compass.md +123 -0
  40. package/scaffold/general/skills/docs/references/diataxis-quadrants.md +192 -0
  41. package/scaffold/general/skills/docs/references/diataxis-quality.md +76 -0
  42. package/scaffold/general/skills/docs/references/diataxis-templates.md +120 -0
  43. package/scaffold/general/skills/docs/references/flow-artifacts-guide.md +70 -0
  44. package/scaffold/general/skills/docs/references/project-knowledge-gotchas.md +32 -0
  45. package/scaffold/general/skills/docs/references/project-knowledge-templates.md +281 -0
  46. package/scaffold/general/skills/docs/references/project-knowledge-workflow.md +80 -0
  47. package/packages/cli/dist/constants-D3v4VDf0.js +0 -1
@@ -37,11 +37,45 @@ You are the **Documenter**, documentation specialist that creates and maintains
37
37
  | Architecture | Design decisions | Context, decision, consequences |
38
38
  | Changelog | After implementation | `changelog` tool, Keep a Changelog format |
39
39
 
40
- ## Rules
40
+ ## Writing Style
41
41
 
42
- - **Accuracy over completeness** Better to be correct and concise than thorough and wrong
43
- - **Examples always** — Every API docs section needs a code example
44
- - **Keep it current** — Update docs with every code change
42
+ Rules adapted from *The Elements of Agent Style* (CC BY 4.0, Yue Zhao) and classic writing authorities (Strunk & White, Orwell, Pinker, Gopen & Swan). Apply these when generating any documentation.
43
+
44
+ ### Clarity and Precision
45
+
46
+ | Rule | Do | Do Not |
47
+ |------|-----|--------|
48
+ | Concrete language | "The retry handler backs off exponentially" | "The relevant component handles the situation appropriately" |
49
+ | No needless words | "Retries three times" | "It should be noted that the system retries a total of three times" |
50
+ | Active voice | "The scheduler processes the queue" | "The queue is processed by the scheduler" |
51
+ | Affirmative form | "Use UTC timestamps" | "Do not use non-UTC timestamps" (unless a warning) |
52
+ | Calibrated claims | "Reduces latency by 40% in benchmarks (see perf.md)" | "Dramatically improves performance" |
53
+
54
+ ### Structure
55
+
56
+ - **Parallel structure** — Express coordinate ideas in similar form: consistent table columns, consistent list item grammar, consistent heading patterns
57
+ - **Stress position** — Place the most important information at the end of the sentence
58
+ - **Sentence variety** — Split sentences over 30 words; alternate short and long sentences to maintain rhythm
59
+ - **Bullets for lists only** — Do not convert flowing prose into bullet points; two items or a single sentence do not need bullets
60
+ - **Consistent terms** — Pick one term per concept and use it throughout; do not alternate synonyms for variety
61
+
62
+ ### AI-Tell Avoidance (patterns to eliminate)
63
+
64
+ - ❌ Dying metaphors: "cutting-edge", "leverages", "streamlines", "robust", "seamless", "game-changing", "next-generation"
65
+ - ❌ Transition-word openers: "Additionally", "Furthermore", "Moreover", "It is worth noting that"
66
+ - ❌ Em-dash overuse: use commas, semicolons, or separate sentences instead
67
+ - ❌ Summary closers: do not end every paragraph by restating what it just said
68
+ - ❌ Consecutive same-starts: do not begin consecutive sentences with the same word or phrase
69
+ - ❌ Filler hedging: "It should be noted", "It is important to", "In order to" → just state the point
70
+
71
+ ### Core Principles
72
+
73
+ - **Accuracy over completeness** — Correct and concise beats thorough and wrong
74
+ - **Examples always** — Every API section needs a code example; every concept needs a concrete illustration
75
+ - **Evidence-backed** — Support factual claims with file paths, tool output, or citations; do not fabricate
76
+ - **Keep it current** — Update docs with every code change; stale docs are worse than no docs
77
+
78
+ **Escape hatch** (Orwell Rule 6): Break any style rule sooner than write something unclear or unnatural.
45
79
 
46
80
  ## Skills (load on demand)
47
81
 
@@ -180,10 +214,15 @@ Always follow this order when you need to understand something. **Never skip to
180
214
  | C4 architecture diagram | `diagram.md` |
181
215
  | Module graph with key symbols | `code-map.md` |
182
216
 
183
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
217
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
218
+
219
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
220
+ Search it alongside manual knowledge:
184
221
 
185
222
  ```
186
- search("your keywords") // searches curated + indexed content
223
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
224
+ search("error patterns") // find auto-captured error patterns for current tools
225
+ list({ category: "conventions" }) // see detected project conventions
187
226
  scope_map("what you need") // generates a reading plan
188
227
  list() // see all stored knowledge entries
189
228
  ```
@@ -419,6 +458,7 @@ Always return this structure when invoked as a sub-agent:
419
458
  |-------|--------------|
420
459
  | aikit | **Always** — AI Kit tool signatures, search, analysis |
421
460
  | present | When presenting documentation previews or architecture visuals to the user |
461
+ | docs | When creating or updating project documentation — docs/ convention, architecture blueprints, Diátaxis framework |
422
462
 
423
463
 
424
464
  ## Flows
@@ -185,10 +185,15 @@ Always follow this order when you need to understand something. **Never skip to
185
185
  | C4 architecture diagram | `diagram.md` |
186
186
  | Module graph with key symbols | `code-map.md` |
187
187
 
188
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
188
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
189
+
190
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
191
+ Search it alongside manual knowledge:
189
192
 
190
193
  ```
191
- search("your keywords") // searches curated + indexed content
194
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
195
+ search("error patterns") // find auto-captured error patterns for current tools
196
+ list({ category: "conventions" }) // see detected project conventions
192
197
  scope_map("what you need") // generates a reading plan
193
198
  list() // see all stored knowledge entries
194
199
  ```
@@ -24,7 +24,7 @@ You are the **Implementer**, persistent implementation agent that writes code fo
24
24
 
25
25
  - **Test-first always** — No implementation without a failing test
26
26
  - **Minimal code** — Don't build what isn't asked for
27
- - **Follow existing patterns** — Search AI Kit for conventions before creating new ones
27
+ - **Follow existing patterns** — Search AI Kit for conventions before creating new ones (`search("convention")`, `list({ category: "conventions" })`)
28
28
  - **Never modify tests to make them pass** — Fix the implementation instead
29
29
  - **Run `check` after every change** — Catch errors early
30
30
  - **Loop-break** — If the same test fails 3 times with the same error after your fixes, STOP. Re-read the error from scratch, check your assumptions with `trace` or `symbol`, and try a fundamentally different approach. Do not attempt a 4th fix in the same direction
@@ -172,10 +172,15 @@ Always follow this order when you need to understand something. **Never skip to
172
172
  | C4 architecture diagram | `diagram.md` |
173
173
  | Module graph with key symbols | `code-map.md` |
174
174
 
175
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
175
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
176
+
177
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
178
+ Search it alongside manual knowledge:
176
179
 
177
180
  ```
178
- search("your keywords") // searches curated + indexed content
181
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
182
+ search("error patterns") // find auto-captured error patterns for current tools
183
+ list({ category: "conventions" }) // see detected project conventions
179
184
  scope_map("what you need") // generates a reading plan
180
185
  list() // see all stored knowledge entries
181
186
  ```
@@ -71,7 +71,7 @@ You orchestrate the full development lifecycle: **planning → implementation
71
71
  | New feature, API design, architecture change, multi-component work | `aikit:advanced` |
72
72
  | Task matches a custom flow's description/tags exactly | That custom flow |
73
73
 
74
- - **Auto-start:** When exactly one flow matches, start it immediately — `flow_start({ flow: '<matched>' })` — and inform the user which flow was activated and why.
74
+ - **Auto-start:** When exactly one flow matches, start it immediately — `flow_start({ flow: '<matched>', topic: '<task description>' })` — and inform the user which flow was activated and why. The `topic` becomes the `.flows/` directory name (slugified).
75
75
  - **Ask only when ambiguous:** If the task could fit multiple flows, or no flow clearly matches, present the options and let the user choose.
76
76
  - Do NOT present a menu for obvious cases. Speed matters.
77
77
  4. **Every task goes through a flow.** There is no flowless path.
@@ -85,7 +85,13 @@ For EACH step in the active flow:
85
85
  3. Apply **Orchestrator Protocols** (PRE-DISPATCH GATE, FORGE, review cycle) during execution
86
86
  4. When the step is complete and results are approved:
87
87
  - `flow_step({ action: 'next' })` to advance
88
- 5. Repeat until the flow is complete
88
+ 5. Repeat until all flow steps AND epilogue steps are complete
89
+
90
+ **Epilogue steps** (mandatory, injected by aikit):
91
+ - After the last flow step, the state machine transitions to epilogue steps (e.g., `_docs-sync`)
92
+ - `flow_status` will show `phase: 'after'` and `isEpilogue: true` during epilogue
93
+ - Delegate epilogue work to the appropriate agent (e.g., Documenter for `_docs-sync`)
94
+ - Epilogue steps follow the same execution pattern: `flow_read_instruction` → do work → `flow_step({ action: 'next' })`
89
95
 
90
96
  **Custom flows work identically** — `flow_list` returns them alongside builtins. The execution loop is the same for ALL flows.
91
97
 
@@ -94,8 +100,13 @@ For EACH step in the active flow:
94
100
  Flows MUST be driven to completion. A flow left active forever blocks future work.
95
101
 
96
102
  **Normal completion:**
97
- - When the last step's `flow_step({ action: 'next' })` is called, the flow finishes automatically
98
- - After completion: run post-implementation protocol (`check` `test_run` `blast_radius` `reindex` `produce_knowledge` `remember`)
103
+ - When the last flow step's `flow_step({ action: 'next' })` is called, the flow transitions to **mandatory epilogue steps** (e.g., `_docs-sync`)
104
+ - Epilogue steps run automatically after every flow — they are NOT optional (but can be skipped with `flow_step({ action: 'skip' })` + warning)
105
+ - The `_docs-sync` epilogue loads the `docs` skill and updates `docs/` based on changes made during the flow
106
+ - After ALL epilogue steps complete, the flow reaches `completed` status
107
+ - After completion: run post-implementation protocol (`check` → `test_run` → `blast_radius` → `reindex`)
108
+ - Note: auto-knowledge facts are captured automatically from all tool outputs above
109
+ - Then continue with `produce_knowledge` → `remember`
99
110
  - Inform the user the flow is complete with a summary of artifacts produced
100
111
 
101
112
  **Stale flow detection** (check at session start when `flow_status` returns an active flow):
@@ -133,8 +144,9 @@ Batch 2 (after batch 1):
133
144
  2. **Goal** — acceptance criteria, testable
134
145
  3. **Arch Context** — code snippets from `compact()`/`digest()`
135
146
  4. **Constraints** — patterns, conventions
136
- 5. **FORGE** — tier + task_id + evidence requirements (reviewers add CRITICAL/HIGH claims into your task_id; never create their own)
137
- 6. **Self-Review** — checklist before declaring status
147
+ 5. **Artifacts Path** — the active flow's run directory and artifacts path from `flow_status` (e.g. `.flows/add-authentication/.spec/`)
148
+ 6. **FORGE** — tier + task_id + evidence requirements (reviewers add CRITICAL/HIGH claims into your task_id; never create their own)
149
+ 7. **Self-Review** — checklist before declaring status
138
150
 
139
151
  **Subagent status protocol:** `DONE` | `DONE_WITH_CONCERNS` | `NEEDS_CONTEXT` | `BLOCKED`
140
152
 
@@ -153,11 +165,12 @@ Reviewers add findings to the Orchestrator's existing `evidence_map` `task_id` a
153
165
  |------|---------|
154
166
  | `flow_list` | List installed flows and active flow |
155
167
  | `flow_info` | Get detailed flow info including steps |
156
- | `flow_start` | Start a named flow |
168
+ | `flow_start` | Start a flow with a topic — creates `.flows/{topic-slug}/` run directory |
157
169
  | `flow_step` | Advance: next, skip, or redo current step |
158
- | `flow_status` | Check current execution state |
159
- | `flow_reset` | Clear flow state to start over |
160
- | `flow_read_instruction` | Read the instruction content for the current step |
170
+ | `flow_status` | Check current execution state including slug, runDir, artifactsPath |
171
+ | `flow_reset` | Abandon the active flow (preserves run directory for history) |
172
+ | `flow_read_instruction` | Read the current step's instruction with `{{artifacts_path}}` resolved |
173
+ | `flow_runs` | List all flow runs (current and past) with topic, status, progress |
161
174
 
162
175
  ## Emergency: STOP → ASSESS → CONTAIN → RECOVER → DOCUMENT
163
176
 
@@ -260,6 +273,7 @@ Before every tool call, verify:
260
273
  | `brainstorming` | When a flow's design step requires creative/design work |
261
274
  | `session-handoff` | Context filling up, session ending, or major milestone |
262
275
  | `lesson-learned` | After completing work — extract engineering principles |
276
+ | `docs` | During `_docs-sync` epilogue — living documentation convention, templates, change-to-doc mapping |
263
277
 
264
278
  **When dispatching subagents**, include relevant skill names in the prompt so subagents know which skills to load (e.g., "Load the `react` and `typescript` skills for this task").
265
279
 
@@ -273,7 +287,7 @@ flow_status({}) # Check/resume ac
273
287
  status({}) # Check AI Kit health + onboard state
274
288
  # If onboard not run → onboard({ path: "." }) # First-time codebase analysis
275
289
  flow_list({}) # See available flows
276
- # Select flow based on task → flow_start({ flow: "<name>" }) # Start flow if appropriate
290
+ # Select flow based on task → flow_start({ flow: "<name>", topic: "<task>" }) # Start flow creates .flows/{topic}/
277
291
  list() # See stored knowledge
278
292
  search({ query: "SESSION CHECKPOINT", origin: "curated" }) # Resume prior work
279
293
  ```
@@ -234,10 +234,15 @@ Always follow this order when you need to understand something. **Never skip to
234
234
  | C4 architecture diagram | `diagram.md` |
235
235
  | Module graph with key symbols | `code-map.md` |
236
236
 
237
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
237
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
238
+
239
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
240
+ Search it alongside manual knowledge:
238
241
 
239
242
  ```
240
- search("your keywords") // searches curated + indexed content
243
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
244
+ search("error patterns") // find auto-captured error patterns for current tools
245
+ list({ category: "conventions" }) // see detected project conventions
241
246
  scope_map("what you need") // generates a reading plan
242
247
  list() // see all stored knowledge entries
243
248
  ```
@@ -183,10 +183,15 @@ Always follow this order when you need to understand something. **Never skip to
183
183
  | C4 architecture diagram | `diagram.md` |
184
184
  | Module graph with key symbols | `code-map.md` |
185
185
 
186
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
186
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
187
+
188
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
189
+ Search it alongside manual knowledge:
187
190
 
188
191
  ```
189
- search("your keywords") // searches curated + indexed content
192
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
193
+ search("error patterns") // find auto-captured error patterns for current tools
194
+ list({ category: "conventions" }) // see detected project conventions
190
195
  scope_map("what you need") // generates a reading plan
191
196
  list() // see all stored knowledge entries
192
197
  ```
@@ -180,10 +180,15 @@ Always follow this order when you need to understand something. **Never skip to
180
180
  | C4 architecture diagram | `diagram.md` |
181
181
  | Module graph with key symbols | `code-map.md` |
182
182
 
183
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
183
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
184
+
185
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
186
+ Search it alongside manual knowledge:
184
187
 
185
188
  ```
186
- search("your keywords") // searches curated + indexed content
189
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
190
+ search("error patterns") // find auto-captured error patterns for current tools
191
+ list({ category: "conventions" }) // see detected project conventions
187
192
  scope_map("what you need") // generates a reading plan
188
193
  list() // see all stored knowledge entries
189
194
  ```
@@ -126,10 +126,15 @@ Always follow this order when you need to understand something. **Never skip to
126
126
  | C4 architecture diagram | `diagram.md` |
127
127
  | Module graph with key symbols | `code-map.md` |
128
128
 
129
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
129
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
130
+
131
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
132
+ Search it alongside manual knowledge:
130
133
 
131
134
  ```
132
- search("your keywords") // searches curated + indexed content
135
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
136
+ search("error patterns") // find auto-captured error patterns for current tools
137
+ list({ category: "conventions" }) // see detected project conventions
133
138
  scope_map("what you need") // generates a reading plan
134
139
  list() // see all stored knowledge entries
135
140
  ```
@@ -54,7 +54,7 @@ flow_status({}) # Check/resume ac
54
54
  status({}) # Check AI Kit health + onboard state
55
55
  # If onboard not run → onboard({ path: "." }) # First-time codebase analysis
56
56
  flow_list({}) # See available flows
57
- # Select flow based on task → flow_start({ flow: "<name>" }) # Start flow if appropriate
57
+ # Select flow based on task → flow_start({ flow: "<name>", topic: "<task>" }) # Start creates .flows/{topic}/
58
58
  list() # See stored knowledge
59
59
  search({ query: "SESSION CHECKPOINT", origin: "curated" }) # Resume prior work
60
60
  ```
@@ -134,6 +134,37 @@ remember({ title: "Session checkpoint: <topic>", content: "<what was done, decis
134
134
  | `list` | `aikit list` | List curated entries |
135
135
  | `produce_knowledge` | — | Auto-generate knowledge from analysis |
136
136
 
137
+ ### Auto-Knowledge (automatic background extraction)
138
+
139
+ Auto-knowledge runs automatically in the background after every tool completion. It extracts useful facts from tool outputs and stores them in curated memory — no manual action required.
140
+
141
+ **What gets captured:**
142
+
143
+ | Extractor | Triggers on | What it stores |
144
+ |-----------|-------------|----------------|
145
+ | Test results | `check`, `test_run` | Framework detection (vitest/jest/mocha), test file naming patterns |
146
+ | Environment | `env`, `config`, `status` | Node.js version, OS, workspace path, store backend, embedding model |
147
+ | Research | `web_search`, `web_fetch`, `search` | Web research findings, fetched page summaries |
148
+ | Conventions | `check`, `analyze_patterns`, `analyze_structure`, `onboard` | Linter/formatter, TypeScript strict mode, package manager, monorepo detection |
149
+ | Build commands | `check`, `test_run` | Verified check results, test summaries, test runner commands |
150
+ | Codebase insights | `analyze_*`, `scope_map`, `blast_radius`, `onboard` | Structure analysis, dependency info, entry points, impact analysis |
151
+ | Tool failures | All tools (global) | Classified actionable errors (filters out transient network/ENOENT errors) |
152
+
153
+ **Quality controls:**
154
+ - **Quality gate**: Facts scored 0-1; only facts >= 0.3 are stored
155
+ - **Dedup**: Checks existing curated titles + in-memory hash dedup
156
+ - **TTL**: Transient facts (errors, blast radius, search context) automatically expire after 1-2 hours
157
+ - **Session limit**: Maximum 50 auto-knowledge facts per session
158
+
159
+ **Searching auto-knowledge:**
160
+ Auto-knowledge facts are stored as regular curated entries. Search them with:
161
+ ```
162
+ search({ query: "error patterns", origin: "curated" })
163
+ search({ query: "conventions", origin: "curated" })
164
+ list({ category: "conventions" })
165
+ list({ tags: ["errors"] })
166
+ ```
167
+
137
168
  ### Verified Lanes (1 tool, 6 actions)
138
169
  | Tool | CLI | Purpose |
139
170
  |------|-----|---------|
@@ -190,16 +221,17 @@ Lane actions: `create` (copy files to lane), `list`, `status` (modified/added/de
190
221
  | `queue` | `aikit queue` | Task queue for sequential agent operations (create/push/next/done/fail) |
191
222
  | `replay` | `aikit replay` | View or clear the audit trail of tool invocations (action: list/clear) |
192
223
 
193
- ### Flows (10)
224
+ ### Flows (11)
194
225
  | Tool | CLI | Purpose |
195
226
  |------|-----|---------|
196
- | `flow_list` | `aikit flow list` | List available flows |
227
+ | `flow_list` | `aikit flow list` | List available flows and active run |
197
228
  | `flow_info` | `aikit flow info` | Get flow details including steps and skill paths |
198
- | `flow_start` | `aikit flow start` | Start a named flow |
229
+ | `flow_start` | `aikit flow start` | Start a flow with topic — creates `.flows/{topic-slug}/` run directory |
199
230
  | `flow_step` | `aikit flow step` | Advance, skip, or redo the current step |
200
- | `flow_status` | `aikit flow status` | Check if a flow is active and view the current step |
201
- | `flow_read_instruction` | `aikit flow read-instruction` | Read the current step's instruction file content directly |
202
- | `flow_reset` | `aikit flow reset` | Clear flow state to start over |
231
+ | `flow_status` | `aikit flow status` | Check active run including slug, runDir, artifactsPath |
232
+ | `flow_read_instruction` | `aikit flow read-instruction` | Read instruction with `{{artifacts_path}}` and `{{run_dir}}` resolved |
233
+ | `flow_reset` | `aikit flow reset` | Abandon the active flow (preserves run directory) |
234
+ | `flow_runs` | `aikit flow runs` | List all flow runs (current and past) |
203
235
  | `flow_add` | `aikit flow add` | Add a custom flow from a directory |
204
236
  | `flow_update` | `aikit flow update` | Update an existing custom flow |
205
237
  | `flow_remove` | `aikit flow remove` | Remove a custom flow |
@@ -242,14 +274,18 @@ Flows are multi-step guided workflows that structure complex tasks. Each step ha
242
274
  ```text
243
275
  flow_list() # See available flows
244
276
  flow_info({ flow: "aikit:basic" }) # View steps, skills, agents
245
- flow_start({ flow: "aikit:basic" }) # Start — sets current step to first
246
- flow_read_instruction({ step: "assess" }) # Read current step's instructions
277
+ flow_start({ flow: "aikit:basic", topic: "Fix login bug" }) # Start — creates .flows/fix-login-bug/
278
+ flow_read_instruction() # Read current step's instructions ({{artifacts_path}} resolved)
247
279
  # ... do the work described in the instruction ...
248
280
  flow_step({ action: "next" }) # Advance to next step
249
281
  flow_step({ action: "skip" }) # Skip current step
250
282
  flow_step({ action: "redo" }) # Redo current step
251
- flow_status() # Check progress
252
- flow_reset() # Clear state, start over
283
+ flow_status() # Check progress (includes slug, runDir, artifactsPath, phase, isEpilogue)
284
+ flow_reset() # Abandon active flow
285
+ flow_runs() # List all runs (current + past)
286
+ # Epilogue steps (mandatory, injected after every flow):
287
+ # After last flow step → _docs-sync epilogue runs automatically
288
+ # flow_status() shows phase: 'after', isEpilogue: true during epilogue
253
289
  ```
254
290
 
255
291
  Custom flow lifecycle management:
@@ -680,7 +716,7 @@ Flows are structured multi-step workflows that guide agents through complex task
680
716
 
681
717
  | Tool | Purpose |
682
718
  |------|---------|
683
- | `flow_status` | Check if a flow is active + current step |
719
+ | `flow_status` | Check if a flow is active + current step + phase (before/flow/after) + isEpilogue |
684
720
  | `flow_list` | List available flows |
685
721
  | `flow_info` | Get flow details including steps and skill paths |
686
722
  | `flow_start` | Start a named flow |
@@ -704,8 +740,9 @@ Flows are structured multi-step workflows that guide agents through complex task
704
740
 
705
741
  ### Flow Lifecycle
706
742
 
707
- 1. **Start**: `flow_list({})` → choose flow → `flow_start({ flow: "<name>" })`
743
+ 1. **Start**: `flow_list({})` → choose flow → `flow_start({ flow: "<name>", topic: "<task>" })`
708
744
  2. **Each step**: `flow_read_instruction({ step: "<name>" })` → follow step instructions → complete work
709
745
  3. **Advance**: `flow_step({ action: "next" })` → repeat from step 2
710
- 4. **Resume**: `flow_status({})` if active, `flow_read_instruction` for current step continue
711
- 5. **Reset**: `flow_reset({})` if you need to start over
746
+ 4. **Epilogue**: After last flow step, mandatory epilogue steps run (e.g., `_docs-sync` updates `docs/`)
747
+ 5. **Resume**: `flow_status({})` if active, `flow_read_instruction` for current step → continue
748
+ 6. **Reset**: `flow_reset({})` if you need to start over