@vpxa/aikit 0.1.74 → 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.
Files changed (134) hide show
  1. package/package.json +6 -1
  2. package/packages/cli/dist/index.js +2 -2
  3. package/packages/cli/dist/{init-DQkar6Es.js → init-CuRXmyD9.js} +1 -1
  4. package/packages/cli/dist/scaffold-WMQ2uQ48.js +2 -0
  5. package/packages/cli/dist/{user-CopNWxHP.js → user-vbJwa7x2.js} +1 -1
  6. package/scaffold/dist/adapters/claude-code.mjs +4 -0
  7. package/scaffold/dist/adapters/copilot.mjs +75 -0
  8. package/scaffold/dist/adapters/flows.mjs +1 -0
  9. package/scaffold/dist/adapters/skills.mjs +1 -0
  10. package/scaffold/{compiled → dist/compiled}/flows-data.mjs +304 -446
  11. package/scaffold/{compiled → dist/compiled}/skills-data.mjs +554 -2281
  12. package/scaffold/dist/definitions/agents.mjs +9 -0
  13. package/scaffold/{definitions → dist/definitions}/bodies.mjs +6 -229
  14. package/scaffold/dist/definitions/exclusions.mjs +1 -0
  15. package/scaffold/dist/definitions/hooks.mjs +1 -0
  16. package/scaffold/dist/definitions/models.mjs +1 -0
  17. package/scaffold/dist/definitions/plugins.mjs +1 -0
  18. package/scaffold/{definitions → dist/definitions}/prompts.mjs +9 -149
  19. package/scaffold/{definitions → dist/definitions}/protocols.mjs +9 -37
  20. package/scaffold/dist/definitions/tools.mjs +1 -0
  21. package/packages/cli/dist/scaffold-ukCDW3wQ.js +0 -2
  22. package/scaffold/_preview/agents/Architect-Reviewer-Alpha.agent.md +0 -132
  23. package/scaffold/_preview/agents/Architect-Reviewer-Beta.agent.md +0 -132
  24. package/scaffold/_preview/agents/Code-Reviewer-Alpha.agent.md +0 -112
  25. package/scaffold/_preview/agents/Code-Reviewer-Beta.agent.md +0 -112
  26. package/scaffold/_preview/agents/Debugger.agent.md +0 -412
  27. package/scaffold/_preview/agents/Documenter.agent.md +0 -468
  28. package/scaffold/_preview/agents/Explorer.agent.md +0 -76
  29. package/scaffold/_preview/agents/Frontend.agent.md +0 -440
  30. package/scaffold/_preview/agents/Implementer.agent.md +0 -425
  31. package/scaffold/_preview/agents/Orchestrator.agent.md +0 -452
  32. package/scaffold/_preview/agents/Planner.agent.md +0 -481
  33. package/scaffold/_preview/agents/README.md +0 -57
  34. package/scaffold/_preview/agents/Refactor.agent.md +0 -435
  35. package/scaffold/_preview/agents/Researcher-Alpha.agent.md +0 -151
  36. package/scaffold/_preview/agents/Researcher-Beta.agent.md +0 -152
  37. package/scaffold/_preview/agents/Researcher-Delta.agent.md +0 -153
  38. package/scaffold/_preview/agents/Researcher-Gamma.agent.md +0 -152
  39. package/scaffold/_preview/agents/Security.agent.md +0 -433
  40. package/scaffold/_preview/agents/_shared/architect-reviewer-base.md +0 -104
  41. package/scaffold/_preview/agents/_shared/code-agent-base.md +0 -366
  42. package/scaffold/_preview/agents/_shared/code-reviewer-base.md +0 -87
  43. package/scaffold/_preview/agents/_shared/decision-protocol.md +0 -27
  44. package/scaffold/_preview/agents/_shared/forge-protocol.md +0 -90
  45. package/scaffold/_preview/agents/_shared/researcher-base.md +0 -114
  46. package/scaffold/_preview/agents/templates/adr-template.md +0 -28
  47. package/scaffold/_preview/agents/templates/execution-state.md +0 -26
  48. package/scaffold/_preview/flows/_epilogue/steps/docs-sync/README.md +0 -120
  49. package/scaffold/_preview/flows/aikit-advanced/README.md +0 -70
  50. package/scaffold/_preview/flows/aikit-advanced/steps/design/README.md +0 -178
  51. package/scaffold/_preview/flows/aikit-advanced/steps/execute/README.md +0 -145
  52. package/scaffold/_preview/flows/aikit-advanced/steps/plan/README.md +0 -122
  53. package/scaffold/_preview/flows/aikit-advanced/steps/spec/README.md +0 -121
  54. package/scaffold/_preview/flows/aikit-advanced/steps/task/README.md +0 -119
  55. package/scaffold/_preview/flows/aikit-advanced/steps/verify/README.md +0 -145
  56. package/scaffold/_preview/flows/aikit-basic/README.md +0 -51
  57. package/scaffold/_preview/flows/aikit-basic/steps/assess/README.md +0 -109
  58. package/scaffold/_preview/flows/aikit-basic/steps/design/README.md +0 -116
  59. package/scaffold/_preview/flows/aikit-basic/steps/implement/README.md +0 -131
  60. package/scaffold/_preview/flows/aikit-basic/steps/verify/README.md +0 -123
  61. package/scaffold/_preview/prompts/aikit-ask.prompt.md +0 -13
  62. package/scaffold/_preview/prompts/aikit-debug.prompt.md +0 -15
  63. package/scaffold/_preview/prompts/aikit-design.prompt.md +0 -15
  64. package/scaffold/_preview/prompts/aikit-flow-add.prompt.md +0 -84
  65. package/scaffold/_preview/prompts/aikit-flow-create.prompt.md +0 -80
  66. package/scaffold/_preview/prompts/aikit-flow-manage.prompt.md +0 -24
  67. package/scaffold/_preview/prompts/aikit-implement.prompt.md +0 -17
  68. package/scaffold/_preview/prompts/aikit-plan.prompt.md +0 -15
  69. package/scaffold/_preview/prompts/aikit-review.prompt.md +0 -24
  70. package/scaffold/_preview/skills/adr-skill/SKILL.md +0 -335
  71. package/scaffold/_preview/skills/adr-skill/assets/templates/adr-madr.md +0 -89
  72. package/scaffold/_preview/skills/adr-skill/assets/templates/adr-readme.md +0 -20
  73. package/scaffold/_preview/skills/adr-skill/assets/templates/adr-simple.md +0 -46
  74. package/scaffold/_preview/skills/adr-skill/references/adr-conventions.md +0 -95
  75. package/scaffold/_preview/skills/adr-skill/references/examples.md +0 -193
  76. package/scaffold/_preview/skills/adr-skill/references/review-checklist.md +0 -77
  77. package/scaffold/_preview/skills/adr-skill/references/template-variants.md +0 -52
  78. package/scaffold/_preview/skills/adr-skill/scripts/bootstrap_adr.js +0 -259
  79. package/scaffold/_preview/skills/adr-skill/scripts/new_adr.js +0 -391
  80. package/scaffold/_preview/skills/adr-skill/scripts/set_adr_status.js +0 -169
  81. package/scaffold/_preview/skills/aikit/SKILL.md +0 -754
  82. package/scaffold/_preview/skills/brainstorming/SKILL.md +0 -265
  83. package/scaffold/_preview/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
  84. package/scaffold/_preview/skills/c4-architecture/SKILL.md +0 -389
  85. package/scaffold/_preview/skills/c4-architecture/references/advanced-patterns.md +0 -552
  86. package/scaffold/_preview/skills/c4-architecture/references/c4-syntax.md +0 -510
  87. package/scaffold/_preview/skills/c4-architecture/references/common-mistakes.md +0 -437
  88. package/scaffold/_preview/skills/c4-architecture/references/html-design-system.md +0 -337
  89. package/scaffold/_preview/skills/c4-architecture/references/html-template.html +0 -627
  90. package/scaffold/_preview/skills/docs/SKILL.md +0 -553
  91. package/scaffold/_preview/skills/docs/references/diataxis-anti-patterns.md +0 -147
  92. package/scaffold/_preview/skills/docs/references/diataxis-compass.md +0 -123
  93. package/scaffold/_preview/skills/docs/references/diataxis-quadrants.md +0 -192
  94. package/scaffold/_preview/skills/docs/references/diataxis-quality.md +0 -76
  95. package/scaffold/_preview/skills/docs/references/diataxis-templates.md +0 -120
  96. package/scaffold/_preview/skills/docs/references/flow-artifacts-guide.md +0 -70
  97. package/scaffold/_preview/skills/docs/references/project-knowledge-gotchas.md +0 -32
  98. package/scaffold/_preview/skills/docs/references/project-knowledge-templates.md +0 -281
  99. package/scaffold/_preview/skills/docs/references/project-knowledge-workflow.md +0 -80
  100. package/scaffold/_preview/skills/frontend-design/SKILL.md +0 -237
  101. package/scaffold/_preview/skills/lesson-learned/SKILL.md +0 -113
  102. package/scaffold/_preview/skills/lesson-learned/references/anti-patterns.md +0 -55
  103. package/scaffold/_preview/skills/lesson-learned/references/se-principles.md +0 -109
  104. package/scaffold/_preview/skills/multi-agents-development/SKILL.md +0 -448
  105. package/scaffold/_preview/skills/multi-agents-development/architecture-review-prompt.md +0 -81
  106. package/scaffold/_preview/skills/multi-agents-development/code-quality-review-prompt.md +0 -91
  107. package/scaffold/_preview/skills/multi-agents-development/implementer-prompt.md +0 -93
  108. package/scaffold/_preview/skills/multi-agents-development/parallel-dispatch-example.md +0 -167
  109. package/scaffold/_preview/skills/multi-agents-development/spec-review-prompt.md +0 -81
  110. package/scaffold/_preview/skills/present/SKILL.md +0 -616
  111. package/scaffold/_preview/skills/react/SKILL.md +0 -309
  112. package/scaffold/_preview/skills/repo-access/SKILL.md +0 -178
  113. package/scaffold/_preview/skills/repo-access/references/error-patterns.md +0 -116
  114. package/scaffold/_preview/skills/repo-access/references/platform-matrix.md +0 -142
  115. package/scaffold/_preview/skills/requirements-clarity/SKILL.md +0 -333
  116. package/scaffold/_preview/skills/session-handoff/SKILL.md +0 -199
  117. package/scaffold/_preview/skills/session-handoff/references/handoff-template.md +0 -139
  118. package/scaffold/_preview/skills/session-handoff/references/resume-checklist.md +0 -80
  119. package/scaffold/_preview/skills/session-handoff/scripts/check_staleness.js +0 -269
  120. package/scaffold/_preview/skills/session-handoff/scripts/create_handoff.js +0 -299
  121. package/scaffold/_preview/skills/session-handoff/scripts/list_handoffs.js +0 -113
  122. package/scaffold/_preview/skills/session-handoff/scripts/validate_handoff.js +0 -241
  123. package/scaffold/_preview/skills/typescript/SKILL.md +0 -405
  124. package/scaffold/adapters/claude-code.mjs +0 -73
  125. package/scaffold/adapters/copilot.mjs +0 -292
  126. package/scaffold/adapters/flows.mjs +0 -27
  127. package/scaffold/adapters/skills.mjs +0 -25
  128. package/scaffold/definitions/agents.mjs +0 -266
  129. package/scaffold/definitions/exclusions.mjs +0 -58
  130. package/scaffold/definitions/hooks.mjs +0 -43
  131. package/scaffold/definitions/models.mjs +0 -84
  132. package/scaffold/definitions/plugins.mjs +0 -147
  133. package/scaffold/definitions/tools.mjs +0 -250
  134. package/scaffold/generate.mjs +0 -92
@@ -1,754 +0,0 @@
1
- ---
2
- name: aikit
3
- description: "Use the @vpxa/aikit AI Kit MCP server for codebase search, analysis, and persistent memory. Load this skill when using aikit_search, aikit_remember, aikit_analyze_*, or any aikit_* tool. Covers all 82 MCP tools: search (hybrid/semantic/keyword), code analysis (structure, dependencies, symbols, patterns, entry points, diagrams, blast radius), knowledge graph (auto-populated module/symbol/import graph with traversal), context management (worksets, stash, checkpoints, restore, lanes), code manipulation (rename, codemod, eval), knowledge management (remember/read/update/forget), web access (fetch, search, http), FORGE protocol (ground, classify, evidence map, stratum cards, digest), brainstorming (interactive ideation sessions), presentation (rich dashboards via present tool), onboarding (full codebase analysis in one call), and developer utilities (regex, encode, measure, changelog, schema-validate, snippet, env, time)."
4
- metadata:
5
- category: cross-cutting
6
- domain: general
7
- applicability: always
8
- inputs: [codebase]
9
- outputs: [search-results, analysis, knowledge]
10
- relatedSkills: [present]
11
- ---
12
-
13
- # @vpxa/aikit — AI Kit
14
-
15
- Local-first AI developer toolkit — 82 MCP tools for search, analysis, context compression, FORGE quality gates, knowledge management, code manipulation, execution, web access, brainstorming, presentation, and developer utilities.
16
-
17
- ## When to Use
18
-
19
- - You need long-term memory across coding sessions
20
- - You want to search a codebase semantically (by meaning, not just keywords)
21
- - You need to compress large contexts to focus on what matters
22
- - You want structured output from build tools (tsc, vitest, biome, git)
23
- - You need to plan which files to read for a task
24
- - You want to safely explore refactors in isolated lanes
25
- - You need to rename symbols, apply codemods, or run code transformations
26
- - You want to fetch and read web pages or search the web
27
- - You need to make HTTP requests, test APIs, or debug endpoints
28
- - You want to test regex patterns, encode/decode data, or validate JSON schemas
29
- - You need code complexity metrics or a git changelog
30
- - You want to save and reuse code snippets across sessions
31
-
32
- ## Skills Reference
33
-
34
- | Context | Skill | Load when |
35
- |---------|-------|----------|
36
- | Repository access recovery | `repo-access` | When encountering git auth failures, accessing private/enterprise repos, or when `web_fetch`/`http` returns auth errors on repository URLs. |
37
-
38
- ## Architecture
39
-
40
- 10-package monorepo published as a single npm package:
41
-
42
- ```
43
- core → store → embeddings → chunker → indexer → analyzers → tools → server → cli → tui
44
- ```
45
-
46
- - **MCP server**: 82 tools + 2 resources (via `@modelcontextprotocol/sdk`)
47
- - **CLI**: 45 commands (thin dispatcher + 10 command groups)
48
- - **Search**: Hybrid vector + keyword + RRF fusion
49
- - **Embeddings**: ONNX local (mxbai-embed-large-v1, 1024 dimensions)
50
- - **Vector store**: LanceDB (embedded, zero infrastructure)
51
- - **Chunking**: Tree-sitter AST (TS/JS/Python/Go/Rust/Java) + regex fallback
52
- - **TUI**: Ink/React dashboard for human monitoring (search, status, curated, activity log)
53
-
54
- ## Session Protocol (MANDATORY)
55
-
56
- ### Start (do ALL)
57
- ```
58
- flow_status({}) # Check/resume active flow FIRST
59
- # If flow active → flow_read_instruction({ step }) → follow step instructions
60
- status({}) # Check AI Kit health + onboard state
61
- # If onboard not run → onboard({ path: "." }) # First-time codebase analysis
62
- flow_list({}) # See available flows
63
- # Select flow based on task → flow_start({ flow: "<name>", topic: "<task>" }) # Start — creates .flows/{topic}/
64
- list() # See stored knowledge
65
- search({ query: "SESSION CHECKPOINT", origin: "curated" }) # Resume prior work
66
- ```
67
-
68
- ### During Session
69
- ```
70
- search → scope_map → symbol → trace (orient)
71
- check → test_run (validate changes)
72
- remember (capture insights)
73
- ```
74
-
75
- ### End of Session
76
- ```
77
- session_digest({ persist: true }) # Auto-capture session activity
78
- remember({ title: "Session checkpoint: <topic>", content: "<what was done, decisions made, next steps>", category: "conventions" })
79
- ```
80
-
81
- ## Tool Catalog (82 tools)
82
-
83
- ### Search & Discovery (8)
84
- | Tool | CLI | Purpose |
85
- |------|-----|---------|
86
- | `search` | `aikit search` | Hybrid/semantic/keyword search with `search_mode` param |
87
- | `find` | `aikit find` | Federated search: vector + FTS + glob + regex in one call. Use `mode: 'examples'` to find usage examples. |
88
- | `symbol` | `aikit symbol` | Resolve symbol definition, imports, and references |
89
- | `lookup` | `aikit lookup` | Full-file retrieval by path or record ID |
90
- | `scope_map` | `aikit scope-map` | Task-scoped reading plan with token estimates |
91
- | `trace` | `aikit trace` | Forward/backward flow tracing through call chains |
92
- | `dead_symbols` | `aikit dead-symbols` | Find exported symbols never imported — separates source (actionable) from docs (informational). Accepts `path` to scope the search. |
93
- | `file_summary` | `aikit summarize` | Structural overview of a file (exports, imports, functions) |
94
-
95
- ### Code Analysis (7)
96
- | Tool | CLI | Purpose |
97
- |------|-----|---------|
98
- | `analyze_structure` | `aikit analyze structure` | Project structure overview |
99
- | `analyze_dependencies` | `aikit analyze deps` | Dependency graph with confidence |
100
- | `analyze_symbols` | `aikit analyze symbols` | Symbol extraction and cross-references |
101
- | `analyze_patterns` | `aikit analyze patterns` | Design pattern detection |
102
- | `analyze_entry_points` | `aikit analyze entry-points` | Find entry points: handlers, CDK constructs, test suites, package exports (walks workspace packages) |
103
- | `analyze_diagram` | `aikit analyze diagram` | Generate Mermaid diagrams |
104
- | `blast_radius` | `aikit analyze blast-radius` | Change impact analysis |
105
-
106
- ### Context Management (6)
107
- | Tool | CLI | Purpose |
108
- |------|-----|---------|
109
- | `compact` | `aikit compact` | Compress text to relevant sections using embeddings (no LLM). Accepts `path` for server-side file read. |
110
- | `workset` | `aikit workset` | Named file set management (save/load/add/remove) |
111
- | `stash` | `aikit stash` | Named key-value store for session data |
112
- | `checkpoint` | `aikit checkpoint` | Save/restore session checkpoints |
113
- | `restore` | `aikit restore` | Restore a previously saved checkpoint |
114
- | `parse_output` | `aikit parse-output` | Parse tsc/vitest/biome/git output → structured JSON |
115
-
116
- ### Code Manipulation (4)
117
- | Tool | CLI | Purpose |
118
- |------|-----|---------|
119
- | `rename` | `aikit rename` | Smart whole-word symbol rename across files (dry-run supported) |
120
- | `codemod` | `aikit codemod` | Regex-based code transformations with rules (dry-run supported) |
121
- | `diff_parse` | `aikit diff` | Parse unified diff → structured changes |
122
- | `data_transform` | `aikit transform` | JQ-like JSON transformations |
123
-
124
- ### Execution & Validation (5)
125
- | Tool | CLI | Purpose |
126
- |------|-----|---------|
127
- | `eval` | `aikit eval` | Sandboxed JavaScript/TypeScript execution |
128
- | `check` | `aikit check` | Incremental typecheck + lint. `detail` param: summary (default, ~300 tokens), errors, full |
129
- | `test_run` | `aikit test` | Run tests with structured pass/fail results |
130
- | `batch` | `aikit batch` | Execute multiple operations in parallel |
131
- | `audit` | `aikit audit` | Unified project audit: structure, deps, patterns, health, dead symbols, check, entry points → synthesized report with score and recommendations. 6 round-trips → 1. |
132
-
133
- ### Knowledge Management (6)
134
- | Tool | CLI | Purpose |
135
- |------|-----|---------|
136
- | `remember` | `aikit remember` | Store a curated knowledge entry |
137
- | `update` | `aikit update` | Update an existing entry |
138
- | `forget` | `aikit forget` | Delete an entry (requires reason) |
139
- | `read` | `aikit read` | Read a curated entry by path |
140
- | `list` | `aikit list` | List curated entries |
141
- | `produce_knowledge` | — | Auto-generate knowledge from analysis |
142
-
143
- ### Auto-Knowledge (automatic background extraction)
144
-
145
- Auto-knowledge runs automatically in the background after every tool completion. It extracts useful facts from tool outputs and stores them in curated memory — no manual action required.
146
-
147
- **What gets captured:**
148
-
149
- | Extractor | Triggers on | What it stores |
150
- |-----------|-------------|----------------|
151
- | Test results | `check`, `test_run` | Framework detection (vitest/jest/mocha), test file naming patterns |
152
- | Environment | `env`, `config`, `status` | Node.js version, OS, workspace path, store backend, embedding model |
153
- | Research | `web_search`, `web_fetch`, `search` | Web research findings, fetched page summaries |
154
- | Conventions | `check`, `analyze_patterns`, `analyze_structure`, `onboard` | Linter/formatter, TypeScript strict mode, package manager, monorepo detection |
155
- | Build commands | `check`, `test_run` | Verified check results, test summaries, test runner commands |
156
- | Codebase insights | `analyze_*`, `scope_map`, `blast_radius`, `onboard` | Structure analysis, dependency info, entry points, impact analysis |
157
- | Tool failures | All tools (global) | Classified actionable errors (filters out transient network/ENOENT errors) |
158
-
159
- **Quality controls:**
160
- - **Quality gate**: Facts scored 0-1; only facts >= 0.3 are stored
161
- - **Dedup**: Checks existing curated titles + in-memory hash dedup
162
- - **TTL**: Transient facts (errors, blast radius, search context) automatically expire after 1-2 hours
163
- - **Session limit**: Maximum 50 auto-knowledge facts per session
164
-
165
- **Searching auto-knowledge:**
166
- Auto-knowledge facts are stored as regular curated entries. Search them with:
167
- ```
168
- search({ query: "error patterns", origin: "curated" })
169
- search({ query: "conventions", origin: "curated" })
170
- list({ category: "conventions" })
171
- list({ tags: ["errors"] })
172
- ```
173
-
174
- ### Verified Lanes (1 tool, 6 actions)
175
- | Tool | CLI | Purpose |
176
- |------|-----|---------|
177
- | `lane` | `aikit lane` | Manage isolated file copies for parallel exploration |
178
-
179
- Lane actions: `create` (copy files to lane), `list`, `status` (modified/added/deleted), `diff` (line-level diff), `merge` (apply back to originals), `discard`.
180
-
181
- ### Git & Environment (4)
182
- | Tool | CLI | Purpose |
183
- |------|-----|---------|
184
- | `git_context` | `aikit git` | Branch, status, recent commits |
185
- | `process` | `aikit proc` | Process supervisor (start/stop/logs) |
186
- | `watch` | `aikit watch` | Filesystem watcher |
187
- | `delegate` | `aikit delegate` | Delegate subtask to local Ollama model |
188
-
189
- ### Web & Network (3)
190
- | Tool | CLI | Purpose |
191
- |------|-----|---------|
192
- | `web_fetch` | — | Fetch web page → markdown/raw/links/outline for LLM consumption |
193
- | `web_search` | — | Search the web via DuckDuckGo (no API key needed) |
194
- | `http` | — | Make HTTP requests for API testing/debugging |
195
-
196
- ### Developer Utilities (8)
197
- | Tool | CLI | Purpose |
198
- |------|-----|---------|
199
- | `regex_test` | — | Test regex patterns with match/replace/split modes |
200
- | `encode` | — | Base64, URL, SHA-256, MD5, hex encode/decode, JWT decode |
201
- | `measure` | — | Code complexity metrics (cyclomatic, cognitive complexity, lines, functions) |
202
- | `changelog` | — | Generate changelog from git history (conventional commits) |
203
- | `schema_validate` | — | Validate JSON data against JSON Schema |
204
- | `snippet` | — | Save/get/search/delete persistent code snippets |
205
- | `env` | — | System and runtime environment info (sensitive values redacted) |
206
- | `time` | — | Date parsing, timezone conversion, duration math |
207
-
208
- ### FORGE Quality Gates (5)
209
- | Tool | CLI | Purpose |
210
- |------|-----|---------|
211
- | `forge_ground` | — | Full Ground phase: classify tier, scope map, unknowns, constraints |
212
- | `forge_classify` | — | Quick tier classification (Floor/Standard/Critical) |
213
- | `evidence_map` | — | CRUD + Gate evaluation for verified/assumed/unknown claims. Safety gate tags (`provenance`/`commitment`/`coverage`) enable mandatory pre-YIELD checks |
214
- | `stratum_card` | — | Generate T1/T2 compressed context cards from files (10-100x token reduction) |
215
- | `digest` | — | Compress N text sources into token-budgeted summary |
216
-
217
- ### System (9)
218
- | Tool | CLI | Purpose |
219
- |------|-----|---------|
220
- | `config` | `aikit config` | View or update project configuration (kb.config.json) |
221
- | `status` | `aikit status` | Index statistics |
222
- | `reindex` | `aikit reindex` | Rebuild index |
223
- | `health` | `aikit health` | Project health checks (package.json, tsconfig, lockfile, circular deps) |
224
- | `guide` | `aikit guide` | Tool discovery — given a goal, recommends tools and workflow order |
225
- | `onboard` | `aikit onboard` | Full codebase onboarding in one call (structure + deps + patterns + knowledge) |
226
- | `graph` | `aikit graph` | Query the auto-populated knowledge graph (modules, symbols, imports) |
227
- | `queue` | `aikit queue` | Task queue for sequential agent operations (create/push/next/done/fail) |
228
- | `replay` | `aikit replay` | View or clear the audit trail of tool invocations (action: list/clear) |
229
-
230
- ### Flows (11)
231
- | Tool | CLI | Purpose |
232
- |------|-----|---------|
233
- | `flow_list` | `aikit flow list` | List available flows and active run |
234
- | `flow_info` | `aikit flow info` | Get flow details including steps and skill paths |
235
- | `flow_start` | `aikit flow start` | Start a flow with topic — creates `.flows/{topic-slug}/` run directory |
236
- | `flow_step` | `aikit flow step` | Advance, skip, or redo the current step |
237
- | `flow_status` | `aikit flow status` | Check active run including slug, runDir, artifactsPath |
238
- | `flow_read_instruction` | `aikit flow read-instruction` | Read instruction with `{{artifacts_path}}` and `{{run_dir}}` resolved |
239
- | `flow_reset` | `aikit flow reset` | Abandon the active flow (preserves run directory) |
240
- | `flow_runs` | `aikit flow runs` | List all flow runs (current and past) |
241
- | `flow_add` | `aikit flow add` | Add a custom flow from a directory |
242
- | `flow_update` | `aikit flow update` | Update an existing custom flow |
243
- | `flow_remove` | `aikit flow remove` | Remove a custom flow |
244
-
245
- ### Presentation (1)
246
- | Tool | CLI | Purpose |
247
- |------|-----|---------|
248
- | `present` | — | Rich dashboards, charts, tables, timelines. Use `format: "browser"` then `openBrowserPage` to display. **In CLI mode (no VS Code chat), always use `format: "browser"`** — `html` UIResource is invisible in terminal. |
249
-
250
- ### Brainstorming (1)
251
- | Tool | CLI | Purpose |
252
- |------|-----|---------|
253
- | `brainstorm` | — | Interactive brainstorming and ideation sessions with structured output |
254
-
255
- ### Meta-Tools — Tool Discovery (3)
256
- | Tool | CLI | Purpose |
257
- |------|-----|---------|
258
- | `list_tools` | — | List all active AI Kit tools with names, titles, and categories. Accepts optional `category` filter. Use for initial tool discovery. |
259
- | `describe_tool` | — | Get detailed metadata for a specific tool (title, categories, annotations). Use after `list_tools` to understand a tool before calling it. |
260
- | `search_tools` | — | Search active tools by keyword across names, titles, and categories. Use when you know what you need but not the tool name. |
261
-
262
- ### Session Management (1)
263
- | Tool | CLI | Purpose |
264
- |------|-----|---------|
265
- | `session_digest` | — | Generate a compressed digest of session activity (replay log, stash, checkpoints). Options: `scope` (tools/stash/all), `since`, `last`, `focus`, `mode` (deterministic/sampling), `tokenBudget`, `persist`. Use at session end for handoff or mid-session to review what happened. |
266
-
267
- ## Flow System
268
-
269
- Flows are multi-step guided workflows that structure complex tasks. Each step has a skill file with detailed instructions, required artifacts, and agent assignments.
270
-
271
- ### Built-in Flows
272
-
273
- | Flow | Steps | Use When |
274
- |------|-------|----------|
275
- | `aikit:basic` | assess → implement → verify | Bug fixes, config changes, small features |
276
- | `aikit:advanced` | spec → plan → task → execute → verify | New modules, cross-service changes, architectural work |
277
-
278
- ### Flow Lifecycle
279
-
280
- ```text
281
- flow_list() # See available flows
282
- flow_info({ flow: "aikit:basic" }) # View steps, skills, agents
283
- flow_start({ flow: "aikit:basic", topic: "Fix login bug" }) # Start — creates .flows/fix-login-bug/
284
- flow_read_instruction() # Read current step's instructions ({{artifacts_path}} resolved)
285
- # ... do the work described in the instruction ...
286
- flow_step({ action: "next" }) # Advance to next step
287
- flow_step({ action: "skip" }) # Skip current step
288
- flow_step({ action: "redo" }) # Redo current step
289
- flow_status() # Check progress (includes slug, runDir, artifactsPath, phase, isEpilogue)
290
- flow_reset() # Abandon active flow
291
- flow_runs() # List all runs (current + past)
292
- # Epilogue steps (mandatory, injected after every flow):
293
- # After last flow step → _docs-sync epilogue runs automatically
294
- # flow_status() shows phase: 'after', isEpilogue: true during epilogue
295
- ```
296
-
297
- Custom flow lifecycle management:
298
-
299
- ```text
300
- flow_add({ source: ".github/flows/my-flow" })
301
- flow_update({ name: "my-flow" })
302
- flow_remove({ name: "my-flow" })
303
- ```
304
-
305
- ### Creating Custom Flows
306
-
307
- 1. Create a directory under `.github/flows/<flow-name>/`
308
- 2. Add `manifest.yaml`:
309
-
310
- ```yaml
311
- name: my-flow
312
- version: "1.0.0"
313
- description: "My custom flow"
314
- artifacts_dir: .spec
315
- steps:
316
- - id: design
317
- name: Design
318
- instruction: steps/design/README.md
319
- description: "Create the design document"
320
- produces: [design.md]
321
- requires: []
322
- agents: [Planner]
323
- - id: implement
324
- name: Implement
325
- instruction: steps/implement/README.md
326
- description: "Implement the design"
327
- produces: [code]
328
- requires: [design]
329
- agents: [Implementer]
330
- agents:
331
- - agents/planner.agent.md
332
- install: []
333
- ```
334
-
335
- 3. Add skill files under `.github/flows/<flow-name>/skills/<step-id>/SKILL.md`
336
- 4. The flow appears in `flow_list()` automatically
337
-
338
- ### How Flows Are Delivered
339
-
340
- - **Built-in flows** ship with the AI Kit MCP server in `scaffold/flows/`
341
- - `aikit init` copies them to `.github/flows/` in your workspace
342
- - At runtime, flow tools resolve paths to `.github/flows/` (workspace-local copies)
343
- - Custom flows placed in `.github/flows/` are discovered alongside built-in ones
344
-
345
- ### Agent-Flow Integration
346
-
347
- - All code agents have a "Flows" section instructing them to check `flow_status()` first
348
- - If a flow is active, the agent follows the current step's instruction via `flow_read_instruction()`
349
- - After completing a step's work, advance with `flow_step({ action: "next" })`
350
- - The **Orchestrator** selects and starts flows; other agents follow them
351
- - The **Orchestrator** specifies `aikit` skill loading — all agents should load `aikit` skill to access flow tools
352
-
353
- ## CRITICAL: Use AI Kit Tools Instead of Native IDE Tools
354
-
355
- AI Kit tools provide **10x richer output** than native IDE tools — with AST-analyzed call graphs, scope context, import classification, and cognitive complexity. **You MUST use AI Kit tools instead of native read/search tools.**
356
-
357
- ### ⛔ PROHIBITED: Native File Reading
358
-
359
- **`read_file` / `read_file_raw` MUST NOT be used to understand code.** They waste tokens and miss structural information.
360
-
361
- The **ONLY** acceptable use of `read_file`: getting exact lines immediately before an edit (to verify the `old_str` for replacement). Even then, use `file_summary` first to identify which lines to read.
362
-
363
- ### Tool Replacement Table
364
-
365
- | ❌ NEVER do this | ✅ Use AI Kit Tool | Why |
366
- |---|---|---|
367
- | `read_file` (full file) | `file_summary` | Exports, imports, call edges — **10x fewer tokens** |
368
- | `read_file` (specific section) | `compact({ path, query })` | Server-side read + extract — **5-20x reduction** |
369
- | `grep_search` / `textSearch` | `search` | Semantic + keyword hybrid across all indexed content |
370
- | `grep_search` for a symbol | `symbol` | Definition + references **with scope context** |
371
- | Multiple `read_file` calls | `digest` | Compresses multiple sources into token-budgeted summary |
372
- | `listDirectory` + `read_file` | `scope_map` | Identifies relevant files for a task automatically |
373
- | Manual code tracing | `trace` | AST call-graph traversal with scope context |
374
- | Line counting / `wc` | `measure` | Lines, complexity, **cognitive complexity**, functions |
375
- | Grep for unused exports | `dead_symbols` | AST-powered export detection with regex fallback |
376
- | Repeated file reads | `stratum_card` | Reusable compressed context — **10-100x reduction** |
377
- | `fetch_webpage` | `web_fetch` | Readability extract + token budget — richer output |
378
- | Web research / browsing | `web_search` | Structured web results without browser — **unique to KB** |
379
-
380
- ### Decision Tree — How to Read Code
381
-
382
- ```
383
- Need to understand a file?
384
- ├─ Just structure? → file_summary (exports, imports, call edges — ~50 tokens)
385
- ├─ Specific section? → compact({ path, query }) — 5-20x reduction
386
- ├─ Multiple files? → digest (multi-source compression — token-budgeted)
387
- ├─ Repeated reference? → stratum_card (T1/T2 card — 10-100x reduction)
388
- ├─ Need exact lines to EDIT? → read_file (the ONLY acceptable use)
389
- └─ "I want to read the whole file" → ⛔ STOP. Use file_summary or compact instead.
390
- ```
391
-
392
- ### Decision Tree — Need Structural Relationships?
393
-
394
- When vector search and file reads don't answer the question (e.g. "who imports this?",
395
- "what does this depend on?", "how are these files connected?"), use `graph`:
396
-
397
- ```
398
- Need to understand relationships between code?
399
- ├─ Who imports / calls this? → graph({action:'find_nodes', name_pattern}) → graph({action:'neighbors', node_id, direction:'incoming'})
400
- ├─ What does this depend on? → graph({action:'neighbors', node_id, direction:'outgoing'})
401
- ├─ Full context for a symbol? → graph({action:'symbol360', name})
402
- ├─ Related files within N hops? → graph({action:'traverse', node_id, max_depth:2})
403
- ├─ Layer/module isolation check? → graph({action:'depth_traverse', node_id, max_depth:3})
404
- └─ Graph size/health? → graph({action:'stats'})
405
- ```
406
-
407
- **Use this BEFORE** reaching for `analyze_dependencies` (slower, less precise) or manually
408
- tracing via `symbol` + `trace` chains. The graph is auto-populated during indexing.
409
-
410
- ### What AI Kit Tools Return (AST-Enhanced)
411
-
412
- These tools use Tree-sitter WASM to analyze source code at the AST level, providing structured data that raw file reads cannot:
413
-
414
- | Tool | Rich Output |
415
- |------|-------------|
416
- | `file_summary` | Imports classified as **external vs internal** (`isExternal` flag). **Call edges** between functions (e.g., `handleRequest() → validateInput() @ line 42`). `exported` flag on interfaces and types. Import count breakdown. |
417
- | `symbol` | References include **scope** — which function/class/method contains each usage (e.g., `referenced in processOrder() at auth-service.ts:55`). |
418
- | `trace` | **Call-graph edges** discovered via AST syntax tree, not text matching. Supports forward (who does X call?) and backward (who calls X?) tracing. Scope context on each node. |
419
- | `measure` | **Cognitive complexity** — weights nesting depth (nested `if` inside `for` inside `try` scores higher). More useful than cyclomatic complexity for understanding code difficulty. |
420
- | `dead_symbols` | **AST export enumeration** — catches `export default`, barrel re-exports (`export { x } from`), `export =`, and `export type`. Regex fallback for non-AST-supported languages. |
421
-
422
- ### Example: `file_summary` Output
423
-
424
- ```
425
- src/auth-service.ts
426
- Language: typescript | Lines: 180 | Estimated tokens: ~1400
427
-
428
- Imports (6): 3 external, 3 internal
429
- - import { hash } from 'bcrypt' [external]
430
- - import { UserRepo } from './user-repo' [internal]
431
-
432
- Functions (4):
433
- - authenticate @ line 22 [exported]
434
- - validateToken @ line 55 [exported]
435
- - hashPassword @ line 90
436
- - generateJwt @ line 110
437
-
438
- Call edges (12 intra-file):
439
- - authenticate() → hashPassword() @ line 35
440
- - authenticate() → generateJwt() @ line 42
441
- - validateToken() → UserRepo.findById() @ line 68
442
-
443
- Interfaces (2):
444
- - AuthResult @ line 8 [exported]
445
- - TokenPayload @ line 14
446
- ```
447
-
448
- Compare: `read_file` would cost ~1400 tokens for raw text. `file_summary` gives structured data in ~120 tokens — **12x reduction** with richer information.
449
-
450
- ## Search Strategy
451
-
452
- 1. **Start broad**: `search({ query: "topic", search_mode: "hybrid" })`
453
- 2. **Narrow**: Add `content_type`, `origin`, or `category` filters
454
- 3. **Exact match**: Use `search_mode: "keyword"` for identifiers
455
- 4. **Federated**: Use `find` to combine vector + glob + regex
456
-
457
- ## Workflow Chains
458
-
459
- ### Codebase Onboarding
460
- ```
461
- analyze_structure({ path: "src/" })
462
- → analyze_dependencies({ path: "src/" })
463
- → analyze_entry_points({ path: "src/" })
464
- → produce_knowledge({ path: "src/" })
465
- → remember({ title: "Codebase onboarding complete", ... })
466
- ```
467
-
468
- ### Planning a Task
469
- ```
470
- scope_map({ task: "implement user auth" })
471
- → compact({ path: "src/auth.ts", query: "auth flow" })
472
- → workset({ action: "save", name: "auth-task", files: [...] })
473
- ```
474
-
475
- ### Bug Investigation
476
- ```
477
- parse_output({ output: <error> }) → symbol({ name: "failingFn" })
478
- → trace({ symbol: "failingFn", direction: "backward" })
479
- → blast_radius({ changed_files: ["suspect.ts"] })
480
- → eval({ code: "hypothesis test" }) → check({ files: ["suspect.ts"] })
481
- ```
482
-
483
- ### Safe Refactor with Lanes
484
- ```
485
- scope_map({ task: "rename UserService" })
486
- → lane({ action: "create", name: "refactor", files: [...] })
487
- → [make changes in lane files]
488
- → lane({ action: "diff", name: "refactor" })
489
- → check({}) → test_run({})
490
- → lane({ action: "merge", name: "refactor" })
491
- ```
492
-
493
- ### Lane — isolated read-only exploration
494
-
495
- `lane({ action:'create', name })` creates an isolated copy of the workspace. Use to try approach A vs B WITHOUT touching canonical source. Other actions: `list`, `diff`, `delete`. Compare with `lane({ action:'diff', names:['a','b'] })`. Do NOT use `lane` for actual refactors — use `checkpoint` instead (`checkpoint` = reversible on canonical source; `lane` = isolated copies for comparison).
496
-
497
- ### After Making Changes
498
- ```
499
- blast_radius({ changed_files: ["src/auth.ts"] })
500
- → check({}) → test_run({ grep: "auth" })
501
- → reindex()
502
- → remember({ title: "Implemented auth", content: "..." })
503
- ```
504
-
505
- ### Pre-Commit Validation
506
- ```
507
- git_context({ diff: true })
508
- → diff_parse({ diff: <staged diff> })
509
- → blast_radius({ changed_files: [...] })
510
- → check({}) → test_run({})
511
- ```
512
-
513
- ---
514
-
515
- ## Persistent Memory (Long-Term Knowledge)
516
-
517
- AI Kit provides cross-session persistent memory via a curated knowledge store. Use it to remember decisions, patterns, conventions, and context that should survive beyond the current conversation.
518
-
519
- ### Writing to Memory
520
-
521
- | Tool | Purpose | Example |
522
- |------|---------|---------|
523
- | `remember` | Store a new knowledge entry | `remember({ title: "Auth uses JWT RS256", content: "All API auth uses RS256 JWT tokens issued by /auth/token. Refresh via httpOnly cookie.", category: "decisions" })` |
524
- | `update` | Modify an existing entry | `update({ id: "<entry-id>", content: "Updated: now also supports Ed25519" })` |
525
- | `produce_knowledge` | Auto-generate analysis entries from code | `produce_knowledge({ path: "src/" })` |
526
-
527
- **Categories** — use these to organize entries:
528
- - `conventions` — coding standards, naming rules, file organization
529
- - `decisions` — architecture decisions, technology choices, trade-offs made
530
- - `patterns` — recurring code patterns, design patterns in use
531
- - `context` — project context, domain knowledge, business rules
532
- - `session` — session checkpoints for resuming work
533
-
534
- ### Reading from Memory
535
-
536
- | Tool | Purpose | Example |
537
- |------|---------|---------|
538
- | `list` | Browse all stored entries | `list()` or `list({ category: "decisions" })` |
539
- | `read` | Read a specific entry by ID | `read({ id: "<entry-id>" })` |
540
- | `search` | Find entries by content/query | `search({ query: "authentication", origin: "curated" })` |
541
- | `forget` | Remove an outdated entry | `forget({ id: "<entry-id>" })` |
542
-
543
- ### When to Remember
544
-
545
- | Situation | What to store | Category |
546
- |-----------|--------------|----------|
547
- | Architecture decision made | Decision + rationale + alternatives considered | `decisions` |
548
- | Pattern discovered in codebase | Pattern description + example locations | `patterns` |
549
- | Convention established | Rule + enforcement approach | `conventions` |
550
- | Session ending | Checkpoint: what was done, what's next, blockers | `session` |
551
- | Bug root cause found | Root cause + fix approach + prevention strategy | `context` |
552
- | External API behavior learned | Behavior quirks, rate limits, gotchas | `context` |
553
-
554
- ### Session Checkpoint Pattern
555
-
556
- At the END of every meaningful work session:
557
- ```
558
- remember({
559
- title: "Session checkpoint: <topic>",
560
- content: "## Done\n- <completed items>\n\n## Decisions\n- <key decisions made>\n\n## Next\n- <pending work>\n\n## Blockers\n- <issues encountered>",
561
- category: "session"
562
- })
563
- ```
564
-
565
- At the START of the next session:
566
- ```
567
- search({ query: "SESSION CHECKPOINT", origin: "curated" }) # Find last checkpoint
568
- list({ category: "session" }) # Browse all checkpoints
569
- ```
570
-
571
- ### Memory Best Practices
572
-
573
- 1. **Remember decisions, not code** — store *why*, not *what*. Code changes; rationale persists.
574
- 2. **Search before remembering** — avoid duplicates: `search({ query: "..." })` first.
575
- 3. **Use categories** — structured categories enable filtered `list()` queries.
576
- 4. **Checkpoint regularly** — don't wait for session end. Checkpoint at milestones.
577
- 5. **Clean up** — `forget()` outdated entries. Memory is only valuable when accurate.
578
- 6. **Cross-reference** — mention related entry titles in content for discoverability.
579
-
580
- ## CLI Quick Reference
581
-
582
- ```bash
583
- aikit init # Scaffold AI Kit in current directory
584
- aikit init --force # Overwrite all scaffold/skill files
585
- aikit init --guide # JSON report of stale files for LLM-driven updates
586
- aikit serve # Start MCP server (stdio or HTTP)
587
- aikit search <q> # Hybrid search
588
- aikit find <q> # Federated search
589
- aikit symbol <name> # Resolve symbol
590
- aikit scope-map <t> # Task reading plan
591
- aikit compact <q> # Context compression (--path file or stdin)
592
- aikit check # Typecheck + lint (--detail summary|errors|full)
593
- aikit test # Run tests
594
- aikit rename <old> <new> <path> # Rename symbol
595
- aikit lane create <name> --files f1,f2 # Create lane
596
- aikit lane diff <name> # View lane changes
597
- aikit lane merge <name> # Merge lane back
598
- aikit status # Index stats
599
- aikit reindex # Rebuild index
600
- ```
601
-
602
- ## Configuration
603
-
604
- `kb.config.json` in project root:
605
- ```json
606
- {
607
- "sources": [{ "path": ".", "excludePatterns": ["node_modules/**", "**/node_modules/**", "dist/**", "coverage/**", ".aikit-data/**"] }],
608
- "indexing": { "chunkSize": 1500, "chunkOverlap": 200, "minChunkSize": 100, "concurrency": 5 },
609
- "embedding": { "model": "mixedbread-ai/mxbai-embed-large-v1", "dimensions": 1024 },
610
- "store": { "backend": "lancedb", "path": ".aikit-data" },
611
- "curated": { "path": "curated", "adapter": "filesystem" }
612
- }
613
- ```
614
-
615
- ## Tool Profiles
616
-
617
- Tool profiles control which subset of the 82 tools are active. Profiles reduce token overhead by exposing only relevant tools for a given task.
618
-
619
- ### Built-in Profiles
620
-
621
- | Profile | Description | Use When |
622
- |---------|-------------|----------|
623
- | `full` | All tools enabled (default) | General development, orchestration |
624
- | `safe` | Read-only tools — no file/state modifications | Code review, analysis, research |
625
- | `research` | Search, analysis, knowledge, web access | Investigation, documentation |
626
- | `minimal` | Essential tools only — search, check, test | Simple tasks, low-token budgets |
627
- | `discovery` | Full toolset + meta-tools for guided exploration | New users, onboarding, tool learning |
628
-
629
- ### Activating a Profile
630
-
631
- Set `toolProfile` in `kb.config.json`:
632
-
633
- ```json
634
- {
635
- "toolProfile": "research"
636
- }
637
- ```
638
-
639
- Base tools (`status`, `config`, `guide`, `health`) are **always available** regardless of profile.
640
-
641
- ### Meta-Tool Discovery Pattern (Token Cost Reduction)
642
-
643
- Instead of loading all 82 tool descriptions at session start, use the `discovery` profile:
644
-
645
- 1. `list_tools()` — get a compact list of tool names + categories (~50 tokens)
646
- 2. `search_tools({ query: "what I need" })` — find relevant tools by keyword
647
- 3. `describe_tool({ tool_name: "specific_tool" })` — get full metadata only for tools you'll use
648
-
649
- This pattern reduces initial tool-loading cost from ~3000 tokens to ~200 tokens.
650
-
651
- ## IDE Integration
652
-
653
- ### VS Code — HTTP mode (recommended for development)
654
- ```json
655
- // .vscode/mcp.json
656
- {
657
- "servers": {
658
- "kb": {
659
- "type": "http",
660
- "url": "http://localhost:3210/mcp"
661
- }
662
- }
663
- }
664
- ```
665
- Start server: `npx aikit serve --http --port 3210`
666
-
667
- ### VS Code — stdio mode (no separate server)
668
- ```json
669
- {
670
- "servers": {
671
- "kb": {
672
- "type": "stdio",
673
- "command": "npx",
674
- "args": ["@vpxa/aikit", "serve", "--stdio"]
675
- }
676
- }
677
- }
678
- ```
679
-
680
- ### Claude Code (`.mcp.json`)
681
- ```json
682
- {
683
- "mcpServers": {
684
- "kb": {
685
- "command": "npx",
686
- "args": ["@vpxa/aikit", "serve"]
687
- }
688
- }
689
- }
690
- ```
691
-
692
- ## Development (Self-Dogfooding)
693
-
694
- When developing @vpxa/aikit itself, use the tool on its own codebase:
695
-
696
- ```bash
697
- # Build → Reindex → Use loop
698
- pnpm build # Build all 10 packages
699
- node bin/aikit.mjs reindex # Index own source into LanceDB
700
- node bin/aikit.mjs search "query" # Search own code
701
- node bin/aikit.mjs symbol "FnName" # Resolve symbols in own code
702
- node bin/aikit.mjs check # Typecheck + lint
703
- pnpm test # Run 287+ tests
704
-
705
- # Start MCP server for agent use during development
706
- node bin/aikit.mjs serve --http --port 3210
707
- ```
708
-
709
- **Rules:**
710
- - Always `pnpm build` before using CLI/server (runs from `dist/`)
711
- - Always `reindex` after structural code changes
712
- - LanceDB is single-process — don't run CLI and HTTP server simultaneously
713
- - Curated entries in `curated/` survive reindex and are indexed separately
714
-
715
- ---
716
-
717
- ## Flows
718
-
719
- Flows are structured multi-step workflows that guide agents through complex tasks. They are the **primary workflow system** — use them instead of ad-hoc planning when a matching flow exists.
720
-
721
- ### Flow Tools
722
-
723
- | Tool | Purpose |
724
- |------|---------|
725
- | `flow_status` | Check if a flow is active + current step + phase (before/flow/after) + isEpilogue |
726
- | `flow_list` | List available flows |
727
- | `flow_info` | Get flow details including steps and skill paths |
728
- | `flow_start` | Start a named flow |
729
- | `flow_step` | Advance: `next`, `skip`, or `redo` current step |
730
- | `flow_read_instruction` | Read the current step's instruction file content directly |
731
- | `flow_reset` | Clear flow state to start over |
732
- | `flow_add` | Add a custom flow from a directory |
733
- | `flow_update` | Update an existing custom flow |
734
- | `flow_remove` | Remove a custom flow |
735
-
736
- ### Flow Selection
737
-
738
- | Task Type | Flow | Why |
739
- |-----------|------|-----|
740
- | Bug fix, config change, small refactor | `aikit:basic` | Known scope, low risk |
741
- | New feature in existing module | `aikit:basic` | Clear boundaries |
742
- | New system/service/module | `aikit:advanced` | Needs spec + planning |
743
- | Cross-service changes | `aikit:advanced` | Multiple boundaries |
744
- | Architectural change | `aikit:advanced` | High impact |
745
- | Unclear scope or exploratory | No flow | Use agent's native workflow |
746
-
747
- ### Flow Lifecycle
748
-
749
- 1. **Start**: `flow_list({})` → choose flow → `flow_start({ flow: "<name>", topic: "<task>" })`
750
- 2. **Each step**: `flow_read_instruction({ step: "<name>" })` → follow step instructions → complete work
751
- 3. **Advance**: `flow_step({ action: "next" })` → repeat from step 2
752
- 4. **Epilogue**: After last flow step, mandatory epilogue steps run (e.g., `_docs-sync` updates `docs/`)
753
- 5. **Resume**: `flow_status({})` → if active, `flow_read_instruction` for current step → continue
754
- 6. **Reset**: `flow_reset({})` if you need to start over