@vpxa/aikit 0.1.151 → 0.1.153

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 (30) hide show
  1. package/package.json +1 -1
  2. package/packages/blocks-core/dist/index.d.ts +471 -0
  3. package/packages/blocks-core/dist/index.js +863 -0
  4. package/packages/chunker/dist/index.d.ts +12 -0
  5. package/packages/chunker/dist/index.js +4 -4
  6. package/packages/cli/dist/index.js +15 -15
  7. package/packages/cli/dist/{init-Dk0WDziB.js → init-O57V8aOH.js} +1 -1
  8. package/packages/cli/dist/{scaffold-BB6OrTuA.js → scaffold-DwQDdiCJ.js} +1 -1
  9. package/packages/cli/dist/{templates-D4t_3cJs.js → templates-VOIHbNnT.js} +1 -1
  10. package/packages/present/dist/index.html +818 -3629
  11. package/packages/server/dist/index.js +1 -1
  12. package/packages/server/dist/server-Bs6Rib4s.js +398 -0
  13. package/packages/store/dist/index.js +12 -12
  14. package/scaffold/dist/adapters/_shared.mjs +2 -1
  15. package/scaffold/dist/adapters/claude-code.mjs +10 -9
  16. package/scaffold/dist/adapters/codex.mjs +3 -3
  17. package/scaffold/dist/adapters/copilot.mjs +20 -20
  18. package/scaffold/dist/adapters/gemini.mjs +9 -3
  19. package/scaffold/dist/definitions/agents.mjs +16 -120
  20. package/scaffold/dist/definitions/bodies.mjs +214 -254
  21. package/scaffold/dist/definitions/protocols.mjs +110 -206
  22. package/scaffold/dist/definitions/skills/adr-skill.mjs +27 -0
  23. package/scaffold/dist/definitions/skills/brainstorming.mjs +14 -0
  24. package/scaffold/dist/definitions/skills/browser-use.mjs +1 -1
  25. package/scaffold/dist/definitions/skills/c4-architecture.mjs +46 -1
  26. package/scaffold/dist/definitions/skills/docs.mjs +34 -0
  27. package/scaffold/dist/definitions/skills/frontend-design.mjs +20 -0
  28. package/scaffold/dist/definitions/skills/present.mjs +31 -0
  29. package/scaffold/dist/definitions/skills/session-handoff.mjs +20 -0
  30. package/packages/server/dist/server-D67lImHa.js +0 -540
@@ -1511,6 +1511,32 @@ metadata:
1511
1511
 
1512
1512
  # C4 Architecture Documentation
1513
1513
 
1514
+ ## Quick Reference
1515
+
1516
+ **Output formats:** Mermaid (markdown) for simple diagrams | HTML viewer for interactive diagrams (>5 components)
1517
+
1518
+ **HTML viewer - data injection API:**
1519
+ - Copy template: \`cp assets/c4-viewer.html docs/architecture/interactive/{name}.html\`
1520
+ - Create data JSON matching this shape:
1521
+ \`\`\`json
1522
+ {
1523
+ "title": "System Name",
1524
+ "elements": [
1525
+ { "id": "unique-id", "label": "Display Name", "type": "system|container|component|person|database|queue|external",
1526
+ "technology": "optional", "description": "optional", "tags": ["optional"], "parentId": "optional-parent-id" }
1527
+ ],
1528
+ "relationships": [
1529
+ { "sourceId": "from-id", "targetId": "to-id", "label": "optional", "technology": "optional" }
1530
+ ]
1531
+ }
1532
+ \`\`\`
1533
+ - Inject data: \`node scripts/inject-viewer.mjs --template assets/c4-viewer.html --data {data.json} --out {output.html}\`
1534
+ - The script replaces content of \`<script type="application/json" id="diagram-data">\` in the template
1535
+
1536
+ **NEVER \`read_file\` on \`assets/c4-viewer.html\`** - it's a 1.8MB minified React/ReactFlow bundle. Use the injection API above.
1537
+
1538
+ **Full schema:** [references/c4.schema.json](references/c4.schema.json) | **Design patterns:** [references/advanced-patterns.md](references/advanced-patterns.md) | **Common mistakes:** [references/common-mistakes.md](references/common-mistakes.md)
1539
+
1514
1540
  Generate software architecture documentation using C4 model diagrams in Mermaid syntax.
1515
1541
 
1516
1542
  ## Workflow
@@ -1979,6 +2005,8 @@ Write architecture documentation to \`docs/architecture/\` with naming conventio
1979
2005
 
1980
2006
  AI Kit ships a pre-built \`c4-viewer.html\` that handles ALL rendering, layout (ELK.js), styling, and interaction. The LLM's only job is to produce valid JSON matching [references/c4.schema.json](references/c4.schema.json). **NEVER generate HTML for architecture diagrams** — inject JSON into the shipped viewer.
1981
2007
 
2008
+ > **WARNING**: NEVER \`read_file\` on \`assets/c4-viewer.html\` - it is a 1.8MB minified bundle. The injection API below is all you need.
2009
+
1982
2010
  ### Usage
1983
2011
 
1984
2012
  1. Generate JSON matching [references/c4.schema.json](references/c4.schema.json)
@@ -2041,7 +2069,24 @@ present({
2041
2069
  }
2042
2070
  \`\`\`
2043
2071
 
2044
- The viewer expects a JSON object matching [references/c4.schema.json](references/c4.schema.json).
2072
+ The viewer expects this JSON shape (full schema: [references/c4.schema.json](references/c4.schema.json)):
2073
+
2074
+ | Field | Type | Required | Description |
2075
+ |-------|------|----------|-------------|
2076
+ | \`title\` | string | Yes | Diagram title |
2077
+ | \`elements[]\` | array | Yes | C4 elements (systems, containers, components, people) |
2078
+ | \`elements[].id\` | string | Yes | Unique identifier |
2079
+ | \`elements[].label\` | string | Yes | Display name |
2080
+ | \`elements[].type\` | string | Yes | \`system|container|component|person|database|queue|external\` |
2081
+ | \`elements[].technology\` | string | No | Technology stack |
2082
+ | \`elements[].description\` | string | No | Brief description |
2083
+ | \`elements[].tags\` | string[] | No | Categorization tags |
2084
+ | \`elements[].parentId\` | string | No | Nesting - references another element's id |
2085
+ | \`relationships[]\` | array | Yes | Connections between elements |
2086
+ | \`relationships[].sourceId\` | string | Yes | Source element id |
2087
+ | \`relationships[].targetId\` | string | Yes | Target element id |
2088
+ | \`relationships[].label\` | string | No | Relationship description |
2089
+ | \`relationships[].technology\` | string | No | Protocol/technology used |
2045
2090
 
2046
2091
  **Node types:** person, system, container, component, database, queue, external, boundary, deploymentNode
2047
2092
 
@@ -2142,6 +2142,38 @@ metadata:
2142
2142
 
2143
2143
  Manage the \`docs/\` folder as a single source of truth for project documentation. This skill runs during the mandatory \`_docs-sync\` epilogue step of every flow, ensuring documentation stays in sync with code changes.
2144
2144
 
2145
+ ## Quick Reference
2146
+
2147
+ **Purpose:** Manage \`docs/\` folder as living documentation. Runs during \`_docs-sync\` epilogue of every flow.
2148
+
2149
+ **When triggered:** Automatically after every flow completion (epilogue step). Also manually for fresh generation.
2150
+
2151
+ **Four scenarios:**
2152
+ 1. **Fresh Generation** — no \`docs/\` exists → full 7-phase pipeline
2153
+ 2. **Update Mode** — \`docs/\` exists with standard structure → incremental update
2154
+ 3. **Migration Mode** — \`docs/\` exists with non-standard structure → migrate first
2155
+ 4. **Epilogue Sync** — during flow \`_docs-sync\` step → combines with 1-3
2156
+
2157
+ **Tour viewer — data injection API:**
2158
+ - Copy template: \`cp assets/tour-viewer.html docs/{name}-tour.html\`
2159
+ - Create tour JSON matching this shape:
2160
+ \`\`\`json
2161
+ {
2162
+ "title": "Tour Title",
2163
+ "steps": [
2164
+ { "title": "Step Name", "file": "src/path.ts", "line": 42, "description": "What to notice here", "highlights": ["symbol1"] }
2165
+ ]
2166
+ }
2167
+ \`\`\`
2168
+ - Inject data: \`node scripts/inject-viewer.mjs --template assets/tour-viewer.html --data {data.json} --out {output.html}\`
2169
+ - The script replaces content of \`<script type="application/json" id="diagram-data">\` in the template
2170
+
2171
+ **NEVER \`read_file\` on \`assets/tour-viewer.html\`** — it's a large minified React bundle. Use the injection API above.
2172
+
2173
+ **Full tour schema:** [references/tour.schema.json](references/tour.schema.json) | **Code tour patterns:** [references/code-tour-patterns.md](references/code-tour-patterns.md) | **Staleness config:** [references/staleness-config.md](references/staleness-config.md)
2174
+
2175
+ **Diátaxis framework:** Tutorials (learning+doing) · How-to (working+doing) · Reference (working+understanding) · Explanation (learning+understanding). See [references/diataxis-reference.md](references/diataxis-reference.md).
2176
+
2145
2177
  ## Principles
2146
2178
 
2147
2179
  1. **Living, not legacy** — Documentation is updated as code changes, never as a separate "docs sprint"
@@ -2612,6 +2644,8 @@ This phase uses the **c4-architecture skill** to produce interactive, data-drive
2612
2644
 
2613
2645
  Tour generation Phase 4c produces interactive tour viewers. Use the docs skill's \`assets/tour-viewer.html\` template:
2614
2646
 
2647
+ > **WARNING**: NEVER \`read_file\` on \`assets/tour-viewer.html\` — it is a large minified bundle. Use the injection script above.
2648
+
2615
2649
  \`\`\`bash
2616
2650
  node scripts/inject-viewer.mjs --template assets/tour-viewer.html --data <tour-data.json> --out docs/tours/interactive/<tour-name>.html
2617
2651
  \`\`\`
@@ -14,6 +14,26 @@ metadata:
14
14
 
15
15
  > Comprehensive frontend design system — visual design thinking, typography, color, layout, motion, accessibility, performance, and anti-pattern detection. Synthesized from Anthropic's frontend-design skill, Vercel Web Interface Guidelines, and Impeccable design patterns.
16
16
 
17
+ ## Quick Reference
18
+
19
+ **Purpose:** Comprehensive design guidance — typography, color, layout, motion, accessibility, performance, anti-pattern detection.
20
+
21
+ **Mandatory** for the Frontend agent on every task. Also for any UI, styling, responsive, or design work.
22
+
23
+ **Context checklist** (infer from codebase if not specified):
24
+ Design system? | Brand guidelines? | Accessibility level (AA default)? | Breakpoints? | Motion budget? | Dark mode? | Target platforms?
25
+
26
+ **Design cycle:** Understand → Explore → Evaluate → Refine
27
+
28
+ **Key principles:**
29
+ - Typography: system font stack, modular scale, max 2 families
30
+ - Color: semantic tokens (\`--color-success\`, not \`--green\`), 4.5:1+ contrast
31
+ - Layout: CSS Grid for 2D, Flexbox for 1D, \`min()\`/\`clamp()\` for fluid sizing
32
+ - Motion: \`prefers-reduced-motion\`, \`will-change\` sparingly, 200-300ms for UI
33
+ - Accessibility: semantic HTML first, ARIA only when needed, focus visible, skip links
34
+
35
+ **Anti-patterns to catch:** z-index wars, magic numbers, \`!important\` chains, px-only sizing, color-only status indicators.
36
+
17
37
  ## When to Use
18
38
 
19
39
  **MANDATORY** for the Frontend agent on every task. Also use when:
@@ -13,6 +13,37 @@ argument-hint: "Content to present — data, analysis results, status report, co
13
13
 
14
14
  # Present Tool — Rich Interactive Dashboards
15
15
 
16
+ ## Quick Reference
17
+
18
+ **Two formats:**
19
+ - \`html\` — in-chat UIResource (display-only: tables, charts, reports). DEFAULT choice.
20
+ - \`browser\` — local URL in system browser (when you need user interaction back, or in CLI mode).
21
+
22
+ **Content blocks** (pass as \`content\` array of \`{ type, title?, value }\`):
23
+ | Type | Value shape | Use for |
24
+ |------|-------------|---------|
25
+ | \`markdown\` | string | Prose, headings, code — **never tables** |
26
+ | \`table\` | \`Record[]\` or \`{headers,rows}\` | **All tabular data** (NEVER put tables in markdown blocks) |
27
+ | \`chart\` | \`{chartType,data,xKey,yKeys}\` | Bar, line, area, pie, radar, scatter |
28
+ | \`metrics\` | \`[{label,value,trend?,status?}]\` | KPI cards |
29
+ | \`cards\` | \`[{title,body?,badge?,status?}]\` | Info cards |
30
+ | \`mermaid\` | string | Diagrams |
31
+ | \`tree\` | \`{name,children?}\` | Hierarchical data |
32
+ | \`timeline\` | \`[{title,description?,timestamp?,status?}]\` | Event sequences |
33
+ | \`checklist\` | \`[{label,checked}]\` | Todo/check lists |
34
+ | \`code\` | string | Code blocks |
35
+
36
+ **Actions** (interactive buttons/selects, mainly for \`browser\` mode):
37
+ \`\`\`json
38
+ { "actions": [{ "type": "button", "id": "approve", "label": "Approve", "variant": "primary" }] }
39
+ \`\`\`
40
+
41
+ **Anti-patterns:**
42
+ - ❌ Tables inside \`markdown\` blocks → renders as raw pipe text
43
+ - ❌ \`html\` format in CLI mode → invisible (use \`browser\`)
44
+ - ❌ Unicode escapes in \`title\` param (\`\\u2014\`) → literal text (use actual — character)
45
+ - ❌ Chart.js format (\`{labels,datasets}\`) → use \`{chartType,data,xKey,yKeys}\`
46
+
16
47
  The \`present\` tool renders structured content as a professional dark-themed dashboard. It supports two output modes:
17
48
 
18
49
  - **\`html\`** — Renders an embedded UIResource for MCP-UI hosts (in-chat). Best for display-only content.
@@ -1313,6 +1313,26 @@ metadata:
1313
1313
 
1314
1314
  Creates comprehensive handoff documents that enable fresh AI agents to seamlessly continue work with zero ambiguity. Solves the long-running agent context exhaustion problem.
1315
1315
 
1316
+ ## Quick Reference
1317
+
1318
+ **Purpose:** Create handoff documents for seamless AI session transfers. Solves context exhaustion — fresh agents continue with zero ambiguity.
1319
+
1320
+ **Two modes:**
1321
+ - **CREATE** — Save current state when: user requests, context filling up, milestone completed, session ending
1322
+ - **RESUME** — Load prior state when: user says "continue", "resume", or references existing handoff
1323
+
1324
+ **Dual storage** (every handoff creates both):
1325
+ 1. **Full file** → \`.aikit-state/handoffs/{flow-slug}/<timestamp>-<slug>.md\` (browsable, gitignored)
1326
+ 2. **Compact entry** → \`knowledge({ action: "remember", scope: "flow", category: "session", title: "Session Handoff: <slug>" })\` (~1-2K chars, for \`withdraw\`)
1327
+
1328
+ **CREATE workflow:** Gather state → Fill template (metadata, state summary, codebase understanding, work completed, pending work, resume context) → Save dual format → Present summary
1329
+
1330
+ **RESUME workflow:** \`withdraw({ scope: "flow", profile: "implementer" })\` → Read compact entry → If need full context, read file from \`.aikit-state/handoffs/\` → Verify state → Continue work
1331
+
1332
+ **Template sections:** Session Metadata | Current State | Codebase Understanding | Work Completed | Pending Work | Resume Context | Environment State | Related Resources
1333
+
1334
+ **Proactive trigger:** After 5+ file edits, complex debugging, or major decisions → suggest handoff.
1335
+
1316
1336
  ## Mode Selection
1317
1337
 
1318
1338
  Determine which mode applies: