@vpxa/aikit 0.1.359 → 0.1.361

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 (67) hide show
  1. package/README.md +442 -442
  2. package/package.json +3 -1
  3. package/packages/analyzers/dist/index.d.ts +1 -1
  4. package/packages/claude-desktop/dist/manifest.json +31 -0
  5. package/packages/claude-desktop/dist/mcp-source.json +16 -0
  6. package/packages/cli/dist/index.js +14 -14
  7. package/packages/cli/dist/init-JfM6gnAO.js +7 -0
  8. package/packages/cli/dist/mcp-entry.json +8 -0
  9. package/packages/cli/dist/{templates-d2UQHjpi.js → templates-CNDa9H4e.js} +25 -25
  10. package/packages/core/dist/index.d.ts +46 -3
  11. package/packages/core/dist/index.js +1 -1
  12. package/packages/flows/dist/index.d.ts +1 -1
  13. package/packages/flows/dist/index.js +1 -1
  14. package/packages/present/dist/annotation-layer.js +10 -10
  15. package/packages/server/dist/bin.js +1 -1
  16. package/packages/server/dist/config-B4klhHVp.js +2 -0
  17. package/packages/server/dist/config-D3rRPB9X.js +1 -0
  18. package/packages/server/dist/index.js +1 -1
  19. package/packages/server/dist/observations-CfglxBMB.js +6 -0
  20. package/packages/server/dist/observations-CrQU_HVm.js +5 -0
  21. package/packages/server/dist/prelude-BIJWSWyX.js +2 -0
  22. package/packages/server/dist/prelude-Dxc3G0Q2.js +1 -0
  23. package/packages/server/dist/routes-Ct7q5jrL.js +6 -0
  24. package/packages/server/dist/routes-DsSm9ea0.js +5 -0
  25. package/packages/server/dist/sampling-BX1qQuXx.js +2 -0
  26. package/packages/server/dist/sampling-QHtj6UuO.js +1 -0
  27. package/packages/server/dist/{server-CICqmfQ_.js → server-CiPwrtSl.js} +171 -171
  28. package/packages/server/dist/{server-BZVPmRGV.js → server-e0mFUKvp.js} +172 -170
  29. package/packages/server/dist/{server-http-CPU9_eVT.js → server-http-B3dZd6bx.js} +1 -1
  30. package/packages/server/dist/{server-http-D3DK1H19.js → server-http-CzScS-EZ.js} +1 -1
  31. package/packages/server/dist/{server-stdio-BRKxFWyO.js → server-stdio-COkJ2pX9.js} +1 -1
  32. package/packages/server/dist/{server-stdio-l8I0RW4l.js → server-stdio-DmsOjBSR.js} +1 -1
  33. package/packages/server/viewers/architecture-static.html +794 -794
  34. package/packages/server/viewers/report-template.html +11 -11
  35. package/packages/server/viewers/tour-viewer.html +26 -26
  36. package/packages/settings-ui/dist/index.html +12 -12
  37. package/packages/tools/dist/index.d.ts +109 -14
  38. package/packages/tools/dist/index.js +118 -98
  39. package/scaffold/definitions/mcp-entry.json +1 -1
  40. package/scaffold/dist/adapters/_shared.mjs +7 -6
  41. package/scaffold/dist/adapters/claude-code.mjs +7 -7
  42. package/scaffold/dist/adapters/claude-desktop.mjs +7 -0
  43. package/scaffold/dist/adapters/copilot.mjs +1 -1
  44. package/scaffold/dist/adapters/gemini.mjs +6 -6
  45. package/scaffold/dist/adapters/hermes-agent.mjs +1 -1
  46. package/scaffold/dist/adapters/hermes.mjs +5 -5
  47. package/scaffold/dist/adapters/hooks.mjs +1 -1
  48. package/scaffold/dist/adapters/opencode.mjs +7 -7
  49. package/scaffold/dist/adapters/zed.mjs +1 -1
  50. package/scaffold/dist/definitions/exec-hooks.mjs +1 -1
  51. package/scaffold/dist/definitions/flows.mjs +40 -162
  52. package/scaffold/dist/definitions/mcp-entry.json +1 -1
  53. package/scaffold/dist/definitions/platform-capabilities.mjs +1 -0
  54. package/scaffold/dist/definitions/protocols.mjs +22 -19
  55. package/scaffold/dist/definitions/skills/adr-skill.mjs +1 -1
  56. package/scaffold/dist/definitions/skills/docs.mjs +51 -1
  57. package/scaffold/dist/definitions/skills/lesson-learned.mjs +21 -0
  58. package/scaffold/vitest.config.mjs +1 -0
  59. package/packages/cli/dist/init-Cvys5TD4.js +0 -7
  60. package/packages/server/dist/config-4M54ZAT8.js +0 -2
  61. package/packages/server/dist/config-BXd38nVn.js +0 -1
  62. package/packages/server/dist/prelude-CfXBHLpw.js +0 -1
  63. package/packages/server/dist/prelude-D33q42vQ.js +0 -2
  64. package/packages/server/dist/routes-9KnBpwfe.js +0 -6
  65. package/packages/server/dist/routes-B8hTXXR8.js +0 -5
  66. package/packages/server/dist/sampling-Cs9MoNYX.js +0 -2
  67. package/packages/server/dist/sampling-DFogBKrL.js +0 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "serverName": "aikit",
2
+ "serverName": "AI Kit",
3
3
  "command": "node",
4
4
  "args": [
5
5
  "-e",
@@ -5,10 +5,11 @@ import{renderLayeredKnowledgeOperatingPolicyV1 as e}from"../definitions/protocol
5
5
  `).trim();return l&&c.push(``,l),c.push(``,`---`,``),c.join(`
6
6
  `)}function a({title:e,content:t}){return`# ${e}\n\n${t}`}function o(e){return Object.entries(e).map(([e,t])=>[`### ${t.title||t.description||e}`,``,t.content.trim(),``,`---`,``].join(`
7
7
  `)).join(`
8
- `).trimEnd()}function s(e){return[[`Session Start`,e.sessionStart],[`Before Code Change`,e.beforeCodeChange],[`Before Commit`,e.beforeCommit],[`Session End`,e.sessionEnd]].map(([e,t])=>{let n=(t?.actions||[]).map(e=>`- \`${e}\``);return[`### ${e}`,``,...n,``].join(`
9
- `)}).join(`
10
- `).trimEnd()}function c(e,t){if(!e)return null;let n=typeof e==`function`?e(t):e[t];return n?typeof n==`string`?n:n.primary||n.model||null:null}function l(e,t){let n=!!t,r=[];for(let[i,a]of Object.entries(e))if(a.variants)for(let[e,o]of Object.entries(a.variants)){let s=`${i}-${e}`,l=[`| **${s}** | ${o.description} |`];n&&l.push(` ${c(t,s)||`—`} |`),l.push(` ${a.category||`—`} |`),r.push(l.join(``))}else{let e=[`| **${i}** | ${a.description} |`];n&&e.push(` ${c(t,i)||`—`} |`),e.push(` ${a.category||`—`} |`),r.push(e.join(``))}return n?`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${r.join(`
8
+ `).trimEnd()}const s={sessionStart:`SessionStart`,beforeCodeChange:`PreToolUse`,beforeCommit:`PreCommit`,sessionEnd:`SessionEnd`},c=[`sessionStart`,`beforeCodeChange`,`beforeCommit`,`sessionEnd`];function l(e){return e?.overall===`none`?[``,`> **Note**: This platform does not support native hook execution (no SessionStart, PreToolUse,`,`> PostToolUse, or PreCommit events). All hook behaviors documented below are **manual** -- you`,`> must perform them yourself. If you need server-side guardrails (privacy guards, scope`,`> enforcement, auto-knowledge signals), consider running the MCP server's **EventBus**, which`,`> provides in-process lifecycle subscribers without requiring IDE-level hook support.`,"> Check `aikit://hooks/config` for available EventBus subscribers.",``].join(`
9
+ `):``}function u(e,t,n,r,i){if(!e||i===`omit`)return``;i!==void 0&&i!==`pinned`&&i!=="default"&&console.warn(`buildHookSubsection: unrecognized treatment "${i}" for "${t}". Valid: ${p.join(`, `)}. Falling back to level-based rendering.`);let a=(e.actions||[]).map(e=>`- \`${e}\``),o=[`### ${t}`];return n===`native`?o.push(``,`_`+(r.native||`Auto-handled by native hooks.`)+`_ The following run automatically:`,``,...a,``):n===`eventbus`?o.push(``,`_`+(r.eventbus||`Monitored by EventBus.`)+`_ Active subscribers run automatically.`,`For awareness, these are the current subscribers:`,``,...a,``,"Check `aikit://hooks/config` for the full subscriber list.",``):n===`middleware`?o.push(``,`_`+(r.middleware||`Automated by middleware.`)+`_ The platform middleware handles this:`,``,...a,``):o.push(``,`${r.none||`Manually run the following:`}`,``,...a,``),o.join(`
10
+ `)}const d={sessionStart:{native:`Auto-handled by hooks. Status/knowledge/search run on every session start.`,eventbus:`Handled by EventBus. Session-start subscribers fire on connection.`,middleware:`Automated by ToolPipeline middleware. Status/knowledge/search run on session init.`,none:`On every session start, manually run the following to resume context:`},beforeCodeChange:{native:`Auto-handled by hooks. Search+scope checks run before every code change.`,eventbus:`Monitored by EventBus. Tool-before subscribers may provide context.`,none:`Before modifying any code, manually run these checks:`},beforeCommit:{native:`Hook auto-runs. Check+test+blast-radius run before every commit.`,eventbus:`No native pre-commit hooks on this platform. Validate manually:`,middleware:`No middleware-based pre-commit support. Validate manually:`,none:`Before committing changes, manually run these validations:`},sessionEnd:{native:`Auto-handled by hooks. Session-end hook persists checkpoints automatically.`,eventbus:`Tracked by EventBus. Stop subscribers fire on shutdown.`,middleware:`Automated by middleware. Handoff runs on session end.`,none:`Before ending a session (or at high context pressure), manually create a handoff:`}},f={sessionStart:`Session Start`,beforeCodeChange:`Before Code Change`,beforeCommit:`Before Commit`,sessionEnd:`Session End`},p=[`pinned`,`default`,`omit`];function m(e,t,n){if(!e)return``;let r=c.map(r=>{let i=e[r];if(!i)return``;let a=s[r],o=t&&a&&t[a]||`none`,c=d[r]||{},l=n?.[r];return u(i,f[r],o,c,l)}),i=l(t);return[...r,i].filter(Boolean).join(`
11
+ `).trimEnd()}function h(e,t){if(!e)return null;let n=typeof e==`function`?e(t):e[t];return n?typeof n==`string`?n:n.primary||n.model||null:null}function g(e,t){let n=!!t,r=[];for(let[i,a]of Object.entries(e))if(a.variants)for(let[e,o]of Object.entries(a.variants)){let s=`${i}-${e}`,c=[`| **${s}** | ${o.description} |`];n&&c.push(` ${h(t,s)||`—`} |`),c.push(` ${a.category||`—`} |`),r.push(c.join(``))}else{let e=[`| **${i}** | ${a.description} |`];n&&e.push(` ${h(t,i)||`—`} |`),e.push(` ${a.category||`—`} |`),r.push(e.join(``))}return n?`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${r.join(`
11
12
  `)}`:`| Agent | Purpose | Category |\n|-------|---------|----------|\n${r.join(`
12
- `)}`}function u(e){let t=[];for(let[n,r]of Object.entries(e)){if(n===`Orchestrator`)continue;let e=r.compactRole||r.description;if(r.variants){let i=Object.keys(r.variants);t.push(`| **${n}-${i.join(`/`)}** | ${e} |`)}else t.push(`| **${n}** | ${e} |`)}return`| Agent | Role |\n|-------|------|\n${t.join(`
13
- `)}`}function d({serverName:e,mcpEntry:t,configKey:n,extraServerFields:r}){let i={...t};return r&&Object.assign(i,r),JSON.stringify({[n]:{[e]:i}},null,2)}function f({flowTool:t=`flow`,isLifecycleOwner:n=!0}={}){let r=[`## Flows`,``,`This project uses aikit's pluggable flow system. Check flow status with the \`${t}\` MCP tool.`,``];return n?r.push(e({audience:`agent`}),``,`Use \`${t}({ action: 'list' })\` to see available flows and \`${t}({ action: 'start', name, topic })\` to begin one.`,``,`If a flow is active, follow the current step's skill instructions. Advance with \`${t}({ action: 'step', advance: 'next' })\`.`):r.push(`This project uses aikit's pluggable flow system. Use \`${t}({ action: 'status' })\` to check if a flow is active.`,`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`),r.join(`
14
- `)}function p({flowTool:e=`flow`}={}){return f({flowTool:e,isLifecycleOwner:!1})}export{r as buildAgentPrompt,l as buildAgentTable,u as buildCompactAgentTable,f as buildFlowSection,s as buildHooksSection,i as buildInlineAgentSection,d as buildMcpConfigJson,a as buildPromptFile,o as buildPromptSections,n as buildSkillsSection,p as buildSubagentFlowSection,t as lowerFirst};
13
+ `)}`}function _(e){let t=[];for(let[n,r]of Object.entries(e)){if(n===`Orchestrator`)continue;let e=r.compactRole||r.description;if(r.variants){let i=Object.keys(r.variants);t.push(`| **${n}-${i.join(`/`)}** | ${e} |`)}else t.push(`| **${n}** | ${e} |`)}return`| Agent | Role |\n|-------|------|\n${t.join(`
14
+ `)}`}function v({serverName:e,mcpEntry:t,configKey:n,extraServerFields:r}){let i={...t};return r&&Object.assign(i,r),JSON.stringify({[n]:{[e]:i}},null,2)}function y({flowTool:t=`flow`,isLifecycleOwner:n=!0}={}){let r=[`## Flows`,``,`This project uses aikit's pluggable flow system. Check flow status with the \`${t}\` MCP tool.`,``];return n?r.push(e({audience:`agent`}),``,`Use \`${t}({ action: 'list' })\` to see available flows and \`${t}({ action: 'start', name, topic })\` to begin one.`,``,`If a flow is active, follow the current step's skill instructions. Advance with \`${t}({ action: 'step', advance: 'next' })\`.`):r.push(`This project uses aikit's pluggable flow system. Use \`${t}({ action: 'status' })\` to check if a flow is active.`,`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`),r.join(`
15
+ `)}function b({flowTool:e=`flow`}={}){return y({flowTool:e,isLifecycleOwner:!1})}export{r as buildAgentPrompt,g as buildAgentTable,_ as buildCompactAgentTable,l as buildEventBusNote,y as buildFlowSection,m as buildHooksSection,i as buildInlineAgentSection,v as buildMcpConfigJson,a as buildPromptFile,o as buildPromptSections,n as buildSkillsSection,b as buildSubagentFlowSection,t as lowerFirst};
@@ -1,8 +1,8 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as a}from"../definitions/models.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as s,PLATFORM_OUTPUT_RULES_SECTION as c,PROTOCOLS as l}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as u,CLAUDE_CODE_TOOL_MAP as d,IDE_CAPABILITIES as f}from"../definitions/tools.mjs";import{buildAgentTable as p,buildCompactAgentTable as m,buildFlowSection as h,buildHooksSection as g,buildMcpConfigJson as _,buildSkillsSection as v,lowerFirst as y}from"./_shared.mjs";const b=h({flowTool:`flow`,isLifecycleOwner:!0}),x=h({flowTool:`flow`,isLifecycleOwner:!0}),S=h({flowTool:`flow`,isLifecycleOwner:!1});function C(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function w(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function T(e){let t=(f[e]||[]).flatMap(e=>d[e]||[]),n=u.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function E(e,t){let n=[];return n.push(`# aikit ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
2
- `)}function D(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function O(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&l[e.sharedBase]&&t.push(l[e.sharedBase]);for(let n of e.sharedProtocols||[])l[n]&&t.push(l[n]);return t}function k(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function A(e){return k().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
3
- `)}function j(t=p(e,a(`claude-code`))){return[`# aikit — Claude Code Agents`,``,c,``,s,``,`## MCP Server`,``,"Server name: `aikit`","Configured in `.mcp.json` (project) and `~/.claude.json` (user-global — `claude mcp add --scope user` format).","Default agent: `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator automatically.",``,`## Agents`,``,t,``,`## Agent Files`,``,A(`.claude/agents`),``,`## Commands`,``,"Slash commands live under `.claude/commands/`.",``,`## Session Protocol`,``,g(n),``].join(`
4
- `)}function M(){return[`# aikit — Claude Code Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Full sub-agent instructions live in `.claude/agents/`.","Slash commands live in `.claude/commands/`.","MCP server config lives in `.mcp.json` (project) and `~/.claude.json` (user-global — written by `claude mcp add --scope user`).","Default agent set to `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator, no `/agent` command needed.",``,"Start with `AGENTS.md`, then open the specific sub-agent file you want to use.",``,c,``,s,``].join(`
5
- `)}function N(e,t,n,r,i){let a=T(t.toolRole),o=O(t),s=v(t.skills),c=e===`Orchestrator`?[b,x]:[S],l=[n,...o,t.bodyAddendum,s,...c].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as a}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as o}from"../definitions/platform-capabilities.mjs";import{PROMPTS as s}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as c,PLATFORM_OUTPUT_RULES_SECTION as l,PROTOCOLS as u}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as d,CLAUDE_CODE_TOOL_MAP as f,IDE_CAPABILITIES as p}from"../definitions/tools.mjs";import{buildAgentTable as m,buildCompactAgentTable as h,buildFlowSection as g,buildHooksSection as _,buildMcpConfigJson as v,buildSkillsSection as y,lowerFirst as b}from"./_shared.mjs";const x=g({flowTool:`flow`,isLifecycleOwner:!0}),S=g({flowTool:`flow`,isLifecycleOwner:!0}),C=g({flowTool:`flow`,isLifecycleOwner:!1});function w(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function T(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function E(e){let t=(p[e]||[]).flatMap(e=>f[e]||[]),n=d.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function D(e,t){let n=[];return n.push(`# ${i} ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
2
+ `)}function O(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function k(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&u[e.sharedBase]&&t.push(u[e.sharedBase]);for(let n of e.sharedProtocols||[])u[n]&&t.push(u[n]);return t}function A(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function j(e){return A().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
3
+ `)}function M(t=m(e,a(`claude-code`))){return[`# ${i} — Claude Code Agents`,``,l,``,c,``,`## MCP Server`,``,`Server name: \`${i}\``,"Configured in `.mcp.json` (project) and `~/.claude.json` (user-global — `claude mcp add --scope user` format).","Default agent: `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator automatically.",``,`## Agents`,``,t,``,`## Agent Files`,``,j(`.claude/agents`),``,`## Commands`,``,"Slash commands live under `.claude/commands/`.",``,`## Session Protocol`,``,_(n,o[`claude-code`]),``].join(`
4
+ `)}function N(){return[`# ${i} — Claude Code Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Full sub-agent instructions live in `.claude/agents/`.","Slash commands live in `.claude/commands/`.","MCP server config lives in `.mcp.json` (project) and `~/.claude.json` (user-global — written by `claude mcp add --scope user`).","Default agent set to `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator, no `/agent` command needed.",``,"Start with `AGENTS.md`, then open the specific sub-agent file you want to use.",``,l,``,c,``].join(`
5
+ `)}function P(e,t,n,r,a){let o=E(t.toolRole),s=k(t),c=y(t.skills),l=e===`Orchestrator`?[x,S]:[C],u=[n,...s,t.bodyAddendum,c,...l].filter(Boolean).join(`
6
6
 
7
- `).trim(),u=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${y(t.description)}.`,d=i?.[e],f=a.length>0?`tools: [${a.join(`, `)}]`:null,p=t.skills?.length>0?`skills: [${t.skills.map(([e])=>e).join(`, `)}]`:null,m=[`---`,`name: ${C(e)}`,`description: ${w(t.description)}`,...d?[`model: ${w(d)}`]:[],...f?[f]:[],`mcpServers:`,` - aikit`,...p?[p]:[],`---`,``,`# ${e} - ${t.title||e}`,``,u];return l&&m.push(``,l),m.push(``),m.join(`
8
- `)}function P(){let t=[],n=a(`claude-code`),s=p(e,n),c=m(e);t.push({path:`.mcp.json`,content:`${_({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`}),t.push({path:`CLAUDE.md`,content:M()}),t.push({path:`AGENTS.md`,content:j(s)});for(let[e,n]of Object.entries(o))t.push({path:`.claude/commands/aikit-${e}.md`,content:E(e,n)});for(let[r,i]of Object.entries(e)){let e=D(r,c);if(i.variants){for(let[a,o]of Object.entries(i.variants)){let c=`${r}-${a}`;t.push({path:`.claude/agents/${c}.md`,content:N(c,{...i,description:o.description||i.description,identity:o.identity,bodyAddendum:o.bodyAddendum},e,s,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:N(r,i,e,s,n)})}return t}export{b as CLAUDE_FLOWS_SECTION,x as CLAUDE_ORCHESTRATOR_FLOW_ROUTING_SECTION,P as generateClaudeCode};
7
+ `).trim(),d=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${b(t.description)}.`,f=a?.[e],p=o.length>0?`tools: [${o.join(`, `)}]`:null,m=t.skills?.length>0?`skills: [${t.skills.map(([e])=>e).join(`, `)}]`:null,h=[`---`,`name: ${w(e)}`,`description: ${T(t.description)}`,...f?[`model: ${T(f)}`]:[],...p?[p]:[],`mcpServers:`,` - ${i}`,...m?[m]:[],`---`,``,`# ${e} - ${t.title||e}`,``,d];return u&&h.push(``,u),h.push(``),h.join(`
8
+ `)}function F(){let t=[],n=a(`claude-code`),o=m(e,n),c=h(e);t.push({path:`.mcp.json`,content:`${v({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`}),t.push({path:`CLAUDE.md`,content:N()}),t.push({path:`AGENTS.md`,content:M(o)});for(let[e,n]of Object.entries(s))t.push({path:`.claude/commands/aikit-${e}.md`,content:D(e,n)});for(let[r,i]of Object.entries(e)){let e=O(r,c);if(i.variants){for(let[a,s]of Object.entries(i.variants)){let c=`${r}-${a}`;t.push({path:`.claude/agents/${c}.md`,content:P(c,{...i,description:s.description||i.description,identity:s.identity,bodyAddendum:s.bodyAddendum},e,o,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:P(r,i,e,o,n)})}return t}export{x as CLAUDE_FLOWS_SECTION,S as CLAUDE_ORCHESTRATOR_FLOW_ROUTING_SECTION,F as generateClaudeCode};
@@ -0,0 +1,7 @@
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as a}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as o}from"../definitions/platform-capabilities.mjs";import{PROMPTS as s}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as c,PLATFORM_OUTPUT_RULES_SECTION as l,PROTOCOLS as u}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as d,CLAUDE_CODE_TOOL_MAP as f,IDE_CAPABILITIES as p}from"../definitions/tools.mjs";import{buildAgentTable as m,buildCompactAgentTable as h,buildFlowSection as g,buildHooksSection as _,buildSkillsSection as v,lowerFirst as y}from"./_shared.mjs";const b=g({flowTool:`flow`,isLifecycleOwner:!0}),x=g({flowTool:`flow`,isLifecycleOwner:!1});function S(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function C(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function w(e){let t=(p[e]||[]).flatMap(e=>f[e]||[]),n=d.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function T(e,t){let n=[];return n.push(`# ${i} ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
2
+ `)}function E(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function D(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&u[e.sharedBase]&&t.push(u[e.sharedBase]);for(let n of e.sharedProtocols||[])u[n]&&t.push(u[n]);return t}function O(){return[`# ${i} — Claude Desktop Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","MCP server config lives in `claude_desktop_config.json`.",``,l,``,c,``,_(n,o[`claude-desktop`]),``].join(`
3
+ `)}function k(e){return[`# ${i} — Claude Desktop Agents`,``,l,``,c,``,`## MCP Server`,``,`Server name: \`${i}\``,"Configured in `claude_desktop_config.json`.",``,`## Agents`,``,e,``,_(n,o[`claude-desktop`]),``].join(`
4
+ `)}function A(e,t,n,r,i){let a=w(t.toolRole),o=D(t),s=v(t.skills),c=e===`Orchestrator`?[b,x]:[x],l=[n,...o,t.bodyAddendum,s,...c].filter(Boolean).join(`
5
+
6
+ `).trim(),u=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${y(t.description)}.`,d=i?.[e],f=a.length>0?`tools: [${a.join(`, `)}]`:null;t.skills?.length>0&&`${t.skills.map(([e])=>e).join(`, `)}`;let p=[`---`,`name: ${S(e)}`,`description: ${C(t.description)}`,...d?[`model: ${C(d)}`]:[],...f?[f]:[],`---`,``,`# ${e} - ${t.title||e}`,``,u];return l&&p.push(``,l),p.push(``),p.join(`
7
+ `)}function j(){let t=[],n=a(`claude-desktop`),o=m(e,n),c=h(e);t.push({path:`claude_desktop_config.json`,content:`${JSON.stringify({mcpServers:{[i]:{command:r.command,args:r.args}}},null,2)}\n`}),t.push({path:`CLAUDE.md`,content:O()}),t.push({path:`AGENTS.md`,content:k(o)});for(let[e,n]of Object.entries(s))t.push({path:`.claude/commands/aikit-${e}.md`,content:T(e,n)});for(let[r,i]of Object.entries(e)){let e=E(r,c);if(i.variants){for(let[a,s]of Object.entries(i.variants)){let c=`${r}-${a}`;t.push({path:`.claude/agents/${c}.md`,content:A(c,{...i,description:s.description||i.description,identity:s.identity,bodyAddendum:s.bodyAddendum},e,o,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:A(r,i,e,o,n)})}return t}export{j as generateClaudeDesktop};
@@ -64,5 +64,5 @@ To regenerate after changing models or agent definitions:
64
64
  cd knowledge-base
65
65
  node scaffold/generate.mjs
66
66
  \`\`\`
67
- `}function E(){return[`# aikit — Copilot Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`These rules are enforced by AI Kit compliance checking. Violations are flagged in reports and reduce your compliance score.`,``,p(),``,a,``].join(`
67
+ `}function E(){return[`# AI Kit — Copilot Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`These rules are enforced by AI Kit compliance checking. Violations are flagged in reports and reduce your compliance score.`,``,p(),``,a,``].join(`
68
68
  `)}function D(){let t=[];if(h().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`copilot-instructions.md`,content:E()});for(let[r,i]of Object.entries(e))if(i.variants)for(let e of n[r]||[])t.push({path:`agents/${r}-${e}.agent.md`,content:S(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:C(r,i)});for(let[e,n]of Object.entries(c))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:T()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:w(e,n)});let r=m(`copilot`,`~/.copilot/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{D as generateCopilot};
@@ -1,7 +1,7 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{PROMPTS as a}from"../definitions/prompts.mjs";import{PROTOCOLS as o}from"../definitions/protocols.mjs";import{buildAgentTable as s,buildCompactAgentTable as c,buildFlowSection as l,buildHooksSection as u,buildMcpConfigJson as d,buildPromptSections as f,buildSkillsSection as p,lowerFirst as m}from"./_shared.mjs";const h=l({flowTool:`flow`,isLifecycleOwner:!0}),g=l({flowTool:`flow`,isLifecycleOwner:!1});function _(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function v(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&o[e.sharedBase]&&t.push(o[e.sharedBase]);for(let n of e.sharedProtocols||[])o[n]&&t.push(o[n]);return t}function y(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function b(e){return y().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
2
- `)}function x(e,t,n){let r=v(t),i=p(t.skills),a=e===`Orchestrator`?h:g,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s}from"../definitions/protocols.mjs";import{buildAgentTable as c,buildCompactAgentTable as l,buildFlowSection as u,buildHooksSection as d,buildMcpConfigJson as f,buildPromptSections as p,buildSkillsSection as m,lowerFirst as h}from"./_shared.mjs";const g=u({flowTool:`flow`,isLifecycleOwner:!0}),_=u({flowTool:`flow`,isLifecycleOwner:!1});function v(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function y(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&s[e.sharedBase]&&t.push(s[e.sharedBase]);for(let n of e.sharedProtocols||[])s[n]&&t.push(s[n]);return t}function b(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function x(e){return b().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
2
+ `)}function S(e,t,n){let r=y(t),i=m(t.skills),a=e===`Orchestrator`?g:_,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
3
3
 
4
- `).trim();return[`# ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${m(t.description)}.`,...o?[``,o]:[],``].join(`
5
- `)}function S(){return[`# aikit — Gemini CLI Agents`,``,"This workspace keeps the root `GEMINI.md` intentionally small. Full agent instructions are split into per-agent files under `.gemini/agents/`.",``,`## MCP Server`,``,"Server name: `aikit`","Configure in `.gemini/settings.json` (already done if scaffold was deployed).",``,`## Agents`,``,s(e),``,`## Agent Files`,``,b(`.gemini/agents`),``,`## Prompts`,``,f(a),``,`## Session Protocol`,``,u(n),``].join(`
6
- `)}function C(){return[`# aikit — Gemini CLI Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Per-agent instructions are emitted under `.gemini/agents/`.","MCP server config lives in `.gemini/settings.json`.",``,"Start with `AGENTS.md`, then open the specific agent file you want to use.",``].join(`
7
- `)}function w(){let t=[{path:`.gemini/settings.json`,content:`${d({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`},{path:`GEMINI.md`,content:C()},{path:`AGENTS.md`,content:S()}],n=c(e);for(let[r,i]of Object.entries(e)){let e=_(r,n);if(i.variants){for(let[n,a]of Object.entries(i.variants)){let o=`${r}-${n}`;t.push({path:`.gemini/agents/${o}.md`,content:x(o,{...i,description:a.description||i.description,identity:a.identity,bodyAddendum:a.bodyAddendum},e)})}continue}t.push({path:`.gemini/agents/${r}.md`,content:x(r,i,e)})}return t}export{w as generateGemini};
4
+ `).trim();return[`# ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${h(t.description)}.`,...o?[``,o]:[],``].join(`
5
+ `)}function C(){let t=c(e);return[`# ${i} — Gemini CLI Agents`,``,"This workspace keeps the root `GEMINI.md` intentionally small. Full agent instructions are split into per-agent files under `.gemini/agents/`.",``,`## MCP Server`,``,`Server name: \`${i}\``,"Configure in `.gemini/settings.json` (already done if scaffold was deployed).",``,`## Agents`,``,t,``,`## Agent Files`,``,x(`.gemini/agents`),``,`## Prompts`,``,p(o),``,`## Session Protocol`,``,d(n,a.gemini),``].join(`
6
+ `)}function w(){return[`# ${i} — Gemini CLI Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Per-agent instructions are emitted under `.gemini/agents/`.","MCP server config lives in `.gemini/settings.json`.",``,"Start with `AGENTS.md`, then open the specific agent file you want to use.",``].join(`
7
+ `)}function T(){let t=[{path:`.gemini/settings.json`,content:`${f({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`},{path:`GEMINI.md`,content:w()},{path:`AGENTS.md`,content:C()}],n=l(e);for(let[r,i]of Object.entries(e)){let e=v(r,n);if(i.variants){for(let[n,a]of Object.entries(i.variants)){let o=`${r}-${n}`;t.push({path:`.gemini/agents/${o}.md`,content:S(o,{...i,description:a.description||i.description,identity:a.identity,bodyAddendum:a.bodyAddendum},e)})}continue}t.push({path:`.gemini/agents/${r}.md`,content:S(r,i,e)})}return t}export{T as generateGemini};
@@ -50,5 +50,5 @@ Hermes provides native tools (\`terminal\`, \`read_file\`, \`write_file\`, \`pat
50
50
  plus AI Kit MCP tools (\`mcp_aikit_search\`, \`mcp_aikit_knowledge\`, etc.) for code analysis, memory, and context compression.
51
51
 
52
52
  See \`AGENTS.md\` (in Hermes config directory) for complete tool usage guidance.
53
- `}function E(){return[`# aikit — Hermes Agent Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`Hermes provides native tools (terminal, read_file, write_file, patch, search_files, delegate_task, etc.)`,`plus AI Kit MCP tools (mcp_aikit_*) for code analysis, memory, and context compression.`,``,`### When to Use AI Kit Tools`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search across all indexed content |","| `cat` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| Running tests in terminal | `mcp_aikit_test_run` | Structured output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,f(),``,a,``].join(`
53
+ `}function E(){return[`# AI Kit — Hermes Agent Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`Hermes provides native tools (terminal, read_file, write_file, patch, search_files, delegate_task, etc.)`,`plus AI Kit MCP tools (mcp_aikit_*) for code analysis, memory, and context compression.`,``,`### When to Use AI Kit Tools`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search across all indexed content |","| `cat` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| Running tests in terminal | `mcp_aikit_test_run` | Structured output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,f(),``,a,``].join(`
54
54
  `)}function D(){let t=[];if(m().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`hermes-instructions.md`,content:E()});for(let[r,i]of Object.entries(e))if(i.variants)for(let e of n[r]||[])t.push({path:`agents/${r}-${e}.agent.md`,content:S(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:C(r,i)});for(let[e,n]of Object.entries(c))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:T()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:w(e,n)});let r=p(`hermes`,`~/.hermes/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{D as generateHermesAgent};
@@ -1,6 +1,6 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{PROMPTS as r}from"../definitions/prompts.mjs";import{PROTOCOLS as i}from"../definitions/protocols.mjs";import{buildAgentTable as a,buildCompactAgentTable as o,buildFlowSection as s,buildHooksSection as c,buildPromptSections as l,buildSkillsSection as u,lowerFirst as d}from"./_shared.mjs";const f=s({flowTool:`flow`,isLifecycleOwner:!0}),p=s({flowTool:`flow`,isLifecycleOwner:!1});function m(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function h(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&i[e.sharedBase]&&t.push(i[e.sharedBase]);for(let n of e.sharedProtocols||[])i[n]&&t.push(i[n]);return t}function g(){let t=a(e),i=o(e),s=l(r),u=[];for(let[t,n]of Object.entries(e)){let e=m(t,i);if(n.variants){for(let[r,i]of Object.entries(n.variants)){let a=`${t}-${r}`;u.push(_(a,{...n,description:i.description||n.description,identity:i.identity,bodyAddendum:i.bodyAddendum},e))}continue}u.push(_(t,n,e))}return[`# AI Kit — Hermes Agent Instructions`,``,"This project uses **AI Kit** (`@vpxa/aikit`), a local-first MCP server that provides search,",`code analysis, persistent memory, context compression, and guided development flows.`,``,`The AI Kit MCP server is registered in your Hermes config and its 64 tools are available`,"as `mcp_aikit_*` tool calls in every conversation.",``,`## MCP Server`,``,"Server name: `aikit`","Configured via `hermes mcp add` (user-level). Tools are auto-discovered at session start.",``,`## Skills-First Rule`,``,`**Before starting ANY task, check available skills.** If a skill matches your task domain`,`— load it first. Skills contain domain-specific patterns, templates, and constraints.`,``,`## Available Tools (64)`,``,`AI Kit provides tools across the following categories:`,``,`| Category | Tools |`,`|----------|-------|`,"| **Search & Discovery** | `search`, `find`, `symbol`, `trace`, `lookup`, `scope_map`, `file_summary`, `dead_symbols` |","| **Code Analysis** | `analyze`, `blast_radius`, `audit`, `graph`, `health`, `check` |","| **Context Compression** | `file_summary`, `digest` |","| **Memory & Knowledge** | `knowledge`, `remember`, `read`, `update`, `forget`, `list`, `stash` |","| **FORGE Quality Gates** | `forge_classify`, `forge_ground`, `evidence_map`, `compliance_score` |","| **Development Workflows** | `flow`, `onboard`, `reindex`, `status`, `guide`, `config` |","| **Testing & Build** | `test_run`, `parse_output`, `check`, `eval` |","| **Code Manipulation** | `rename`, `codemod`, `data_transform`, `diff_parse`, `git_context`, `replay` |","| **Web & HTTP** | `web_search`, `web_fetch`, `http` |","| **Present & Visualize** | `present`, `signal`, `session_digest` |","| **Sandbox & Process** | `process`, `watch`, `workset`, `lane`, `queue`, `restore`, `delegate` |","| **Utilities** | `encode`, `regex_test`, `measure`, `changelog`, `schema_validate`, `env`, `time` |","| **Browser** | `browser` |",``,`## Important: Prefer AI Kit Tools Over Generic Shell Commands`,``,`When working in this project, use AI Kit MCP tools instead of generic alternatives:`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search (vector + keyword + BM25) across all indexed content |","| `read_file` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| `cd` + `ls` | `mcp_aikit_analyze` | Structural analysis with tree views |","| Running tests in terminal | `mcp_aikit_test_run` | Structured test output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,`## Agents`,``,t,``,`## Agent Instructions`,``,u.join(`
2
- `),``,`## Prompts`,``,s,``,f,``,`## Session Protocol`,``,c(n),``].join(`
3
- `)}function _(e,t,n){let r=h(t),i=u(t.skills),a=e===`Orchestrator`?f:p,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{PLATFORM_HOOK_CAPABILITIES as r}from"../definitions/platform-capabilities.mjs";import{PROMPTS as i}from"../definitions/prompts.mjs";import{PROTOCOLS as a}from"../definitions/protocols.mjs";import{buildAgentTable as o,buildCompactAgentTable as s,buildFlowSection as c,buildHooksSection as l,buildPromptSections as u,buildSkillsSection as d,lowerFirst as f}from"./_shared.mjs";const p=c({flowTool:`flow`,isLifecycleOwner:!0}),m=c({flowTool:`flow`,isLifecycleOwner:!1});function h(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function g(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&a[e.sharedBase]&&t.push(a[e.sharedBase]);for(let n of e.sharedProtocols||[])a[n]&&t.push(a[n]);return t}function _(){let t=o(e),a=s(e),c=u(i),d=[];for(let[t,n]of Object.entries(e)){let e=h(t,a);if(n.variants){for(let[r,i]of Object.entries(n.variants)){let a=`${t}-${r}`;d.push(v(a,{...n,description:i.description||n.description,identity:i.identity,bodyAddendum:i.bodyAddendum},e))}continue}d.push(v(t,n,e))}return[`# AI Kit — Hermes Agent Instructions`,``,"This project uses **AI Kit** (`@vpxa/aikit`), a local-first MCP server that provides search,",`code analysis, persistent memory, context compression, and guided development flows.`,``,`The AI Kit MCP server is registered in your Hermes config and its 64 tools are available`,"as `mcp_aikit_*` tool calls in every conversation.",``,`## MCP Server`,``,"Server name: `AI Kit`","Configured via `hermes mcp add` (user-level). Tools are auto-discovered at session start.",``,`## Skills-First Rule`,``,`**Before starting ANY task, check available skills.** If a skill matches your task domain`,`— load it first. Skills contain domain-specific patterns, templates, and constraints.`,``,`## Available Tools (64)`,``,`AI Kit provides tools across the following categories:`,``,`| Category | Tools |`,`|----------|-------|`,"| **Search & Discovery** | `search`, `find`, `symbol`, `trace`, `lookup`, `scope_map`, `file_summary`, `dead_symbols` |","| **Code Analysis** | `analyze`, `blast_radius`, `audit`, `graph`, `health`, `check` |","| **Context Compression** | `file_summary`, `digest` |","| **Memory & Knowledge** | `knowledge`, `remember`, `read`, `update`, `forget`, `list`, `stash` |","| **FORGE Quality Gates** | `forge_classify`, `forge_ground`, `evidence_map`, `compliance_score` |","| **Development Workflows** | `flow`, `onboard`, `reindex`, `status`, `guide`, `config` |","| **Testing & Build** | `test_run`, `parse_output`, `check`, `eval` |","| **Code Manipulation** | `rename`, `codemod`, `data_transform`, `diff_parse`, `git_context`, `replay` |","| **Web & HTTP** | `web_search`, `web_fetch`, `http` |","| **Present & Visualize** | `present`, `signal`, `session_digest` |","| **Sandbox & Process** | `process`, `watch`, `workset`, `lane`, `queue`, `restore`, `delegate` |","| **Utilities** | `encode`, `regex_test`, `measure`, `changelog`, `schema_validate`, `env`, `time` |","| **Browser** | `browser` |",``,`## Important: Prefer AI Kit Tools Over Generic Shell Commands`,``,`When working in this project, use AI Kit MCP tools instead of generic alternatives:`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search (vector + keyword + BM25) across all indexed content |","| `read_file` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| `cd` + `ls` | `mcp_aikit_analyze` | Structural analysis with tree views |","| Running tests in terminal | `mcp_aikit_test_run` | Structured test output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,`## Agents`,``,t,``,`## Agent Instructions`,``,d.join(`
2
+ `),``,`## Prompts`,``,c,``,p,``,`## Session Protocol`,``,l(n,r.hermes),``].join(`
3
+ `)}function v(e,t,n){let r=g(t),i=d(t.skills),a=e===`Orchestrator`?p:m,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
4
4
 
5
- `).trim();return[`## ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${d(t.description)}.`,...o?[``,o]:[],``].join(`
6
- `)}function v(){return[{path:`AGENTS.md`,content:g()}]}export{v as generateHermes};
5
+ `).trim();return[`## ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${f(t.description)}.`,...o?[``,o]:[],``].join(`
6
+ `)}function y(){return[{path:`AGENTS.md`,content:_()}]}export{y as generateHermes};
@@ -1 +1 @@
1
- import{EXEC_HOOKS as e,HOOK_EVENTS as t,HOOK_TOOL_MATCHERS as n,SUPPORTED_PLATFORMS as r}from"../definitions/exec-hooks.mjs";const i={PreCompact:3e3,PostToolUse:3e3},a={copilot:`hooks.json`,copilotCli:`hooks.json`,hermes:`hooks.json`},o=r;function s(e){if(!o.includes(e))throw Error(`Unknown platform: "${e}". Supported: ${o.join(`, `)}. Add it to SUPPORTED_PLATFORMS in exec-hooks.mjs first, then add entries to HOOK_EVENTS and HOOK_TOOL_MATCHERS. Add FILE_NAMES in generateHooks if file-producing.`);for(let[n,r]of Object.entries(t))if(!(e in r))throw Error(`Platform "${e}" is missing from HOOK_EVENTS.${n}. Add a "${e}" key to HOOK_EVENTS.${n} in exec-hooks.mjs.`);for(let[t,r]of Object.entries(n))if(!(e in r))throw Error(`Platform "${e}" is missing from HOOK_TOOL_MATCHERS.${t}. Add a "${e}" key to HOOK_TOOL_MATCHERS.${t} in exec-hooks.mjs.`)}function c(e,t){return(e.matcher||[]).flatMap(e=>{let r=n[e];if(!r)throw Error(`Unknown hook matcher: ${e}`);return r[t]||[]})}function l(e,t,n,r){let a=`${n}/${e.script}`;if(r===`claude`){let t=c(e,r);return{matcher:t.length>0?t.join(`|`):``,hooks:[{type:`command`,command:`node ${JSON.stringify(a)}`}]}}return r===`copilot`?{event:t,steps:[{type:`command`,command:`node`,args:[a],timeout:i[e.event]||5e3}]}:{command:`node`,args:[a]}}function u(n,r){s(n);let i={};for(let a of Object.values(e)){let e=t[a.event]?.[n];if(!e){console.warn(`[aikit] Unsupported hook event ${a.event} for ${n} — skipping`);continue}i[e]||=[],i[e].push(l(a,e,r,n))}return{hooks:i}}function d(n,r){if(s(n),n===`claude`)return[];if(n===`copilot`){let i=Object.values(e).flatMap(e=>{let i=t[e.event]?.[n];return i?l(e,i,r,n):(console.warn(`[aikit] Unsupported hook event ${e.event} for ${n} — skipping`),[])});return[{path:a[n],content:JSON.stringify({hooks:i},null,2)}]}if(!(n in a))throw Error(`Platform "${n}" is missing from FILE_NAMES. Add "${n}: '<filename>'" to FILE_NAMES in adapters/hooks.mjs.`);let i={};for(let a of Object.values(e)){let e=t[a.event]?.[n];if(!e){console.warn(`[aikit] Unsupported hook event ${a.event} for ${n} — skipping`);continue}i[e]||=[],i[e].push(l(a,e,r,n))}return[{path:a[n],content:JSON.stringify({hooks:i},null,2)}]}function f(){return[`_runtime.mjs`,...Object.values(e).map(e=>e.script)]}export{u as buildHooksBlock,d as generateHooks,f as getHookScriptFiles};
1
+ import{EXEC_HOOKS as e,HOOK_EVENTS as t,HOOK_TOOL_MATCHERS as n,SUPPORTED_PLATFORMS as r}from"../definitions/exec-hooks.mjs";const i={PreCompact:3e3,PostToolUse:3e3},a={copilot:`hooks.json`,copilotCli:`hooks.json`,hermes:`hooks.json`},o=r;function s(e){if(!o.includes(e))throw Error(`Unknown platform: "${e}". Supported: ${o.join(`, `)}. Add it to SUPPORTED_PLATFORMS in exec-hooks.mjs first, then add entries to HOOK_EVENTS and HOOK_TOOL_MATCHERS. Add FILE_NAMES in generateHooks if file-producing.`);for(let[n,r]of Object.entries(t))if(!(e in r))throw Error(`Platform "${e}" is missing from HOOK_EVENTS.${n}. Add a "${e}" key to HOOK_EVENTS.${n} in exec-hooks.mjs.`);for(let[t,r]of Object.entries(n))if(!(e in r))throw Error(`Platform "${e}" is missing from HOOK_TOOL_MATCHERS.${t}. Add a "${e}" key to HOOK_TOOL_MATCHERS.${t} in exec-hooks.mjs.`)}function c(e,t){return(e.matcher||[]).flatMap(e=>{let r=n[e];if(!r)throw Error(`Unknown hook matcher: ${e}`);return r[t]||[]})}function l(e,t,n,r){let a=`${n}/${e.script}`;if(r===`claude`){let t=c(e,r);return{matcher:t.length>0?t.join(`|`):``,hooks:[{type:`command`,command:`node ${JSON.stringify(a)}`}]}}return r===`copilot`?{event:t,steps:[{type:`command`,command:`node`,args:[a],timeout:i[e.event]||5e3}]}:{command:`node`,args:[a]}}function u(n,r){s(n);let i={};for(let a of Object.values(e)){let e=t[a.event]?.[n];if(!e){console.warn(`[aikit] Unsupported hook event ${a.event} for ${n} — skipping`);continue}i[e]||=[],i[e].push(l(a,e,r,n))}return{hooks:i}}function d(n,r){if(s(n),n===`claude`)return[];if(n===`copilot`){let i=Object.values(e).flatMap(e=>{let i=t[e.event]?.[n];return i?l(e,i,r,n):(console.warn(`[aikit] Unsupported hook event ${e.event} for ${n} — skipping`),[])});return[{path:a[n],content:JSON.stringify({hooks:i},null,2)}]}if(!(n in a))throw Error(`Platform "${n}" is missing from FILE_NAMES. Add "${n}: '<filename>'" to FILE_NAMES in adapters/hooks.mjs.`);let i={};for(let a of Object.values(e)){let e=t[a.event]?.[n];if(!e){console.warn(`[aikit] Unsupported hook event ${a.event} for ${n} — skipping`);continue}i[e]||=[],i[e].push(l(a,e,r,n))}return[{path:a[n],content:JSON.stringify({hooks:i},null,2)}]}function f(){return[`_runtime.mjs`,...Object.values(e).map(e=>e.script)]}function p(){let t={PostToolUse:`tool:after`,SessionStart:`session:start`,Stop:`server:stop`},n={fileRead:[`read_file`,`readFile`,`Read`,`grep_search`,`semantic_search`],fileWrite:[`write_file`,`patch`,`editFiles`,`Edit`,`Write`,`MultiEdit`],fileSearch:[`search_files`,`grep_search`,`semantic_search`,`find`,`Bash`,`mcp_aikit_search`,`mcp_aikit_find`]};return Object.values(e).map(e=>{let r=t[e.event]||e.event.toLowerCase().replace(/([a-z])([A-Z])/g,`$1:$2`).replace(/^./,e=>e.toLowerCase()),i=(e.matcher||[]).flatMap(e=>n[e]||[]);return{id:`scaffold-${e.id}`,eventType:r,policy:`async`,name:e.id,toolFilter:i.length>0?i:void 0,description:e.description,llmBenefit:e.llmBenefit,category:e.category,failurePolicy:e.failurePolicy,executionModel:e.executionModel}})}export{u as buildHooksBlock,p as buildServerHookConfig,d as generateHooks,f as getHookScriptFiles};
@@ -1,8 +1,8 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{PROMPTS as a}from"../definitions/prompts.mjs";import{PROTOCOLS as o}from"../definitions/protocols.mjs";import{buildAgentTable as s,buildCompactAgentTable as c,buildFlowSection as l,buildHooksSection as u,buildPromptSections as d,buildSkillsSection as f,lowerFirst as p}from"./_shared.mjs";const m=l({flowTool:`flow`,isLifecycleOwner:!0}),h=l({flowTool:`flow`,isLifecycleOwner:!1});function g(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function _(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&o[e.sharedBase]&&t.push(o[e.sharedBase]);for(let n of e.sharedProtocols||[])o[n]&&t.push(o[n]);return t}function v(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function y(e){return v().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
2
- `)}const b={orchestrator:{edit:`allow`,bash:`allow`},planner:{edit:`allow`,bash:`allow`},codeAgent:{edit:`allow`,bash:`allow`},refactor:{edit:`allow`,bash:`allow`},debugger:{edit:`allow`,bash:`allow`},security:{edit:`allow`,bash:`allow`},documenter:{edit:`allow`,bash:`deny`},explorer:{edit:`deny`,bash:`deny`},researcher:{edit:`deny`,bash:`deny`},reviewer:{edit:`deny`,bash:`deny`}};function x(e){let t=e.category===`orchestration`&&e.title===`The Master Conductor`?`primary`:`subagent`,n=b[e.toolRole]||{edit:`deny`,bash:`deny`},r=[`---`,`description: ${e.description}`,`mode: ${t}`,`permission:`];for(let[e,t]of Object.entries(n))r.push(` ${e}: ${t}`);return r.push(`---`),r.join(`
3
- `)}function S(e,t,n){let r=_(t),i=f(t.skills),a=e===`Orchestrator`?m:h,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s}from"../definitions/protocols.mjs";import{buildAgentTable as c,buildCompactAgentTable as l,buildFlowSection as u,buildHooksSection as d,buildPromptSections as f,buildSkillsSection as p,lowerFirst as m}from"./_shared.mjs";const h=u({flowTool:`flow`,isLifecycleOwner:!0}),g=u({flowTool:`flow`,isLifecycleOwner:!1});function _(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function v(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&s[e.sharedBase]&&t.push(s[e.sharedBase]);for(let n of e.sharedProtocols||[])s[n]&&t.push(s[n]);return t}function y(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function b(e){return y().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
2
+ `)}const x={orchestrator:{edit:`allow`,bash:`allow`},planner:{edit:`allow`,bash:`allow`},codeAgent:{edit:`allow`,bash:`allow`},refactor:{edit:`allow`,bash:`allow`},debugger:{edit:`allow`,bash:`allow`},security:{edit:`allow`,bash:`allow`},documenter:{edit:`allow`,bash:`deny`},explorer:{edit:`deny`,bash:`deny`},researcher:{edit:`deny`,bash:`deny`},reviewer:{edit:`deny`,bash:`deny`}};function S(e){let t=e.category===`orchestration`&&e.title===`The Master Conductor`?`primary`:`subagent`,n=x[e.toolRole]||{edit:`deny`,bash:`deny`},r=[`---`,`description: ${e.description}`,`mode: ${t}`,`permission:`];for(let[e,t]of Object.entries(n))r.push(` ${e}: ${t}`);return r.push(`---`),r.join(`
3
+ `)}function C(e,t,n){let r=v(t),i=p(t.skills),a=e===`Orchestrator`?h:g,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
4
4
 
5
- `).trim(),s=[`# ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${p(t.description)}.`,...o?[``,o]:[],``].join(`
6
- `);return`${x(t)}\n\n${s}`}function C(){return[`# aikit — OpenCode Agents`,``,"This workspace keeps the root `OPENCODE.md` intentionally small. Full agent instructions are split into per-agent files under `.opencode/agents/`.",``,`## MCP Server`,``,"Server name: `aikit`","Configure in `.opencode/opencode.json` (already done if scaffold was deployed).",``,`## Agents`,``,s(e),``,`## Agent Files`,``,y(`.opencode/agents`),``,`## Prompts`,``,d(a),``,`## Session Protocol`,``,u(n),``].join(`
7
- `)}function w(){return[`# aikit — OpenCode Instructions`,``,"Detailed workspace instructions live in `OPENCODE.md`.","Per-agent instructions are emitted under `.opencode/agents/`.","MCP server config lives in `.opencode/opencode.json`.",``,"Start with `OPENCODE.md`, then open the specific agent file you want to use.",``].join(`
8
- `)}function T(e,t){let{type:n,...r}=t;return JSON.stringify({mcp:{[e]:{type:`local`,command:[r.command,...r.args]}}},null,2)}function E(){let t=[{path:`.opencode/opencode.json`,content:`${T(i,r)}\n`},{path:`OPENCODE.md`,content:w()},{path:`AGENTS.md`,content:C()}],n=c(e);for(let[r,i]of Object.entries(e)){let e=g(r,n);if(i.variants){for(let[n,a]of Object.entries(i.variants)){let o=`${r}-${n}`;t.push({path:`.opencode/agents/${o}.md`,content:S(o,{...i,description:a.description||i.description,identity:a.identity,bodyAddendum:a.bodyAddendum},e)})}continue}t.push({path:`.opencode/agents/${r}.md`,content:S(r,i,e)})}return t}export{E as generateOpencode};
5
+ `).trim(),s=[`# ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${m(t.description)}.`,...o?[``,o]:[],``].join(`
6
+ `);return`${S(t)}\n\n${s}`}function w(){let t=c(e);return[`# ${i} — OpenCode Agents`,``,"This workspace keeps the root `OPENCODE.md` intentionally small. Full agent instructions are split into per-agent files under `.opencode/agents/`.",``,`## MCP Server`,``,`Server name: \`${i}\``,"Configure in `.opencode/opencode.json` (already done if scaffold was deployed).",``,`## Agents`,``,t,``,`## Agent Files`,``,b(`.opencode/agents`),``,`## Prompts`,``,f(o),``,`## Session Protocol`,``,d(n,a.opencode),``].join(`
7
+ `)}function T(){return[`# ${i} — OpenCode Instructions`,``,"Detailed workspace instructions live in `OPENCODE.md`.","Per-agent instructions are emitted under `.opencode/agents/`.","MCP server config lives in `.opencode/opencode.json`.",``,"Start with `OPENCODE.md`, then open the specific agent file you want to use.",``].join(`
8
+ `)}function E(e,t){let{type:n,...r}=t;return JSON.stringify({mcp:{[e]:{type:`local`,command:[r.command,...r.args]}}},null,2)}function D(){let t=[{path:`.opencode/opencode.json`,content:`${E(i,r)}\n`},{path:`OPENCODE.md`,content:T()},{path:`AGENTS.md`,content:w()}],n=l(e);for(let[r,i]of Object.entries(e)){let e=_(r,n);if(i.variants){for(let[n,a]of Object.entries(i.variants)){let o=`${r}-${n}`;t.push({path:`.opencode/agents/${o}.md`,content:C(o,{...i,description:a.description||i.description,identity:a.identity,bodyAddendum:a.bodyAddendum},e)})}continue}t.push({path:`.opencode/agents/${r}.md`,content:C(r,i,e)})}return t}export{D as generateOpencode};
@@ -1,4 +1,4 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{MCP_SERVER_ENTRY as n,SERVER_NAME as r}from"../definitions/mcp.mjs";import{PROMPTS as i}from"../definitions/prompts.mjs";import{PROTOCOLS as a}from"../definitions/protocols.mjs";import{buildAgentPrompt as o,buildCompactAgentTable as s,buildMcpConfigJson as c,buildPromptFile as l}from"./_shared.mjs";function u(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function d(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&a[e.sharedBase]&&t.push(a[e.sharedBase]);for(let n of e.sharedProtocols||[])a[n]&&t.push(a[n]);return t}function f(){let t=[];t.push({path:`.zed/settings.json`,content:`${c({serverName:r,mcpEntry:n,configKey:`context_servers`})}\n`});for(let[e,n]of Object.entries(i))t.push({path:`.zed/prompts/aikit-${e}.md`,content:l({title:`aikit ${e}`,content:[`> ${n.description}`,``,n.content.trim(),``].join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{MCP_SERVER_ENTRY as n,SERVER_NAME as r}from"../definitions/mcp.mjs";import{PROMPTS as i}from"../definitions/prompts.mjs";import{PROTOCOLS as a}from"../definitions/protocols.mjs";import{buildAgentPrompt as o,buildCompactAgentTable as s,buildMcpConfigJson as c,buildPromptFile as l}from"./_shared.mjs";function u(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function d(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&a[e.sharedBase]&&t.push(a[e.sharedBase]);for(let n of e.sharedProtocols||[])a[n]&&t.push(a[n]);return t}function f(){let t=[];t.push({path:`.zed/settings.json`,content:`${c({serverName:r,mcpEntry:n,configKey:`context_servers`})}\n`});for(let[e,n]of Object.entries(i))t.push({path:`.zed/prompts/aikit-${e}.md`,content:l({title:`${r} ${e}`,content:[`> ${n.description}`,``,n.content.trim(),``].join(`
2
2
  `)})});let a=s(e);for(let[n,r]of Object.entries(e)){let e=r.title||n,i=u(n,a),s=d(r);if(r.variants){for(let[a,c]of Object.entries(r.variants)){let l=`${n}-${a}`,u=c.description||r.description,d=[i,...s,c.bodyAddendum].filter(Boolean).join(`
3
3
 
4
4
  `);t.push({path:`.zed/prompts/agent-${l}.md`,content:o({name:l,title:e,description:u,skills:r.skills,bodyAddendum:d})})}continue}let c=[i,...s,r.bodyAddendum].filter(Boolean).join(`
@@ -1 +1 @@
1
- const e=[`copilot`,`claude`,`copilotCli`,`hermes`],t={SessionStart:{copilot:`SessionStart`,claude:`SessionStart`,copilotCli:`sessionStart`,hermes:`SessionStart`},PreToolUse:{copilot:`PreToolUse`,claude:`PreToolUse`,copilotCli:`preToolUse`,hermes:`PreToolUse`},PostToolUse:{copilot:`PostToolUse`,claude:`PostToolUse`,copilotCli:`postToolUse`,hermes:`PostToolUse`},SubagentStart:{copilot:`SubagentStart`,claude:`SubagentStart`,copilotCli:`subagentStart`,hermes:`SubagentStart`},PreCompact:{copilot:`PreCompact`,claude:`PreCompact`,copilotCli:`preCompact`,hermes:`PreCompact`},Stop:{copilot:`Stop`,claude:`Stop`,copilotCli:`stop`,hermes:`Stop`}},n={fileRead:{copilot:[`read_file`,`readFile`],claude:[`Read`],copilotCli:[`read_file`],hermes:[`read_file`]},fileWrite:{copilot:[`editFiles`,`replace_string_in_file`,`create_file`],claude:[`Edit`,`Write`,`MultiEdit`],copilotCli:[`editFiles`,`replace_string_in_file`],hermes:[`write_file`,`patch`]},fileSearch:{copilot:[`grep_search`,`semantic_search`,`find`],claude:[`Bash`],copilotCli:[`grep_search`],hermes:[`search_files`]}},r={"privacy-guard":{id:`privacy-guard`,event:`PreToolUse`,category:`guard`,description:`Deny reads of secret-bearing files: .env, .pem, .key, .ssh/*, credentials, tokens, .netrc.`,script:`privacy-guard.mjs`,matcher:[`fileRead`],outputBudgetLines:0,scope:`user`},"scout-guard":{id:`scout-guard`,event:`PreToolUse`,category:`guard`,description:`Deny reads inside generated/dependency directories: node_modules/, dist/, .git/objects/, vendor/, build/.`,script:`scout-guard.mjs`,matcher:[`fileRead`,`fileSearch`],outputBudgetLines:0,scope:`user`},"freshness-signal":{id:`freshness-signal`,event:`SessionStart`,category:`signal`,description:`Check workspace state freshness at session start: onboard staleness, active flow, scaffold drift.`,script:`freshness-signal.mjs`,outputBudgetLines:5,scope:`user`},"scope-guard":{id:`scope-guard`,event:`PostToolUse`,category:`signal`,description:`After file writes, detect edit drift: files changed outside flow scope, too many files, scaffold source/dist mismatch.`,script:`scope-guard.mjs`,matcher:[`fileWrite`],outputBudgetLines:5,scope:`user`}};function i(r){let i=[{name:`HOOK_EVENTS`,entries:Object.values(t)},{name:`HOOK_TOOL_MATCHERS`,entries:Object.values(n)}];for(let t of e){for(let e of i)for(let n of e.entries)if(!(t in n))throw Error(`Registration drift: platform "${t}" is missing from ${e.name} (entry has keys: ${Object.keys(n).join(`, `)}). Add a "${t}" key to all entries in ${e.name} in exec-hooks.mjs.`);if(r){for(let[e,n]of Object.entries(r))if(!(t in n))throw Error(`Registration drift: platform "${t}" is missing from ${e} (has keys: ${Object.keys(n).join(`, `)}). Add "${t}: '...'" to ${e}.`)}}}export{r as EXEC_HOOKS,t as HOOK_EVENTS,n as HOOK_TOOL_MATCHERS,e as SUPPORTED_PLATFORMS,i as validateAllPlatformRegistries};
1
+ const e=[`copilot`,`claude`,`copilotCli`,`hermes`],t={SessionStart:{copilot:`SessionStart`,claude:`SessionStart`,copilotCli:`sessionStart`,hermes:`SessionStart`},PreToolUse:{copilot:`PreToolUse`,claude:`PreToolUse`,copilotCli:`preToolUse`,hermes:`PreToolUse`},PostToolUse:{copilot:`PostToolUse`,claude:`PostToolUse`,copilotCli:`postToolUse`,hermes:`PostToolUse`},SubagentStart:{copilot:`SubagentStart`,claude:`SubagentStart`,copilotCli:`subagentStart`,hermes:`SubagentStart`},PreCompact:{copilot:`PreCompact`,claude:`PreCompact`,copilotCli:`preCompact`,hermes:`PreCompact`},Stop:{copilot:`Stop`,claude:`Stop`,copilotCli:`stop`,hermes:`Stop`}},n={fileRead:{copilot:[`read_file`,`readFile`],claude:[`Read`],copilotCli:[`read_file`],hermes:[`read_file`]},fileWrite:{copilot:[`editFiles`,`replace_string_in_file`,`create_file`],claude:[`Edit`,`Write`,`MultiEdit`],copilotCli:[`editFiles`,`replace_string_in_file`],hermes:[`write_file`,`patch`]},fileSearch:{copilot:[`grep_search`,`semantic_search`,`find`],claude:[`Bash`],copilotCli:[`grep_search`],hermes:[`search_files`]}},r={"privacy-guard":{id:`privacy-guard`,event:`PreToolUse`,category:`guard`,description:`Deny reads of secret-bearing files: .env, .pem, .key, .ssh/*, credentials, tokens, .netrc.`,llmBenefit:`Prevents accidental leakage of API keys, tokens, and credentials into conversation context.`,script:`privacy-guard.mjs`,matcher:[`fileRead`],outputBudgetLines:0,executionModel:`child-process`,scope:`user`,failurePolicy:`deny-closed`,supportedPlatforms:[`copilot`,`claude`,`copilotCli`,`hermes`],unsupportedBehavior:`Reject via agent instruction — no native hook runtime available`,evidenceRequirements:`Hook script tested against known secret patterns`,rollbackBehavior:`Remove from settings.json hooks block and delete script file`},"scout-guard":{id:`scout-guard`,event:`PreToolUse`,category:`guard`,description:`Deny reads inside generated/dependency directories: node_modules/, dist/, .git/objects/, vendor/, build/.`,llmBenefit:`Keeps context clean by preventing reads of irrelevant generated or vendored files.`,script:`scout-guard.mjs`,matcher:[`fileRead`,`fileSearch`],outputBudgetLines:0,executionModel:`child-process`,scope:`user`,failurePolicy:`deny-closed`,supportedPlatforms:[`copilot`,`claude`,`copilotCli`,`hermes`],unsupportedBehavior:`Reject via agent instruction — no native hook runtime available`,evidenceRequirements:`Hook script tested against known generated directory patterns`,rollbackBehavior:`Remove from settings.json hooks block and delete script file`},"freshness-signal":{id:`freshness-signal`,event:`SessionStart`,category:`signal`,description:`Check workspace state freshness at session start: onboard staleness, active flow, scaffold drift.`,llmBenefit:`Avoids working with stale onboard data or drifting scaffold state.`,script:`freshness-signal.mjs`,outputBudgetLines:5,executionModel:`child-process`,scope:`user`,silentWhenHealthy:!0,failurePolicy:`allow-open`,matcher:[],supportedPlatforms:[`copilot`,`claude`,`copilotCli`,`hermes`],unsupportedBehavior:`Skip — no native hook runtime on this platform`,evidenceRequirements:`None (signal-only, no enforcement)`,rollbackBehavior:`Remove from settings.json hooks block`},"scope-guard":{id:`scope-guard`,event:`PostToolUse`,category:`signal`,description:`After file writes, detect edit drift: files changed outside flow scope, too many files, scaffold source/dist mismatch.`,llmBenefit:`Prevents accidental scope creep, over-editing, and scaffold drift during a session.`,script:`scope-guard.mjs`,matcher:[`fileWrite`],outputBudgetLines:5,executionModel:`child-process`,scope:`user`,silentWhenHealthy:!0,failurePolicy:`allow-open`,supportedPlatforms:[`copilot`,`claude`,`copilotCli`,`hermes`],unsupportedBehavior:`Skip — no native hook runtime on this platform`,evidenceRequirements:`None (signal-only, no enforcement)`,rollbackBehavior:`Remove from settings.json hooks block`}},i=[`id`,`event`,`category`,`script`,`description`],a=[`matcher`,`llmBenefit`,`executionModel`,`scope`,`failurePolicy`,`outputBudgetLines`,`supportedPlatforms`,`unsupportedBehavior`],o=[`evidenceRequirements`,`rollbackBehavior`],s=[`silentWhenHealthy`];function c(){let e=new Set(Object.keys(t)),n=[`child-process`,`eventbus-subscriber`],c=[`deny-closed`,`allow-open`];for(let[t,l]of Object.entries(r)){for(let e of i){if(!(e in l)||l[e]===void 0||l[e]===null)throw Error(`EXEC_HOOKS["${t}"] is missing or null Tier 1 field "${e}". Add it to the "${t}" entry in exec-hooks.mjs.`);if(typeof l[e]==`string`&&l[e].trim()===``)throw Error(`EXEC_HOOKS["${t}"] has empty string for Tier 1 field "${e}". Provide a non-empty value.`)}for(let e of a)(!(e in l)||l[e]===void 0||l[e]===null)&&console.warn(`EXEC_HOOKS["${t}"] is missing Tier 2 field "${e}". Add it when the field values are actionable.`);if(l.category===`guard`)for(let e of o)(!(e in l)||l[e]===void 0||l[e]===null)&&console.warn(`EXEC_HOOKS["${t}"] (guard) is missing guard field "${e}". Add it when guard lifecycle tooling exists.`);if(l.category===`signal`)for(let e of s)(!(e in l)||l[e]===void 0||l[e]===null)&&console.warn(`EXEC_HOOKS["${t}"] (signal) is missing signal field "${e}". Add it when signal lifecycle tooling exists.`);if(l.id!==t)throw Error(`EXEC_HOOKS["${t}"] has id="${l.id}" which doesn't match its object key. Set id to "${t}".`);if(!e.has(l.event))throw Error(`EXEC_HOOKS["${t}"] has unrecognized event "${l.event}". Valid: ${[...e].join(`, `)}.`);if(![`guard`,`signal`].includes(l.category))throw Error(`EXEC_HOOKS["${t}"] has invalid category "${l.category}". Must be "guard" or "signal".`);[`user`,`workspace`].includes(l.scope)||console.warn(`EXEC_HOOKS["${t}"] has invalid scope "${l.scope}". Must be "user" or "workspace".`),l.executionModel&&!n.includes(l.executionModel)&&console.warn(`EXEC_HOOKS["${t}"] has unrecognized executionModel "${l.executionModel}". Valid: ${n.join(`, `)}.`),l.failurePolicy&&!c.includes(l.failurePolicy)&&console.warn(`EXEC_HOOKS["${t}"] has unrecognized failurePolicy "${l.failurePolicy}". Valid: ${c.join(`, `)}.`)}}function l(r){let i=[{name:`HOOK_EVENTS`,entries:Object.values(t)},{name:`HOOK_TOOL_MATCHERS`,entries:Object.values(n)}];for(let t of e){for(let e of i)for(let n of e.entries)if(!(t in n))throw Error(`Registration drift: platform "${t}" is missing from ${e.name} (entry has keys: ${Object.keys(n).join(`, `)}). Add a "${t}" key to all entries in ${e.name} in exec-hooks.mjs.`);if(r){for(let[e,n]of Object.entries(r))if(!(t in n))throw Error(`Registration drift: platform "${t}" is missing from ${e} (has keys: ${Object.keys(n).join(`, `)}). Add "${t}: '...'" to ${e}.`)}}}function u(e){let t=[];if(!e||typeof e!=`object`)return t.push(`Generated hook must be a non-null object`),t;for(let n of[`id`,`event`,`category`,`description`])(!e[n]||typeof e[n]!=`string`)&&t.push(`Generated hook missing or invalid "${n}" (must be a non-empty string)`);e.category&&![`guard`,`signal`].includes(e.category)&&t.push(`Generated hook has invalid category "${e.category}". Must be "guard" or "signal".`);let n=[`candidate`,`evaluated`,`promoted`,`rejected`,`disabled`];return e.promotionState&&!n.includes(e.promotionState)&&t.push(`Generated hook has invalid promotionState "${e.promotionState}". Valid: ${n.join(`, `)}.`),e.confidence!==void 0&&(typeof e.confidence!=`number`||e.confidence<0||e.confidence>1)&&t.push(`Generated hook confidence must be a number between 0 and 1, got "${e.confidence}"`),e.originToolNames!==void 0&&!Array.isArray(e.originToolNames)&&t.push(`Generated hook originToolNames must be an array of strings`),e.promotionState===`promoted`&&!e.createdAt&&t.push(`Generated hook promoted but missing createdAt timestamp`),t}export{r as EXEC_HOOKS,t as HOOK_EVENTS,n as HOOK_TOOL_MATCHERS,e as SUPPORTED_PLATFORMS,l as validateAllPlatformRegistries,u as validateGeneratedHookDef,c as validateHookDefinitions};
@@ -1,142 +1,38 @@
1
1
  const e=e=>!e||e.length===0?``:`**Skills for this step:** ${e.map(e=>`\`${e}\``).join(`, `)}.
2
- Load them when their preconditions are met.`,t={design:{contextProfile:`researcher`,l0CardTypes:[`workspace-core`,`architecture`],l1Fields:[`objective`,`acceptanceCriteria`,`scope`,`exclusions`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`decisions`,`retrievedRefs`,`summary`],candidateLearnings:[`Architectural decisions with evidence`,`Scope boundary lessons`],handoffArtifact:`design-decisions.md`,handoffFields:[`decisions`,`scope`,`exclusions`,`retrievedRefs`]},spec:{contextProfile:`researcher`,l0CardTypes:[`workspace-core`],l1Fields:[`objective`,`acceptanceCriteria`,`decisions`,`scope`],l2Refs:`required`,l3Evidence:`none`,updates:[`acceptanceCriteria`,`decisions`,`unresolvedClaims`],candidateLearnings:[`Requirement ambiguity lessons when evidenced`,`Contract boundary clarity`],handoffArtifact:`spec.md`,handoffFields:[`acceptanceCriteria`,`scope`,`decisions`]},plan:{contextProfile:`implementer`,l0CardTypes:[`workspace-core`,`architecture`],l1Fields:[`acceptanceCriteria`,`scope`,`decisions`,`retrievedRefs`],l2Refs:`required`,l3Evidence:`none`,updates:[`decisions`,`artifacts`,`stepSummaries`],candidateLearnings:[`Planning pattern when reusable and evidenced`],handoffArtifact:`plan.md`,handoffFields:[`artifacts`,`decisions`]},task:{contextProfile:`implementer`,l0CardTypes:[`workspace-core`],l1Fields:[`acceptanceCriteria`,`scope`,`decisions`,`retrievedRefs`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`artifacts`,`stepSummaries`],candidateLearnings:[],handoffArtifact:`tasks.md`,handoffFields:[`artifacts`,`stepSummaries`]},execute:{contextProfile:`implementer`,l0CardTypes:[],l1Fields:[`artifacts`,`scope`,`retrievedRefs`],l2Refs:`on-demand`,l3Evidence:`on-demand`,updates:[`artifacts`,`summaries`,`failures`,`successPatterns`,`verifiedClaims`,`assumedClaims`],candidateLearnings:[`Candidate only — no promotion`],handoffArtifact:`progress.md`,handoffFields:[`artifacts`,`summaries`,`failures`,`successPatterns`]},verify:{contextProfile:`reviewer`,l0CardTypes:[],l1Fields:[`acceptanceCriteria`,`artifacts`,`verifiedClaims`,`assumedClaims`,`unresolvedClaims`],l2Refs:`on-demand`,l3Evidence:`required`,updates:[`verifiedClaims`,`unresolvedClaims`,`verifiedFinalOutcome`],candidateLearnings:[`Confirm or reject candidates — no direct promotion`],handoffArtifact:`verify-report.md`,handoffFields:[`verifiedClaims`,`verifiedFinalOutcome`]},"basic-design":{contextProfile:`researcher`,l0CardTypes:[`workspace-core`],l1Fields:[`objective`,`acceptanceCriteria`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`decisions`,`summary`],candidateLearnings:[],handoffArtifact:`design-decisions.md`,handoffFields:[`decisions`]},assess:{contextProfile:`implementer`,l0CardTypes:[`workspace-core`],l1Fields:[`objective`,`scope`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`summary`,`retrievedRefs`],candidateLearnings:[],handoffArtifact:`assessment.md`,handoffFields:[`scope`,`retrievedRefs`]},"basic-implement":{contextProfile:`implementer`,l0CardTypes:[],l1Fields:[`scope`,`retrievedRefs`],l2Refs:`on-demand`,l3Evidence:`on-demand`,updates:[`artifacts`,`summaries`,`verifiedClaims`],candidateLearnings:[`Candidate only — no promotion`],handoffArtifact:`progress.md`,handoffFields:[`artifacts`,`summaries`]},"basic-verify":{contextProfile:`reviewer`,l0CardTypes:[],l1Fields:[`acceptanceCriteria`,`artifacts`,`verifiedClaims`],l2Refs:`none`,l3Evidence:`required`,updates:[`verifiedClaims`,`verifiedFinalOutcome`],candidateLearnings:[],handoffArtifact:`verify-report.md`,handoffFields:[`verifiedFinalOutcome`]},"docs-sync":{contextProfile:`documenter`,l0CardTypes:[],l1Fields:[`artifacts`,`stepSummaries`,`candidateLearnings`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[],candidateLearnings:[`L2 candidate mapping from durable doc changes`],handoffArtifact:``,handoffFields:[]},"lesson-learned":{contextProfile:`documenter`,l0CardTypes:[],l1Fields:[`failures`,`successPatterns`,`candidateLearnings`,`verifiedFinalOutcome`],l2Refs:`none`,l3Evidence:`on-demand`,updates:[],candidateLearnings:[`Evidence-backed candidate learnings into L1/L3`],handoffArtifact:``,handoffFields:[]}},n="### Dispatch Protocol\n- **Max 2 corrective retries** per task, then escalate.\n- Use `knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })` before dispatching.\n- Context: `file_summary` (T1=structure, T2=structure+content), `digest` for multi-file synthesis.\n- Subagents: `DONE` | `DONE_WITH_CONCERNS` | `NEEDS_CONTEXT` | `BLOCKED`. No `present`. No flow advance.",r='### Evidence Gate\nStandard/Critical: Use one stable `task_id` (from Design/Assessment).\n1. `evidence_map({ action: "create", task_id: "<slug>", tier: "<tier>" })` — create once.\n2. Add CRITICAL/HIGH claims during implementation and review.\n3. Orchestrator calls `evidence_map({ action: "gate", task_id: "<slug>" })` → YIELD/HOLD/HARD_BLOCK.\n4. HOLD → fix, re-gate (max 2 retries). HARD_BLOCK → escalate.',i={_epilogue:[{file:`steps/docs-sync/README.md`,content:`# Epilogue: Documentation Sync
3
-
4
- > **This is a mandatory epilogue step.** Runs after every flow to keep project documentation synced with code changes.
2
+ Load them when their preconditions are met.`,t={design:{contextProfile:`researcher`,l0CardTypes:[`workspace-core`,`architecture`],l1Fields:[`objective`,`acceptanceCriteria`,`scope`,`exclusions`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`decisions`,`retrievedRefs`,`summary`],candidateLearnings:[`Architectural decisions with evidence`,`Scope boundary lessons`],handoffArtifact:`design-decisions.md`,handoffFields:[`decisions`,`scope`,`exclusions`,`retrievedRefs`]},spec:{contextProfile:`researcher`,l0CardTypes:[`workspace-core`],l1Fields:[`objective`,`acceptanceCriteria`,`decisions`,`scope`],l2Refs:`required`,l3Evidence:`none`,updates:[`acceptanceCriteria`,`decisions`,`unresolvedClaims`],candidateLearnings:[`Requirement ambiguity lessons when evidenced`,`Contract boundary clarity`],handoffArtifact:`spec.md`,handoffFields:[`acceptanceCriteria`,`scope`,`decisions`]},plan:{contextProfile:`implementer`,l0CardTypes:[`workspace-core`,`architecture`],l1Fields:[`acceptanceCriteria`,`scope`,`decisions`,`retrievedRefs`],l2Refs:`required`,l3Evidence:`none`,updates:[`decisions`,`artifacts`,`stepSummaries`],candidateLearnings:[`Planning pattern when reusable and evidenced`],handoffArtifact:`plan.md`,handoffFields:[`artifacts`,`decisions`]},task:{contextProfile:`implementer`,l0CardTypes:[`workspace-core`],l1Fields:[`acceptanceCriteria`,`scope`,`decisions`,`retrievedRefs`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`artifacts`,`stepSummaries`],candidateLearnings:[],handoffArtifact:`tasks.md`,handoffFields:[`artifacts`,`stepSummaries`]},execute:{contextProfile:`implementer`,l0CardTypes:[],l1Fields:[`artifacts`,`scope`,`retrievedRefs`],l2Refs:`on-demand`,l3Evidence:`on-demand`,updates:[`artifacts`,`summaries`,`failures`,`successPatterns`,`verifiedClaims`,`assumedClaims`],candidateLearnings:[`Candidate only — no promotion`],handoffArtifact:`progress.md`,handoffFields:[`artifacts`,`summaries`,`failures`,`successPatterns`]},verify:{contextProfile:`reviewer`,l0CardTypes:[],l1Fields:[`acceptanceCriteria`,`artifacts`,`verifiedClaims`,`assumedClaims`,`unresolvedClaims`],l2Refs:`on-demand`,l3Evidence:`required`,updates:[`verifiedClaims`,`unresolvedClaims`,`verifiedFinalOutcome`],candidateLearnings:[`Confirm or reject candidates — no direct promotion`],handoffArtifact:`verify-report.md`,handoffFields:[`verifiedClaims`,`verifiedFinalOutcome`]},"basic-design":{contextProfile:`researcher`,l0CardTypes:[`workspace-core`],l1Fields:[`objective`,`acceptanceCriteria`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`decisions`,`summary`],candidateLearnings:[],handoffArtifact:`design-decisions.md`,handoffFields:[`decisions`]},assess:{contextProfile:`implementer`,l0CardTypes:[`workspace-core`],l1Fields:[`objective`,`scope`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`summary`,`retrievedRefs`],candidateLearnings:[],handoffArtifact:`assessment.md`,handoffFields:[`scope`,`retrievedRefs`]},"basic-implement":{contextProfile:`implementer`,l0CardTypes:[],l1Fields:[`scope`,`retrievedRefs`],l2Refs:`on-demand`,l3Evidence:`on-demand`,updates:[`artifacts`,`summaries`,`verifiedClaims`],candidateLearnings:[`Candidate only — no promotion`],handoffArtifact:`progress.md`,handoffFields:[`artifacts`,`summaries`]},"basic-verify":{contextProfile:`reviewer`,l0CardTypes:[],l1Fields:[`acceptanceCriteria`,`artifacts`,`verifiedClaims`],l2Refs:`none`,l3Evidence:`required`,updates:[`verifiedClaims`,`verifiedFinalOutcome`],candidateLearnings:[],handoffArtifact:`verify-report.md`,handoffFields:[`verifiedFinalOutcome`]},"docs-sync":{contextProfile:`documenter`,l0CardTypes:[],l1Fields:[`artifacts`,`stepSummaries`,`candidateLearnings`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[],candidateLearnings:[`L2 candidate mapping from durable doc changes`],handoffArtifact:``,handoffFields:[]},"lesson-learned":{contextProfile:`documenter`,l0CardTypes:[],l1Fields:[`failures`,`successPatterns`,`candidateLearnings`,`verifiedFinalOutcome`],l2Refs:`none`,l3Evidence:`on-demand`,updates:[],candidateLearnings:[`Evidence-backed candidate learnings into L1/L3`],handoffArtifact:``,handoffFields:[]}},n="### Dispatch Protocol\n- **Max 2 corrective retries** per task, then escalate.\n- Use `knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })` before dispatching.\n- Context: `file_summary` (T1=structure, T2=structure+content), `digest` for multi-file synthesis.\n- Subagents: `DONE` | `DONE_WITH_CONCERNS` | `NEEDS_CONTEXT` | `BLOCKED`. No `present`. No flow advance.",r='### Evidence Gate\nStandard/Critical: Use one stable `task_id` (from Design/Assessment).\n1. `evidence_map({ action: "create", task_id: "<slug>", tier: "<tier>" })` — create once.\n2. Add CRITICAL/HIGH claims during implementation and review.\n3. Orchestrator calls `evidence_map({ action: "gate", task_id: "<slug>" })` → YIELD/HOLD/HARD_BLOCK.\n4. HOLD → fix, re-gate (max 2 retries). HARD_BLOCK → escalate.',i={_epilogue:[{file:`steps/docs-sync/README.md`,content:`---
3
+ name: _docs-sync
4
+ description: Synchronize project documentation after flow completion
5
+ skills: [docs]
6
+ ---
5
7
 
6
- ## Objective
8
+ # Epilogue: Documentation Sync
7
9
 
8
- Review flow changes and update \`docs/\` with AI Kit analysis tools. Never write docs from scratch when a tool can generate the base.
10
+ > Mandatory epilogue step. Runs after every flow.
9
11
 
10
12
  ## Prerequisites
11
13
 
12
- Load the \`docs\` skill before proceeding.
14
+ Load the \`docs\` skill. Its **Flow-Aware Sync** section has the full assessment toolchain and doc-update workflow.
13
15
 
14
16
  ## Instructions
15
17
 
16
- ### 0. Gather Flow Artifacts
17
-
18
- Read all flow artifacts.
19
-
20
- \`\`\`
21
- flow({ action: 'status' }) # Get artifactsPath
22
- find({ glob: "{{artifacts_path}}/**/*.md" }) # Discover all flow artifacts
23
- digest({ sources: [ # Compress artifacts for context
24
- { path: "<found-artifact-1>" },
25
- { path: "<found-artifact-2>" },
26
- ...
27
- ]})
28
- \`\`\`
29
-
30
- Map each artifact to doc actions with the \`docs\` skill mapping. Focus on decisions, requirements, and verification.
31
-
32
- If no artifacts exist, proceed to Step 1 in source-only mode.
33
-
34
- ### 1. Assess Changes (tool-driven)
35
-
36
- \`\`\`
37
- git_context({}) # What changed in this flow
38
- blast_radius({ path: ".", files: ["<changed-files>"] }) # Impact analysis — which modules affected
39
- \`\`\`
40
-
41
- Classify changes from tool output:
42
-
43
- | Change Signal | Documentation Action |
44
- |---------------|---------------------|
45
- | New files in \`src/\` | Potential new component doc |
46
- | Modified API surface | Update reference docs |
47
- | New package or module boundary | Update architecture overview |
48
- | Architecture decision made | Delegate to \`adr-skill\` |
49
- | Test-only or config-only changes | Likely skip |
50
-
51
- ### 2. Apply the Change-to-Doc Mapping
52
-
53
- Follow the \`docs\` skill decision tree.
54
-
55
- ### 3. Bootstrap \`docs/\` If Needed (full tool-driven workflow)
56
-
57
- If \`docs/\` doesn't exist, run the **Architecture Blueprint Workflow** from the \`docs\` skill:
58
-
59
- \`\`\`
60
- # Step 1: Generate content with AI Kit tools
61
- produce_knowledge({ scope: "." }) # → Foundation for docs/README.md
62
- analyze({ items: [{aspect: "structure", path: "."}] }) # → docs/architecture/overview.md structure
63
- analyze({ items: [{aspect: "diagram", path: "."}] }) # → docs/architecture/ Mermaid diagrams
64
- analyze({ items: [{aspect: "dependencies", path: "."}] }) # → docs/architecture/overview.md deps section
65
- analyze({ items: [{aspect: "entry_points", path: "."}] }) # → docs/reference/api.md foundation
66
- analyze({ items: [{aspect: "patterns", path: "."}] }) # → docs/architecture/overview.md patterns
67
-
68
- # Step 2: Create the docs/ tree from tool outputs
69
- docs/
70
- ├── README.md ← From produce_knowledge + project context
71
- ├── architecture/
72
- │ ├── overview.md ← From analyze(structure|dependencies|diagram)
73
- │ └── components/ ← From analyze(symbols) per major component
74
- ├── decisions/
75
- │ └── index.md ← ADR log (delegate to adr-skill)
76
- ├── guides/
77
- │ └── testing.md ← From analyze(patterns) test info
78
- └── reference/
79
- └── api.md ← From analyze(entry_points)
80
- \`\`\`
81
-
82
- Use the \`docs\` skill Architecture Blueprint sections as the template.
83
-
84
- ### 4. Update Existing Docs (tool-assisted)
85
-
86
- When \`docs/\` already exists:
87
-
88
- \`\`\`
89
- file_summary({ files: ["docs/architecture/overview.md"], tier: 'T2', query: "section to update" }) # Read target section
90
- blast_radius({ path: ".", files: ["<files>"] }) # What's affected
91
- \`\`\`
92
-
93
- - **Don't rewrite** — update relevant sections only
94
- - **Don't duplicate** — reference code comments or READMEs when they already contain it
95
- - Use \`file_summary\` to read existing doc sections before editing
96
- - Use \`blast_radius\` output to determine which sections need updating
97
-
98
- ### 5. Delegate When Appropriate
99
-
100
- - Architecture decisions → \`adr-skill\` → \`docs/decisions/\`
101
- - Architecture diagrams → \`c4-architecture\` skill → \`docs/architecture/\`
102
- - Full architecture refresh → run the \`docs\` skill Architecture Blueprint Workflow
103
-
104
- ### 6. Update Index
105
-
106
- If docs were added, removed, or renamed, update \`docs/README.md\`.
107
-
108
- ### 6b. Update HTML Documentation Site (if exists)
109
-
110
- If \`docs/site/\` exists with a manifest:
111
-
112
- 1. **Detect staleness** — compare source changes from \`git_context\` against manifest page data
113
- 2. **Identify affected pages** — use \`blast_radius\` to find pages whose source data changed
114
- 3. **Regenerate affected pages only** — update manifest JSON with fresh data for changed pages
115
- 4. **Rebuild** — Run \`inject-viewer.mjs --manifest\` with the updated manifest
116
- 5. **Regenerate hub** — If pages were added or removed, regenerate the docs-hub page
117
-
118
- If \`docs/site/\` doesn't exist but the flow produced architecture diagrams or process flows, suggest \`/docs-site\`.
119
-
120
- ### 7. Skip If Nothing Changed
121
-
122
- If changes don't warrant doc updates, report:
123
- - "No documentation updates needed"
124
- - Reason: (brief explanation)
18
+ Follow the \`docs\` skill's **Flow-Aware Sync** workflow:
19
+ 1. Gather flow artifacts via \`flow({status})\` → \`find\` → \`digest\`
20
+ 2. Assess changes via \`git_context\` + \`blast_radius\`
21
+ 3. Apply change-to-doc mapping
22
+ 4. Update or create docs (branch by tier)
23
+ 5. Check HTML site staleness if \`docs/site/\` exists
24
+ 6. Skip if nothing changed
125
25
 
126
26
  ## Knowledge Contract
127
27
 
128
- This step has a \`documenter\` context profile. It reads L1 artifacts and step summaries, retrieves L2 on demand for context, and produces L2 candidate mappings from durable doc changes. Does not write to L0 or L3.
28
+ Profile: \`documenter\`. Reads L1 artifacts and step summaries, retrieves L2 on demand, produces L2 candidate mappings from durable doc changes. Does not write to L0 or L3.
129
29
 
130
30
  ## Completion Criteria
131
31
 
132
- - [ ] \`git_context\` + \`blast_radius\` used to assess changes
133
- - [ ] Change-to-doc mapping applied from \`docs\` skill
134
- - [ ] \`docs/\` bootstrapped with tool outputs if it didn't exist
135
- - [ ] \`docs/site/\` checked for staleness if it exists
136
- - [ ] Stale HTML pages regenerated from fresh analysis data
137
- - [ ] Relevant docs created or updated (or skipped with reason)
138
- - [ ] \`docs/README.md\` index is current
139
- - [ ] No placeholder/empty docs created — all content tool-generated or written with purpose`},{file:`steps/lesson-learned/README.md`,content:`---
32
+ - [ ] Flow artifacts gathered and assessed
33
+ - [ ] Docs updated or skip documented with reason
34
+ - [ ] \`docs/site/\` checked for staleness if exists
35
+ - [ ] No placeholder docs created`},{file:`steps/lesson-learned/README.md`,content:`---
140
36
  name: _lesson-learned
141
37
  description: Extract engineering principles from the completed flow
142
38
  skills: [lesson-learned]
@@ -144,48 +40,30 @@ skills: [lesson-learned]
144
40
 
145
41
  # Epilogue: Lesson Learned
146
42
 
147
- ## Condition Check (MUST evaluate first)
43
+ ## Condition Check
148
44
 
149
- Before extracting lessons, check whether this flow produced learnable outcomes:
45
+ Evaluate before extracting (full criteria in the skill's **Condition Check** subsection):
150
46
 
151
- **Skip this step (advance with 'skip') when ALL are true:**
152
- - Flow was Floor-tier (trivial change)
153
- - blast_radius ≤ 2 for all changes
154
- - Flow completed in a single batch with no iteration
155
- - No agent returned BLOCKED or DONE_WITH_CONCERNS
156
- - evidence_map never reached HOLD state
47
+ **Skip when ALL are true:**
48
+ - Flow was Floor-tier
49
+ - blast_radius ≤ 2
50
+ - Single batch, no iteration
51
+ - No BLOCKED/DONE_WITH_CONCERNS
52
+ - evidence_map never HOLD
157
53
 
158
54
  **Proceed when ANY are true:**
159
- - An agent returned BLOCKED or DONE_WITH_CONCERNS during the flow
160
- - evidence_map had HOLD before reaching YIELD (required iteration to pass)
161
- - Multi-model decision protocol was invoked
162
- - blast_radius > 5 (complex change with systemic implications)
163
- - A novel pattern or anti-pattern was discovered
164
- - A debugging session revealed non-obvious root cause
165
-
166
- If skip condition is met → \`flow({ action: 'step', advance: 'skip' })\` with note: "No lesson signals detected."
167
-
168
- ## Extraction Protocol
169
-
170
- 1. **Load the \`lesson-learned\` skill**
171
- 2. Run \`git_context({ include_diff: true, commit_count: 10 })\`
172
- 3. Review flow artifacts in \`{{artifacts_path}}\`
173
- 4. Extract 1-3 principles using the skill's framework:
174
- - What went wrong → What we learned → What we'll do differently
175
- - OR: What went right → Why it worked → How to replicate
176
- 5. Store each principle: \`knowledge({ action: "remember", title: "Lesson: <principle>", content: "<context + evidence>", category: "patterns" })\`
177
-
178
- ## Quality Bar
179
-
180
- A good lesson:
181
- - Is **generalizable** (applies beyond this task)
182
- - Has **evidence** (references files, errors, or decisions)
183
- - Is **actionable** (tells future agents what to do or avoid)
184
-
185
- Skip lessons that:
186
- - Restate what was done without insight
187
- - Is too specific to reuse ("file X had a typo on line 42")
188
- - Captures a convention already documented elsewhere
55
+ - Agent returned BLOCKED/DONE_WITH_CONCERNS
56
+ - evidence_map had HOLD before YIELD
57
+ - Multi-model decision invoked
58
+ - blast_radius > 5
59
+ - Novel pattern/anti-pattern found
60
+ - Non-obvious root cause
61
+
62
+ If skip → \`flow({ action: 'step', advance: 'skip' })\` with note: "No lesson signals detected."
63
+
64
+ ## Execution
65
+
66
+ Load the \`lesson-learned\` skill. It contains the full extraction protocol, quality bar, and memory hygiene rules.
189
67
  `}],"aikit-advanced":[{file:`README.md`,content:`# aikit:advanced — Full Development Flow
190
68
 
191
69
  Full development flow for **new features, API design, and architecture changes**.
@@ -1,5 +1,5 @@
1
1
  {
2
- "serverName": "aikit",
2
+ "serverName": "AI Kit",
3
3
  "command": "node",
4
4
  "args": [
5
5
  "-e",
@@ -0,0 +1 @@
1
+ const e=[`SessionStart`,`PreToolUse`,`PostToolUse`,`PreCommit`,`SessionEnd`],t=[`native`,`eventbus`,`middleware`,`none`],n=[`full`,`partial`,`eventbus`,`middleware`,`none`],r={"claude-code":{SessionStart:`native`,PreToolUse:`native`,PostToolUse:`native`,PreCommit:`native`,SessionEnd:`native`,overall:`full`,label:`Claude Code`},"claude-desktop":{SessionStart:`eventbus`,PreToolUse:`none`,PostToolUse:`eventbus`,PreCommit:`none`,SessionEnd:`eventbus`,overall:`eventbus`,label:`Claude Desktop`},cursor:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Cursor`},windsurf:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Windsurf`},copilot:{SessionStart:`none`,PreToolUse:`native`,PostToolUse:`native`,PreCommit:`none`,SessionEnd:`none`,overall:`partial`,label:`GitHub Copilot`},hermes:{SessionStart:`middleware`,PreToolUse:`middleware`,PostToolUse:`middleware`,PreCommit:`none`,SessionEnd:`middleware`,overall:`middleware`,label:`Hermes Agent (legacy)`},"hermes-agent":{SessionStart:`middleware`,PreToolUse:`middleware`,PostToolUse:`middleware`,PreCommit:`none`,SessionEnd:`middleware`,overall:`middleware`,label:`Hermes Agent`},codex:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Codex CLI`},gemini:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Gemini CLI`},opencode:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`OpenCode`},zed:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Zed`},intellij:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`IntelliJ`}};function i(){let i=new Set(e),a=[`overall`,`label`];for(let[o,s]of Object.entries(r)){for(let e of i)if(!(e in s))throw Error(`Capability matrix: platform "${o}" is missing event "${e}". Add it to PLATFORM_HOOK_CAPABILITIES.${o}.`);for(let e of a)if(!(e in s))throw Error(`Capability matrix: platform "${o}" is missing "${e}". Add it to PLATFORM_HOOK_CAPABILITIES.${o}.`);if(typeof s.label!=`string`||s.label.length===0)throw Error(`Capability matrix: platform "${o}" has empty or missing "label". Set a non-empty label.`);if(!n.includes(s.overall))throw Error(`Capability matrix: platform "${o}" has invalid overall "${s.overall}". Valid: ${n.join(`, `)}.`);let r=e.every(e=>s[e]===`none`);if(r&&s.overall!==`none`)throw Error(`Capability matrix: platform "${o}" has all events 'none' but overall="${s.overall}". Set overall to 'none'.`);if(s.overall===`none`&&!r)throw Error(`Capability matrix: platform "${o}" has overall='none' but individual events are not all 'none'. Set each event to 'none' or change overall.`);for(let e of i)if(!t.includes(s[e]))throw Error(`Capability matrix: platform "${o}" event "${e}" has invalid level "${s[e]}". Valid: ${t.join(`, `)}.`)}}function a(e){let t=Object.keys(r),n=new Set(e);for(let e of t)n.has(e)||console.warn(`Capability matrix: platform "${e}" has no corresponding adapter in generate.mjs ADAPTERS. Hook generation for this platform will be skipped.`)}export{e as HOOK_EVENTS,r as PLATFORM_HOOK_CAPABILITIES,i as validateCapabilityMatrix,a as validateMatrixAdapterAlignment};