@vpxa/aikit 0.1.380 → 0.1.382
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 +1 -1
- package/packages/claude-desktop/dist/manifest.json +1 -1
- package/packages/cli/dist/index.js +3 -3
- package/packages/cli/dist/{init-BTsNYC02.js → init-DMj2ctyd.js} +1 -1
- package/packages/cli/dist/{templates-CRs_gkfS.js → templates-DLra78_O.js} +30 -30
- package/packages/server/dist/bin.js +2 -2
- package/packages/server/dist/{config-DZskEKrY.js → config-CQKoGfwD.js} +1 -1
- package/packages/server/dist/{config-Bz8Uyzuq.js → config-DX1KYSbN.js} +1 -1
- package/packages/server/dist/{curated-manager-CBKTmAjM.js → curated-manager-D4MOFQ-t.js} +1 -1
- package/packages/server/dist/{dashboard-static-NghHzTNh.js → dashboard-static-C6RP0VA7.js} +1 -1
- package/packages/server/dist/{dashboard-static-gAOiHHqI.js → dashboard-static-DdsIJd-u.js} +1 -1
- package/packages/server/dist/index.d.ts +1 -1
- package/packages/server/dist/index.js +2 -2
- package/packages/server/dist/{observations-CfglxBMB.js → observations-BhMmh4uj.js} +1 -1
- package/packages/server/dist/{observations-CrQU_HVm.js → observations-Cri43dvk.js} +1 -1
- package/packages/server/dist/register-tools-C49Lkpvq.js +3044 -0
- package/packages/server/dist/register-tools-i_1kjBhi.js +3043 -0
- package/packages/server/dist/{server-C43D7SrT.js → server-CTUxU4KX.js} +11 -11
- package/packages/server/dist/{server-BmVdf84Q.js → server-Dm2u4PSm.js} +11 -11
- package/packages/server/dist/{server-http-YQ9jxThI.js → server-http-D8Wemu8Y.js} +1 -1
- package/packages/server/dist/{server-http-BCpGwi0k.js → server-http-DcgFpWra.js} +1 -1
- package/packages/server/dist/{server-stdio-3hhuJU8B.js → server-stdio-Bpoo8KOT.js} +1 -1
- package/packages/server/dist/{server-stdio-CuLAgQjc.js → server-stdio-CskpvBew.js} +1 -1
- package/packages/server/dist/{settings-static-DcTUiqr7.js → settings-static-C0oT3Ctk.js} +1 -1
- package/packages/server/dist/{settings-static-PjpMR9Q7.js → settings-static-DVMG47Oh.js} +1 -1
- package/packages/server/dist/startup-maintenance-cbRSFMY5.js +21 -0
- package/packages/server/dist/startup-maintenance-kHH8tjds.js +20 -0
- package/packages/tools/dist/index.d.ts +23 -3
- package/packages/tools/dist/index.js +111 -105
- package/scaffold/dist/adapters/_shared.mjs +1 -1
- package/scaffold/dist/adapters/hermes.mjs +1 -1
- package/scaffold/dist/definitions/agents.mjs +1 -1
- package/scaffold/dist/definitions/bodies.mjs +21 -16
- package/scaffold/dist/definitions/exec-hooks.mjs +1 -1
- package/scaffold/dist/definitions/flows.mjs +5 -5
- package/scaffold/dist/definitions/hooks.mjs +1 -1
- package/scaffold/dist/definitions/protocols.mjs +26 -26
- package/scaffold/dist/definitions/skills/aikit.mjs +2 -152
- package/scaffold/dist/definitions/skills/browser-use.mjs +1 -1
- package/scaffold/dist/definitions/skills/c4-architecture.mjs +5 -5
- package/scaffold/dist/definitions/skills/docs.mjs +12 -10
- package/scaffold/dist/definitions/skills/multi-agents-development.mjs +4 -4
- package/scaffold/dist/definitions/skills/orchestrator.mjs +50 -8
- package/packages/server/dist/register-tools-Dgu64Px5.js +0 -3034
- package/packages/server/dist/register-tools-jgdif5r4.js +0 -3035
- package/packages/server/dist/startup-maintenance-B4xWqEjc.js +0 -20
- package/packages/server/dist/startup-maintenance-BnTozHs1.js +0 -21
|
@@ -1,105 +1,4 @@
|
|
|
1
|
-
var e=[{file:`SKILL.md`,content
|
|
2
|
-
name: aikit
|
|
3
|
-
description: "Use the @vpxa/aikit AI Kit MCP server for codebase search, context compression, validation, and persistent memory. Load at session start or before using aikit_* tools. This skill teaches tool judgment: minimize raw reads, choose the smallest useful retrieval path, and persist decisions that matter."
|
|
4
|
-
metadata:
|
|
5
|
-
category: cross-cutting
|
|
6
|
-
domain: general
|
|
7
|
-
applicability: always
|
|
8
|
-
inputs: [codebase]
|
|
9
|
-
outputs: [search-results, analysis, knowledge]
|
|
10
|
-
relatedSkills: [session-handoff, present]
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# @vpxa/aikit - AI Kit
|
|
14
|
-
|
|
15
|
-
Use AI Kit as compression, memory, validation, and coordination layer. Each call should reduce uncertainty or token load.
|
|
16
|
-
|
|
17
|
-
## Session Loop
|
|
18
|
-
|
|
19
|
-
Start:
|
|
20
|
-
1. status({ includePrelude: true }).
|
|
21
|
-
2. If prelude.workspaceCore is null → run \`onboard({ path, mode: 'generate' })\`, then \`status({ includePrelude: true })\` again.
|
|
22
|
-
3. **L0 session start**: Fetch \`aikit://l0/workspace-core\` resource (full card) or \`status({ includePrelude: true })\` (compact summary). Extract workspace shape, package map, tool surfaces, key entry points, constraints, and known pitfalls before broad retrieval. If L0 answers enough, skip \`scope_map\`/wide \`search\`. If a flow is active, workflow card loaded via flow context. ≤ 2,100 tokens.
|
|
23
|
-
4. search({ query: "SESSION CHECKPOINT", origin: "curated" }).
|
|
24
|
-
5. flow({ action: 'status' }) when active flow may exist — use L1 snapshot before broad retrieval.
|
|
25
|
-
6. scope_map({ task }) only when L0 + checkpoint do not identify a narrow workset.
|
|
26
|
-
|
|
27
|
-
During:
|
|
28
|
-
- Prefer search/file_summary/digest/symbol/trace/graph over raw reads.
|
|
29
|
-
- Use stash for temporary findings; knowledge for durable decisions.
|
|
30
|
-
- Run blast_radius before shared/public edits.
|
|
31
|
-
- Validate with check + relevant test_run.
|
|
32
|
-
|
|
33
|
-
End:
|
|
34
|
-
- reindex after structural changes.
|
|
35
|
-
- produce_knowledge for durable project updates.
|
|
36
|
-
- session_digest({ persist: true }).
|
|
37
|
-
- knowledge remember session checkpoint with done/decisions/next/blockers.
|
|
38
|
-
|
|
39
|
-
## Retrieval Ladder — Layered (L0-L3)
|
|
40
|
-
|
|
41
|
-
| Layer | Need | Tool |
|
|
42
|
-
|-------|------|------|
|
|
43
|
-
| **L0** | Session briefing (after onboard) | Resource \`aikit://l0/workspace-core\` (full card) or \`status({ includePrelude: true })\` (compact summary). Run \`onboard\` first if card missing. Consume before broad scans. |
|
|
44
|
-
| **L0** | Architecture overview | \`architecture\` briefing card |
|
|
45
|
-
| **L0** | Known issues | \`known-issues\` briefing card |
|
|
46
|
-
| **L0** | Flow-specific context | \`workflow:<flow>\` briefing card |
|
|
47
|
-
| **L1** | Active flow state | \`knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>' })\` |
|
|
48
|
-
| **L2** | Prior decisions/conventions | \`search\` / \`knowledge\` |
|
|
49
|
-
| **L2** | File structure | \`file_summary({ files, tier: 'T1' })\` |
|
|
50
|
-
| **L2** | Exact relevant section | \`file_summary({ files, tier: 'T2' })\` |
|
|
51
|
-
| **L2** | Many files | \`digest\` |
|
|
52
|
-
| **L2** | Symbol defs/refs | \`symbol\` |
|
|
53
|
-
| **L2** | Call/data flow | \`trace\` |
|
|
54
|
-
| **L2** | Module/import relationships | \`graph\` |
|
|
55
|
-
| **L2** | Impact | \`blast_radius\` |
|
|
56
|
-
| **L2** | Type/lint/test | \`check\` / \`test_run\` |
|
|
57
|
-
| **L3** | Evidence, provenance, conflict review | \`search\` with \`knowledge({ action: 'lesson' })\` — focused only |
|
|
58
|
-
| **General** | Tool choice unknown | \`list_tools\` → \`search_tools\` → \`describe_tool\` |
|
|
59
|
-
|
|
60
|
-
Raw read_file only for exact edit lines after compressed tools identify target.
|
|
61
|
-
|
|
62
|
-
## Context Reuse
|
|
63
|
-
|
|
64
|
-
Before rereading path/topic, search exact path/topic first. If response gives ctxc_..., reuse with file_summary({ ref }) or file_summary({ ref, query }). Use enrich: true on tools that support it after first pass.
|
|
65
|
-
|
|
66
|
-
## Patterns
|
|
67
|
-
|
|
68
|
-
- New area: search -> scope_map -> file_summary -> graph/trace -> stash.
|
|
69
|
-
- Bug: search -> symbol -> trace -> file_summary -> test/check -> remember.
|
|
70
|
-
- Refactor shared code: blast_radius -> checkpoint -> file_summary -> rename/codemod -> check -> test_run.
|
|
71
|
-
- Web/API: web_search/web_fetch/http; browser only when JS/auth interaction needed. Browser snapshots now use ~200-400 tokens, making them practical for quick page state checks.
|
|
72
|
-
|
|
73
|
-
## Memory Discipline
|
|
74
|
-
|
|
75
|
-
Store only high-signal facts:
|
|
76
|
-
- Decisions and rationale.
|
|
77
|
-
- Conventions that constrain future work.
|
|
78
|
-
- Non-obvious root causes and fixes.
|
|
79
|
-
- Checkpoints and blockers.
|
|
80
|
-
|
|
81
|
-
Review decayed/stale entries periodically with knowledge({ action: 'flagged' }). Use lesson actions for reusable engineering lessons; load lesson-learned after implementation/review work.
|
|
82
|
-
|
|
83
|
-
## Flow + FORGE
|
|
84
|
-
|
|
85
|
-
Flows guide multi-step work. Read active step before acting. FORGE handles tiering/evidence/gates; load references only when main skill is too thin.
|
|
86
|
-
|
|
87
|
-
### Layered Knowledge Protocol
|
|
88
|
-
- **L0** → Generated briefing cards: load \`workspace-core\` at session start via \`aikit://l0/workspace-core\` resource (full card, live-updated) or \`status({ includePrelude: true })\` (compact summary). Requires \`onboard()\` first — if card null, run \`onboard\` before session start. Consume L0 as the default workspace map before \`search\`, \`scope_map\`, \`digest\`, or repeated \`file_summary\`; add \`workflow:<flow>\` if flow active, or one task card if no flow. Use \`file_summary({ tier: 'T1' })\` for structure, or \`file_summary({ tier: 'T2', query })\` for content only after L0 narrows the workset. Token-bounded.
|
|
89
|
-
- **L1** → Flow working context. Withdraw before dispatch; reuse before broad retrieval.
|
|
90
|
-
- **L2** → Canonical curated knowledge. Retrieve on demand; never preload broadly.
|
|
91
|
-
- **L3** → Evidence/auto-knowledge. Inspect only for provenance, conflict, or promotion assessment.
|
|
92
|
-
|
|
93
|
-
Reference docs:
|
|
94
|
-
- references/coordination.md - queue, lanes, stash, checkpoints, signaling.
|
|
95
|
-
- references/forge-protocol.md - tiering, evidence, gates.
|
|
96
|
-
- references/search-patterns.md - search, trace, graph, compression recipes.
|
|
97
|
-
- references/layered-knowledge-protocol.md - L0-L3 operating policy and hot path.
|
|
98
|
-
|
|
99
|
-
## Self-Dogfooding
|
|
100
|
-
|
|
101
|
-
When developing AI Kit itself: regenerate scaffold output, run focused checks, rebuild, then reindex so future searches see new shape.
|
|
102
|
-
`},{file:`references/coordination.md`,content:`# Coordination
|
|
1
|
+
var e=[{file:`SKILL.md`,content:"---\nname: aikit\ndescription: \"Use the @vpxa/aikit AI Kit MCP server for codebase search, context compression, validation, and persistent memory. Load at session start or before using aikit_* tools. This skill teaches tool judgment: minimize raw reads, choose the smallest useful retrieval path, and persist decisions that matter.\"\nmetadata:\n category: cross-cutting\n domain: general\n applicability: always\n inputs: [codebase]\n outputs: [search-results, analysis, knowledge]\n relatedSkills: [session-handoff, present]\n---\n\n# @vpxa/aikit - AI Kit\n\nUse AI Kit as compression, memory, validation, and coordination layer. Each call should reduce uncertainty or token load.\n\n## Communicating With the User\n\n**Use `present({ schemaVersion: 1, title, blocks })` for ALL non-trivial output.** This is the preferred way to show summaries, results, evidence maps, task plans, reviews, comparisons, dashboards, charts, timelines, and batch results to the user. Plain text is only for 1-2 sentence status updates or simple questions. The `present` tool renders rich, structured output that the user can interact with.\n\n## Session Loop\n\nStart:\n1. status({ includePrelude: true }).\n2. If `onboarded` is false or `prelude.onboardContext` / `structuredContent.onboard_context` is null → run `onboard({ path, mode: 'generate' })`, then `status({ includePrelude: true })` again.\n3. If `onboard_context.freshness.status` is `stale` or `unknown`, or `nextAction.kind === \"update_onboard\"` → run `onboard({ path, update: true })`, then `status({ includePrelude: true })` again.\n4. **Workspace context start**: Extract workspace skill + fresh onboard context from status: `workspace_skill.uri`, `prelude.workspaceSkillResource`, `onboard_context.freshness`, `onboard_context.packageMap`, `onboard_context.architecture`, and `onboard_context.recommendedReadOrder`. Read `aikit://skill/SKILL.md` when full repo-specific guidance is needed. Use fresh onboard context before broad retrieval. ≤ 2,100 tokens.\n5. search({ query: \"SESSION CHECKPOINT\", origin: \"curated\" }).\n6. flow({ action: 'status' }) when active flow may exist — use L1 snapshot before broad retrieval.\n7. scope_map({ task }) only when workspace context + checkpoint do not identify a narrow workset.\n\nDuring:\n- Prefer search/file_summary/digest/symbol/trace/graph over raw reads.\n- Use stash for temporary findings; knowledge for durable decisions.\n- Run blast_radius before shared/public edits.\n- Validate with check + relevant test_run.\n\nEnd:\n- reindex after structural changes.\n- produce_knowledge for durable project updates.\n- session_digest({ persist: true }).\n- knowledge remember session checkpoint with done/decisions/next/blockers.\n\n## Retrieval Ladder — Layered (Workspace Context + L1-L3)\n\n> This table maps knowledge layers to tool needs. For the canonical quick-reference tool decision table, see `aiKitToolPreference()` in protocols.mjs.\n\n| Layer | Need | Tool |\n|-------|------|------|\n| **Workspace Context** | Workspace skill + fresh onboard context | `status({ includePrelude: true })`; read `aikit://skill/SKILL.md` only when full guidance is needed. Run `onboard({ path, mode: 'generate' })` if `onboard_context` is missing; run `onboard({ path, update: true })` if `onboard_context.freshness.status` is `stale` or `unknown`. Consume fresh context before broad scans. |\n| **Workspace Context** | Architecture overview | `status({ includePrelude: true }).onboard_context.architecture`, then onboard `diagram.md` / `domains.md` when deeper detail is needed |\n| **Workspace Context** | Package map / repo shape | `status({ includePrelude: true }).onboard_context.packageMap`, then onboard `structure.md` / `dependencies.md` |\n| **Flow Context** | Flow-specific context | L1 flow snapshot via `knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>' })` |\n| **L1** | Active flow state | `knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>' })` |\n| **L2** | Prior decisions/conventions | `search` / `knowledge` |\n| **L2** | File structure | `file_summary({ files, tier: 'T1' })` |\n| **L2** | Exact relevant section | `file_summary({ files, tier: 'T2' })` |\n| **L2** | Many files | `digest` |\n| **L2** | Symbol defs/refs | `symbol` |\n| **L2** | Call/data flow | `trace` |\n| **L2** | Module/import relationships | `graph` |\n| **L2** | Impact | `blast_radius` |\n| **L2** | Type/lint/test | `check` / `test_run` |\n| **L3** | Evidence, provenance, conflict review | `search` with `knowledge({ action: 'lesson' })` — focused only |\n| **General** | Tool choice unknown | `list_tools({ intent: \"<task>\" })` (use intent param for planner-ranked results) or `search({ query: \"tool to <do X>\" })` |\n\nRaw read_file only for exact edit lines after compressed tools identify target.\n\n## Context Reuse\n\nBefore rereading path/topic, search exact path/topic first. If response gives ctxc_..., reuse with file_summary({ ref }) or file_summary({ ref, query }). Use enrich: true on tools that support it after first pass.\n\n## Patterns\n\n- New area: search -> scope_map -> file_summary -> graph/trace -> stash.\n- Bug: search -> symbol -> trace -> file_summary -> test/check -> remember.\n- Refactor shared code: blast_radius -> checkpoint -> file_summary -> rename/codemod -> check -> test_run.\n- Web/API: web_search/web_fetch/http; browser only when JS/auth interaction needed. Browser snapshots now use ~200-400 tokens, making them practical for quick page state checks.\n\n## Memory Discipline\n\nStore only high-signal facts:\n- Decisions and rationale.\n- Conventions that constrain future work.\n- Non-obvious root causes and fixes.\n- Checkpoints and blockers.\n\nReview decayed/stale entries periodically with knowledge({ action: 'flagged' }). Use lesson actions for reusable engineering lessons; load lesson-learned after implementation/review work.\n\n## Flow + FORGE\n\nFlows guide multi-step work. Read active step before acting. FORGE handles tiering/evidence/gates; load references only when main skill is too thin.\n\n### Layered Knowledge Protocol\n- **Workspace Context** → Workspace skill + fresh onboard context: load via `status({ includePrelude: true })`. Requires `onboard()` first — if `onboard_context` is null, run `onboard`; if `onboard_context.freshness.status` is `stale` or `unknown`, run `onboard({ path, update: true })`. Consume the workspace skill preview/resource pointer and fresh onboard package map/architecture/read-order before `search`, `scope_map`, `digest`, or repeated `file_summary`. Use `file_summary({ tier: 'T1' })` for structure, or `file_summary({ tier: 'T2', query })` for content only after status/onboard context narrows the workset. Token-bounded.\n- **L1** → Flow working context. Withdraw before dispatch; reuse before broad retrieval.\n- **L2** → Canonical curated knowledge. Retrieve on demand; never preload broadly.\n- **L3** → Evidence/auto-knowledge. Inspect only for provenance, conflict, or promotion assessment.\n\nReference docs:\n- references/coordination.md - queue, lanes, stash, checkpoints, signaling.\n- references/forge-protocol.md - tiering, evidence, gates.\n- references/search-patterns.md - search, trace, graph, compression recipes.\n- references/layered-knowledge-protocol.md - workspace context + L1-L3 operating policy and hot path.\n\n## Self-Dogfooding\n\nWhen developing AI Kit itself: regenerate scaffold output, run focused checks, rebuild, then reindex so future searches see new shape.\n"},{file:`references/coordination.md`,content:`# Coordination
|
|
103
2
|
|
|
104
3
|
Use coordination tools when work is parallel, long-running, or easy to repeat incorrectly.
|
|
105
4
|
|
|
@@ -194,53 +93,4 @@ file_summary (T1=structure, T2=content) or digest (multi-file synthesis). Read_f
|
|
|
194
93
|
## Rule of Thumb
|
|
195
94
|
|
|
196
95
|
If you are about to read raw code, ask whether the answer is really about structure, relevance, flow, or relationships. AI Kit has a smaller tool for each of those.
|
|
197
|
-
`},{file:`references/layered-knowledge-protocol.md`,content
|
|
198
|
-
|
|
199
|
-
AI Kit delivers knowledge through four layers:
|
|
200
|
-
|
|
201
|
-
## L0 — Generated Briefing Cards
|
|
202
|
-
|
|
203
|
-
Fast, compact task setup loaded at session start.
|
|
204
|
-
|
|
205
|
-
- **Auto-injected**: \`workspace-core\` (800-1200 tokens) — available via \`status({ includePrelude: true })\` after \`onboard()\` generates the card. If null → run \`onboard({ path, mode: 'generate' })\` then retry status.
|
|
206
|
-
- **If flow active**: Load \`workflow:<flow>\` (500-900 tokens) via flow start refs (replaces task card)
|
|
207
|
-
- **If no flow**: Optionally load one task card via \`file_summary\`
|
|
208
|
-
- **Budget**: ≤ 2,100 tokens total
|
|
209
|
-
- **Storage**: Generated workspace cache (path from server config)
|
|
210
|
-
- **Card families**: \`workspace-core\`, \`architecture\`, \`testing-release\`, \`known-issues\`, \`workflow:<flow>\`
|
|
211
|
-
- Session-start budget: workspace-core (800-1200 tokens) + 1 additional card ≤ 2,100 tokens total
|
|
212
|
-
- Generated cache, not canonical — rebuildable from L2 canonical sources
|
|
213
|
-
|
|
214
|
-
## L1 — Flow Working Context
|
|
215
|
-
|
|
216
|
-
Active run state and role-filtered dispatch context.
|
|
217
|
-
|
|
218
|
-
- Withdraw via \`knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })\`
|
|
219
|
-
- Use withdrawn refs before calling \`file_summary\`, \`scope_map\`, \`blast_radius\`, or \`search\`
|
|
220
|
-
- Each step has a declared \`contextProfile\` (implementer, reviewer, researcher, documenter, debugger)
|
|
221
|
-
|
|
222
|
-
## L2 — Canonical Curated Knowledge
|
|
223
|
-
|
|
224
|
-
Durable workspace archive managed by CuratedKnowledgeManager.
|
|
225
|
-
|
|
226
|
-
- Retrieve on demand via \`search()\` or \`knowledge({ action: 'read' })\`
|
|
227
|
-
- Never preload broadly at session start when L1 refs are already supplied
|
|
228
|
-
- Markdown is the canonical form; vector/FTS indexes are derived
|
|
229
|
-
|
|
230
|
-
## L3 — Evidence Archive
|
|
231
|
-
|
|
232
|
-
High-volume observations, proofs, failures, and runtime traces.
|
|
233
|
-
|
|
234
|
-
- Never auto-injected into session or step context
|
|
235
|
-
- Inspect only for provenance verification, conflict review, or promotion assessment
|
|
236
|
-
- Auto-knowledge extractors write to L3; they cannot navigate flow state or promote
|
|
237
|
-
|
|
238
|
-
## Retrieval Order
|
|
239
|
-
|
|
240
|
-
1. L0 (loaded cards at session start)
|
|
241
|
-
2. L1 (flow withdrawal when active)
|
|
242
|
-
3. L2 (on-demand canonical knowledge)
|
|
243
|
-
4. L3 (focused evidence retrieval only)
|
|
244
|
-
|
|
245
|
-
No active flow → keep L1 absent; use L0 + on-demand L2; turn-local context only.
|
|
246
|
-
`}];export{e as default};
|
|
96
|
+
`},{file:`references/layered-knowledge-protocol.md`,content:"# Layered Knowledge Protocol\n\nAI Kit delivers knowledge through startup workspace context plus L1-L3:\n\n## Workspace Context — Workspace Skill + Onboard Context\n\nFast, compact task setup loaded at session start.\n\n- **Auto-injected/discoverable**: `status({ includePrelude: true })` returns workspace skill preview/resource pointer and `onboard_context` after `onboard()` generates artifacts. If `onboard_context` is null → run `onboard({ path, mode: 'generate' })` then retry status. If `onboard_context.freshness.status` is `stale` or `unknown` → run `onboard({ path, update: true })` then retry status.\n- **Full workspace skill**: Read `aikit://skill/SKILL.md` only when full conventions, commands, or lessons are needed.\n- **Onboard files**: Use `onboard_context.recommendedReadOrder` and paths for `synthesis-guide.md`, `structure.md`, `dependencies.md`, `diagram.md`, `domains.md`, `entry-points.md`, and `code-map.md`.\n- **If flow active**: Load L1 via `knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>' })` and reuse supplied refs before broad retrieval.\n- **If no flow**: Optionally load one task card via `file_summary`\n- **Budget**: ≤ 2,100 tokens total\n- **Storage**: Workspace skill plus generated onboard artifacts under the status `onboardDir`\n- Generated workspace context, not canonical — rebuildable from L2 canonical sources and current repo analysis\n\n## L1 — Flow Working Context\n\nActive run state and role-filtered dispatch context.\n\n- Withdraw via `knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })`\n- Use withdrawn refs before calling `file_summary`, `scope_map`, `blast_radius`, or `search`\n- Each step has a declared `contextProfile` (implementer, reviewer, researcher, documenter, debugger)\n\n## L2 — Canonical Curated Knowledge\n\nDurable workspace archive managed by CuratedKnowledgeManager.\n\n- Retrieve on demand via `search()` or `knowledge({ action: 'read' })`\n- Never preload broadly at session start when L1 refs are already supplied\n- Markdown is the canonical form; vector/FTS indexes are derived\n\n## L3 — Evidence Archive\n\nHigh-volume observations, proofs, failures, and runtime traces.\n\n- Never auto-injected into session or step context\n- Inspect only for provenance verification, conflict review, or promotion assessment\n- Auto-knowledge extractors write to L3; they cannot navigate flow state or promote\n\n## Retrieval Order\n\n1. Workspace context (workspace skill + onboard context at session start)\n2. L1 (flow withdrawal when active)\n3. L2 (on-demand canonical knowledge)\n4. L3 (focused evidence retrieval only)\n\nNo active flow → keep L1 absent; use workspace context + on-demand L2; turn-local context only.\n"}];export{e as default};
|
|
@@ -450,7 +450,7 @@ browser({ action: 'eval', pageId, code: 'localStorage.getItem("authToken")' })
|
|
|
450
450
|
| Console + eval hybrid | \`console\` | consoleSubAction: get, expression (evaluates JS) |
|
|
451
451
|
| Compare changes | \`diff\` | (compares to previous snapshot) |
|
|
452
452
|
|
|
453
|
-
For full parameter details: \`
|
|
453
|
+
For full parameter details: \`list_tools({ intent: "browser automation" })\` or check the tool's schema
|
|
454
454
|
|
|
455
455
|
## Principles
|
|
456
456
|
|
|
@@ -141,15 +141,15 @@ Default: Context + Container. Add Component only for a complex container and a c
|
|
|
141
141
|
2. Identify audience and decision the diagram supports.
|
|
142
142
|
3. **Gather evidence with AI Kit - check onboard cache FIRST:**
|
|
143
143
|
a. **Check onboard cache:**
|
|
144
|
-
|
|
145
|
-
-
|
|
144
|
+
- Run status({ includePrelude: true }) - if structuredContent.onboard_context is present and onboard_context.freshness.status == "fresh":
|
|
145
|
+
- Use onboard_context.recommendedReadOrder and read cache files from onboardDir:
|
|
146
146
|
- structure.md - module tree, layers, directory shape
|
|
147
147
|
- dependencies.md - internal/external dependency graph
|
|
148
|
+
- diagram.md / domains.md - architecture boundaries
|
|
148
149
|
- symbols.md - exported symbols, type signatures
|
|
149
150
|
- entry-points.md - API surface, CLI entry points
|
|
150
|
-
- Freshness:
|
|
151
|
-
|
|
152
|
-
Default: <50 pending changes -> serve from cache | >=50 -> refresh.
|
|
151
|
+
- Freshness: trust status().onboard_context.freshness.status, not timestamps inferred by the model.
|
|
152
|
+
If freshness is stale/unknown, run onboard({ path: ".", update: true }) and status again before using onboard files.
|
|
153
153
|
b. **Use cache data for C4:**
|
|
154
154
|
- Extract layers from structure analysis (layer-detector classifications)
|
|
155
155
|
- Extract modules/containers from directory tree
|
|
@@ -155,8 +155,9 @@ Detailed workflow for acquiring and documenting project knowledge into \`docs/ar
|
|
|
155
155
|
|
|
156
156
|
### Phase 1: Scan and Read Intent (IR-aware)
|
|
157
157
|
|
|
158
|
-
Pre-flight — load
|
|
158
|
+
Pre-flight — load workspace context + L1 context:
|
|
159
159
|
- \`status({ includePrelude: true })\`
|
|
160
|
+
- If \`onboard_context\` is missing, run \`onboard({ path: ".", mode: "generate" })\`; if \`onboard_context.freshness.status\` is \`stale\` or \`unknown\`, run \`onboard({ path: ".", update: true })\`; then status again.
|
|
160
161
|
- \`knowledge({ action: 'withdraw', scope: 'flow', profile: 'documenter', budget: 6000 })\`
|
|
161
162
|
|
|
162
163
|
Then check \`docs/.docs-state.json\` (the Committed Docs IR):
|
|
@@ -789,7 +790,7 @@ Use this template for any generated section that includes factual claims:
|
|
|
789
790
|
|
|
790
791
|
### Update Mode Template (\`docs/.docs-state.json\`)
|
|
791
792
|
|
|
792
|
-
Committed state file for incremental documentation updates.
|
|
793
|
+
Committed state file for incremental documentation updates. Workspace-context regeneratable cache,
|
|
793
794
|
committed to git so clones have warm cache.
|
|
794
795
|
|
|
795
796
|
**Design: extends existing schema (backward compatible).** NO parallel \`_lastSynced\` block.
|
|
@@ -798,7 +799,7 @@ Adds \`signatureHash\`, \`contractHash\` (optional), and \`syncedAt\` to the exi
|
|
|
798
799
|
\`\`\`json
|
|
799
800
|
{
|
|
800
801
|
"version": "1.1",
|
|
801
|
-
"layer": "
|
|
802
|
+
"layer": "workspace-context",
|
|
802
803
|
"timestamp": "ISO-8601",
|
|
803
804
|
"lastCommitSha": "git rev-parse HEAD of last documented commit",
|
|
804
805
|
|
|
@@ -1732,7 +1733,7 @@ Orchestrate phased documentation generation with document-type-specific outputs
|
|
|
1732
1733
|
|
|
1733
1734
|
Before executing the generation pipeline, load available context from across the infrastructure:
|
|
1734
1735
|
|
|
1735
|
-
-
|
|
1736
|
+
- Workspace context: \`status({ includePrelude: true })\` — workspace skill, onboard context, lessons, conventions
|
|
1736
1737
|
- L1: \`knowledge({ action: 'withdraw', scope: 'flow', profile: 'documenter', budget: 6000 })\` — flow context
|
|
1737
1738
|
- L2: \`search({ origin: 'curated' })\` + \`knowledge({ action: 'lesson', subAction: 'list-lessons' })\` — curated knowledge
|
|
1738
1739
|
- L3: Evidence archive (provenance only, never auto-injected)
|
|
@@ -1741,8 +1742,9 @@ Before executing the generation pipeline, load available context from across the
|
|
|
1741
1742
|
|
|
1742
1743
|
### Phase 1 — Docs IR Producer (deterministic)
|
|
1743
1744
|
|
|
1744
|
-
Pre-flight: load
|
|
1745
|
-
- \`status({ includePrelude: true })\` —
|
|
1745
|
+
Pre-flight: load workspace context + L1 context from infrastructure.
|
|
1746
|
+
- \`status({ includePrelude: true })\` — workspace skill + onboard context prelude
|
|
1747
|
+
- If \`onboard_context\` is missing, generate onboard. If \`onboard_context.freshness.status\` is \`stale\` or \`unknown\`, update onboard, then status again.
|
|
1746
1748
|
- \`knowledge({ action: 'withdraw', scope: 'flow', profile: 'documenter', budget: 6000 })\` — L1 flow context
|
|
1747
1749
|
|
|
1748
1750
|
Step 1: Check \`docs/.docs-state.json\` (the Committed Docs IR):
|
|
@@ -1810,7 +1812,7 @@ Step 2: Doc inventory (always runs, not cached):
|
|
|
1810
1812
|
- \`blast_radius({ files: changedFiles })\` — stale doc detection
|
|
1811
1813
|
|
|
1812
1814
|
The IR (\`docs/.docs-state.json\`) stores:
|
|
1813
|
-
- \`version\` + \`layer: "
|
|
1815
|
+
- \`version\` + \`layer: "workspace-context"\` (regeneratable cache, not curated; committed to git)
|
|
1814
1816
|
- \`lastCommitSha\` (committed = warm clones, no cold starts)
|
|
1815
1817
|
- \`onboardRef\` (pointer to onboard cache, NO duplicated analysis data)
|
|
1816
1818
|
- \`sourceFiles\` (per-file contentHash, signatureHash, contractHash, syncedAt, changeClass)
|
|
@@ -3304,7 +3306,7 @@ Each doc type uses specific tools. Load the tools before generating.
|
|
|
3304
3306
|
Documentation is the bridge between AI Kit's layered knowledge and human readers.
|
|
3305
3307
|
|
|
3306
3308
|
\`\`\`
|
|
3307
|
-
|
|
3309
|
+
Workspace skill + onboard context ─→ docs/ — Human-readable summaries of workspace state
|
|
3308
3310
|
│
|
|
3309
3311
|
L1 (Flow Context) ───→ docs/architecture/flows/ — Flow design decisions → durable docs
|
|
3310
3312
|
│ │
|
|
@@ -3315,7 +3317,7 @@ L3 (Evidence Archive) ──→ docs/reference/ — Verified claims with tool re
|
|
|
3315
3317
|
|
|
3316
3318
|
| Layer | Docs Role | Action |
|
|
3317
3319
|
|---|---|---|
|
|
3318
|
-
|
|
|
3320
|
+
| Workspace context | Regenerate via onboard/status/skill compiler when topics change | Onboard + workspace skill freshness trigger |
|
|
3319
3321
|
| L1 | Withdraw flow context, extract decisions/artifacts → docs/ | \`knowledge({action:'withdraw',scope:'flow'})\` |
|
|
3320
3322
|
| L2 | Candidate for promotion from verified docs | Consolidation adjudication |
|
|
3321
3323
|
| L3 | Evidence chain for every doc claim | \`knowledge({action:'lesson'})\` + receipts |
|
|
@@ -3439,7 +3441,7 @@ Report: "No documentation updates needed" + brief reason.
|
|
|
3439
3441
|
- If \`syncedAt\` missing on doc → treat as stale (conservative), emit warning
|
|
3440
3442
|
- If no recent lessons match → continue silently
|
|
3441
3443
|
- Session dedup: maintain \`Set<string>\` of checked topic+entry IDs per session; skip if already checked
|
|
3442
|
-
2. **Load layered context**: \`status({ includePrelude: true })\` →
|
|
3444
|
+
2. **Load layered context**: \`status({ includePrelude: true })\` → fresh workspace context (generate/update onboard first if missing/stale/unknown). \`knowledge({ action: 'withdraw', scope: 'flow', profile: 'documenter', budget: 6000 })\` → L1.
|
|
3443
3445
|
3. Gather intent/evidence from flow artifacts, git diff, blast_radius, produce_knowledge, analyze, changelog, or search.
|
|
3444
3446
|
4. Classify target docs with Diataxis or extended doc type table.
|
|
3445
3447
|
5. Map changed capability to doc action.
|
|
@@ -467,8 +467,8 @@ Every subagent prompt includes:
|
|
|
467
467
|
2. Goal + acceptance criteria.
|
|
468
468
|
3. Files/boundary + do-not-touch list.
|
|
469
469
|
4. Compressed context: relevant snippets, conventions, decisions, active flow paths.
|
|
470
|
-
5. **
|
|
471
|
-
6. **Hard rule — no broad
|
|
470
|
+
5. **Workspace/L1 refs**: Include supplied workspace skill/onboard context, \`retrievedRefs\`, and L1 \`FlowContextSnapshotV1\` fields relevant to the role.
|
|
471
|
+
6. **Hard rule — no broad rediscovery**: Subagent must reuse supplied refs first. Must NOT independently rediscover workspace basics or reload architecture context when the dispatch already carries applicable refs.
|
|
472
472
|
7. Constraints: skills to load, libraries/patterns, no present, no flow advance.
|
|
473
473
|
8. FORGE: tier, task_id, evidence claims to add.
|
|
474
474
|
9. Validation: expected check, test_run, or reason skipped.
|
|
@@ -480,10 +480,10 @@ Use references/implementer-prompt.md for implementation dispatches and reference
|
|
|
480
480
|
|
|
481
481
|
Before dispatch:
|
|
482
482
|
- knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })
|
|
483
|
-
- Include
|
|
483
|
+
- Include supplied workspace/onboard context refs and \`retrievedRefs\` (from L1) in the dispatch envelope.
|
|
484
484
|
- Add only missing snippets with file_summary/digest.
|
|
485
485
|
- Paste context into dispatch; do not tell subagent to rediscover basics.
|
|
486
|
-
- **Hard rule**: Subagent must reuse supplied
|
|
486
|
+
- **Hard rule**: Subagent must reuse supplied workspace/L1 refs before broad retrieval. Block if it independently rediscovers workspace basics already present in the dispatch.
|
|
487
487
|
|
|
488
488
|
After subagent work:
|
|
489
489
|
- Store durable findings with knowledge({ action: 'remember', scope: 'flow', ... }).
|
|
@@ -14,19 +14,45 @@ metadata:
|
|
|
14
14
|
|
|
15
15
|
YOU MUST FOLLOW THIS PROTOCOL ON EVERY TASK. You are an orchestrator, not an implementer.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Priority Ladder (conflict resolution order)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
1. Safety + user approval.
|
|
20
|
+
2. Tool/bootstrap correctness.
|
|
21
|
+
3. Delegation boundary.
|
|
22
|
+
4. Evidence + verification.
|
|
23
|
+
5. Context budget.
|
|
24
|
+
6. Terse communication.
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
## MANDATORY FIRST ACTIONS (session start)
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
Execute these before ANY other work:
|
|
29
|
+
1. \`flow({ action: 'status' })\` — Check active flow state.
|
|
30
|
+
2. \`status({ includePrelude: true })\` — Load workspace skill summary plus onboard context.
|
|
31
|
+
3. If \`onboarded\` is false or \`onboard_context\` is null → \`onboard({ path: ".", mode: "generate" })\` first, then status again.
|
|
32
|
+
4. If \`onboard_context.freshness.status\` is \`stale\` or \`unknown\`, or \`nextAction.kind === "update_onboard"\` → \`onboard({ path: ".", update: true })\` first, then status again.
|
|
33
|
+
5. \`skill({ name: 'aikit' })\` — Load the AI Kit skill for tool routing, retrieval ladder, and communication patterns.
|
|
24
34
|
|
|
25
|
-
|
|
35
|
+
On platforms without native \`skill()\` support, the AI Kit instructions are already in your system prompt via other channels.
|
|
26
36
|
|
|
27
|
-
**
|
|
37
|
+
**Workspace skill:** \`status({ includePrelude: true })\` gives you the compact summary. For full content (conventions, commands, lessons): read \`aikit://skill/SKILL.md\` MCP resource on demand.
|
|
28
38
|
|
|
29
|
-
|
|
39
|
+
## User-Facing Presentation
|
|
40
|
+
|
|
41
|
+
Use \`present({ schemaVersion: 1, title, blocks })\` for almost every substantive response to the user. If the response is more than 3 sentences, contains a list/table/checklist/plan/status/verdict/summary/progress/evidence map, or asks for approval/choice, use \`present\`. Prefer \`present\` even without actions for read-only summaries; add \`actions\` for approvals, confirmations, and selections. Plain text only for tiny status updates or one simple question that fits in 3 short sentences.
|
|
42
|
+
|
|
43
|
+
## Delegation Rules
|
|
44
|
+
|
|
45
|
+
**RULE 1 — Decompose everything.** Break every task into independent, parallelizable subtasks.
|
|
46
|
+
|
|
47
|
+
**RULE 2 — Delegate, never implement.** For every subtask, spawn a sub-agent via Task(). If you catch yourself about to edit a file directly, STOP. Spawn a sub-agent.
|
|
48
|
+
|
|
49
|
+
**RULE 3 — Wait and synthesize.** After all sub-agents complete, consolidate their outputs.
|
|
50
|
+
|
|
51
|
+
**RULE 4 — No direct coding.** You NEVER write, edit, or create files yourself. That is sub-agent work.
|
|
52
|
+
|
|
53
|
+
**RULE 5 — Parallel fan-out.** Subtasks without data dependencies MUST run in parallel.
|
|
54
|
+
|
|
55
|
+
**RULE 6 — Full cycle per phase.** Each phase (Plan → Implement → Review → Verify) gets its own delegation cycle.
|
|
30
56
|
|
|
31
57
|
## Exceptions (ONLY these)
|
|
32
58
|
|
|
@@ -35,4 +61,20 @@ You MAY write code directly ONLY when:
|
|
|
35
61
|
- You are fixing a sub-agent's output (typo, quick patch)
|
|
36
62
|
- There is no sub-agent available for the required skill
|
|
37
63
|
|
|
38
|
-
|
|
64
|
+
## Dispatch Envelope (every subagent prompt)
|
|
65
|
+
|
|
66
|
+
Every subagent dispatch MUST include:
|
|
67
|
+
1. Agent + Goal — specialist name, acceptance criteria
|
|
68
|
+
2. Files + Boundary — target files, do-not-touch list
|
|
69
|
+
3. Arch Context — compress with file_summary/digest before including
|
|
70
|
+
4. Prior Knowledge — search lessons + conventions
|
|
71
|
+
5. FORGE — tier, task_id, evidence requirements
|
|
72
|
+
6. Flow Context — withdraw context FIRST, reuse refs
|
|
73
|
+
7. Constraints — no present tool, no flow advance, stay in scope
|
|
74
|
+
8. Return contract — DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED (≤200 words)
|
|
75
|
+
|
|
76
|
+
## Emergency Recovery
|
|
77
|
+
|
|
78
|
+
STOP → ASSESS (\`git diff --stat\` + \`check({})\`) → CONTAIN (1-3 files: fix, widespread: stash) → RECOVER (stash first) → DOCUMENT (remember what went wrong).
|
|
79
|
+
|
|
80
|
+
Max 2 retries per task. Same failure twice → stop loop, change plan.`}];export{e as default};
|