@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
@@ -0,0 +1,123 @@
1
+ # The Diataxis Compass
2
+
3
+ The Diataxis Compass is a simple classification aid for documentation. It reduces classification to two axes so an author can decide what kind of document they are writing before structure and tone drift across quadrants.
4
+
5
+ Use it when a draft feels mixed, when a request could fit more than one documentation type, or when you need a quick check before creating a new document.
6
+
7
+ ## The Two Axes
8
+
9
+ The compass uses two independent axes:
10
+
11
+ | Axis | Question | Poles | What it tells you |
12
+ |------|----------|-------|-------------------|
13
+ | Horizontal | Is the reader trying to do something or understand something? | Action vs Cognition | Whether the content should guide behavior or develop understanding |
14
+ | Vertical | Is the reader learning or working? | Study vs Work | Whether the content serves acquisition or application |
15
+
16
+ Interpret the axes this way:
17
+
18
+ - **Action** means practical doing, following steps, executing work, or completing a task.
19
+ - **Cognition** means understanding, context, concepts, relationships, or meaning.
20
+ - **Study** means the reader is acquiring skill or knowledge.
21
+ - **Work** means the reader is applying skill or knowledge to a real task.
22
+
23
+ ## ASCII Quadrant Diagram
24
+
25
+ ```text
26
+ ACTION COGNITION
27
+ +--------------------------------+--------------------------------+
28
+ STUDY | Tutorial | Explanation |
29
+ | Learn by doing | Learn by understanding |
30
+ +--------------------------------+--------------------------------+
31
+ WORK | How-to Guide | Reference |
32
+ | Accomplish a specific task | Consult facts while working |
33
+ +--------------------------------+--------------------------------+
34
+ ```
35
+
36
+ ## Two-Question Decision Tree
37
+
38
+ Ask these questions in order:
39
+
40
+ 1. Is the reader trying to **DO** something or **UNDERSTAND** something?
41
+ 2. Is the reader **LEARNING** or **WORKING**?
42
+
43
+ Answer matrix:
44
+
45
+ | Q1 | Q2 | Result |
46
+ |----|----|--------|
47
+ | Action | Study | Tutorial |
48
+ | Action | Work | How-to guide |
49
+ | Cognition | Work | Reference |
50
+ | Cognition | Study | Explanation |
51
+
52
+ Short version:
53
+
54
+ - Action + Study = **Tutorial**
55
+ - Action + Work = **How-to guide**
56
+ - Cognition + Work = **Reference**
57
+ - Cognition + Study = **Explanation**
58
+
59
+ ## Content Type Signals
60
+
61
+ Trigger phrases are not absolute rules, but they are strong signals.
62
+
63
+ | Quadrant | Typical trigger phrases or patterns | What they usually indicate |
64
+ |----------|-------------------------------------|----------------------------|
65
+ | Tutorial | `build your first`, `getting started`, `learn`, `introduction to`, `beginner`, `walkthrough` | A guided learning path with a defined outcome |
66
+ | How-to guide | `how to`, `configure`, `deploy`, `set up`, `integrate`, `migrate`, `troubleshoot` | A task-focused guide for a user trying to solve a real problem |
67
+ | Reference | `API`, `parameters`, `options`, `schema`, `configuration`, `specification`, `returns` | Structured factual material consulted during work |
68
+ | Explanation | `why`, `how it works`, `overview`, `trade-offs`, `background`, `concepts`, `design` | Material meant to increase understanding and context |
69
+
70
+ Signals become more reliable when they align across title, headings, verbs, and document structure.
71
+
72
+ ## Confidence Calibration
73
+
74
+ Use confidence to decide whether to classify, split, or rewrite.
75
+
76
+ | Confidence | Interpretation | Recommended action |
77
+ |------------|----------------|--------------------|
78
+ | High | All signals match one quadrant | Classify directly and write fully in that mode |
79
+ | Medium | Signals match one quadrant but the topic could span two | Classify to the dominant quadrant and cross-link the adjacent need |
80
+ | Low | Mixed signals across quadrants | Split the document rather than forcing one label |
81
+
82
+ Practical rule:
83
+
84
+ - **High** means title, tone, structure, and user need all point the same way.
85
+ - **Medium** means one quadrant clearly dominates, but a neighboring quadrant is tempting.
86
+ - **Low** means the document is trying to teach, guide, explain, and describe at once.
87
+
88
+ ## Edge Cases
89
+
90
+ Some common document labels are ambiguous on their face. Classify by function, not by title alone.
91
+
92
+ | Content label | Recommended classification | Reasoning |
93
+ |---------------|----------------------------|-----------|
94
+ | README | Reference | Usually a project summary and entry point, not a discursive explanation |
95
+ | FAQ | Split per question | Each answer may belong to a different quadrant |
96
+ | Getting Started | Tutorial or How-to guide | Tutorial if aimed at learning; How-to if aimed at competent users getting started in work |
97
+ | Troubleshooting | How-to guide | It is task-oriented problem solving |
98
+ | Changelog | Reference | It is a factual record |
99
+ | Architecture overview | Explanation | It exists to help the reader understand system design |
100
+ | Migration guide | How-to guide | It helps the reader complete a concrete transition task |
101
+
102
+ ## Ambiguity Protocol
103
+
104
+ When classification is uncertain:
105
+
106
+ 1. Default to the quadrant that serves the reader's immediate need.
107
+ 2. If it is still unclear, split the document by quadrant.
108
+ 3. If splitting is not worth the cost, classify it by the dominant quadrant and explicitly note the secondary one.
109
+
110
+ Useful signs that a split is warranted:
111
+
112
+ - the introduction promises learning, but the body is a task checklist
113
+ - the document alternates between step-by-step actions and API facts
114
+ - the writer keeps adding “why” digressions to operational instructions
115
+ - headings naturally group into two different quadrant modes
116
+
117
+ ## Attribution
118
+
119
+ This document adapts concepts from the Diataxis framework at [diataxis.fr](https://diataxis.fr/), especially the Compass and related quadrant descriptions.
120
+
121
+ Source material is licensed under **CC-BY-SA 4.0**.
122
+
123
+ Attribution: Daniele Procida, *Diataxis*, [https://diataxis.fr/](https://diataxis.fr/).
@@ -0,0 +1,192 @@
1
+ # Diataxis Quadrants
2
+
3
+ This reference describes the four documentation quadrants in Diataxis: Tutorial, How-to guide, Reference, and Explanation. Use it when a document has already been classified, or when you need boundary tests to decide whether content belongs in one quadrant or has drifted into another.
4
+
5
+ ## Tutorial
6
+
7
+ ### Definition
8
+
9
+ A tutorial is a guided learning experience. It helps a reader acquire competence by doing something meaningful in a controlled path toward a defined outcome.
10
+
11
+ ### Tutorial Is / Is Not
12
+
13
+ | IS | IS NOT |
14
+ |----|--------|
15
+ | Learning-oriented | A reference to consult |
16
+ | Practical and guided | A set of independent steps |
17
+ | Structured as a path | Complete coverage of a topic |
18
+ | Built around a defined outcome | A free-form discussion |
19
+
20
+ ### Defining Characteristics
21
+
22
+ - It is designed for a reader who is still learning.
23
+ - It follows a deliberate path from start to finish.
24
+ - It creates a successful encounter with the product or skill.
25
+ - It limits choices so the learner can focus.
26
+ - It optimizes for confidence, momentum, and visible progress.
27
+
28
+ ### Language Patterns
29
+
30
+ Tutorial language is guided, concrete, and supportive. It commonly uses second person and first-person plural.
31
+
32
+ - `In this tutorial, you will ...`
33
+ - `You'll see ...`
34
+ - `Next, we ...`
35
+ - `Notice that ...`
36
+ - `The output should look something like ...`
37
+
38
+ The tone should reduce uncertainty, set expectations, and keep the learner on a single path.
39
+
40
+ ### Boundary Tests
41
+
42
+ - If the steps can be done in any order, it is probably **not** a tutorial.
43
+ - If there is no learning outcome, it is probably a **How-to guide**.
44
+ - If the content starts listing all options and variants, it is drifting toward **Reference**.
45
+ - If the content spends time on rationale and design history, it is drifting toward **Explanation**.
46
+
47
+ ## How-to Guide
48
+
49
+ ### Definition
50
+
51
+ A how-to guide is a task-oriented document for someone trying to solve a specific problem or complete a real piece of work. It assumes the reader already has enough competence to act on concise guidance.
52
+
53
+ ### How-to Is / Is Not
54
+
55
+ | IS | IS NOT |
56
+ |----|--------|
57
+ | Task-oriented | A lesson |
58
+ | Practical | An explanation of concepts |
59
+ | Focused on a specific problem | A comprehensive reference |
60
+ | Written for application in real work | A broad introduction |
61
+
62
+ ### Defining Characteristics
63
+
64
+ - It starts from a concrete goal or problem.
65
+ - It is written for readers who are already doing work.
66
+ - It emphasizes action, judgement, and usable sequence.
67
+ - It avoids digressions into fundamentals unless strictly necessary.
68
+ - It may branch for real-world conditions and alternatives.
69
+
70
+ ### Language Patterns
71
+
72
+ How-to language is direct and imperative. It should sound executable.
73
+
74
+ - `Configure X.`
75
+ - `Deploy to Y.`
76
+ - `Set up the service account.`
77
+ - `If you need Z, do ...`
78
+ - `To migrate safely, first ...`
79
+
80
+ Good how-to writing is short, concrete, and free of conceptual detours.
81
+
82
+ ### Boundary Tests
83
+
84
+ - If it teaches fundamentals before the task, it is drifting toward **Tutorial**.
85
+ - If it mostly describes available options rather than choosing a path, it is drifting toward **Reference**.
86
+ - If it answers `why` more than `what to do`, it is drifting toward **Explanation**.
87
+ - If success depends on following a pedagogical sequence rather than solving a task, it belongs in **Tutorial**.
88
+
89
+ ## Reference
90
+
91
+ ### Definition
92
+
93
+ Reference is factual documentation consulted during work. It describes the machinery, interface, structure, or behavior of the system as clearly and consistently as possible.
94
+
95
+ ### Reference Is / Is Not
96
+
97
+ | IS | IS NOT |
98
+ |----|--------|
99
+ | Information-oriented | A guide |
100
+ | Austere and factual | Opinionated |
101
+ | Comprehensive within scope | Narrative |
102
+ | Structured consistently | Selective in the style of a lesson |
103
+
104
+ ### Defining Characteristics
105
+
106
+ - It is optimized for lookup, not for linear reading.
107
+ - It presents facts, interfaces, constraints, and structure.
108
+ - It uses a consistent pattern so readers can find answers quickly.
109
+ - It aims for completeness inside a defined scope.
110
+ - It avoids persuasion, instruction-heavy flow, and discursive context.
111
+
112
+ ### Language Patterns
113
+
114
+ Reference language is descriptive, factual, and usually third person.
115
+
116
+ - `Returns {type}.`
117
+ - `Accepts the following parameters ...`
118
+ - `Option values are ...`
119
+ - `The schema contains ...`
120
+ - `Configuration keys include ...`
121
+
122
+ Warnings and constraints are fine, but they should remain factual rather than tutorial or argumentative.
123
+
124
+ ### Boundary Tests
125
+
126
+ - If the content explains why a design exists, it belongs in **Explanation**.
127
+ - If the content shows how to accomplish a task with the feature, it belongs in **How-to guide**.
128
+ - If the content walks a newcomer through a first success path, it belongs in **Tutorial**.
129
+ - If the content becomes selective and outcome-driven rather than complete and structured, it is no longer pure reference.
130
+
131
+ ## Explanation
132
+
133
+ ### Definition
134
+
135
+ Explanation is understanding-oriented documentation. It connects concepts, provides rationale and background, and helps the reader build a mental model of the system or topic.
136
+
137
+ ### Explanation Is / Is Not
138
+
139
+ | IS | IS NOT |
140
+ |----|--------|
141
+ | Understanding-oriented | Step-by-step instructions |
142
+ | Discursive and connective | A lookup table |
143
+ | Rich in context | A tutorial |
144
+ | Concerned with reasons and implications | A terse list of facts |
145
+
146
+ ### Defining Characteristics
147
+
148
+ - It provides context, rationale, and conceptual framing.
149
+ - It connects details into a broader mental model.
150
+ - It can discuss trade-offs, history, alternatives, and design intent.
151
+ - It supports reflection more than immediate action.
152
+ - It is bounded by topic rather than by task or API surface.
153
+
154
+ ### Language Patterns
155
+
156
+ Explanation language is descriptive, interpretive, and often comparative.
157
+
158
+ - `The reason for ...`
159
+ - `This approach was chosen because ...`
160
+ - `Consider the trade-off ...`
161
+ - `Historically, the system evolved this way because ...`
162
+ - `An X in this system is analogous to ...`
163
+
164
+ It is acceptable here to surface perspective, evaluation, and multiple interpretations.
165
+
166
+ ### Boundary Tests
167
+
168
+ - If the document has numbered operational steps, it likely belongs in **How-to guide** or **Tutorial**.
169
+ - If it lists facts without context, it likely belongs in **Reference**.
170
+ - If it promises a concrete outcome the reader will build, it likely belongs in **Tutorial**.
171
+ - If it exists mainly to solve an immediate operational problem, it belongs in **How-to guide**.
172
+
173
+ ## Cross-Linking Rules
174
+
175
+ Quadrants should cooperate rather than compete. Each document should point to adjacent documentation types when a different reader need appears.
176
+
177
+ | From | Cross-link pattern |
178
+ |------|--------------------|
179
+ | Tutorial | `For the full API, see [Reference].` |
180
+ | How-to guide | `To understand why, see [Explanation].` |
181
+ | Reference | `For a guide on using this, see [How-to].` |
182
+ | Explanation | `To get started, see [Tutorial].` |
183
+
184
+ Use cross-links when content would otherwise drift into the wrong quadrant. Link instead of absorbing the adjacent material.
185
+
186
+ ## Attribution
187
+
188
+ This document adapts concepts from the Diataxis framework at [diataxis.fr](https://diataxis.fr/), especially the quadrant descriptions and distinction pages.
189
+
190
+ Source material is licensed under **CC-BY-SA 4.0**.
191
+
192
+ Attribution: Daniele Procida, *Diataxis*, [https://diataxis.fr/](https://diataxis.fr/).
@@ -0,0 +1,76 @@
1
+ # Diataxis Quality & Iteration
2
+
3
+ How to assess and improve documentation quality using the Diátaxis framework.
4
+
5
+ ## Quality Checklist
6
+
7
+ Run this checklist against every document created or updated during `_docs-sync`:
8
+
9
+ ### Quadrant Purity
10
+ - [ ] Document serves exactly ONE Diátaxis quadrant
11
+ - [ ] No mixed-mode content (tutorial narration + reference tables + explanation prose)
12
+ - [ ] Language patterns match the quadrant (see diataxis-quadrants.md)
13
+ - [ ] If content from another quadrant is needed, it's linked — not embedded
14
+
15
+ ### Structure & Completeness
16
+ - [ ] All required template sections are present (see diataxis-templates.md)
17
+ - [ ] No empty placeholder sections
18
+ - [ ] Cross-references to related docs in other quadrants exist
19
+ - [ ] `type:` frontmatter tag matches the actual content quadrant
20
+
21
+ ### Evidence & Accuracy
22
+ - [ ] Claims are traceable to source files, config, or AI Kit tool output
23
+ - [ ] Unknowns are marked `[TODO]`, not guessed
24
+ - [ ] Team-intent items are marked `[ASK USER]`
25
+ - [ ] No stale information (version numbers, deprecated APIs, removed features)
26
+
27
+ ### Audience Fit
28
+ - [ ] Tutorial: assumes beginner, teaches one skill, shows visible results at each step
29
+ - [ ] How-To: assumes competence, addresses specific task, no unnecessary explanation
30
+ - [ ] Reference: factual, comprehensive, consistent structure, austere
31
+ - [ ] Explanation: provides context, takes a position, connects concepts
32
+
33
+ ## Iterative Improvement Process
34
+
35
+ Documentation improves incrementally. Don't try to perfect everything at once.
36
+
37
+ ### The Loop
38
+
39
+ ```
40
+ 1. Pick one document (or section, or paragraph)
41
+ 2. Classify it → which Diátaxis quadrant?
42
+ 3. Check → does it serve that quadrant well? (use checklist above)
43
+ 4. Make one improvement
44
+ 5. Repeat
45
+ ```
46
+
47
+ ### When to Iterate
48
+
49
+ | Trigger | Action |
50
+ |---------|--------|
51
+ | New doc created during `_docs-sync` | Run full checklist before committing |
52
+ | Existing doc updated | Check only the modified sections |
53
+ | Docs audit requested | Run checklist on all docs; prioritize by staleness |
54
+ | Content feels wrong but works | Classify first — often the issue is quadrant mixing |
55
+
56
+ ### Organic Growth (from diataxis.fr)
57
+
58
+ - Let documentation structure emerge from content needs — don't create empty four-section structures
59
+ - A project with no tutorials doesn't need a `tutorials/` directory
60
+ - Add documentation types as the project actually needs them
61
+ - Perfect is the enemy of good — a correct how-to guide is better than no documentation
62
+
63
+ ### Scoring (optional, for audits)
64
+
65
+ Per document, count how many checklist items pass out of the total applicable items.
66
+
67
+ | Score | Quality | Action |
68
+ |-------|---------|--------|
69
+ | 100% | Excellent | No action needed |
70
+ | 75-99% | Good | Fix during next relevant change |
71
+ | 50-74% | Needs work | Schedule improvement |
72
+ | <50% | Poor | Rewrite or split immediately |
73
+
74
+ ---
75
+
76
+ *Quality framework follows the Diátaxis documentation framework (CC-BY-SA 4.0, Daniele Procida).*
@@ -0,0 +1,120 @@
1
+ # Diataxis Templates
2
+
3
+ Templates for Tutorial and Explanation documents. For How-To and Reference templates, see the main docs SKILL.md.
4
+
5
+ ## Tutorial Template
6
+
7
+ **Location**: `docs/guides/tutorials/{topic}.md`
8
+ **Quadrant**: Tutorial (learning-oriented, practical)
9
+
10
+ ```markdown
11
+ ---
12
+ type: tutorial
13
+ ---
14
+
15
+ # Tutorial: {Title — Start with a Verb Phrase}
16
+
17
+ > **What you'll build/learn**: One sentence describing the concrete outcome.
18
+
19
+ ## Prerequisites
20
+
21
+ - {Prerequisite 1} — [install guide](link)
22
+ - {Prerequisite 2}
23
+
24
+ ## Steps
25
+
26
+ ### 1. {First Visible Result}
27
+
28
+ {Concrete action with immediate, visible output.}
29
+
30
+ ```bash
31
+ {command or code}
32
+ ```
33
+
34
+ > **You'll see**: {expected output — always show what success looks like}
35
+
36
+ ### 2. {Build on Step 1}
37
+
38
+ {Next concrete action that builds on the previous result.}
39
+
40
+ > **You'll see**: {expected output}
41
+
42
+ ### 3. {Complete the Goal}
43
+
44
+ {Final action that achieves the tutorial's stated outcome.}
45
+
46
+ > **You'll see**: {final result matching the "What you'll build" promise}
47
+
48
+ ## What You Learned
49
+
50
+ {One-paragraph summary of skills acquired. No new concepts here.}
51
+
52
+ ## Next Steps
53
+
54
+ - [How to {related task}](../guides/{topic}.md) — apply what you learned
55
+ - [{Topic} Reference](../../reference/{topic}.md) — full API details
56
+ - [About {concept}](../../architecture/{topic}.md) — understand the design
57
+ ```
58
+
59
+ ### Tutorial Rules
60
+
61
+ 1. **Always show results** — every step must have a "You'll see" block
62
+ 2. **Linear path only** — no branching, no optional steps, no alternatives
63
+ 3. **No explanations** — if the reader asks "why?", link to an Explanation doc
64
+ 4. **Concrete outcome** — the tutorial must produce something visible (output, file, running service)
65
+ 5. **Minimum viable scope** — teach ONE thing; link to other tutorials for more
66
+
67
+ ## Explanation Template
68
+
69
+ **Location**: `docs/architecture/{topic}.md` or `docs/decisions/NNN-{title}.md`
70
+ **Quadrant**: Explanation (understanding-oriented, theoretical)
71
+
72
+ ```markdown
73
+ ---
74
+ type: explanation
75
+ ---
76
+
77
+ # About {Topic}
78
+
79
+ ## Context
80
+
81
+ {Why this topic matters. What problem or question it addresses. Set the stage.}
82
+
83
+ ## Background
84
+
85
+ {Historical context, prior art, or constraints that shaped the current approach.}
86
+
87
+ ## How It Works
88
+
89
+ {Discursive description — connections between components, data flow, design reasoning.}
90
+ {NO step-by-step procedures — link to How-To guides for that.}
91
+
92
+ ## Design Decisions
93
+
94
+ {Why this approach was chosen over alternatives.}
95
+ {Link to ADRs where they exist: [ADR-NNN](../decisions/NNN-{title}.md)}
96
+
97
+ ## Trade-Offs
98
+
99
+ | Gained | Sacrificed |
100
+ |--------|-----------|
101
+ | {benefit} | {cost} |
102
+
103
+ ## Related
104
+
105
+ - [How to {task}](../guides/{topic}.md) — practical application
106
+ - [{API} Reference](../reference/{topic}.md) — technical details
107
+ - [Tutorial: {topic}](../guides/tutorials/{topic}.md) — hands-on introduction
108
+ ```
109
+
110
+ ### Explanation Rules
111
+
112
+ 1. **Take a position** — good explanation has perspective and opinion
113
+ 2. **Connect concepts** — show relationships, not isolated facts
114
+ 3. **No procedures** — if you write "Step 1:", move it to a How-To doc
115
+ 4. **Bounded scope** — explain ONE concept/decision/pattern per document
116
+ 5. **Link to evidence** — reference ADRs, code, or analysis tool output
117
+
118
+ ---
119
+
120
+ *Templates follow the Diátaxis documentation framework (CC-BY-SA 4.0, Daniele Procida).*
@@ -0,0 +1,70 @@
1
+ # Flow Artifacts Guide
2
+
3
+ ## What Are Flow Artifacts
4
+
5
+ Flows produce structured markdown artifacts in `{{artifacts_path}}/`. These files capture requirements, decisions, plan shape, implementation progress, and verification results for the completed flow.
6
+
7
+ Use artifacts to document the why behind changes. Code diffs still matter, but artifacts usually contain the rationale, constraints, risks, and review findings that should shape durable documentation.
8
+
9
+ ## How to Discover Artifacts
10
+
11
+ ```text
12
+ flow_status() # Get artifactsPath
13
+ find({ pattern: "*.md", path: "<artifactsPath>" }) # Discover artifact files
14
+ digest({ sources: [ # Compress into working context
15
+ { path: "<found-artifact-1>" },
16
+ { path: "<found-artifact-2>" },
17
+ ...
18
+ ]})
19
+ ```
20
+
21
+ Read every artifact `find()` returns. Different flows produce different files — do not assume specific filenames exist.
22
+
23
+ ## Artifact Catalog
24
+
25
+ | Artifact | Flow | Contains |
26
+ |---|---|---|
27
+ | `design-decisions.md` | `aikit:basic`, `aikit:advanced` | FORGE tier, approach, key decisions, constraints, and risks |
28
+ | `assessment.md` | `aikit:basic` | Goal, affected files, approach steps, risks, and open questions |
29
+ | `spec.md` | `aikit:advanced` | Requirements, acceptance criteria, and scope boundaries |
30
+ | `plan.md` | `aikit:advanced` | Phased implementation plan and architecture decisions |
31
+ | `tasks.md` | `aikit:advanced` | Atomic task list, dependencies, and agent assignments |
32
+ | `progress.md` | `aikit:basic`, `aikit:advanced` | Changes made, tests, deviations, and validation results |
33
+ | `verify-report.md` | `aikit:basic`, `aikit:advanced` | Verdict, quality gates, review findings, security, and recommendation |
34
+
35
+ ## Artifact-to-Documentation Mapping
36
+
37
+ | Artifact | Contains | Documentation Target | Action |
38
+ |---|---|---|---|
39
+ | `design-decisions.md` | FORGE tier, approach, key decisions | `docs/decisions/` | Create or update ADRs via `adr-skill` for each key decision |
40
+ | `design-decisions.md` | Architecture approach, constraints | `docs/architecture/overview.md` | Update the design rationale section |
41
+ | `spec.md` | Requirements, acceptance criteria | `docs/reference/` | Update API or component reference when public surface changed |
42
+ | `plan.md` | Architecture decisions, phase design | `docs/architecture/` | Update architecture docs with structural changes |
43
+ | `tasks.md` | Task breakdown, dependencies | Usually skip | Only document if it reveals new component boundaries |
44
+ | `progress.md` | Files changed, deviations, tests | `docs/guides/testing.md` | Update when testing strategy changed |
45
+ | `progress.md` | Deviations from plan | `docs/decisions/` | Document significant deviations as ADRs |
46
+ | `verify-report.md` | Code review findings, security | `docs/architecture/overview.md` | Update if findings reveal architectural patterns |
47
+ | `verify-report.md` | Security concerns | `docs/guides/` | Create or update security guidance when concerns are material |
48
+
49
+ ## Reading Strategy
50
+
51
+ Read every artifact `find()` returns. Triage by content type:
52
+
53
+ | Content Signal | Documentation Value | Action |
54
+ |---|---|---|
55
+ | Decisions, rationale, constraints | High — durable knowledge | Extract into `docs/decisions/` or architecture docs |
56
+ | Requirements, scope, acceptance criteria | High — defines intent | Update reference docs if public surface changed |
57
+ | Review findings, security concerns, quality gates | Medium — surfaces issues | Update architecture or guides if findings are material |
58
+ | Implementation progress, task lists | Low — transient | Document only meaningful deviations from the plan |
59
+
60
+ Skip artifacts that only repeat completed work with no insights beyond the code diff.
61
+
62
+ > The catalog and mapping tables above list artifacts from built-in flows (`aikit:basic`, `aikit:advanced`). Custom flows may produce entirely different artifacts — always discover dynamically with `find()` and classify by content, not by filename.
63
+
64
+ ## What Not to Document
65
+
66
+ | Avoid | Do Instead |
67
+ |---|---|
68
+ | Copying artifact text verbatim into `docs/` | Extract decisions, rationale, constraints, and stable guidance |
69
+ | Documenting every task or progress update | Keep only durable insights that help future readers |
70
+ | Mirroring temporary planning details | Preserve the final reasoning, not the transient workflow chatter |
@@ -0,0 +1,32 @@
1
+ # Project Knowledge — Gotchas
2
+
3
+ Common pitfalls when documenting project knowledge. Reference this during Phase 2 (Investigate) and Phase 4 (Validate).
4
+
5
+ ## Environment Gotchas
6
+
7
+ **Monorepos:** Root `package.json` may have no source — check for `workspaces`, `packages/`, or `apps/` directories. Each workspace may have independent dependencies and conventions. Map each sub-package separately.
8
+
9
+ **Outdated README:** README often describes intended architecture, not the current one. Cross-reference with actual file structure before treating any README claim as fact.
10
+
11
+ **TypeScript path aliases:** `tsconfig.json` `paths` config means imports like `@/foo` don't map directly to the filesystem. Map aliases to real paths before documenting structure.
12
+
13
+ **Generated/compiled output:** Never document patterns from `dist/`, `build/`, `generated/`, `.next/`, `out/`, or `__pycache__/`. These are artefacts — document source conventions only.
14
+
15
+ **`.env.example` reveals required config:** Secrets are never committed. Read `.env.example`, `.env.template`, or `.env.sample` to discover required environment variables.
16
+
17
+ **`devDependencies` ≠ production stack:** Only `dependencies` (or equivalent) runs in production. Document linters, formatters, and test frameworks separately as dev tooling in `stack.md`.
18
+
19
+ **Test TODOs ≠ production debt:** TODOs inside test directories are coverage gaps, not production technical debt. Separate them in `concerns.md`.
20
+
21
+ **High-churn files = fragile areas:** Files appearing most in recent `git_context({})` output have the highest modification rate and likely hidden complexity. Always note them in `concerns.md`.
22
+
23
+ ## Anti-Pattern Table
24
+
25
+ | ❌ Don't | ✅ Do instead |
26
+ |---------|--------------|
27
+ | "Uses Clean Architecture with Domain/Data layers" (when no such directories exist) | State only what directory structure actually shows |
28
+ | "This is a Next.js project" (without checking `package.json`) | Check `dependencies` first. State what's actually there |
29
+ | Guess the database from a variable name like `dbUrl` | Check manifest for `pg`, `mysql2`, `mongoose`, `prisma`, etc. |
30
+ | Document `dist/` or `build/` naming patterns as conventions | Source files only |
31
+ | Assume README describes current architecture | Cross-reference with actual file structure via `analyze_structure` |
32
+ | Treat test TODOs as production tech debt | Separate coverage gaps from production concerns in `concerns.md` |