@vpxa/aikit 0.1.73 → 0.1.75
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.
- package/package.json +9 -1
- package/packages/cli/dist/index.js +2 -2
- package/packages/cli/dist/{init-D_OGLUN1.js → init-CuRXmyD9.js} +4 -4
- package/packages/cli/dist/scaffold-WMQ2uQ48.js +2 -0
- package/packages/cli/dist/{templates-DJ7EC5vw.js → templates-ArdAVWoY.js} +13 -3
- package/packages/cli/dist/user-vbJwa7x2.js +5 -0
- package/packages/dashboard/dist/assets/index-C6D-PCp0.js.map +1 -1
- package/packages/flows/dist/index.d.ts +29 -0
- package/packages/flows/dist/index.js +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/{server-B9Mx1aK-.js → server-CVhVH5cT.js} +127 -127
- package/packages/tools/dist/index.d.ts +19 -1
- package/packages/tools/dist/index.js +39 -39
- package/scaffold/dist/adapters/claude-code.mjs +4 -0
- package/scaffold/dist/adapters/copilot.mjs +75 -0
- package/scaffold/dist/adapters/flows.mjs +1 -0
- package/scaffold/dist/adapters/skills.mjs +1 -0
- package/scaffold/dist/compiled/flows-data.mjs +1429 -0
- package/scaffold/dist/compiled/skills-data.mjs +9951 -0
- package/scaffold/dist/definitions/agents.mjs +9 -0
- package/scaffold/{definitions → dist/definitions}/bodies.mjs +6 -229
- package/scaffold/dist/definitions/exclusions.mjs +1 -0
- package/scaffold/dist/definitions/hooks.mjs +1 -0
- package/scaffold/dist/definitions/models.mjs +1 -0
- package/scaffold/dist/definitions/plugins.mjs +1 -0
- package/scaffold/{definitions → dist/definitions}/prompts.mjs +9 -149
- package/scaffold/{definitions → dist/definitions}/protocols.mjs +9 -37
- package/scaffold/dist/definitions/tools.mjs +1 -0
- package/packages/cli/dist/scaffold-CJwkHf-q.js +0 -2
- package/packages/cli/dist/user-BEmVW8Tp.js +0 -5
- package/scaffold/adapters/claude-code.mjs +0 -73
- package/scaffold/adapters/copilot.mjs +0 -292
- package/scaffold/definitions/agents.mjs +0 -266
- package/scaffold/definitions/hooks.mjs +0 -43
- package/scaffold/definitions/models.mjs +0 -84
- package/scaffold/definitions/plugins.mjs +0 -147
- package/scaffold/definitions/tools.mjs +0 -250
- package/scaffold/flows/_epilogue/steps/docs-sync/README.md +0 -120
- package/scaffold/flows/aikit-advanced/README.md +0 -70
- package/scaffold/flows/aikit-advanced/flow.json +0 -69
- package/scaffold/flows/aikit-advanced/steps/design/README.md +0 -178
- package/scaffold/flows/aikit-advanced/steps/execute/README.md +0 -145
- package/scaffold/flows/aikit-advanced/steps/plan/README.md +0 -122
- package/scaffold/flows/aikit-advanced/steps/spec/README.md +0 -121
- package/scaffold/flows/aikit-advanced/steps/task/README.md +0 -119
- package/scaffold/flows/aikit-advanced/steps/verify/README.md +0 -145
- package/scaffold/flows/aikit-basic/README.md +0 -51
- package/scaffold/flows/aikit-basic/flow.json +0 -45
- package/scaffold/flows/aikit-basic/steps/assess/README.md +0 -109
- package/scaffold/flows/aikit-basic/steps/design/README.md +0 -116
- package/scaffold/flows/aikit-basic/steps/implement/README.md +0 -131
- package/scaffold/flows/aikit-basic/steps/verify/README.md +0 -123
- package/scaffold/general/agents/Architect-Reviewer-Alpha.agent.md +0 -132
- package/scaffold/general/agents/Architect-Reviewer-Beta.agent.md +0 -132
- package/scaffold/general/agents/Code-Reviewer-Alpha.agent.md +0 -112
- package/scaffold/general/agents/Code-Reviewer-Beta.agent.md +0 -112
- package/scaffold/general/agents/Debugger.agent.md +0 -412
- package/scaffold/general/agents/Documenter.agent.md +0 -468
- package/scaffold/general/agents/Explorer.agent.md +0 -76
- package/scaffold/general/agents/Frontend.agent.md +0 -440
- package/scaffold/general/agents/Implementer.agent.md +0 -425
- package/scaffold/general/agents/Orchestrator.agent.md +0 -452
- package/scaffold/general/agents/Planner.agent.md +0 -481
- package/scaffold/general/agents/README.md +0 -57
- package/scaffold/general/agents/Refactor.agent.md +0 -435
- package/scaffold/general/agents/Researcher-Alpha.agent.md +0 -151
- package/scaffold/general/agents/Researcher-Beta.agent.md +0 -152
- package/scaffold/general/agents/Researcher-Delta.agent.md +0 -153
- package/scaffold/general/agents/Researcher-Gamma.agent.md +0 -152
- package/scaffold/general/agents/Security.agent.md +0 -433
- package/scaffold/general/agents/_shared/architect-reviewer-base.md +0 -104
- package/scaffold/general/agents/_shared/code-agent-base.md +0 -366
- package/scaffold/general/agents/_shared/code-reviewer-base.md +0 -87
- package/scaffold/general/agents/_shared/decision-protocol.md +0 -27
- package/scaffold/general/agents/_shared/forge-protocol.md +0 -90
- package/scaffold/general/agents/_shared/researcher-base.md +0 -114
- package/scaffold/general/agents/templates/adr-template.md +0 -28
- package/scaffold/general/agents/templates/execution-state.md +0 -26
- package/scaffold/general/prompts/aikit-ask.prompt.md +0 -13
- package/scaffold/general/prompts/aikit-debug.prompt.md +0 -15
- package/scaffold/general/prompts/aikit-design.prompt.md +0 -15
- package/scaffold/general/prompts/aikit-flow-add.prompt.md +0 -84
- package/scaffold/general/prompts/aikit-flow-create.prompt.md +0 -80
- package/scaffold/general/prompts/aikit-flow-manage.prompt.md +0 -24
- package/scaffold/general/prompts/aikit-implement.prompt.md +0 -17
- package/scaffold/general/prompts/aikit-plan.prompt.md +0 -15
- package/scaffold/general/prompts/aikit-review.prompt.md +0 -24
- package/scaffold/general/skills/adr-skill/SKILL.md +0 -335
- package/scaffold/general/skills/adr-skill/assets/templates/adr-madr.md +0 -89
- package/scaffold/general/skills/adr-skill/assets/templates/adr-readme.md +0 -20
- package/scaffold/general/skills/adr-skill/assets/templates/adr-simple.md +0 -46
- package/scaffold/general/skills/adr-skill/references/adr-conventions.md +0 -95
- package/scaffold/general/skills/adr-skill/references/examples.md +0 -193
- package/scaffold/general/skills/adr-skill/references/review-checklist.md +0 -77
- package/scaffold/general/skills/adr-skill/references/template-variants.md +0 -52
- package/scaffold/general/skills/adr-skill/scripts/bootstrap_adr.js +0 -259
- package/scaffold/general/skills/adr-skill/scripts/new_adr.js +0 -391
- package/scaffold/general/skills/adr-skill/scripts/set_adr_status.js +0 -169
- package/scaffold/general/skills/aikit/SKILL.md +0 -754
- package/scaffold/general/skills/brainstorming/SKILL.md +0 -265
- package/scaffold/general/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/scaffold/general/skills/c4-architecture/SKILL.md +0 -389
- package/scaffold/general/skills/c4-architecture/references/advanced-patterns.md +0 -552
- package/scaffold/general/skills/c4-architecture/references/c4-syntax.md +0 -510
- package/scaffold/general/skills/c4-architecture/references/common-mistakes.md +0 -437
- package/scaffold/general/skills/c4-architecture/references/html-design-system.md +0 -337
- package/scaffold/general/skills/c4-architecture/references/html-template.html +0 -627
- package/scaffold/general/skills/docs/SKILL.md +0 -553
- package/scaffold/general/skills/docs/references/diataxis-anti-patterns.md +0 -147
- package/scaffold/general/skills/docs/references/diataxis-compass.md +0 -123
- package/scaffold/general/skills/docs/references/diataxis-quadrants.md +0 -192
- package/scaffold/general/skills/docs/references/diataxis-quality.md +0 -76
- package/scaffold/general/skills/docs/references/diataxis-templates.md +0 -120
- package/scaffold/general/skills/docs/references/flow-artifacts-guide.md +0 -70
- package/scaffold/general/skills/docs/references/project-knowledge-gotchas.md +0 -32
- package/scaffold/general/skills/docs/references/project-knowledge-templates.md +0 -281
- package/scaffold/general/skills/docs/references/project-knowledge-workflow.md +0 -80
- package/scaffold/general/skills/frontend-design/SKILL.md +0 -237
- package/scaffold/general/skills/lesson-learned/SKILL.md +0 -113
- package/scaffold/general/skills/lesson-learned/references/anti-patterns.md +0 -55
- package/scaffold/general/skills/lesson-learned/references/se-principles.md +0 -109
- package/scaffold/general/skills/multi-agents-development/SKILL.md +0 -448
- package/scaffold/general/skills/multi-agents-development/architecture-review-prompt.md +0 -81
- package/scaffold/general/skills/multi-agents-development/code-quality-review-prompt.md +0 -91
- package/scaffold/general/skills/multi-agents-development/implementer-prompt.md +0 -93
- package/scaffold/general/skills/multi-agents-development/parallel-dispatch-example.md +0 -167
- package/scaffold/general/skills/multi-agents-development/spec-review-prompt.md +0 -81
- package/scaffold/general/skills/present/SKILL.md +0 -616
- package/scaffold/general/skills/react/SKILL.md +0 -309
- package/scaffold/general/skills/repo-access/SKILL.md +0 -178
- package/scaffold/general/skills/repo-access/references/error-patterns.md +0 -116
- package/scaffold/general/skills/repo-access/references/platform-matrix.md +0 -142
- package/scaffold/general/skills/requirements-clarity/SKILL.md +0 -333
- package/scaffold/general/skills/session-handoff/SKILL.md +0 -199
- package/scaffold/general/skills/session-handoff/references/handoff-template.md +0 -139
- package/scaffold/general/skills/session-handoff/references/resume-checklist.md +0 -80
- package/scaffold/general/skills/session-handoff/scripts/check_staleness.js +0 -269
- package/scaffold/general/skills/session-handoff/scripts/create_handoff.js +0 -299
- package/scaffold/general/skills/session-handoff/scripts/list_handoffs.js +0 -113
- package/scaffold/general/skills/session-handoff/scripts/validate_handoff.js +0 -241
- package/scaffold/general/skills/typescript/SKILL.md +0 -405
- package/scaffold/generate.mjs +0 -82
|
@@ -1,553 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: docs
|
|
3
|
-
description: "Living documentation management — Diátaxis framework, docs/ convention, create/update rules, staleness detection, integration with adr-skill and c4-architecture."
|
|
4
|
-
metadata:
|
|
5
|
-
category: cross-cutting
|
|
6
|
-
domain: general
|
|
7
|
-
applicability: on-demand
|
|
8
|
-
inputs: [code-changes, flow-artifacts, architecture]
|
|
9
|
-
outputs: [documentation]
|
|
10
|
-
relatedSkills: [adr-skill, c4-architecture]
|
|
11
|
-
internal: true
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
# Docs — Living Documentation Skill
|
|
15
|
-
|
|
16
|
-
Manage the `docs/` folder as a single source of truth for project documentation. This skill runs during the mandatory `_docs-sync` epilogue step of every flow, ensuring documentation stays in sync with code changes.
|
|
17
|
-
|
|
18
|
-
## Principles
|
|
19
|
-
|
|
20
|
-
1. **Living, not legacy** — Documentation is updated as code changes, never as a separate "docs sprint"
|
|
21
|
-
2. **One source of truth** — Never duplicate what's in code comments, READMEs, or inline JSDoc
|
|
22
|
-
3. **Diátaxis framework** — Organize docs into four categories using the two-question compass:
|
|
23
|
-
- **Q1**: Is the reader trying to **do** something (action) or **understand** something (cognition)?
|
|
24
|
-
- **Q2**: Is the reader **learning** (study) or **working** (work)?
|
|
25
|
-
- Action+Study → Tutorial · Action+Work → How-to · Cognition+Work → Reference · Cognition+Study → Explanation
|
|
26
|
-
- See [references/diataxis-compass.md](references/diataxis-compass.md) for the full classification system
|
|
27
|
-
4. **Minimal but complete** — Create docs only when they add value beyond what code communicates
|
|
28
|
-
5. **Delegate to specialists** — Architecture diagrams → `c4-architecture` skill. Decision records → `adr-skill`
|
|
29
|
-
|
|
30
|
-
## Documentation Modes
|
|
31
|
-
|
|
32
|
-
This skill operates in two modes, often combined:
|
|
33
|
-
|
|
34
|
-
### Source-Only Mode
|
|
35
|
-
Generate documentation from code analysis alone. Used when:
|
|
36
|
-
- Bootstrapping `docs/` for the first time (`produce_knowledge`, `analyze_*` tools)
|
|
37
|
-
- Running outside a flow context (manual documentation refresh)
|
|
38
|
-
- Flow produced no artifacts (auto-skipped design step)
|
|
39
|
-
|
|
40
|
-
### Flow-Aware Mode (Primary)
|
|
41
|
-
Generate documentation from code changes **plus** flow artifacts. This is the primary mode during `_docs-sync` because every completed flow produces structured artifacts containing design decisions, requirements, and verification results.
|
|
42
|
-
|
|
43
|
-
Flow artifacts are the most valuable documentation input — they capture the *why* behind changes (decisions, constraints, trade-offs, risks) while code only shows the *what*.
|
|
44
|
-
|
|
45
|
-
**Artifact reading sequence:**
|
|
46
|
-
```
|
|
47
|
-
flow_status() # Get artifactsPath
|
|
48
|
-
find({ pattern: "*.md", path: "<artifactsPath>" }) # Discover all artifacts
|
|
49
|
-
digest({ sources: [ # Compress into working context
|
|
50
|
-
{ path: "<found-artifact-1>" },
|
|
51
|
-
{ path: "<found-artifact-2>" },
|
|
52
|
-
...
|
|
53
|
-
]})
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
See [references/flow-artifacts-guide.md](references/flow-artifacts-guide.md) for the artifact catalog and artifact-to-documentation mapping.
|
|
57
|
-
|
|
58
|
-
## AI Kit Tools for Documentation
|
|
59
|
-
|
|
60
|
-
Use these existing AI Kit tools to generate documentation content — never write docs from scratch when a tool can provide the foundation:
|
|
61
|
-
|
|
62
|
-
| Documentation Task | AI Kit Tool | What It Provides |
|
|
63
|
-
|---|---|---|
|
|
64
|
-
| Project overview | `produce_knowledge({ path: "." })` | Comprehensive analysis: structure, patterns, dependencies → `docs/README.md` |
|
|
65
|
-
| Architecture overview | `analyze_structure({ path: "." })` | File tree, package layout, layer organization → `docs/architecture/overview.md` |
|
|
66
|
-
| Architecture diagrams | `analyze_diagram({ path: "." })` | Mermaid diagrams of component relationships → `docs/architecture/` |
|
|
67
|
-
| Dependency map | `analyze_dependencies({ path: "." })` | Import graph, cross-package edges → `docs/architecture/overview.md` dependencies section |
|
|
68
|
-
| Component analysis | `analyze_symbols({ path: "src/component" })` | Exports, classes, interfaces → `docs/architecture/components/{name}.md` |
|
|
69
|
-
| Entry points / API surface | `analyze_entry_points({ path: "." })` | CLI bins, route handlers, main exports → `docs/reference/api.md` |
|
|
70
|
-
| Code patterns | `analyze_patterns({ path: "." })` | Design patterns, conventions → `docs/architecture/overview.md` patterns section |
|
|
71
|
-
| Impact analysis | `blast_radius({ changed_files: [...] })` | What's affected by changes → targeted doc updates |
|
|
72
|
-
| Change detection | `git_context({})` | Recent changes, diff summary → determine which docs need updating |
|
|
73
|
-
| Module graph | `graph({ action: 'neighbors', node_id })` | Who-imports-whom, cross-package dependencies → architecture diagrams |
|
|
74
|
-
| Full audit | `audit({ path: "." })` | Structure + deps + patterns + health + dead symbols → comprehensive docs refresh |
|
|
75
|
-
|
|
76
|
-
### Tool-First Workflow
|
|
77
|
-
|
|
78
|
-
When creating documentation, always start with tool output, then enhance with human context:
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
1. Run the relevant analysis tool(s)
|
|
82
|
-
2. Use the output as the doc's foundation
|
|
83
|
-
3. Add: purpose/motivation (why, not just what)
|
|
84
|
-
4. Add: decision context (link to ADRs)
|
|
85
|
-
5. Add: cross-references to related docs
|
|
86
|
-
6. Remove: implementation details visible in code
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## `docs/` Convention
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
docs/
|
|
93
|
-
├── README.md ← Project overview + docs index (always exists)
|
|
94
|
-
├── architecture/
|
|
95
|
-
│ ├── overview.md ← C4 context + container diagrams (c4-architecture skill)
|
|
96
|
-
│ ├── stack.md ← Language, runtime, frameworks, all dependencies
|
|
97
|
-
│ ├── structure.md ← Directory layout, entry points, key files
|
|
98
|
-
│ ├── design.md ← Layers, patterns, data flow
|
|
99
|
-
│ ├── conventions.md ← Naming, formatting, error handling, imports
|
|
100
|
-
│ ├── integrations.md ← External APIs, databases, auth, monitoring
|
|
101
|
-
│ ├── testing.md ← Frameworks, file organization, mocking strategy
|
|
102
|
-
│ ├── concerns.md ← Tech debt, bugs, security risks, perf bottlenecks
|
|
103
|
-
│ └── components/
|
|
104
|
-
│ └── {component-name}.md ← Per-component technical docs
|
|
105
|
-
├── decisions/ ← Architecture Decision Records (adr-skill)
|
|
106
|
-
│ ├── index.md ← ADR log / table of contents
|
|
107
|
-
│ └── NNN-{title}.md ← Individual ADRs
|
|
108
|
-
├── guides/
|
|
109
|
-
│ ├── tutorials/ ← Learning-oriented lessons (Diátaxis: Tutorial)
|
|
110
|
-
│ │ └── {topic}.md
|
|
111
|
-
│ └── {topic}.md ← How-to guides for common tasks (Diátaxis: How-To)
|
|
112
|
-
└── reference/
|
|
113
|
-
├── api.md ← API reference (endpoints, schemas, auth)
|
|
114
|
-
└── configuration.md ← Configuration options and environment variables
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Directory Purposes
|
|
118
|
-
|
|
119
|
-
| Directory | Diátaxis Quadrant | What Goes Here | When to Create/Update |
|
|
120
|
-
|-----------|-------------------|----------------|----------------------|
|
|
121
|
-
| `architecture/` | Explanation + Reference | C4 diagrams, project knowledge (stack, structure, design, conventions, integrations, testing, concerns), component docs | Initial onboarding, new component, structural change, architecture decision |
|
|
122
|
-
| `decisions/` | Explanation | ADRs — why decisions were made | Non-trivial technical decision (see adr-skill triggers) |
|
|
123
|
-
| `guides/` | How-To | Step-by-step instructions for tasks | New workflow, complex setup, common operations |
|
|
124
|
-
| `guides/tutorials/` | Tutorial | Learning-oriented guided lessons with concrete outcomes | New technology/feature adoption, onboarding new developers |
|
|
125
|
-
| `reference/` | Reference | API docs, config options, data schemas | API change, new config option, schema modification |
|
|
126
|
-
|
|
127
|
-
## Change-to-Doc Mapping
|
|
128
|
-
|
|
129
|
-
Use this decision tree to determine what documentation action to take after a flow completes:
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
What changed?
|
|
133
|
-
├── New component/module/package
|
|
134
|
-
│ ├── Creates public API? → Create docs/architecture/components/{name}.md + update reference/api.md
|
|
135
|
-
│ └── Internal only? → Update docs/architecture/overview.md (component list)
|
|
136
|
-
├── API change (new endpoint, changed contract, new config)
|
|
137
|
-
│ └── Update docs/reference/api.md or docs/reference/configuration.md
|
|
138
|
-
├── Architecture/infrastructure decision
|
|
139
|
-
│ └── Delegate to adr-skill → creates/updates docs/decisions/NNN-{title}.md
|
|
140
|
-
├── Structural/architecture change
|
|
141
|
-
│ └── Delegate to c4-architecture skill → updates docs/architecture/overview.md
|
|
142
|
-
├── New developer workflow (build, deploy, test pattern)
|
|
143
|
-
│ └── Create or update docs/guides/{topic}.md
|
|
144
|
-
├── Bug fix
|
|
145
|
-
│ ├── Reveals missing docs? → Create the missing doc
|
|
146
|
-
│ └── Straightforward fix? → No docs update needed
|
|
147
|
-
└── Dependency update / refactor / cleanup
|
|
148
|
-
└── No docs update needed (unless public API changed)
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Classify by Diátaxis Quadrant
|
|
152
|
-
|
|
153
|
-
After determining the documentation action, classify the target document's quadrant:
|
|
154
|
-
|
|
155
|
-
| Action → Cognition? | Study → Work? | Quadrant | Target Directory |
|
|
156
|
-
|---------------------|---------------|----------|------------------|
|
|
157
|
-
| Action (doing) | Study (learning) | **Tutorial** | `guides/tutorials/` |
|
|
158
|
-
| Action (doing) | Work (applying) | **How-To** | `guides/` |
|
|
159
|
-
| Cognition (understanding) | Work (using) | **Reference** | `reference/` |
|
|
160
|
-
| Cognition (understanding) | Study (grasping) | **Explanation** | `architecture/`, `decisions/` |
|
|
161
|
-
|
|
162
|
-
Use the [Diátaxis Compass](references/diataxis-compass.md) for edge cases and ambiguous content.
|
|
163
|
-
|
|
164
|
-
## Templates
|
|
165
|
-
|
|
166
|
-
### Component Doc Template (`docs/architecture/components/{name}.md`)
|
|
167
|
-
|
|
168
|
-
```markdown
|
|
169
|
-
# {Component Name}
|
|
170
|
-
|
|
171
|
-
## Purpose
|
|
172
|
-
One-paragraph description of what this component does and why it exists.
|
|
173
|
-
|
|
174
|
-
## Architecture
|
|
175
|
-
- **Location**: `src/{path}/`
|
|
176
|
-
- **Entry point**: `{file}`
|
|
177
|
-
- **Key dependencies**: {list}
|
|
178
|
-
|
|
179
|
-
## Public API
|
|
180
|
-
Brief description of the component's public interface.
|
|
181
|
-
|
|
182
|
-
## Design Decisions
|
|
183
|
-
- Link to relevant ADRs: [ADR-NNN](../../decisions/NNN-{title}.md)
|
|
184
|
-
|
|
185
|
-
## Data Flow
|
|
186
|
-
How data enters, transforms through, and exits this component.
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Guide Template (`docs/guides/{topic}.md`)
|
|
190
|
-
|
|
191
|
-
```markdown
|
|
192
|
-
# How to {Task}
|
|
193
|
-
|
|
194
|
-
## Prerequisites
|
|
195
|
-
What you need before starting.
|
|
196
|
-
|
|
197
|
-
## Steps
|
|
198
|
-
1. Step one
|
|
199
|
-
2. Step two
|
|
200
|
-
3. Step three
|
|
201
|
-
|
|
202
|
-
## Verification
|
|
203
|
-
How to confirm it worked.
|
|
204
|
-
|
|
205
|
-
## Troubleshooting
|
|
206
|
-
Common issues and solutions.
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### Decision Index Template (`docs/decisions/index.md`)
|
|
210
|
-
|
|
211
|
-
```markdown
|
|
212
|
-
# Architecture Decision Record Index
|
|
213
|
-
|
|
214
|
-
This page is the ADR log for the project. IDs are assigned sequentially as decisions are recorded.
|
|
215
|
-
|
|
216
|
-
## Index
|
|
217
|
-
|
|
218
|
-
| ID | Title | Status | Date | Source |
|
|
219
|
-
| --- | --- | --- | --- | --- |
|
|
220
|
-
| ADR-001 | {Decision title} | {Accepted/Proposed/Deprecated/Superseded} | {YYYY-MM-DD} | [{flow-topic}]({relative-path-to-flow-artifact}) |
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
The **Source** column links to the flow artifact (typically `design.md` or `design-decisions.md`) where the decision was originally designed. Use the flow's run directory path relative to the index file location (e.g., `../../.flows/{topic}/{artifacts}/design.md`). If the decision was made outside a flow, use "Manual" or link to the relevant discussion.
|
|
224
|
-
|
|
225
|
-
### Reference Template (`docs/reference/{topic}.md`)
|
|
226
|
-
|
|
227
|
-
```markdown
|
|
228
|
-
# {Topic} Reference
|
|
229
|
-
|
|
230
|
-
## Overview
|
|
231
|
-
Brief description of what this reference covers.
|
|
232
|
-
|
|
233
|
-
## {Section}
|
|
234
|
-
|
|
235
|
-
| Item | Type | Default | Description |
|
|
236
|
-
|------|------|---------|-------------|
|
|
237
|
-
| ... | ... | ... | ... |
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
> **Tutorial and Explanation templates**: For the remaining two Diátaxis quadrants, see [references/diataxis-templates.md](references/diataxis-templates.md).
|
|
241
|
-
|
|
242
|
-
## Integration with Other Skills
|
|
243
|
-
|
|
244
|
-
### `adr-skill` Integration
|
|
245
|
-
- All ADRs live in `docs/decisions/`
|
|
246
|
-
- When the docs-sync step detects an architecture decision was made during the flow, delegate to `adr-skill`
|
|
247
|
-
- After `adr-skill` creates/updates an ADR, update `docs/decisions/index.md`
|
|
248
|
-
- Include the Source column linking to the flow artifact where the decision was designed.
|
|
249
|
-
- Cross-reference ADRs from component docs where relevant
|
|
250
|
-
|
|
251
|
-
### `c4-architecture` Integration
|
|
252
|
-
- Architecture diagrams live in `docs/architecture/`
|
|
253
|
-
- When the docs-sync step detects structural changes (new packages, changed boundaries), delegate to `c4-architecture`
|
|
254
|
-
- Use Mermaid format for docs files (not HTML) — markdown renders in GitHub
|
|
255
|
-
- Reference diagrams from component docs
|
|
256
|
-
|
|
257
|
-
### Mermaid Syntax Rules
|
|
258
|
-
|
|
259
|
-
When generating Mermaid diagrams in documentation:
|
|
260
|
-
|
|
261
|
-
- **Quote node labels containing special characters** — Names with `@`, `/`, or other special characters must be wrapped in double quotes inside square brackets: `subgraph Commons["@scope/package-name"]`, `NodeId["@org/lib"]`
|
|
262
|
-
- **Quote subgraph titles with special characters** — `subgraph Title["@scope/name"]` not `subgraph @scope/name`
|
|
263
|
-
- Node IDs (aliases) must not contain special characters — use plain alphanumeric IDs and put the display name in `["..."]`
|
|
264
|
-
|
|
265
|
-
## Project Knowledge Acquisition
|
|
266
|
-
|
|
267
|
-
Produces seven populated documents in `docs/architecture/` covering everything needed to work effectively on the project — stack, structure, design, conventions, integrations, testing, and concerns.
|
|
268
|
-
|
|
269
|
-
**Only document what is verifiable from files or tool output — never infer or assume.**
|
|
270
|
-
|
|
271
|
-
### Output Contract
|
|
272
|
-
|
|
273
|
-
All of the following must be true before finishing:
|
|
274
|
-
|
|
275
|
-
1. All seven files exist in `docs/architecture/`: `stack.md`, `structure.md`, `design.md`, `conventions.md`, `integrations.md`, `testing.md`, `concerns.md`
|
|
276
|
-
2. Every claim is traceable to source files, config, or AI Kit tool output
|
|
277
|
-
3. Unknowns are marked `[TODO]`; intent-dependent decisions are marked `[ASK USER]`
|
|
278
|
-
4. Every document includes a short "Evidence" section with file paths or tool receipts
|
|
279
|
-
5. Final response includes numbered `[ASK USER]` questions and intent-vs-reality divergences
|
|
280
|
-
|
|
281
|
-
### Documents
|
|
282
|
-
|
|
283
|
-
| Document | Covers | Primary Tools |
|
|
284
|
-
|----------|--------|---------------|
|
|
285
|
-
| `stack.md` | Language, runtime, frameworks, dependencies, dev tooling | `analyze_dependencies`, `analyze_structure` |
|
|
286
|
-
| `structure.md` | Directory layout, entry points, key files, packages | `analyze_structure`, `analyze_entry_points` |
|
|
287
|
-
| `design.md` | Layers, patterns, data flow, component boundaries | `analyze_structure`, `analyze_patterns`, `analyze_diagram` |
|
|
288
|
-
| `conventions.md` | Naming, formatting, error handling, import conventions | `analyze_patterns`, `search("conventions")` |
|
|
289
|
-
| `integrations.md` | External APIs, databases, auth, monitoring, CI/CD | `analyze_dependencies`, `search("API\|database\|auth")` |
|
|
290
|
-
| `testing.md` | Test frameworks, file organization, mocking, coverage | `analyze_patterns`, `test_run({})`, `search("test")` |
|
|
291
|
-
| `concerns.md` | Tech debt, bugs, security risks, perf, high-churn files | `audit()`, `dead_symbols()`, `git_context()` |
|
|
292
|
-
|
|
293
|
-
Use [references/project-knowledge-templates.md](references/project-knowledge-templates.md) for the standard template of each document.
|
|
294
|
-
|
|
295
|
-
### Workflow & References
|
|
296
|
-
|
|
297
|
-
Follow the four-phase workflow: **Scan → Investigate → Populate → Validate**.
|
|
298
|
-
|
|
299
|
-
- [references/project-knowledge-workflow.md](references/project-knowledge-workflow.md) — Full 4-phase workflow, investigation tools per document, population rules, focus area mode
|
|
300
|
-
- [references/project-knowledge-gotchas.md](references/project-knowledge-gotchas.md) — Environment gotchas and anti-pattern table
|
|
301
|
-
|
|
302
|
-
## Architecture Blueprint Generation
|
|
303
|
-
|
|
304
|
-
When bootstrapping `docs/` for the first time or refreshing architecture documentation, generate a comprehensive architecture blueprint. This replaces manual documentation with tool-driven analysis.
|
|
305
|
-
|
|
306
|
-
### Blueprint Workflow
|
|
307
|
-
|
|
308
|
-
```
|
|
309
|
-
Step 1: Detect & Analyze
|
|
310
|
-
analyze_structure({ path: "." }) → project layout, packages, layers
|
|
311
|
-
analyze_patterns({ path: "." }) → conventions, design patterns
|
|
312
|
-
analyze_entry_points({ path: "." }) → API surface, CLI entry points
|
|
313
|
-
|
|
314
|
-
Step 2: Map Dependencies
|
|
315
|
-
analyze_dependencies({ path: "." }) → import graph, cross-package edges
|
|
316
|
-
graph({ action: 'find_nodes', name_pattern: '*' }) → module graph nodes
|
|
317
|
-
graph({ action: 'neighbors', node_id: '...' }) → dependency directions
|
|
318
|
-
|
|
319
|
-
Step 3: Visualize
|
|
320
|
-
analyze_diagram({ path: "." }) → Mermaid architecture diagrams
|
|
321
|
-
Delegate to c4-architecture skill → C4 context/container/component views
|
|
322
|
-
|
|
323
|
-
Step 4: Synthesize
|
|
324
|
-
produce_knowledge({ path: "." }) → comprehensive analysis
|
|
325
|
-
Combine outputs into docs/ structure
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### Blueprint Sections
|
|
329
|
-
|
|
330
|
-
The architecture blueprint should cover these areas (adapted from the Architecture Blueprint Generator pattern):
|
|
331
|
-
|
|
332
|
-
#### 1. Architecture Detection & Analysis
|
|
333
|
-
- **Auto-detect**: Project type, framework, architectural pattern (Clean Architecture, Microservices, Layered, etc.)
|
|
334
|
-
- **Tools**: `analyze_structure` → folder organization, `analyze_patterns` → framework detection, `analyze_dependencies` → dependency flow
|
|
335
|
-
- **Output**: `docs/architecture/overview.md` header section
|
|
336
|
-
|
|
337
|
-
#### 2. Architectural Overview
|
|
338
|
-
- Guiding principles from code structure
|
|
339
|
-
- Architectural boundaries and enforcement mechanisms
|
|
340
|
-
- Hybrid patterns or adaptations
|
|
341
|
-
- **Tools**: `produce_knowledge` + `analyze_structure`
|
|
342
|
-
- **Output**: `docs/architecture/overview.md` main body
|
|
343
|
-
|
|
344
|
-
#### 3. Architecture Visualization
|
|
345
|
-
- High-level subsystem diagram
|
|
346
|
-
- Component interaction diagrams
|
|
347
|
-
- Data flow diagrams
|
|
348
|
-
- **Tools**: `analyze_diagram` + `c4-architecture` skill
|
|
349
|
-
- **Output**: `docs/architecture/overview.md` diagrams + `docs/architecture/diagrams/`
|
|
350
|
-
|
|
351
|
-
#### 4. Core Architectural Components
|
|
352
|
-
For each major component:
|
|
353
|
-
- Purpose and responsibility
|
|
354
|
-
- Internal structure
|
|
355
|
-
- Key abstractions
|
|
356
|
-
- Interaction patterns
|
|
357
|
-
- **Tools**: `analyze_symbols({ path: "component/" })` + `compact({ path, query: "exports" })`
|
|
358
|
-
- **Output**: `docs/architecture/components/{name}.md`
|
|
359
|
-
|
|
360
|
-
#### 5. Layers & Dependencies
|
|
361
|
-
- Layer structure as implemented
|
|
362
|
-
- Dependency rules between layers
|
|
363
|
-
- Abstraction mechanisms for separation
|
|
364
|
-
- Circular dependencies or violations
|
|
365
|
-
- **Tools**: `analyze_dependencies` + `graph({ action: 'neighbors' })`
|
|
366
|
-
- **Output**: `docs/architecture/overview.md` layers section
|
|
367
|
-
|
|
368
|
-
#### 6. Cross-Cutting Concerns
|
|
369
|
-
Document implementation patterns for:
|
|
370
|
-
- Error handling & resilience
|
|
371
|
-
- Logging & observability
|
|
372
|
-
- Validation patterns
|
|
373
|
-
- Configuration management
|
|
374
|
-
- **Tools**: `analyze_patterns` + `search({ query: "error handling" })`
|
|
375
|
-
- **Output**: `docs/architecture/overview.md` cross-cutting section
|
|
376
|
-
|
|
377
|
-
#### 7. Testing Architecture
|
|
378
|
-
- Test framework and strategy
|
|
379
|
-
- Test boundary patterns (unit, integration, e2e)
|
|
380
|
-
- Test file conventions
|
|
381
|
-
- **Tools**: `analyze_patterns` + `search({ query: "test" })`
|
|
382
|
-
- **Output**: `docs/guides/testing.md`
|
|
383
|
-
|
|
384
|
-
#### 8. Extension & Evolution
|
|
385
|
-
- How to add features while preserving architecture
|
|
386
|
-
- Component creation patterns
|
|
387
|
-
- Integration patterns for external systems
|
|
388
|
-
- **Tools**: `analyze_entry_points` + `analyze_patterns`
|
|
389
|
-
- **Output**: `docs/guides/contributing.md` or `docs/architecture/overview.md` extension section
|
|
390
|
-
|
|
391
|
-
## Rules for the `_docs-sync` Epilogue Step
|
|
392
|
-
|
|
393
|
-
When this skill is loaded during the `_docs-sync` epilogue:
|
|
394
|
-
|
|
395
|
-
### 0. Gather Flow Artifacts
|
|
396
|
-
|
|
397
|
-
Read all available artifacts from the completed flow before assessing code changes:
|
|
398
|
-
|
|
399
|
-
```
|
|
400
|
-
flow_status() # Get artifactsPath, topic, phase
|
|
401
|
-
find({ pattern: "*.md", path: "<artifactsPath>" }) # Discover all flow artifacts
|
|
402
|
-
digest({ sources: [ # Compress artifacts for context
|
|
403
|
-
{ path: "<found-artifact-1>" },
|
|
404
|
-
{ path: "<found-artifact-2>" },
|
|
405
|
-
...
|
|
406
|
-
]})
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
Map each discovered artifact to documentation actions using [references/flow-artifacts-guide.md](references/flow-artifacts-guide.md).
|
|
410
|
-
|
|
411
|
-
Read every artifact `find()` returns — different flows produce different files. Focus on artifacts that contain decisions, requirements, and verification results; skip artifacts that only repeat completed work.
|
|
412
|
-
|
|
413
|
-
If `flow_status()` returns no active flow or no artifacts directory exists, skip this step (source-only mode).
|
|
414
|
-
|
|
415
|
-
### 1. Assess Changes (tool-driven)
|
|
416
|
-
|
|
417
|
-
```
|
|
418
|
-
git_context({}) # What changed in this flow
|
|
419
|
-
blast_radius({ changed_files: ["changed-files"] }) # Impact analysis
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
Use the output to classify changes against the Change-to-Doc Mapping decision tree.
|
|
423
|
-
|
|
424
|
-
### 1b. Classify Target Quadrant
|
|
425
|
-
|
|
426
|
-
For each doc action identified in Step 1, determine the Diátaxis quadrant:
|
|
427
|
-
|
|
428
|
-
1. Ask: **Action or Cognition?** Is the reader doing something or understanding something?
|
|
429
|
-
2. Ask: **Study or Work?** Is the reader learning or applying?
|
|
430
|
-
3. Match the answer pair to a quadrant → pick the target directory
|
|
431
|
-
4. If ambiguous → consult [references/diataxis-compass.md](references/diataxis-compass.md) for edge cases
|
|
432
|
-
|
|
433
|
-
Run the [quality checklist](references/diataxis-quality.md) against any doc created or substantially modified.
|
|
434
|
-
|
|
435
|
-
### 2. Apply the Mapping
|
|
436
|
-
|
|
437
|
-
Follow the Change-to-Doc Mapping decision tree above to determine required documentation actions.
|
|
438
|
-
|
|
439
|
-
### 3. Bootstrap `docs/` If Needed (tool-driven)
|
|
440
|
-
|
|
441
|
-
If `docs/` doesn't exist, run the full Architecture Blueprint workflow:
|
|
442
|
-
|
|
443
|
-
```
|
|
444
|
-
# Generate content with tools
|
|
445
|
-
produce_knowledge({ path: "." }) # → docs/README.md foundation
|
|
446
|
-
analyze_structure({ path: "." }) # → docs/architecture/overview.md structure section
|
|
447
|
-
analyze_diagram({ path: "." }) # → docs/architecture/ Mermaid diagrams
|
|
448
|
-
analyze_dependencies({ path: "." }) # → docs/architecture/overview.md dependency section
|
|
449
|
-
analyze_entry_points({ path: "." }) # → docs/reference/api.md foundation
|
|
450
|
-
analyze_patterns({ path: "." }) # → docs/architecture/overview.md patterns section
|
|
451
|
-
|
|
452
|
-
# Create the docs/ tree
|
|
453
|
-
docs/
|
|
454
|
-
├── README.md ← From produce_knowledge output + project context
|
|
455
|
-
├── architecture/
|
|
456
|
-
│ ├── overview.md ← From analyze_structure + analyze_dependencies + analyze_diagram
|
|
457
|
-
│ └── components/ ← From analyze_symbols per major component
|
|
458
|
-
├── decisions/
|
|
459
|
-
│ └── index.md ← ADR log with Source column linking to flow artifacts
|
|
460
|
-
├── guides/
|
|
461
|
-
│ └── testing.md ← From analyze_patterns test info
|
|
462
|
-
└── reference/
|
|
463
|
-
└── api.md ← From analyze_entry_points
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
### 4. Update Existing Docs (tool-assisted)
|
|
467
|
-
|
|
468
|
-
- Use `compact({ path: "docs/existing.md", query: "section to update" })` to read the current section
|
|
469
|
-
- Use `blast_radius` output to identify which sections need updating
|
|
470
|
-
- **Don't rewrite** — update relevant sections, preserve existing content
|
|
471
|
-
- **Don't duplicate** — reference code comments/READMEs instead of copying
|
|
472
|
-
|
|
473
|
-
### 5. Delegate When Appropriate
|
|
474
|
-
|
|
475
|
-
- Architecture decisions → `adr-skill` → `docs/decisions/`
|
|
476
|
-
- Architecture diagrams → `c4-architecture` skill → `docs/architecture/`
|
|
477
|
-
- Blueprint refresh → Run Blueprint Workflow above
|
|
478
|
-
|
|
479
|
-
### 6. Update the Index
|
|
480
|
-
|
|
481
|
-
If docs were added/removed, update `docs/README.md` index.
|
|
482
|
-
|
|
483
|
-
### 7. Skip If Nothing Changed
|
|
484
|
-
|
|
485
|
-
If the flow's changes don't warrant doc updates (e.g., pure bug fix with no revelations), report "No documentation updates needed" and move on.
|
|
486
|
-
|
|
487
|
-
## Writing Style
|
|
488
|
-
|
|
489
|
-
Follow these rules when generating documentation content. Adapted from *The Elements of Agent Style* (CC BY 4.0, Yue Zhao) and classic writing authorities.
|
|
490
|
-
|
|
491
|
-
### Clarity and Precision
|
|
492
|
-
- **Concrete over abstract** — Use specific terms, not vague language ("the retry handler" not "the relevant component")
|
|
493
|
-
- **No needless words** — Cut filler; every sentence earns its place
|
|
494
|
-
- **Active voice when the agent matters** — "The scheduler retries failed jobs" not "Failed jobs are retried"
|
|
495
|
-
- **Affirmative form** — State what something does, not what it does not do (unless a warning)
|
|
496
|
-
- **Claims match evidence** — Do not overstate or understate; back factual claims with file paths or tool output
|
|
497
|
-
|
|
498
|
-
### Structure
|
|
499
|
-
- **Parallel structure** — Express coordinate ideas in similar form (consistent table columns, consistent list grammar)
|
|
500
|
-
- **Stress position** — Place the important information at the end of the sentence
|
|
501
|
-
- **Sentence variety** — Break sentences over 30 words; vary length to maintain rhythm
|
|
502
|
-
- **Bullets only for genuine lists** — Do not convert flowing prose into bullet points; two items or a sentence do not need bullets
|
|
503
|
-
|
|
504
|
-
### AI-Tell Avoidance
|
|
505
|
-
- **No dying metaphors** — Avoid "cutting-edge", "leverages", "streamlines", "robust", "seamless"
|
|
506
|
-
- **No transition-word openers** — Do not start paragraphs with "Additionally", "Furthermore", "Moreover"
|
|
507
|
-
- **No em-dash overuse** — Use commas, semicolons, or separate sentences instead
|
|
508
|
-
- **No summary closers** — Do not end every paragraph by restating what it just said
|
|
509
|
-
- **Consistent terminology** — Pick one term and use it throughout; do not alternate synonyms for variety
|
|
510
|
-
|
|
511
|
-
## Link Rules
|
|
512
|
-
|
|
513
|
-
### Relative Path Correctness
|
|
514
|
-
|
|
515
|
-
All links in generated docs must be correct relative to the file that contains them. Compute the path from the target doc's directory, not from the project root.
|
|
516
|
-
|
|
517
|
-
| Doc location | Link to `src/types/index.ts` | Link to `.flows/topic/artifacts/design.md` |
|
|
518
|
-
|---|---|---|
|
|
519
|
-
| `docs/README.md` | `../src/types/index.ts` | `../.flows/topic/artifacts/design.md` |
|
|
520
|
-
| `docs/architecture/overview.md` | `../../src/types/index.ts` | `../../.flows/topic/artifacts/design.md` |
|
|
521
|
-
| `docs/decisions/index.md` | `../../src/types/index.ts` | `../../.flows/topic/artifacts/design.md` |
|
|
522
|
-
| `docs/reference/api.md` | `../../src/types/index.ts` | `../../.flows/topic/artifacts/design.md` |
|
|
523
|
-
|
|
524
|
-
**Rules:**
|
|
525
|
-
1. Count the directory depth from the doc file to `docs/`, then add `../` to reach the project root
|
|
526
|
-
2. Verify every link target exists before writing it — use `find({ pattern })` if unsure
|
|
527
|
-
3. Never use absolute paths in documentation — always relative
|
|
528
|
-
4. Test links mentally: from `docs/architecture/overview.md`, `../../` reaches the project root
|
|
529
|
-
|
|
530
|
-
## Anti-Patterns
|
|
531
|
-
|
|
532
|
-
### Documentation Maintenance
|
|
533
|
-
- ❌ Documenting implementation details that are obvious from code
|
|
534
|
-
- ❌ Creating docs for every small change (use the mapping tree)
|
|
535
|
-
- ❌ Duplicating information already in code comments or README files
|
|
536
|
-
- ❌ Writing docs that will be immediately outdated (e.g., exact version numbers)
|
|
537
|
-
- ❌ Creating empty placeholder docs "for later"
|
|
538
|
-
- ❌ Rewriting existing docs from scratch instead of updating sections
|
|
539
|
-
|
|
540
|
-
### Quadrant Mixing (Diátaxis)
|
|
541
|
-
- ❌ **Tutorial with Explanation** — conceptual paragraphs between steps → extract "why" to Explanation doc, link from tutorial
|
|
542
|
-
- ❌ **How-To that Teaches** — "Let's learn..." framing in a task guide → assume competence, link prerequisites
|
|
543
|
-
- ❌ **Reference with Narrative** — opinions in API tables ("I recommend...") → strip opinions to Explanation doc
|
|
544
|
-
- ❌ **Explanation with Procedures** — numbered steps in a conceptual doc → move procedures to How-To
|
|
545
|
-
- ❌ **Mixed-Mode Document** — one doc serving multiple quadrants → split into separate documents per quadrant
|
|
546
|
-
- See [references/diataxis-anti-patterns.md](references/diataxis-anti-patterns.md) for detection signals, counterexamples, and blur zones
|
|
547
|
-
|
|
548
|
-
### Project Knowledge
|
|
549
|
-
- See [references/project-knowledge-gotchas.md](references/project-knowledge-gotchas.md) for environment gotchas and anti-pattern table
|
|
550
|
-
|
|
551
|
-
---
|
|
552
|
-
|
|
553
|
-
*Diátaxis content in this skill and its reference files is adapted from the [Diátaxis framework](https://diataxis.fr/) by Daniele Procida, used under [CC-BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).*
|