@vpxa/aikit 0.1.360 → 0.1.362
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +442 -442
- package/package.json +3 -1
- package/packages/claude-desktop/dist/manifest.json +31 -0
- package/packages/claude-desktop/dist/mcp-source.json +16 -0
- package/packages/cli/dist/index.js +14 -14
- package/packages/cli/dist/init-JfM6gnAO.js +7 -0
- package/packages/cli/dist/mcp-entry.json +8 -0
- package/packages/cli/dist/{templates-DUUaYk_d.js → templates-CNDa9H4e.js} +25 -25
- package/packages/core/dist/index.d.ts +4 -2
- package/packages/core/dist/index.js +1 -1
- package/packages/flows/dist/index.d.ts +1 -1
- package/packages/flows/dist/index.js +1 -1
- package/packages/present/dist/annotation-layer.js +97 -14
- package/packages/present/dist/index.html +92 -9
- package/packages/server/dist/bin.js +1 -1
- package/packages/server/dist/config-B4klhHVp.js +2 -0
- package/packages/server/dist/config-D3rRPB9X.js +1 -0
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/prelude-BgvW6Hp5.js +2 -0
- package/packages/server/dist/prelude-Di-ZDdDk.js +1 -0
- package/packages/server/dist/routes-Ct7q5jrL.js +6 -0
- package/packages/server/dist/routes-DsSm9ea0.js +5 -0
- package/packages/server/dist/sampling-CFWUnzbA.js +1 -0
- package/packages/server/dist/sampling-lcC_v6KY.js +2 -0
- package/packages/server/dist/server-Bsceh-AT.js +3070 -0
- package/packages/server/dist/server-DUWF6mtP.js +3071 -0
- package/packages/server/dist/{server-http-Dd2uCMBi.js → server-http-BGcKUn5y.js} +1 -1
- package/packages/server/dist/{server-http-BaMUtb5Y.js → server-http-Cx4tvbmK.js} +1 -1
- package/packages/server/dist/{server-stdio-B5rk-PAI.js → server-stdio-BmGuXkkF.js} +1 -1
- package/packages/server/dist/{server-stdio-CtR4QNT3.js → server-stdio-C66e05P_.js} +1 -1
- package/packages/server/viewers/architecture-static.html +794 -794
- package/packages/server/viewers/report-template.html +11 -11
- package/packages/server/viewers/tour-viewer.html +26 -26
- package/packages/settings-ui/dist/index.html +12 -12
- package/packages/tools/dist/index.d.ts +109 -14
- package/packages/tools/dist/index.js +118 -98
- package/scaffold/definitions/mcp-entry.json +1 -1
- package/scaffold/dist/adapters/claude-code.mjs +5 -5
- package/scaffold/dist/adapters/claude-desktop.mjs +6 -6
- package/scaffold/dist/adapters/copilot.mjs +1 -1
- package/scaffold/dist/adapters/gemini.mjs +2 -2
- package/scaffold/dist/adapters/hermes-agent.mjs +1 -1
- package/scaffold/dist/adapters/hermes.mjs +1 -1
- package/scaffold/dist/adapters/opencode.mjs +2 -2
- package/scaffold/dist/adapters/zed.mjs +1 -1
- package/scaffold/dist/definitions/flows.mjs +40 -162
- package/scaffold/dist/definitions/mcp-entry.json +1 -1
- package/scaffold/dist/definitions/platform-capabilities.mjs +1 -1
- package/scaffold/dist/definitions/protocols.mjs +22 -19
- package/scaffold/dist/definitions/skills/adr-skill.mjs +1 -1
- package/scaffold/dist/definitions/skills/docs.mjs +51 -1
- package/scaffold/dist/definitions/skills/lesson-learned.mjs +21 -0
- package/scaffold/vitest.config.mjs +1 -0
- package/packages/cli/dist/init-C_WzeMTD.js +0 -7
- package/packages/server/dist/config-4M54ZAT8.js +0 -2
- package/packages/server/dist/config-BXd38nVn.js +0 -1
- package/packages/server/dist/prelude-CNOjd5qt.js +0 -2
- package/packages/server/dist/prelude-Dki25eYn.js +0 -1
- package/packages/server/dist/routes-9KnBpwfe.js +0 -6
- package/packages/server/dist/routes-B8hTXXR8.js +0 -5
- package/packages/server/dist/sampling-B8NwOv_z.js +0 -1
- package/packages/server/dist/sampling-DOOgTH1B.js +0 -2
- package/packages/server/dist/server-C2n9kQMF.js +0 -3069
- package/packages/server/dist/server-CizTllz1.js +0 -3070
- package/scaffold/AUTOMATION-BOUNDARY-ANALYSIS.md +0 -78
|
@@ -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{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(`#
|
|
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
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[`#
|
|
4
|
-
`)}function N(){return[`#
|
|
5
|
-
`)}function P(e,t,n,r,
|
|
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(),
|
|
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
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};
|
|
@@ -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}from"../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as
|
|
2
|
-
`)}function
|
|
3
|
-
`)}function
|
|
4
|
-
`)}function
|
|
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
5
|
|
|
6
|
-
`).trim(),u=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${
|
|
7
|
-
`)}function
|
|
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[`#
|
|
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};
|
|
@@ -2,6 +2,6 @@ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from
|
|
|
2
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
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(){return[`#
|
|
6
|
-
`)}function w(){return[`#
|
|
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
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[`#
|
|
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,4 +1,4 @@
|
|
|
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: `
|
|
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
2
|
`),``,`## Prompts`,``,c,``,p,``,`## Session Protocol`,``,l(n,r.hermes),``].join(`
|
|
3
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
|
|
|
@@ -3,6 +3,6 @@ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from
|
|
|
3
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
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(){return[`#
|
|
7
|
-
`)}function T(){return[`#
|
|
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
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
|
|
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,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
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
8
|
+
# Epilogue: Documentation Sync
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
> Mandatory epilogue step. Runs after every flow.
|
|
9
11
|
|
|
10
12
|
## Prerequisites
|
|
11
13
|
|
|
12
|
-
Load the \`docs\` skill
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
- [ ]
|
|
133
|
-
- [ ]
|
|
134
|
-
- [ ] \`docs/\`
|
|
135
|
-
- [ ]
|
|
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
|
|
43
|
+
## Condition Check
|
|
148
44
|
|
|
149
|
-
|
|
45
|
+
Evaluate before extracting (full criteria in the skill's **Condition Check** subsection):
|
|
150
46
|
|
|
151
|
-
**Skip
|
|
152
|
-
- Flow was Floor-tier
|
|
153
|
-
- blast_radius ≤ 2
|
|
154
|
-
-
|
|
155
|
-
- No
|
|
156
|
-
- evidence_map never
|
|
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
|
-
-
|
|
160
|
-
- evidence_map had HOLD before
|
|
161
|
-
- Multi-model decision
|
|
162
|
-
- blast_radius > 5
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
If skip
|
|
167
|
-
|
|
168
|
-
##
|
|
169
|
-
|
|
170
|
-
|
|
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 +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(`, `)}.`);
|
|
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{SERVER_NAME as e}from"./mcp.mjs";import{generateForbiddenTable as t}from"./policies.mjs";function n(e){return`
|
|
2
2
|
## Flow Context Bootstrap
|
|
3
3
|
|
|
4
4
|
When dispatched as a subagent within an active flow:
|
|
@@ -17,10 +17,11 @@ When dispatched as a subagent within an active flow:
|
|
|
17
17
|
|
|
18
18
|
${e===`<PROFILE>`?`**Profile:** Check your role → implementer | documenter | reviewer | researcher | debugger`:`**Profile:** \`${e}\``}
|
|
19
19
|
|
|
20
|
-
---`}function
|
|
20
|
+
---`}function r(){return"\n## Evidence Citation Protocol (tier-aware)\n\nNo FORGE `task_id` → skip `evidence_map`; use `file:line` citations only.\nDo not create your own `task_id` or run the gate.\n\n| Tier | Your responsibility |\n|------|---------------------|\n| Floor | Findings with `file.ts#Lxx` citations. No `evidence_map`. |\n| Standard | Add 2-4 CRITICAL/HIGH findings with receipts. |\n| Critical | Add all CRITICAL/HIGH findings; tag contract/security claims with `safety_gate`. |\n\n**Every response MUST include:**\n- `**FORGE Task ID:** <task_id>` (passed in by Orchestrator, or state \"not provided\")\n- `**Tier applied:** Floor | Standard | Critical`\n- `**Findings:** <list>` with `file:line` receipts\n- Verdict: `APPROVED` | `CHANGES_REQUESTED` | `BLOCKED`\n\nDo NOT create a new `evidence_map`, run `evidence_map({action:'gate'})`, or add non-critical noise."}function i(...e){return e.filter(Boolean).join(`
|
|
21
21
|
|
|
22
|
-
`)}function
|
|
23
|
-
`)
|
|
22
|
+
`)}function a({title:e=`Knowledge Recall`,intro:t,commands:n,followUp:r}={}){let a=[``,`### Retrieval-First Knowledge Access`,``,`**Always follow progressive discovery: L0 → exact-topic search/refs → broad scans.**`,``,"1. **Start with L0** — `status({ includePrelude: true })` or `aikit://l0/workspace-core` resource",'2. **Search exact topic** — `search({ query: "<specific-topic>" })` — results include `ctxc_` refs','3. **Reuse refs** — `compact({ ref: "ctxc_<hash>" })` restores context without re-running search',"4. **Use `enrich: true`** on search/find/symbol for graph context without extra round-trip",`5. **Broad scan last resort** — only use find/glob/raw reads when L0 + exact search + refs fail`,``,`> **Note:** L1 (flow working-context withdrawal) is handled by your Orchestrator before dispatch —`,'> do not re-withdraw `knowledge({ scope: "flow" })` yourself. L2 (curated) is covered by step 2 above.',``].join(`
|
|
23
|
+
`);return i(`## Pre-Task: ${e} (MANDATORY)`,t,["```",...(Array.isArray(n)?n:[n]).filter(Boolean),"```"].join(`
|
|
24
|
+
`),r,a)}function o(){return i(`## Post-Task: Capture Lesson`,`**HARD RULE:** Before DONE, capture 1-2 lessons unless change is pure config/formatting.`,'Quick capture:\n```\nknowledge({ action: "lesson", subAction: "create", context: "<what situation you faced>", insight: "<what principle the solution demonstrates>", evidence: "<file:line or commit that proves it>", confidence: 65 })\n```',"If recalled lesson was confirmed/invalid, use `confirm` or `contradict`.")}const s=1,c=Object.freeze({version:1,l0MemoriesDir:`memories`,sessionStart:{requiredCards:[`workspace-core`],maxAdditionalCards:1,activeFlowPreference:`workflow-card`,totalTokenBudget:2100},retrievalOrder:[`l0`,`l1`,`l2-on-demand`,`l3-evidence-only`],noFlowFallback:`l0-plus-l2-with-turn-local-context`,degradedFallback:`prelude-manifest-canonical-markdown`,lifecycleAuthority:`opaque-owner-capability`,autoKnowledgeMode:`observer-only`,l0Budgets:Object.freeze({"workspace-core":{min:800,max:1200},architecture:{min:600,max:900},"testing-release":{min:600,max:900},"known-issues":{min:400,max:700},"workflow:*":{min:500,max:900}})});function l(e={}){let{audience:t=`agent`}=e,n=c,r=`## Layered Knowledge Protocol (v${n.version})
|
|
24
25
|
|
|
25
26
|
AI Kit delivers knowledge through four layers:
|
|
26
27
|
|
|
@@ -51,7 +52,7 @@ AI Kit delivers knowledge through four layers:
|
|
|
51
52
|
- Route L1 withdrawal by configured profile; never promote.
|
|
52
53
|
- Emit L3 evidence as observer-only; never navigate flow state.`:t===`flow`?r+`
|
|
53
54
|
### Step Contracts
|
|
54
|
-
Each built-in flow step declares knowledge inputs (L0 card types, L1 fields, L2 refs, L3 evidence), context updates, candidate learnings, and handoff artifacts. The step knowledge contract drives role-aware L1 projection.`:r}const
|
|
55
|
+
Each built-in flow step declares knowledge inputs (L0 card types, L1 fields, L2 refs, L3 evidence), context updates, candidate learnings, and handoff artifacts. The step knowledge contract drives role-aware L1 projection.`:r}const u=i(`## Output Rules (HARD RULE)`,`**Plain text is allowed only when ALL are true:**`,` - Response is 1-2 short sentences.`,` - No table, list, checklist, plan, report, verdict, review, summary, progress, evidence map, or batch result is being returned.`,` - No user approval, mandatory stop, or choice is needed.`,"Follow the **Presentation Priority** (1st Inline Visual - `present({ schemaVersion: 1, title, blocks })` → 2nd Interactive - `present({ schemaVersion: 1, title, blocks, actions })` → 3rd Plain Text). Only tiny status/questions that pass the gate above → plain text (Priority 3). Prefer `present` for all others, especially summaries, comparisons, reports, task plans, verdicts, and progress.");function d(){return'## Tool Preference — AI Kit First (HARD RULE)\n\n**Never start with `read_file`, `grep_search`, `semantic_search`, or `run_in_terminal`. AI Kit tools replace all of these.**\n\n| Need | Use | NEVER |\n|------|-----|-------|\n| Structure of a file | `file_summary({ path })` | `read_file` to "understand" it |\n| Find specific code | `file_summary({ files, tier: \'T2\', query })` | `read_file` to search |\n| Multiple files | `digest({ sources, query })` | Multiple `read_file` calls |\n| Reuse previous output | `file_summary({ ref, query })` with `enrich:true` | Re-reading same file |\n| Search codebase | `search({ query })` | `grep_search` / `semantic_search` |\n| Find a symbol | `symbol({ name })` | `grep_search` |\n| Trace data flow | `trace({ items: [{start, direction}] })` | Manual code tracing |\n| Module relationships | `graph({action:\'neighbors\', node_id})` | Manual import tracing |\n| Typecheck + lint | `check({})` | `run_in_terminal tsc` / biome |\n| Run tests | `test_run({})` | `run_in_terminal vitest` |\n| Impact analysis | `blast_radius({ changed_files })` | Manual caller tracing |\n| Complexity metrics | `measure({ path })` | Line counting / wc |\n| L0 briefing card (workspace-core) | `aikit://l0/workspace-core` resource (full card), `file_summary` | Raw file discovery |\n| L0 briefing card (known issues) | `search({ query: "known issues" })` + `knowledge({ action: "lesson" })` | Manual history review |\n| Web research | `web_search({ queries })` + `web_fetch({ urls })` | `fetch_webpage` |\n\n`read_file` is ONLY acceptable when you need exact line content FOR EDITING (before `replace_string_in_file`).\n\nEven then, use `file_summary` first to identify which lines to read.'}const f=i(`## AI Kit Recovery`,`If AI Kit tools are unavailable or missing, run \`npx -y @vpxa/aikit@latest init --user\`, then reload the client so the \`${e}\` MCP server and user instructions become available.`),p={"code-agent-base":`# Code Agent - Shared Kernel
|
|
55
56
|
|
|
56
57
|
> Shared protocol for code-writing agents. Role files add only role-specific behavior.
|
|
57
58
|
|
|
@@ -71,7 +72,7 @@ Each built-in flow step declares knowledge inputs (L0 card types, L1 fields, L2
|
|
|
71
72
|
- Use terse style if requested by Orchestrator.
|
|
72
73
|
- End with one status: \`DONE\` | \`DONE_WITH_CONCERNS\` | \`NEEDS_CONTEXT\` | \`BLOCKED\`.
|
|
73
74
|
|
|
74
|
-
${
|
|
75
|
+
${d()}
|
|
75
76
|
|
|
76
77
|
## Protocol Coverage
|
|
77
78
|
- conversation-compression: prefer provided compressed context; stash/remember concise findings before context changes; never paste raw long output.
|
|
@@ -81,9 +82,9 @@ ${u()}
|
|
|
81
82
|
- access protocol: \`401\`/\`403\`/\`404\`/\`407\`, login HTML, CAPTCHA, SSO, or repo auth failure -> \`NEEDS_CONTEXT\` with receipt.
|
|
82
83
|
- context-cache protocol: search/reuse \`ctxc_...\`, stash, or flow withdrawal before rereading same path/topic.
|
|
83
84
|
|
|
84
|
-
${
|
|
85
|
+
${t()}
|
|
85
86
|
|
|
86
|
-
${
|
|
87
|
+
${r()}
|
|
87
88
|
|
|
88
89
|
## Work Loop
|
|
89
90
|
1. Restate scope and success criteria.
|
|
@@ -118,9 +119,9 @@ Instructions use short names such as \`status\`, \`file_summary\`, \`search\`. R
|
|
|
118
119
|
|
|
119
120
|
> Researchers are read-only subagents for discovery, trade-offs, and decision input.
|
|
120
121
|
|
|
121
|
-
${
|
|
122
|
+
${n(`researcher`)}
|
|
122
123
|
|
|
123
|
-
${
|
|
124
|
+
${d()}
|
|
124
125
|
|
|
125
126
|
## Method
|
|
126
127
|
1. Start from Orchestrator question + provided context.
|
|
@@ -148,9 +149,9 @@ Status: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
|
|
|
148
149
|
|
|
149
150
|
> Review changed behavior, tests, correctness, security, maintainability, patterns, and type safety.
|
|
150
151
|
|
|
151
|
-
${
|
|
152
|
+
${n(`reviewer`)}
|
|
152
153
|
|
|
153
|
-
${
|
|
154
|
+
${d()}
|
|
154
155
|
|
|
155
156
|
## Method
|
|
156
157
|
1. Use provided diff/context first; run \`blast_radius\` when scope is unclear.
|
|
@@ -180,9 +181,9 @@ Approve only with zero CRITICAL/HIGH findings.
|
|
|
180
181
|
|
|
181
182
|
> Review structure: dependency direction, boundaries, public contracts, pattern fit, testability.
|
|
182
183
|
|
|
183
|
-
${
|
|
184
|
+
${n(`reviewer`)}
|
|
184
185
|
|
|
185
|
-
${
|
|
186
|
+
${d()}
|
|
186
187
|
|
|
187
188
|
## Method
|
|
188
189
|
1. Use provided design/diff/context first.
|
|
@@ -241,9 +242,11 @@ Each perspective was produced independently — they have NOT seen each other's
|
|
|
241
242
|
[Perspective B]
|
|
242
243
|
{Beta's full response}
|
|
243
244
|
|
|
244
|
-
[Perspective C]
|
|
245
|
+
[Perspective C]
|
|
246
|
+
{Gamma's full response}
|
|
245
247
|
|
|
246
|
-
[Perspective D]
|
|
248
|
+
[Perspective D]
|
|
249
|
+
{Delta's full response}
|
|
247
250
|
|
|
248
251
|
Evaluate ALL perspectives. Your review MUST include:
|
|
249
252
|
1. **Strongest argument** — which perspective and why (cite specific evidence)
|
|
@@ -427,7 +430,7 @@ evidence_map({ action: "gate", task_id: "add-user-api" }) → YIELD ✅
|
|
|
427
430
|
- **Surface conflicts.** If two patterns contradict, pick one (more recent / more tested). Explain why. Flag the other.
|
|
428
431
|
- **Checkpoint.** After every significant step, summarize what was done, what’s verified, what’s left.
|
|
429
432
|
- **Fail loud.** “Completed” is wrong if anything was skipped. Default to surfacing uncertainty.
|
|
430
|
-
`,"layered-knowledge-operating-policy":
|
|
433
|
+
`,"layered-knowledge-operating-policy":l({audience:`agent`}),"engineering-principles":`# Engineering Principles
|
|
431
434
|
|
|
432
435
|
> Operating constraints for code-writing agents. Violating these is a defect.
|
|
433
436
|
|
|
@@ -516,7 +519,7 @@ Reduces per-request token consumption by 40-70% (from ~85K to ~25-50K). Cache hi
|
|
|
516
519
|
- ALWAYS deposit findings BEFORE compressing
|
|
517
520
|
- Keep each step-summary under 2000 characters
|
|
518
521
|
- If a step produced errors or blockers, include those verbatim (do not compress)
|
|
519
|
-
- On completion: knowledge({action: flush, scope: flow:<run-id>})`},
|
|
522
|
+
- On completion: knowledge({action: flush, scope: flow:<run-id>})`},m={"execution-state":`# Execution State: {Task Title}
|
|
520
523
|
|
|
521
524
|
**Status:** PLANNING | IN_PROGRESS | REVIEW | COMPLETED | BLOCKED
|
|
522
525
|
**Started:** {timestamp}
|
|
@@ -568,4 +571,4 @@ Reduces per-request token consumption by 40-70% (from ~85K to ~25-50K). Cache hi
|
|
|
568
571
|
|
|
569
572
|
## Alternatives Considered
|
|
570
573
|
{Other approaches evaluated and why they were rejected - keeps the "why not" alongside the "why"}
|
|
571
|
-
`};export{
|
|
574
|
+
`};export{f as AIKIT_INSTALL_HINT_SECTION,c as LAYERED_KNOWLEDGE_OPERATING_POLICY,s as LAYERED_KNOWLEDGE_OPERATING_POLICY_VERSION,u as PLATFORM_OUTPUT_RULES_SECTION,p as PROTOCOLS,m as TEMPLATES,d as aiKitToolPreference,o as postTaskLesson,a as preTaskKnowledgeRecall,l as renderLayeredKnowledgeOperatingPolicyV1};
|
|
@@ -334,7 +334,7 @@ Spin up a fresh PostgreSQL container for each CI job.
|
|
|
334
334
|
|
|
335
335
|
### In-memory PostgreSQL (pg-mem)
|
|
336
336
|
|
|
337
|
-
|
|
337
|
+
pg-mem — in-memory PostgreSQL emulator for testing.
|
|
338
338
|
|
|
339
339
|
- Good, because better SQL compatibility than SQLite
|
|
340
340
|
- Good, because no infrastructure needed
|