@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
@@ -21,6 +21,7 @@ export const AGENTS = {
21
21
  sharedBase: null, // Orchestrator has inline instructions
22
22
  sharedProtocols: ['decision-protocol', 'forge-protocol'],
23
23
  category: 'orchestration',
24
+ skills: [],
24
25
  },
25
26
 
26
27
  Planner: {
@@ -120,6 +121,10 @@ export const AGENTS = {
120
121
  skills: [
121
122
  ['aikit', '**Always** — AI Kit tool signatures, search, analysis'],
122
123
  ['present', 'When presenting documentation previews or architecture visuals to the user'],
124
+ [
125
+ 'docs',
126
+ 'When creating or updating project documentation — docs/ convention, architecture blueprints, Diátaxis framework',
127
+ ],
123
128
  ],
124
129
  },
125
130
 
@@ -54,7 +54,7 @@ ${agentTable}
54
54
  | New feature, API design, architecture change, multi-component work | \`aikit:advanced\` |
55
55
  | Task matches a custom flow's description/tags exactly | That custom flow |
56
56
 
57
- - **Auto-start:** When exactly one flow matches, start it immediately — \`flow_start({ flow: '<matched>' })\` — and inform the user which flow was activated and why.
57
+ - **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).
58
58
  - **Ask only when ambiguous:** If the task could fit multiple flows, or no flow clearly matches, present the options and let the user choose.
59
59
  - Do NOT present a menu for obvious cases. Speed matters.
60
60
  4. **Every task goes through a flow.** There is no flowless path.
@@ -68,7 +68,13 @@ For EACH step in the active flow:
68
68
  3. Apply **Orchestrator Protocols** (PRE-DISPATCH GATE, FORGE, review cycle) during execution
69
69
  4. When the step is complete and results are approved:
70
70
  - \`flow_step({ action: 'next' })\` to advance
71
- 5. Repeat until the flow is complete
71
+ 5. Repeat until all flow steps AND epilogue steps are complete
72
+
73
+ **Epilogue steps** (mandatory, injected by aikit):
74
+ - After the last flow step, the state machine transitions to epilogue steps (e.g., \`_docs-sync\`)
75
+ - \`flow_status\` will show \`phase: 'after'\` and \`isEpilogue: true\` during epilogue
76
+ - Delegate epilogue work to the appropriate agent (e.g., Documenter for \`_docs-sync\`)
77
+ - Epilogue steps follow the same execution pattern: \`flow_read_instruction\` → do work → \`flow_step({ action: 'next' })\`
72
78
 
73
79
  **Custom flows work identically** — \`flow_list\` returns them alongside builtins. The execution loop is the same for ALL flows.
74
80
 
@@ -77,8 +83,13 @@ For EACH step in the active flow:
77
83
  Flows MUST be driven to completion. A flow left active forever blocks future work.
78
84
 
79
85
  **Normal completion:**
80
- - When the last step's \`flow_step({ action: 'next' })\` is called, the flow finishes automatically
81
- - After completion: run post-implementation protocol (\`check\` \`test_run\` \`blast_radius\` \`reindex\` \`produce_knowledge\` \`remember\`)
86
+ - When the last flow step's \`flow_step({ action: 'next' })\` is called, the flow transitions to **mandatory epilogue steps** (e.g., \`_docs-sync\`)
87
+ - Epilogue steps run automatically after every flow — they are NOT optional (but can be skipped with \`flow_step({ action: 'skip' })\` + warning)
88
+ - The \`_docs-sync\` epilogue loads the \`docs\` skill and updates \`docs/\` based on changes made during the flow
89
+ - After ALL epilogue steps complete, the flow reaches \`completed\` status
90
+ - After completion: run post-implementation protocol (\`check\` → \`test_run\` → \`blast_radius\` → \`reindex\`)
91
+ - Note: auto-knowledge facts are captured automatically from all tool outputs above
92
+ - Then continue with \`produce_knowledge\` → \`remember\`
82
93
  - Inform the user the flow is complete with a summary of artifacts produced
83
94
 
84
95
  **Stale flow detection** (check at session start when \`flow_status\` returns an active flow):
@@ -116,8 +127,9 @@ Batch 2 (after batch 1):
116
127
  2. **Goal** — acceptance criteria, testable
117
128
  3. **Arch Context** — code snippets from \`compact()\`/\`digest()\`
118
129
  4. **Constraints** — patterns, conventions
119
- 5. **FORGE** — tier + task_id + evidence requirements (reviewers add CRITICAL/HIGH claims into your task_id; never create their own)
120
- 6. **Self-Review** — checklist before declaring status
130
+ 5. **Artifacts Path** — the active flow's run directory and artifacts path from \`flow_status\` (e.g. \`.flows/add-authentication/.spec/\`)
131
+ 6. **FORGE** — tier + task_id + evidence requirements (reviewers add CRITICAL/HIGH claims into your task_id; never create their own)
132
+ 7. **Self-Review** — checklist before declaring status
121
133
 
122
134
  **Subagent status protocol:** \`DONE\` | \`DONE_WITH_CONCERNS\` | \`NEEDS_CONTEXT\` | \`BLOCKED\`
123
135
 
@@ -136,11 +148,12 @@ Reviewers add findings to the Orchestrator's existing \`evidence_map\` \`task_id
136
148
  |------|---------|
137
149
  | \`flow_list\` | List installed flows and active flow |
138
150
  | \`flow_info\` | Get detailed flow info including steps |
139
- | \`flow_start\` | Start a named flow |
151
+ | \`flow_start\` | Start a flow with a topic — creates \`.flows/{topic-slug}/\` run directory |
140
152
  | \`flow_step\` | Advance: next, skip, or redo current step |
141
- | \`flow_status\` | Check current execution state |
142
- | \`flow_reset\` | Clear flow state to start over |
143
- | \`flow_read_instruction\` | Read the instruction content for the current step |
153
+ | \`flow_status\` | Check current execution state including slug, runDir, artifactsPath |
154
+ | \`flow_reset\` | Abandon the active flow (preserves run directory for history) |
155
+ | \`flow_read_instruction\` | Read the current step's instruction with \`{{artifacts_path}}\` resolved |
156
+ | \`flow_runs\` | List all flow runs (current and past) with topic, status, progress |
144
157
 
145
158
  ## Emergency: STOP → ASSESS → CONTAIN → RECOVER → DOCUMENT
146
159
 
@@ -243,6 +256,7 @@ Before every tool call, verify:
243
256
  | \`brainstorming\` | When a flow's design step requires creative/design work |
244
257
  | \`session-handoff\` | Context filling up, session ending, or major milestone |
245
258
  | \`lesson-learned\` | After completing work — extract engineering principles |
259
+ | \`docs\` | During \`_docs-sync\` epilogue — living documentation convention, templates, change-to-doc mapping |
246
260
 
247
261
  **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").
248
262
 
@@ -256,7 +270,7 @@ flow_status({}) # Check/resume ac
256
270
  status({}) # Check AI Kit health + onboard state
257
271
  # If onboard not run → onboard({ path: "." }) # First-time codebase analysis
258
272
  flow_list({}) # See available flows
259
- # Select flow based on task → flow_start({ flow: "<name>" }) # Start flow if appropriate
273
+ # Select flow based on task → flow_start({ flow: "<name>", topic: "<task>" }) # Start flow creates .flows/{topic}/
260
274
  list() # See stored knowledge
261
275
  search({ query: "SESSION CHECKPOINT", origin: "curated" }) # Resume prior work
262
276
  \`\`\`
@@ -397,7 +411,7 @@ When subagents complete, their visual outputs (from \`present\`) are NOT visible
397
411
 
398
412
  - **Test-first always** — No implementation without a failing test
399
413
  - **Minimal code** — Don't build what isn't asked for
400
- - **Follow existing patterns** — Search AI Kit for conventions before creating new ones
414
+ - **Follow existing patterns** — Search AI Kit for conventions before creating new ones (\`search("convention")\`, \`list({ category: "conventions" })\`)
401
415
  - **Never modify tests to make them pass** — Fix the implementation instead
402
416
  - **Run \`check\` after every change** — Catch errors early
403
417
  - **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
@@ -469,7 +483,7 @@ If the pre-flight dev server cannot be started (e.g. sandbox), fall back to
469
483
 
470
484
  ## Debugging Protocol
471
485
 
472
- 1. **AI Kit Recall** — Search for known issues matching this error pattern
486
+ 1. **AI Kit Recall** — \`search("error patterns")\` to find auto-captured error patterns; \`list({ tags: ["errors"] })\` for all error entries; search for known issues matching this error pattern
473
487
  2. **Reproduce** — Confirm the error, use \`parse_output\` on stack traces and build errors for structured analysis
474
488
  3. **Verify targets exist** — Before tracing, confirm the files and functions mentioned in the error actually exist. Use \`find\` or \`symbol\` to verify paths and signatures. **Never trace into a file you haven't confirmed exists**
475
489
  4. **Trace** — \`graph\` (module imports), \`symbol\` (definitions/references), \`trace\` (call chains) — start with \`graph\` to understand module relationships, then drill into symbols
@@ -604,11 +618,45 @@ For multi-approach uncertainty (A vs B), do NOT create lanes. Instead:
604
618
  | Architecture | Design decisions | Context, decision, consequences |
605
619
  | Changelog | After implementation | \`changelog\` tool, Keep a Changelog format |
606
620
 
607
- ## Rules
621
+ ## Writing Style
622
+
623
+ 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.
624
+
625
+ ### Clarity and Precision
626
+
627
+ | Rule | Do | Do Not |
628
+ |------|-----|--------|
629
+ | Concrete language | "The retry handler backs off exponentially" | "The relevant component handles the situation appropriately" |
630
+ | No needless words | "Retries three times" | "It should be noted that the system retries a total of three times" |
631
+ | Active voice | "The scheduler processes the queue" | "The queue is processed by the scheduler" |
632
+ | Affirmative form | "Use UTC timestamps" | "Do not use non-UTC timestamps" (unless a warning) |
633
+ | Calibrated claims | "Reduces latency by 40% in benchmarks (see perf.md)" | "Dramatically improves performance" |
634
+
635
+ ### Structure
636
+
637
+ - **Parallel structure** — Express coordinate ideas in similar form: consistent table columns, consistent list item grammar, consistent heading patterns
638
+ - **Stress position** — Place the most important information at the end of the sentence
639
+ - **Sentence variety** — Split sentences over 30 words; alternate short and long sentences to maintain rhythm
640
+ - **Bullets for lists only** — Do not convert flowing prose into bullet points; two items or a single sentence do not need bullets
641
+ - **Consistent terms** — Pick one term per concept and use it throughout; do not alternate synonyms for variety
642
+
643
+ ### AI-Tell Avoidance (patterns to eliminate)
644
+
645
+ - ❌ Dying metaphors: "cutting-edge", "leverages", "streamlines", "robust", "seamless", "game-changing", "next-generation"
646
+ - ❌ Transition-word openers: "Additionally", "Furthermore", "Moreover", "It is worth noting that"
647
+ - ❌ Em-dash overuse: use commas, semicolons, or separate sentences instead
648
+ - ❌ Summary closers: do not end every paragraph by restating what it just said
649
+ - ❌ Consecutive same-starts: do not begin consecutive sentences with the same word or phrase
650
+ - ❌ Filler hedging: "It should be noted", "It is important to", "In order to" → just state the point
651
+
652
+ ### Core Principles
653
+
654
+ - **Accuracy over completeness** — Correct and concise beats thorough and wrong
655
+ - **Examples always** — Every API section needs a code example; every concept needs a concrete illustration
656
+ - **Evidence-backed** — Support factual claims with file paths, tool output, or citations; do not fabricate
657
+ - **Keep it current** — Update docs with every code change; stale docs are worse than no docs
608
658
 
609
- - **Accuracy over completeness** Better to be correct and concise than thorough and wrong
610
- - **Examples always** — Every API docs section needs a code example
611
- - **Keep it current** — Update docs with every code change
659
+ **Escape hatch** (Orwell Rule 6): Break any style rule sooner than write something unclear or unnatural.
612
660
 
613
661
  ## Skills (load on demand)
614
662
 
@@ -127,4 +127,10 @@ export const PLUGINS = {
127
127
  source: 'scaffold/general/skills/typescript/SKILL.md',
128
128
  required: false,
129
129
  },
130
+ docs: {
131
+ description:
132
+ 'Living documentation management — Diátaxis framework, docs/ convention, staleness detection, integration with adr-skill and c4-architecture',
133
+ source: 'scaffold/general/skills/docs/SKILL.md',
134
+ required: true,
135
+ },
130
136
  };
@@ -134,10 +134,15 @@ Always follow this order when you need to understand something. **Never skip to
134
134
  | C4 architecture diagram | \`diagram.md\` |
135
135
  | Module graph with key symbols | \`code-map.md\` |
136
136
 
137
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
137
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
138
+
139
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
140
+ Search it alongside manual knowledge:
138
141
 
139
142
  \`\`\`
140
- search("your keywords") // searches curated + indexed content
143
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
144
+ search("error patterns") // find auto-captured error patterns for current tools
145
+ list({ category: "conventions" }) // see detected project conventions
141
146
  scope_map("what you need") // generates a reading plan
142
147
  list() // see all stored knowledge entries
143
148
  \`\`\`
@@ -0,0 +1,120 @@
1
+ # Epilogue: Documentation Sync
2
+
3
+ > **This is a mandatory epilogue step.** It runs automatically after every flow completes to keep project documentation synchronized with code changes.
4
+
5
+ ## Objective
6
+
7
+ Review the changes made during this flow and update the `docs/` folder using AI Kit analysis tools — never write docs from scratch when a tool can generate the foundation.
8
+
9
+ ## Prerequisites
10
+
11
+ Load the `docs` skill before proceeding — it contains the full documentation convention, templates, architecture blueprint workflow, and change-to-doc mapping rules.
12
+
13
+ ## Instructions
14
+
15
+ ### 0. Gather Flow Artifacts
16
+
17
+ Read all artifacts produced during this flow — they contain design decisions, requirements, and verification results that are the most valuable documentation input.
18
+
19
+ ```
20
+ flow_status() # Get artifactsPath
21
+ find({ pattern: "*.md", path: "{{artifacts_path}}" }) # Discover all flow artifacts
22
+ digest({ sources: [ # Compress artifacts for context
23
+ { path: "<found-artifact-1>" },
24
+ { path: "<found-artifact-2>" },
25
+ ...
26
+ ]})
27
+ ```
28
+
29
+ Map each discovered artifact to documentation actions using the artifact-to-doc mapping from the `docs` skill. Different flows produce different artifacts — read everything `find()` returns and focus on content that contains decisions, requirements, and verification results.
30
+
31
+ If no artifacts exist, proceed to Step 1 in source-only mode.
32
+
33
+ ### 1. Assess Changes (tool-driven)
34
+
35
+ ```
36
+ git_context({}) # What changed in this flow
37
+ blast_radius({ changed_files: ["<changed-files>"] }) # Impact analysis — which modules affected
38
+ ```
39
+
40
+ Use the output to classify changes:
41
+
42
+ | Change Signal | Documentation Action |
43
+ |---------------|---------------------|
44
+ | New files in `src/` | Potential new component doc |
45
+ | Modified API surface | Update reference docs |
46
+ | New package or module boundary | Update architecture overview |
47
+ | Architecture decision made | Delegate to `adr-skill` |
48
+ | Test-only or config-only changes | Likely skip |
49
+
50
+ ### 2. Apply the Change-to-Doc Mapping
51
+
52
+ Follow the decision tree from the `docs` skill to determine which documentation actions are needed.
53
+
54
+ ### 3. Bootstrap `docs/` If Needed (full tool-driven workflow)
55
+
56
+ If `docs/` doesn't exist, run the **Architecture Blueprint Workflow** from the `docs` skill:
57
+
58
+ ```
59
+ # Step 1: Generate content with AI Kit tools
60
+ produce_knowledge({ path: "." }) # → Foundation for docs/README.md
61
+ analyze_structure({ path: "." }) # → docs/architecture/overview.md structure
62
+ analyze_diagram({ path: "." }) # → docs/architecture/ Mermaid diagrams
63
+ analyze_dependencies({ path: "." }) # → docs/architecture/overview.md deps section
64
+ analyze_entry_points({ path: "." }) # → docs/reference/api.md foundation
65
+ analyze_patterns({ path: "." }) # → docs/architecture/overview.md patterns
66
+
67
+ # Step 2: Create the docs/ tree from tool outputs
68
+ docs/
69
+ ├── README.md ← From produce_knowledge + project context
70
+ ├── architecture/
71
+ │ ├── overview.md ← From analyze_structure + analyze_dependencies + analyze_diagram
72
+ │ └── components/ ← From analyze_symbols per major component
73
+ ├── decisions/
74
+ │ └── index.md ← ADR log (delegate to adr-skill)
75
+ ├── guides/
76
+ │ └── testing.md ← From analyze_patterns test info
77
+ └── reference/
78
+ └── api.md ← From analyze_entry_points
79
+ ```
80
+
81
+ Use the Architecture Blueprint sections from the `docs` skill as the template for each document.
82
+
83
+ ### 4. Update Existing Docs (tool-assisted)
84
+
85
+ When `docs/` already exists:
86
+
87
+ ```
88
+ compact({ path: "docs/architecture/overview.md", query: "section to update" }) # Read target section
89
+ blast_radius({ changed_files: ["<files>"] }) # What's affected
90
+ ```
91
+
92
+ - **Don't rewrite** — update the relevant sections of existing docs
93
+ - **Don't duplicate** — if the information is in code comments or READMEs, reference it
94
+ - Use `compact` to read existing doc sections before editing
95
+ - Use `blast_radius` output to determine which sections need updating
96
+
97
+ ### 5. Delegate When Appropriate
98
+
99
+ - Architecture decisions → `adr-skill` → `docs/decisions/`
100
+ - Architecture diagrams → `c4-architecture` skill → `docs/architecture/`
101
+ - Full architecture refresh → Run the Architecture Blueprint Workflow from `docs` skill
102
+
103
+ ### 6. Update Index
104
+
105
+ If documents were added, removed, or renamed, update `docs/README.md` to reflect the current structure.
106
+
107
+ ### 7. Skip If Nothing Changed
108
+
109
+ If the flow's changes don't warrant doc updates (e.g., pure bug fix with no revelations), report:
110
+ - "No documentation updates needed"
111
+ - Reason: (brief explanation)
112
+
113
+ ## Completion Criteria
114
+
115
+ - [ ] `git_context` + `blast_radius` used to assess changes
116
+ - [ ] Change-to-doc mapping applied from `docs` skill
117
+ - [ ] `docs/` bootstrapped with tool outputs if it didn't exist
118
+ - [ ] Relevant docs created or updated (or skipped with reason)
119
+ - [ ] `docs/README.md` index is current
120
+ - [ ] No placeholder/empty docs created — all content tool-generated or hand-written with purpose
@@ -67,4 +67,4 @@ When the Orchestrator activates a step:
67
67
 
68
68
  ## Artifacts
69
69
 
70
- All artifacts are stored in the `.spec/` directory relative to the project root.
70
+ All artifacts are stored in the run directory under `.flows/{topic}/`. The template variable `{{artifacts_path}}` resolves to the actual path at runtime.
@@ -9,7 +9,7 @@ description: Implement all tasks from the task breakdown, dispatching agents in
9
9
 
10
10
  Before starting this step, verify:
11
11
  - [ ] Task breakdown approved with valid task graph
12
- - [ ] `.spec/<slug>/tasks.md` exists with defined batches and dependencies
12
+ - [ ] `{{artifacts_path}}/tasks.md` exists with defined batches and dependencies
13
13
 
14
14
  If prerequisites are NOT met -> **backtrack to task step** (`flow_step({ action: 'redo' })` on previous step)
15
15
 
@@ -19,7 +19,7 @@ Execute all tasks from the breakdown, dispatching implementation agents in batch
19
19
 
20
20
  ## Inputs
21
21
 
22
- - `.spec/<slug>/tasks.md` — the atomic task list with dependencies and agent assignments
22
+ - `{{artifacts_path}}/tasks.md` — the atomic task list with dependencies and agent assignments
23
23
 
24
24
  ## Process
25
25
 
@@ -38,7 +38,7 @@ Execute all tasks from the breakdown, dispatching implementation agents in batch
38
38
 
39
39
  ## Outputs
40
40
 
41
- Produce `.spec/<slug>/progress.md` with:
41
+ Produce `{{artifacts_path}}/progress.md` with:
42
42
 
43
43
  ```markdown
44
44
  # Execution Progress: <feature title>
@@ -130,7 +130,7 @@ Follow the `multi-agents-development` skill patterns for dispatch:
130
130
  - [ ] `check({})` passes
131
131
  - [ ] `test_run({})` passes
132
132
  - [ ] No blocked items remaining
133
- - [ ] `.spec/<slug>/progress.md` written
133
+ - [ ] `{{artifacts_path}}/progress.md` written
134
134
 
135
135
  ## Knowledge Capture
136
136
 
@@ -9,7 +9,7 @@ description: Analyze the codebase, design the architecture, and create a detaile
9
9
 
10
10
  Before starting this step, verify:
11
11
  - [ ] Specification approved with clarity score ≥90
12
- - [ ] `.spec/<slug>/spec.md` exists and is complete
12
+ - [ ] `{{artifacts_path}}/spec.md` exists and is complete
13
13
 
14
14
  If prerequisites are NOT met → **backtrack to spec step** (`flow_step({ action: 'redo' })` on previous step)
15
15
 
@@ -19,7 +19,7 @@ Translate the specification into a concrete, phased implementation plan with arc
19
19
 
20
20
  ## Inputs
21
21
 
22
- - `.spec/<slug>/spec.md` — the validated specification
22
+ - `{{artifacts_path}}/spec.md` — the validated specification
23
23
 
24
24
  ## Process
25
25
 
@@ -38,7 +38,7 @@ Translate the specification into a concrete, phased implementation plan with arc
38
38
 
39
39
  ## Outputs
40
40
 
41
- Produce `.spec/<slug>/plan.md` with:
41
+ Produce `{{artifacts_path}}/plan.md` with:
42
42
 
43
43
  ```markdown
44
44
  # Implementation Plan: <feature title>
@@ -107,7 +107,7 @@ Load these skills BEFORE executing this step:
107
107
  - [ ] Architecture decisions documented with rationale
108
108
  - [ ] Dependency graph has no circular dependencies
109
109
  - [ ] Risks identified with mitigations
110
- - [ ] `.spec/<slug>/plan.md` written
110
+ - [ ] `{{artifacts_path}}/plan.md` written
111
111
 
112
112
  ## Knowledge Capture
113
113
 
@@ -36,7 +36,7 @@ Transform a vague or broad feature request into a precise, testable specificatio
36
36
 
37
37
  ## Outputs
38
38
 
39
- Produce `.spec/<slug>/spec.md` with:
39
+ Produce `{{artifacts_path}}/spec.md` with:
40
40
 
41
41
  ```markdown
42
42
  # Specification: <feature title>
@@ -106,7 +106,7 @@ Load these skills BEFORE executing this step:
106
106
  - [ ] Scope boundaries are explicit
107
107
  - [ ] Requirements clarity score ≥ 90
108
108
  - [ ] No open questions remain
109
- - [ ] `.spec/<slug>/spec.md` written
109
+ - [ ] `{{artifacts_path}}/spec.md` written
110
110
 
111
111
  ## Knowledge Capture
112
112
 
@@ -9,7 +9,7 @@ description: Break the implementation plan into ordered, atomic tasks with depen
9
9
 
10
10
  Before starting this step, verify:
11
11
  - [ ] Implementation plan approved
12
- - [ ] `.spec/<slug>/plan.md` exists with defined phases
12
+ - [ ] `{{artifacts_path}}/plan.md` exists with defined phases
13
13
 
14
14
  If prerequisites are NOT met → **backtrack to plan step** (`flow_step({ action: 'redo' })` on previous step)
15
15
 
@@ -19,7 +19,7 @@ Decompose the implementation plan into small, atomic tasks that agents can execu
19
19
 
20
20
  ## Inputs
21
21
 
22
- - `.spec/<slug>/plan.md` — the phased implementation plan
22
+ - `{{artifacts_path}}/plan.md` — the phased implementation plan
23
23
 
24
24
  ## Process
25
25
 
@@ -35,7 +35,7 @@ Decompose the implementation plan into small, atomic tasks that agents can execu
35
35
 
36
36
  ## Outputs
37
37
 
38
- Produce `.spec/<slug>/tasks.md` with:
38
+ Produce `{{artifacts_path}}/tasks.md` with:
39
39
 
40
40
  ```markdown
41
41
  # Task Breakdown: <feature title>
@@ -104,7 +104,7 @@ Load these skills BEFORE executing this step:
104
104
  - [ ] Dependencies form a DAG (no cycles)
105
105
  - [ ] Parallelism opportunities identified
106
106
  - [ ] Architect review confirms no integration risks
107
- - [ ] `.spec/<slug>/tasks.md` written
107
+ - [ ] `{{artifacts_path}}/tasks.md` written
108
108
 
109
109
  ## Knowledge Capture
110
110
 
@@ -10,7 +10,7 @@ description: Dual code review, architecture review, security review, and compreh
10
10
  Before starting this step, verify:
11
11
  - [ ] All tasks marked complete in progress tracker
12
12
  - [ ] `check({})` and `test_run({})` pass
13
- - [ ] `.spec/<slug>/progress.md` exists with execution results
13
+ - [ ] `{{artifacts_path}}/progress.md` exists with execution results
14
14
 
15
15
  If prerequisites are NOT met → **backtrack to execute step** (`flow_step({ action: 'redo' })` on previous step)
16
16
 
@@ -20,10 +20,10 @@ Perform thorough multi-perspective validation of all changes through parallel du
20
20
 
21
21
  ## Inputs
22
22
 
23
- - `.spec/<slug>/spec.md` — original requirements and acceptance criteria
24
- - `.spec/<slug>/plan.md` — architecture decisions and phase design
25
- - `.spec/<slug>/tasks.md` — task breakdown with per-task acceptance criteria
26
- - `.spec/<slug>/progress.md` — implementation status and changes made
23
+ - `{{artifacts_path}}/spec.md` — original requirements and acceptance criteria
24
+ - `{{artifacts_path}}/plan.md` — architecture decisions and phase design
25
+ - `{{artifacts_path}}/tasks.md` — task breakdown with per-task acceptance criteria
26
+ - `{{artifacts_path}}/progress.md` — implementation status and changes made
27
27
 
28
28
  ## Process
29
29
 
@@ -44,7 +44,7 @@ Perform thorough multi-perspective validation of all changes through parallel du
44
44
 
45
45
  ## Outputs
46
46
 
47
- Produce `.spec/<slug>/verify-report.md` with:
47
+ Produce `{{artifacts_path}}/verify-report.md` with:
48
48
 
49
49
  ```markdown
50
50
  # Verification Report: <feature title>
@@ -130,7 +130,7 @@ After all reviews complete:
130
130
  - [ ] `test_run({})` passes
131
131
  - [ ] All spec acceptance criteria verified
132
132
  - [ ] FORGE gate passed (YIELD)
133
- - [ ] `.spec/<slug>/verify-report.md` written with clear verdict
133
+ - [ ] `{{artifacts_path}}/verify-report.md` written with clear verdict
134
134
 
135
135
  ## Knowledge Capture
136
136
 
@@ -48,4 +48,4 @@ When the Orchestrator activates a step:
48
48
 
49
49
  ## Artifacts
50
50
 
51
- All artifacts are stored in the `.spec/` directory relative to the project root.
51
+ All artifacts are stored in the run directory under `.flows/{topic}/`. The template variable `{{artifacts_path}}` resolves to the actual path at runtime.
@@ -38,7 +38,7 @@ If any prerequisites are missing or incomplete:
38
38
 
39
39
  ## Outputs
40
40
 
41
- Produce `.spec/<slug>/assessment.md` with:
41
+ Produce `{{artifacts_path}}/assessment.md` with:
42
42
 
43
43
  ```markdown
44
44
  # Assessment: <task title>
@@ -94,7 +94,7 @@ Load these skills BEFORE executing this step:
94
94
  - [ ] Implementation approach is concrete (not vague)
95
95
  - [ ] Risks documented with mitigations
96
96
  - [ ] No unresolved open questions that block implementation
97
- - [ ] `.spec/<slug>/assessment.md` written
97
+ - [ ] `{{artifacts_path}}/assessment.md` written
98
98
 
99
99
  ## Knowledge Capture
100
100
 
@@ -11,7 +11,7 @@ Execute the implementation plan from the assessment, writing production code and
11
11
 
12
12
  ## Inputs
13
13
 
14
- - `.spec/<slug>/assessment.md` — the approach, affected files, and risks
14
+ - `{{artifacts_path}}/assessment.md` — the approach, affected files, and risks
15
15
 
16
16
  ## Prerequisites Check
17
17
 
@@ -28,7 +28,7 @@ If any prerequisites are missing or incomplete:
28
28
 
29
29
  ## Process
30
30
 
31
- 1. **Read assessment** — Load `.spec/<slug>/assessment.md` and internalize the approach
31
+ 1. **Read assessment** — Load `{{artifacts_path}}/assessment.md` and internalize the approach
32
32
  2. **Set up tests first** — Where applicable, write failing tests that define success
33
33
  3. **Implement changes** — Follow the approach steps sequentially
34
34
  - One logical change per commit-worthy chunk
@@ -39,7 +39,7 @@ If any prerequisites are missing or incomplete:
39
39
 
40
40
  ## Outputs
41
41
 
42
- Produce `.spec/<slug>/progress.md` with:
42
+ Produce `{{artifacts_path}}/progress.md` with:
43
43
 
44
44
  ```markdown
45
45
  # Implementation Progress: <task title>
@@ -116,7 +116,7 @@ Follow the `multi-agents-development` skill patterns for dispatch:
116
116
  - [ ] `check({})` passes (no type/lint errors)
117
117
  - [ ] `test_run({})` passes (no test failures)
118
118
  - [ ] No files modified outside assessed scope
119
- - [ ] `.spec/<slug>/progress.md` written
119
+ - [ ] `{{artifacts_path}}/progress.md` written
120
120
 
121
121
  ## Knowledge Capture
122
122
 
@@ -11,8 +11,8 @@ Validate that the implementation meets the original requirements, passes all qua
11
11
 
12
12
  ## Inputs
13
13
 
14
- - `.spec/<slug>/assessment.md` — original requirements and approach
15
- - `.spec/<slug>/progress.md` — what was implemented and any deviations
14
+ - `{{artifacts_path}}/assessment.md` — original requirements and approach
15
+ - `{{artifacts_path}}/progress.md` — what was implemented and any deviations
16
16
 
17
17
  ## Prerequisites Check
18
18
 
@@ -42,7 +42,7 @@ If any prerequisites are missing or incomplete:
42
42
 
43
43
  ## Outputs
44
44
 
45
- Produce `.spec/<slug>/verify-report.md` with:
45
+ Produce `{{artifacts_path}}/verify-report.md` with:
46
46
 
47
47
  ```markdown
48
48
  # Verification Report: <task title>
@@ -108,7 +108,7 @@ After all reviews complete:
108
108
  - [ ] Code review complete with no blocking issues
109
109
  - [ ] Security review complete
110
110
  - [ ] Blast radius assessed
111
- - [ ] `.spec/<slug>/verify-report.md` written with clear PASS/FAIL verdict
111
+ - [ ] `{{artifacts_path}}/verify-report.md` written with clear PASS/FAIL verdict
112
112
 
113
113
  ## Knowledge Capture
114
114
 
@@ -13,7 +13,7 @@ You are the **Debugger**, expert debugger that diagnoses issues, traces errors,
13
13
 
14
14
  ## Debugging Protocol
15
15
 
16
- 1. **AI Kit Recall** — Search for known issues matching this error pattern
16
+ 1. **AI Kit Recall** — `search("error patterns")` to find auto-captured error patterns; `list({ tags: ["errors"] })` for all error entries; search for known issues matching this error pattern
17
17
  2. **Reproduce** — Confirm the error, use `parse_output` on stack traces and build errors for structured analysis
18
18
  3. **Verify targets exist** — Before tracing, confirm the files and functions mentioned in the error actually exist. Use `find` or `symbol` to verify paths and signatures. **Never trace into a file you haven't confirmed exists**
19
19
  4. **Trace** — `graph` (module imports), `symbol` (definitions/references), `trace` (call chains) — start with `graph` to understand module relationships, then drill into symbols
@@ -159,10 +159,15 @@ Always follow this order when you need to understand something. **Never skip to
159
159
  | C4 architecture diagram | `diagram.md` |
160
160
  | Module graph with key symbols | `code-map.md` |
161
161
 
162
- ### Step 2: Curated Knowledge (past decisions, remembered patterns)
162
+ ### Step 2: Curated Knowledge (past decisions, remembered patterns, auto-knowledge)
163
+
164
+ Auto-knowledge captures facts automatically from tool outputs (conventions, errors, test results, research).
165
+ Search it alongside manual knowledge:
163
166
 
164
167
  ```
165
- search("your keywords") // searches curated + indexed content
168
+ search("your keywords") // searches curated + indexed content (includes auto-knowledge)
169
+ search("error patterns") // find auto-captured error patterns for current tools
170
+ list({ category: "conventions" }) // see detected project conventions
166
171
  scope_map("what you need") // generates a reading plan
167
172
  list() // see all stored knowledge entries
168
173
  ```