@vpxa/aikit 0.1.64 → 0.1.66

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 (36) hide show
  1. package/package.json +2 -2
  2. package/packages/cli/dist/constants-D93JHBiN.js +1 -0
  3. package/packages/cli/dist/index.js +4 -4
  4. package/packages/cli/dist/{init-C0VZ6PkG.js → init-DANkCO2c.js} +1 -1
  5. package/packages/cli/dist/{user-CDSf9aCI.js → user-Bb99C6xW.js} +1 -1
  6. package/packages/flows/dist/index.d.ts +37 -2
  7. package/packages/flows/dist/index.js +1 -1
  8. package/packages/indexer/dist/index.js +1 -1
  9. package/packages/server/dist/index.js +1 -1
  10. package/packages/server/dist/{server-C7mYTlIU.js → server-DFqOZEJC.js} +159 -159
  11. package/scaffold/definitions/agents.mjs +5 -0
  12. package/scaffold/definitions/bodies.mjs +65 -17
  13. package/scaffold/definitions/plugins.mjs +6 -0
  14. package/scaffold/definitions/protocols.mjs +7 -2
  15. package/scaffold/flows/_epilogue/steps/docs-sync/README.md +120 -0
  16. package/scaffold/general/agents/Debugger.agent.md +8 -3
  17. package/scaffold/general/agents/Documenter.agent.md +46 -6
  18. package/scaffold/general/agents/Frontend.agent.md +7 -2
  19. package/scaffold/general/agents/Implementer.agent.md +8 -3
  20. package/scaffold/general/agents/Orchestrator.agent.md +15 -3
  21. package/scaffold/general/agents/Planner.agent.md +7 -2
  22. package/scaffold/general/agents/Refactor.agent.md +7 -2
  23. package/scaffold/general/agents/Security.agent.md +7 -2
  24. package/scaffold/general/agents/_shared/code-agent-base.md +7 -2
  25. package/scaffold/general/skills/aikit/SKILL.md +39 -4
  26. package/scaffold/general/skills/docs/SKILL.md +509 -0
  27. package/scaffold/general/skills/docs/references/diataxis-anti-patterns.md +147 -0
  28. package/scaffold/general/skills/docs/references/diataxis-compass.md +123 -0
  29. package/scaffold/general/skills/docs/references/diataxis-quadrants.md +192 -0
  30. package/scaffold/general/skills/docs/references/diataxis-quality.md +76 -0
  31. package/scaffold/general/skills/docs/references/diataxis-templates.md +120 -0
  32. package/scaffold/general/skills/docs/references/flow-artifacts-guide.md +70 -0
  33. package/scaffold/general/skills/docs/references/project-knowledge-gotchas.md +32 -0
  34. package/scaffold/general/skills/docs/references/project-knowledge-templates.md +281 -0
  35. package/scaffold/general/skills/docs/references/project-knowledge-workflow.md +80 -0
  36. package/packages/cli/dist/constants-D3v4VDf0.js +0 -1
@@ -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` |
@@ -0,0 +1,281 @@
1
+ # Project Knowledge Templates
2
+
3
+ Templates for the seven project knowledge documents in `docs/architecture/`. Use these to ensure consistent structure across projects.
4
+
5
+ ## stack.md
6
+
7
+ ```markdown
8
+ # Stack
9
+
10
+ ## Language and Runtime
11
+
12
+ | Item | Version | Notes |
13
+ |------|---------|-------|
14
+ | {language} | {version} | {notes} |
15
+
16
+ ## Frameworks
17
+
18
+ | Framework | Version | Role |
19
+ |-----------|---------|------|
20
+ | {name} | {version} | {role} |
21
+
22
+ ## Production Dependencies
23
+
24
+ | Package | Version | Purpose |
25
+ |---------|---------|---------|
26
+ | {name} | {version} | {purpose} |
27
+
28
+ ## Dev Tooling
29
+
30
+ | Tool | Version | Purpose |
31
+ |------|---------|---------|
32
+ | {name} | {version} | {purpose} |
33
+
34
+ ## Evidence
35
+
36
+ - `package.json` / `requirements.txt` / `go.mod` — dependency versions
37
+ - `tsconfig.json` / `pyproject.toml` — language configuration
38
+ ```
39
+
40
+ ## structure.md
41
+
42
+ ```markdown
43
+ # Structure
44
+
45
+ ## Directory Layout
46
+
47
+ ```
48
+ {root}/
49
+ ├── {dir}/ ← {purpose}
50
+ │ └── ...
51
+ └── {dir}/ ← {purpose}
52
+ ```
53
+
54
+ ## Entry Points
55
+
56
+ | Entry Point | Path | Type |
57
+ |-------------|------|------|
58
+ | {name} | `{path}` | CLI / HTTP / Library |
59
+
60
+ ## Key Files
61
+
62
+ | File | Purpose |
63
+ |------|---------|
64
+ | `{path}` | {purpose} |
65
+
66
+ ## Packages (monorepo only)
67
+
68
+ | Package | Path | Purpose |
69
+ |---------|------|---------|
70
+ | {name} | `{path}` | {purpose} |
71
+
72
+ ## Evidence
73
+
74
+ - `analyze_structure` output — directory tree
75
+ - `analyze_entry_points` output — entry points
76
+ ```
77
+
78
+ ## design.md
79
+
80
+ ```markdown
81
+ # Design
82
+
83
+ ## Architectural Pattern
84
+
85
+ {Pattern name} — {one-sentence description of how it applies here}.
86
+
87
+ ## Layers
88
+
89
+ | Layer | Directory | Responsibility |
90
+ |-------|-----------|----------------|
91
+ | {name} | `{path}` | {responsibility} |
92
+
93
+ ## Data Flow
94
+
95
+ ```
96
+ {source} → {transform} → {destination}
97
+ ```
98
+
99
+ {Brief description of primary data paths.}
100
+
101
+ ## Component Boundaries
102
+
103
+ | Component | Owns | Depends On |
104
+ |-----------|------|------------|
105
+ | {name} | {responsibility} | {dependencies} |
106
+
107
+ ## Key Patterns
108
+
109
+ | Pattern | Where Used | Purpose |
110
+ |---------|-----------|---------|
111
+ | {name} | `{path}` | {purpose} |
112
+
113
+ ## Evidence
114
+
115
+ - `analyze_structure` output — layers
116
+ - `analyze_patterns` output — design patterns
117
+ - `analyze_diagram` output — component diagrams
118
+ ```
119
+
120
+ ## conventions.md
121
+
122
+ ```markdown
123
+ # Conventions
124
+
125
+ ## Naming
126
+
127
+ | Element | Convention | Example |
128
+ |---------|-----------|---------|
129
+ | Files | {convention} | `{example}` |
130
+ | Functions | {convention} | `{example}` |
131
+ | Types/Interfaces | {convention} | `{example}` |
132
+ | Constants | {convention} | `{example}` |
133
+
134
+ ## Formatting
135
+
136
+ - Formatter: {tool} with {config file}
137
+ - Linter: {tool} with {config file}
138
+ - Line length: {limit}
139
+ - Indentation: {style}
140
+
141
+ ## Error Handling
142
+
143
+ {Describe the project's error handling pattern: throw/catch, Result type, error codes, etc.}
144
+
145
+ ## Import Conventions
146
+
147
+ | Import Type | Convention | Example |
148
+ |-------------|-----------|---------|
149
+ | Internal | {pattern} | `{example}` |
150
+ | External | {pattern} | `{example}` |
151
+ | Type-only | {pattern} | `{example}` |
152
+
153
+ ## Evidence
154
+
155
+ - `analyze_patterns` output — detected conventions
156
+ - Linter/formatter config files — enforced rules
157
+ ```
158
+
159
+ ## integrations.md
160
+
161
+ ```markdown
162
+ # Integrations
163
+
164
+ ## External APIs
165
+
166
+ | Service | Protocol | Auth | Config |
167
+ |---------|----------|------|--------|
168
+ | {name} | REST / gRPC / GraphQL | {auth method} | `{env var or config}` |
169
+
170
+ ## Databases
171
+
172
+ | Database | Driver | Connection | Usage |
173
+ |----------|--------|------------|-------|
174
+ | {name} | {driver package} | `{env var}` | {what it stores} |
175
+
176
+ ## Authentication
177
+
178
+ {Describe auth mechanism: JWT, OAuth, API keys, sessions, etc.}
179
+
180
+ ## Monitoring and Observability
181
+
182
+ | Tool | Purpose | Config |
183
+ |------|---------|--------|
184
+ | {name} | Logging / Metrics / Tracing | `{config}` |
185
+
186
+ ## CI/CD
187
+
188
+ | Platform | Config | Stages |
189
+ |----------|--------|--------|
190
+ | {name} | `{config file}` | {stages} |
191
+
192
+ ## Evidence
193
+
194
+ - `analyze_dependencies` output — external packages
195
+ - `.env.example` — required environment variables
196
+ - CI config files — pipeline definitions
197
+ ```
198
+
199
+ ## testing.md
200
+
201
+ ```markdown
202
+ # Testing
203
+
204
+ ## Framework
205
+
206
+ | Tool | Version | Purpose |
207
+ |------|---------|---------|
208
+ | {name} | {version} | Unit / Integration / E2E |
209
+
210
+ ## File Organization
211
+
212
+ | Pattern | Location | Example |
213
+ |---------|----------|---------|
214
+ | {convention} | `{path}` | `{example file}` |
215
+
216
+ ## Mocking Strategy
217
+
218
+ {Describe how mocks are created and used: manual, library, DI, etc.}
219
+
220
+ ## Coverage
221
+
222
+ - Target: {percentage or policy}
223
+ - Tool: {coverage tool}
224
+ - Config: `{config file}`
225
+
226
+ ## Running Tests
227
+
228
+ ```bash
229
+ {command to run all tests}
230
+ {command to run specific tests}
231
+ {command to run with coverage}
232
+ ```
233
+
234
+ ## Evidence
235
+
236
+ - `analyze_patterns` output — test patterns
237
+ - `test_run({})` output — test health
238
+ - Test config files — framework configuration
239
+ ```
240
+
241
+ ## concerns.md
242
+
243
+ ```markdown
244
+ # Concerns
245
+
246
+ ## Tech Debt
247
+
248
+ | Area | Description | Severity | Evidence |
249
+ |------|-------------|----------|----------|
250
+ | {area} | {description} | High / Medium / Low | `{file or tool}` |
251
+
252
+ ## Known Issues
253
+
254
+ | Issue | Impact | Workaround |
255
+ |-------|--------|------------|
256
+ | {issue} | {impact} | {workaround or "None"} |
257
+
258
+ ## Security Risks
259
+
260
+ | Risk | Severity | Mitigation |
261
+ |------|----------|------------|
262
+ | {risk} | {severity} | {mitigation} |
263
+
264
+ ## Performance Bottlenecks
265
+
266
+ | Area | Symptom | Evidence |
267
+ |------|---------|----------|
268
+ | {area} | {symptom} | `{file or metric}` |
269
+
270
+ ## High-Churn Files
271
+
272
+ | File | Recent Changes | Why |
273
+ |------|---------------|-----|
274
+ | `{path}` | {change count} | {reason} |
275
+
276
+ ## Evidence
277
+
278
+ - `audit()` output — health issues
279
+ - `dead_symbols({})` output — dead code
280
+ - `git_context({})` output — high-churn files
281
+ ```
@@ -0,0 +1,80 @@
1
+ # Project Knowledge — Workflow
2
+
3
+ Detailed workflow for acquiring and documenting project knowledge into `docs/architecture/`.
4
+
5
+ ## Four-Phase Workflow
6
+
7
+ ```
8
+ - [ ] Phase 1: Scan with AI Kit tools, read intent documents
9
+ - [ ] Phase 2: Investigate each documentation area
10
+ - [ ] Phase 3: Populate all seven docs in docs/architecture/
11
+ - [ ] Phase 4: Validate docs, present findings, resolve all [ASK USER] items
12
+ ```
13
+
14
+ ### Phase 1: Scan and Read Intent
15
+
16
+ ```
17
+ onboard({ path: "." }) # Full codebase scan
18
+ produce_knowledge({ path: "." }) # Comprehensive analysis
19
+ analyze_structure({ path: "." }) # Project layout, packages, layers
20
+ analyze_dependencies({ path: "." }) # All dependencies + import graph
21
+ ```
22
+
23
+ Then read `README`, `PRD`, `TRD`, `ROADMAP`, `SPEC`, `DESIGN` files if they exist.
24
+ Summarise the stated project intent before reading any source code.
25
+
26
+ ### Phase 2: Investigate
27
+
28
+ Use Phase 1 tool outputs to answer questions for each of the seven documents. Run additional targeted tools:
29
+
30
+ | Document | Investigation Tools |
31
+ |----------|-------------------|
32
+ | stack.md | `analyze_dependencies` → manifests, frameworks; `analyze_structure` → runtime signals |
33
+ | structure.md | `analyze_structure` → file tree, packages; `analyze_entry_points` → entry points, key files |
34
+ | design.md | `analyze_structure` → layers; `analyze_patterns` → design patterns; `analyze_diagram` → component diagrams |
35
+ | conventions.md | `analyze_patterns` → naming, formatting; `search("conventions")` → detected conventions |
36
+ | integrations.md | `analyze_dependencies` → external deps; `search("API\|database\|auth\|webhook")` → integration points |
37
+ | testing.md | `analyze_patterns` → test patterns; `search("test framework")` → test setup; `test_run({})` → test health |
38
+ | concerns.md | `audit({ path: "." })` → health issues; `dead_symbols({})` → dead code; `git_context({})` → high-churn files |
39
+
40
+ ### Phase 3: Populate Documents
41
+
42
+ Create each document in `docs/architecture/` in this order:
43
+
44
+ 1. **stack.md** — Language, runtime version, frameworks, production dependencies, dev tooling
45
+ 2. **structure.md** — Directory layout, entry points, key files, package organization
46
+ 3. **design.md** — Layers, architectural patterns, data flow, component boundaries
47
+ 4. **conventions.md** — Naming conventions, formatting rules, error handling patterns, import conventions
48
+ 5. **integrations.md** — External APIs, databases, auth providers, monitoring, CI/CD
49
+ 6. **testing.md** — Test frameworks, file organization, mocking strategy, coverage approach
50
+ 7. **concerns.md** — Tech debt, known bugs, security risks, performance bottlenecks, high-churn files
51
+
52
+ Rules:
53
+ - Use `[TODO]` for anything that cannot be determined from code
54
+ - Use `[ASK USER]` where the right answer requires team intent
55
+ - Include an "Evidence" section in each doc with file paths and tool receipts
56
+
57
+ ### Phase 4: Validate, Repair, Verify
58
+
59
+ Run this mandatory validation loop before finalizing:
60
+
61
+ 1. For each non-trivial claim, confirm at least one evidence reference exists
62
+ 2. If any required section is missing or unsupported → fix and re-validate
63
+ 3. Repeat until all seven docs pass
64
+
65
+ Validation pass criteria:
66
+ - No unsupported claims
67
+ - No empty required sections
68
+ - Unknowns use `[TODO]` rather than assumptions
69
+ - Team-intent gaps are explicitly marked `[ASK USER]`
70
+
71
+ Then present a summary, list every `[ASK USER]` item as a numbered question, and highlight any Intent vs. Reality divergences from Phase 1.
72
+
73
+ ## Focus Area Mode
74
+
75
+ If the user specifies a focus area (e.g., "architecture only" or "testing and concerns"):
76
+
77
+ 1. Always run Phase 1 in full
78
+ 2. Fully complete focus-area documents first
79
+ 3. For non-focus documents, keep required sections present and mark unknowns as `[TODO]`
80
+ 4. Still run the Phase 4 validation loop on all seven documents
@@ -1 +0,0 @@
1
- const e=`aikit`,t={type:`stdio`,command:`npx`,args:[`-y`,`@vpxa/aikit`,`serve`]},n=[`aikit`,`brainstorming`,`multi-agents-development`,`session-handoff`,`requirements-clarity`,`lesson-learned`,`c4-architecture`,`adr-skill`,`present`,`frontend-design`,`react`,`typescript`],r=[`aikit-basic`,`aikit-advanced`],i={"chat.agentFilesLocations":{"~/.claude/agents":!1},"github.copilot.chat.copilotMemory.enabled":!0,"chat.customAgentInSubagent.enabled":!0,"chat.useNestedAgentsMdFiles":!0,"chat.useAgentSkills":!0,"github.copilot.chat.switchAgent.enabled":!0,"workbench.browser.enableChatTools":!0,"chat.mcp.apps.enabled":!0,"chat.instructionsFilesLocations":{"~/.copilot/instructions":!0,".github/instructions":!0}};export{i as a,n as i,t as n,e as r,r as t};