@vpxa/aikit 0.1.380 → 0.1.382

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/package.json +1 -1
  2. package/packages/claude-desktop/dist/manifest.json +1 -1
  3. package/packages/cli/dist/index.js +3 -3
  4. package/packages/cli/dist/{init-BTsNYC02.js → init-DMj2ctyd.js} +1 -1
  5. package/packages/cli/dist/{templates-CRs_gkfS.js → templates-DLra78_O.js} +30 -30
  6. package/packages/server/dist/bin.js +2 -2
  7. package/packages/server/dist/{config-DZskEKrY.js → config-CQKoGfwD.js} +1 -1
  8. package/packages/server/dist/{config-Bz8Uyzuq.js → config-DX1KYSbN.js} +1 -1
  9. package/packages/server/dist/{curated-manager-CBKTmAjM.js → curated-manager-D4MOFQ-t.js} +1 -1
  10. package/packages/server/dist/{dashboard-static-NghHzTNh.js → dashboard-static-C6RP0VA7.js} +1 -1
  11. package/packages/server/dist/{dashboard-static-gAOiHHqI.js → dashboard-static-DdsIJd-u.js} +1 -1
  12. package/packages/server/dist/index.d.ts +1 -1
  13. package/packages/server/dist/index.js +2 -2
  14. package/packages/server/dist/{observations-CfglxBMB.js → observations-BhMmh4uj.js} +1 -1
  15. package/packages/server/dist/{observations-CrQU_HVm.js → observations-Cri43dvk.js} +1 -1
  16. package/packages/server/dist/register-tools-C49Lkpvq.js +3044 -0
  17. package/packages/server/dist/register-tools-i_1kjBhi.js +3043 -0
  18. package/packages/server/dist/{server-C43D7SrT.js → server-CTUxU4KX.js} +11 -11
  19. package/packages/server/dist/{server-BmVdf84Q.js → server-Dm2u4PSm.js} +11 -11
  20. package/packages/server/dist/{server-http-YQ9jxThI.js → server-http-D8Wemu8Y.js} +1 -1
  21. package/packages/server/dist/{server-http-BCpGwi0k.js → server-http-DcgFpWra.js} +1 -1
  22. package/packages/server/dist/{server-stdio-3hhuJU8B.js → server-stdio-Bpoo8KOT.js} +1 -1
  23. package/packages/server/dist/{server-stdio-CuLAgQjc.js → server-stdio-CskpvBew.js} +1 -1
  24. package/packages/server/dist/{settings-static-DcTUiqr7.js → settings-static-C0oT3Ctk.js} +1 -1
  25. package/packages/server/dist/{settings-static-PjpMR9Q7.js → settings-static-DVMG47Oh.js} +1 -1
  26. package/packages/server/dist/startup-maintenance-cbRSFMY5.js +21 -0
  27. package/packages/server/dist/startup-maintenance-kHH8tjds.js +20 -0
  28. package/packages/tools/dist/index.d.ts +23 -3
  29. package/packages/tools/dist/index.js +111 -105
  30. package/scaffold/dist/adapters/_shared.mjs +1 -1
  31. package/scaffold/dist/adapters/hermes.mjs +1 -1
  32. package/scaffold/dist/definitions/agents.mjs +1 -1
  33. package/scaffold/dist/definitions/bodies.mjs +21 -16
  34. package/scaffold/dist/definitions/exec-hooks.mjs +1 -1
  35. package/scaffold/dist/definitions/flows.mjs +5 -5
  36. package/scaffold/dist/definitions/hooks.mjs +1 -1
  37. package/scaffold/dist/definitions/protocols.mjs +26 -26
  38. package/scaffold/dist/definitions/skills/aikit.mjs +2 -152
  39. package/scaffold/dist/definitions/skills/browser-use.mjs +1 -1
  40. package/scaffold/dist/definitions/skills/c4-architecture.mjs +5 -5
  41. package/scaffold/dist/definitions/skills/docs.mjs +12 -10
  42. package/scaffold/dist/definitions/skills/multi-agents-development.mjs +4 -4
  43. package/scaffold/dist/definitions/skills/orchestrator.mjs +50 -8
  44. package/packages/server/dist/register-tools-Dgu64Px5.js +0 -3034
  45. package/packages/server/dist/register-tools-jgdif5r4.js +0 -3035
  46. package/packages/server/dist/startup-maintenance-B4xWqEjc.js +0 -20
  47. package/packages/server/dist/startup-maintenance-BnTozHs1.js +0 -21
@@ -1,4 +1,4 @@
1
- import{renderLayeredKnowledgeOperatingPolicyV1 as e}from"../definitions/protocols.mjs";function t(e){return e&&e[0].toLowerCase()+e.slice(1)}function n(){return[`## Workspace Skill`,``,`This project has an auto-generated workspace skill at`,"`<aikit-workspace>/skills/<workspace-name>/SKILL.md`.",``,`The skill tracks **conventions**, **known issues**, and **workflow tips**`,`specific to this codebase. Load it at session start by either:`,``,"1. Calling `status()` and checking the `workspace_skill` metadata field"," for the skill file path, then reading it with `read_file`.",`2. Reading the skill file directly if you know the workspace path.`,``,`The skill is auto-generated from the AI Kit knowledge store and updates`,`automatically when new facts are promoted. To contribute learnings, use`,"the `knowledge` tool — entries appear in the skill on next regeneration.",``,`**Deep-dive references** (per-topic, loaded on demand):`,"- `<skill-dir>/references/architecture.md` — deep architecture","- `<skill-dir>/references/known-issues.md` — recurring problems","- `<skill-dir>/references/workflow-tips.md` — optimization patterns","- `<skill-dir>/references/flow-<slug>.md` — active flow briefing",``].join(`
1
+ import{renderLayeredKnowledgeOperatingPolicyV1 as e}from"../definitions/protocols.mjs";function t(e){return e&&e[0].toLowerCase()+e.slice(1)}function n(){return[`## Workspace Skill`,``,`This project has an auto-generated workspace skill with project-specific`,`conventions, known issues, and workflow tips.`,``,`Load it at session start:`,``,"1. **Primary (guaranteed)**: Call `status({ includePrelude: true })` for a",` compact workspace-skill summary (fast, bounded, always available).`,"2. **Full content (conditional)**: Read `aikit://skill/SKILL.md` MCP resource.",` If the resource returns "not configured", use step 1 only.`,"3. **Do NOT use `read_file`** the skill is served via MCP resources or status prelude.",``,`The skill is auto-generated from the AI Kit knowledge store and updates`,`automatically when new facts are promoted. To contribute learnings, use`,"the `knowledge` tool — entries appear in the skill on next regeneration.",``,`**Deep-dive references** (per-topic, loaded on demand):`,"- `<skill-dir>/references/architecture.md` — deep architecture","- `<skill-dir>/references/known-issues.md` — recurring problems","- `<skill-dir>/references/workflow-tips.md` — optimization patterns","- `<skill-dir>/references/flow-<slug>.md` — active flow briefing",``].join(`
2
2
  `)}function r(e){return!e||e.length===0?``:`## Skills\n\n| Skill | When to load |\n|-------|--------------|\n${e.map(([e,t])=>`| ${e} | ${t} |`).join(`
3
3
  `)}`}function i({name:e,title:i,description:a,skills:o,bodyAddendum:s}){let c=r(o),l=n(),u=[`# ${e} - ${i||e}`,``,`> ${a}`,``,`You are the **${e}**, ${t(a)}.`];return s&&u.push(``,s.trim()),c&&u.push(``,c),u.push(``,l),u.push(``),u.join(`
4
4
  `)}function a({name:e,title:n,description:i,body:a,skills:o,additionalSections:s}){let c=[`### ${e} — ${n||e}`,``,`> ${i}`,``,`You are the **${e}**, ${t(i)}.`],l=[a,...s||[],r(o)].filter(Boolean).join(`
@@ -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{VARIANT_GROUPS as r,getPrimaryAgentModel as i}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s,TEMPLATES as c}from"../definitions/protocols.mjs";import{IDE_CAPABILITIES as l}from"../definitions/tools.mjs";import{buildAgentTable as u,buildCompactAgentTable as d,buildFlowSection as f,buildHooksSection as p,buildPromptSections as m,buildSkillsSection as h,injectOrchestratorDirective as g,lowerFirst as _}from"./_shared.mjs";import{generateHooks as v,getHookScriptFiles as y}from"./hooks.mjs";const b=f({flowTool:`flow`,isLifecycleOwner:!0}),x=f({flowTool:`flow`,isLifecycleOwner:!1});function S(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function C(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}const w={terminal:`terminal`,problems:`mcp_aikit_check`,readFile:`read_file`,lastCommand:`terminal`,subagent:`delegate_task`,createFile:`write_file`,editFiles:`patch`,rename:`write_file`,createDirectory:`terminal(mkdir)`,search:`search_files, mcp_aikit_search, mcp_aikit_find`,web:`web_search, web_extract, mcp_aikit_web_search, mcp_aikit_web_fetch`,todo:`todo`,memory:`memory`,newWorkspace:`terminal(cd)`,reviewPlan:`clarify`,askQuestions:`clarify`,resolveMemoryFileUri:`read_file`,runCommand:`terminal`,switchAgent:`delegate_task`,killTerminal:`process(kill)`,createTask:`todo`,terminalSel:`terminal`,fileSearch:`search_files`,listDir:`search_files(target=files)`,textSearch:`search_files(target=content)`,searchSubagent:`delegate_task`,browser:`mcp_aikit_browser, browser_navigate`};function T(e){let t=(l[e]||[]).map(e=>{let t=w[e];return t?t.split(`,`).map(e=>e.trim()):null}).filter(Boolean).flat();return`[${[...new Set(t),`aikit/*`].join(`, `)}]`}function E(e){return i(`hermes`,e,`Auto (hermes)`)}function D(e){let t=[[/`runSubagent`/g,"`delegate_task`"],[/`runSubagent\(/g,"`delegate_task("],[/\brunSubagent\b/g,`delegate_task`],[/`editFiles`/g,"`patch`"],[/`createFile`/g,"`write_file`"],[/`edit\/createFile`/g,"`write_file`"],[/`edit\/editFiles`/g,"`patch`"],[/`run_in_terminal`/g,"`terminal`"],[/`execute\/runInTerminal`/g,"`terminal`"],[/`execute\/killTerminal`/g,"`process(kill)`"],[/`grep_search`/g,"`search_files`"],[/`search\/codebase`/g,"`mcp_aikit_search`"],[/`search\/changes`/g,"`search_files`"],[/`search\/usages`/g,"`mcp_aikit_symbol` / `mcp_aikit_trace`"],[/`search\/textSearch`/g,"`search_files`"],[/`search\/searchSubagent`/g,"`delegate_task`"],[/`web\/fetch`/g,"`web_extract` / `mcp_aikit_web_fetch`"],[/`web\/githubRepo`/g,"`terminal(git ...)`"],[/`web\/webSearch`/g,"`web_search` / `mcp_aikit_web_search`"],[/`vscode\/memory`/g,"`memory`"],[/`vscode\/runCommand`/g,"`terminal`"],[/`vscode\/switchAgent`/g,"`delegate_task`"],[/`vscode\/newWorkspace`/g,"`terminal(cd)`"],[/`vscode\/reviewPlan`/g,"`clarify`"],[/`vscode\/askQuestions`/g,"`clarify`"],[/`vscode\/resolveMemoryFileUri`/g,"`read_file`"],[/`read\/readFile`/g,"`read_file`"],[/`read\/terminalLastCommand`/g,"`terminal`"],[/`read\/terminalSelection`/g,"`terminal`"],[/`read\/problems`/g,"`mcp_aikit_check`"],[/`agent\/runSubagent`/g,"`delegate_task`"],[/`execute\/createAndRunTask`/g,"`todo` / `delegate_task`"],[/`read_file` \(for understanding\)/g,"`read_file` (Hermes)"],[/(copilot)/g,`(hermes)`],[/runSubagent\(\{agentName:/g,`delegate_task({goal:`],[/runSubagent\(\{/g,`delegate_task({`]],n=e;for(let[e,r]of t)n=n.replace(e,r);return n}function O(){let t=u(e),r=d(e),i=m(o),s=[];for(let[t,n]of Object.entries(e)){let e=S(t,r);if(n.variants){for(let[r,i]of Object.entries(n.variants)){let a=`${t}-${r}`;s.push(k(a,{...n,description:i.description||n.description,identity:i.identity,bodyAddendum:i.bodyAddendum},e))}continue}s.push(k(t,n,e))}return g([`# 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 52 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.`,``,`## Workspace Skill`,``,`This project has an auto-generated workspace skill that tracks conventions, known issues,`,`and workflow tips for this specific codebase. Load it at session start:`,``,` skill_view('<workspace-name>')`,``,`The skill is named after your workspace (the project directory name).`,`It's auto-generated from the knowledge store and updates automatically.`,"If you discover something new about this workspace, store it via `knowledge` tool",`— it will appear in the skill on the next regeneration.`,``,"Use `skill_view(name, file_path)` for deep-dives into specific topics:","- `skill_view(name, 'references/architecture.md')` — deep architecture","- `skill_view(name, 'references/known-issues.md')` — recurring problems","- `skill_view(name, 'references/workflow-tips.md')` — optimization patterns","- `skill_view(name, 'references/flow-<slug>.md')` — active flow briefing",``,`## Available Tools (37)`,``,`AI Kit provides tools across the following categories:`,``,`| Category | Tools |`,`|----------|-------|`,"| **Search & Discovery** | `search`, `find`, `symbol`, `trace`, `scope_map`, `file_summary` |","| **Code Analysis** | `analyze`, `audit`, `graph`, `check` |","| **Context Compression** | `file_summary`, `digest` |","| **Memory & Knowledge** | `knowledge`, `remember`, `read`, `update`, `forget`, `list` |","| **FORGE Quality Gates** | `forge_ground`, `evidence_map` |","| **Development Workflows** | `flow`, `onboard`, `reindex`, `status`, `config` |","| **Testing & Build** | `test_run`, `parse_output`, `check`, `eval` |","| **Code Manipulation** | `rename`, `codemod`, `diff_parse`, `replay` |","| **Git** | `git` |","| **Session** | `session` |","| **Web & HTTP** | `web_search`, `web_fetch` |","| **Present & Visualize** | `present` |","| **Sandbox & Process** | `process`, `queue`, `restore`, `delegate` |","| **Utilities** | `measure`, `env` |","| **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`,``,s.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{VARIANT_GROUPS as r,getPrimaryAgentModel as i}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s,TEMPLATES as c}from"../definitions/protocols.mjs";import{IDE_CAPABILITIES as l}from"../definitions/tools.mjs";import{buildAgentTable as u,buildCompactAgentTable as d,buildFlowSection as f,buildHooksSection as p,buildPromptSections as m,buildSkillsSection as h,injectOrchestratorDirective as g,lowerFirst as _}from"./_shared.mjs";import{generateHooks as v,getHookScriptFiles as y}from"./hooks.mjs";const b=f({flowTool:`flow`,isLifecycleOwner:!0}),x=f({flowTool:`flow`,isLifecycleOwner:!1});function S(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function C(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}const w={terminal:`terminal`,problems:`mcp_aikit_check`,readFile:`read_file`,lastCommand:`terminal`,subagent:`delegate_task`,createFile:`write_file`,editFiles:`patch`,rename:`write_file`,createDirectory:`terminal(mkdir)`,search:`search_files, mcp_aikit_search, mcp_aikit_find`,web:`web_search, web_extract, mcp_aikit_web_search, mcp_aikit_web_fetch`,todo:`todo`,memory:`memory`,newWorkspace:`terminal(cd)`,reviewPlan:`clarify`,askQuestions:`clarify`,resolveMemoryFileUri:`read_file`,runCommand:`terminal`,switchAgent:`delegate_task`,killTerminal:`process(kill)`,createTask:`todo`,terminalSel:`terminal`,fileSearch:`search_files`,listDir:`search_files(target=files)`,textSearch:`search_files(target=content)`,searchSubagent:`delegate_task`,browser:`mcp_aikit_browser, browser_navigate`};function T(e){let t=(l[e]||[]).map(e=>{let t=w[e];return t?t.split(`,`).map(e=>e.trim()):null}).filter(Boolean).flat();return`[${[...new Set(t),`aikit/*`].join(`, `)}]`}function E(e){return i(`hermes`,e,`Auto (hermes)`)}function D(e){let t=[[/`runSubagent`/g,"`delegate_task`"],[/`runSubagent\(/g,"`delegate_task("],[/\brunSubagent\b/g,`delegate_task`],[/`editFiles`/g,"`patch`"],[/`createFile`/g,"`write_file`"],[/`edit\/createFile`/g,"`write_file`"],[/`edit\/editFiles`/g,"`patch`"],[/`run_in_terminal`/g,"`terminal`"],[/`execute\/runInTerminal`/g,"`terminal`"],[/`execute\/killTerminal`/g,"`process(kill)`"],[/`grep_search`/g,"`search_files`"],[/`search\/codebase`/g,"`mcp_aikit_search`"],[/`search\/changes`/g,"`search_files`"],[/`search\/usages`/g,"`mcp_aikit_symbol` / `mcp_aikit_trace`"],[/`search\/textSearch`/g,"`search_files`"],[/`search\/searchSubagent`/g,"`delegate_task`"],[/`web\/fetch`/g,"`web_extract` / `mcp_aikit_web_fetch`"],[/`web\/githubRepo`/g,"`terminal(git ...)`"],[/`web\/webSearch`/g,"`web_search` / `mcp_aikit_web_search`"],[/`vscode\/memory`/g,"`memory`"],[/`vscode\/runCommand`/g,"`terminal`"],[/`vscode\/switchAgent`/g,"`delegate_task`"],[/`vscode\/newWorkspace`/g,"`terminal(cd)`"],[/`vscode\/reviewPlan`/g,"`clarify`"],[/`vscode\/askQuestions`/g,"`clarify`"],[/`vscode\/resolveMemoryFileUri`/g,"`read_file`"],[/`read\/readFile`/g,"`read_file`"],[/`read\/terminalLastCommand`/g,"`terminal`"],[/`read\/terminalSelection`/g,"`terminal`"],[/`read\/problems`/g,"`mcp_aikit_check`"],[/`agent\/runSubagent`/g,"`delegate_task`"],[/`execute\/createAndRunTask`/g,"`todo` / `delegate_task`"],[/`read_file` \(for understanding\)/g,"`read_file` (Hermes)"],[/(copilot)/g,`(hermes)`],[/runSubagent\(\{agentName:/g,`delegate_task({goal:`],[/runSubagent\(\{/g,`delegate_task({`]],n=e;for(let[e,r]of t)n=n.replace(e,r);return n}function O(){let t=u(e),r=d(e),i=m(o),s=[];for(let[t,n]of Object.entries(e)){let e=S(t,r);if(n.variants){for(let[r,i]of Object.entries(n.variants)){let a=`${t}-${r}`;s.push(k(a,{...n,description:i.description||n.description,identity:i.identity,bodyAddendum:i.bodyAddendum},e))}continue}s.push(k(t,n,e))}return g([`# 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. Available tools vary by platform`,"and version run `list_tools` at session start to see the exact set. 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.`,``,`## Workspace Skill`,``,`This project has an auto-generated workspace skill that tracks conventions, known issues,`,`and workflow tips for this specific codebase. Load it at session start:`,``,` skill_view('<workspace-name>')`,``,`The skill is named after your workspace (the project directory name).`,`It's auto-generated from the knowledge store and updates automatically.`,"If you discover something new about this workspace, store it via `knowledge` tool",`— it will appear in the skill on the next regeneration.`,``,"Use `skill_view(name, file_path)` for deep-dives into specific topics:","- `skill_view(name, 'references/architecture.md')` — deep architecture","- `skill_view(name, 'references/known-issues.md')` — recurring problems","- `skill_view(name, 'references/workflow-tips.md')` — optimization patterns","- `skill_view(name, 'references/flow-<slug>.md')` — active flow briefing",``,`## Available Tools (37)`,``,`AI Kit provides tools across the following categories:`,``,`| Category | Tools |`,`|----------|-------|`,"| **Search & Discovery** | `search`, `find`, `symbol`, `trace`, `scope_map`, `file_summary` |","| **Code Analysis** | `analyze`, `audit`, `graph`, `check` |","| **Context Compression** | `file_summary`, `digest` |","| **Memory & Knowledge** | `knowledge`, `remember`, `read`, `update`, `forget`, `list` |","| **FORGE Quality Gates** | `forge_ground`, `evidence_map` |","| **Development Workflows** | `flow`, `onboard`, `reindex`, `status`, `config` |","| **Testing & Build** | `test_run`, `parse_output`, `check`, `eval` |","| **Code Manipulation** | `rename`, `codemod`, `diff_parse`, `replay` |","| **Git** | `git` |","| **Session** | `session` |","| **Web & HTTP** | `web_search`, `web_fetch` |","| **Present & Visualize** | `present` |","| **Sandbox & Process** | `process`, `queue`, `restore`, `delegate` |","| **Utilities** | `measure`, `env` |","| **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`,``,s.join(`
2
2
  `),``,`## Prompts`,``,i,``,b,``,`## Session Protocol`,``,p(n,a.hermes),``]).join(`
3
3
  `)}function k(e,t,n){let r=C(t),i=h(t.skills),a=e===`Orchestrator`?b:x,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
4
4
 
@@ -26,4 +26,4 @@ ${e(o)}
26
26
  ${s}
27
27
  ${c}`}}const i={Orchestrator:{title:`The Master Conductor`,description:`Master conductor that orchestrates the full development lifecycle: Planning → Implementation → Review → Recovery → Commit`,argumentHint:null,toolRole:`orchestrator`,sharedBase:null,category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit recall, flow status, search, and ctx ref reuse`],[`multi-agents-development`,`Before delegation — decomposition, dispatch envelope, review pipeline`],[`present`,`For plans, reviews, evidence maps, approvals, and non-tiny user output`],[`brainstorming`,`For design forks, trade-offs, or creative requirements`],[`requirements-clarity`,`For vague, large, or cross-team requirements before planning`],[`c4-architecture`,`For architecture diagrams, boundary questions, or structure docs`],[`adr-skill`,`For non-trivial technical decisions and ADR lifecycle`],[`docs`,`For docs-sync, durable docs, PRDs, tours, and architecture docs`],[`lesson-learned`,`After implementation/review work — persist reusable engineering lessons`],[`session-handoff`,`When context pressure rises or work must pause/resume`],[`repo-access`,`For private/self-hosted repo access failures`],[`browser-use`,`For browser auth, JS-rendered pages, visual verification, web automation`]],subagentConstraints:["Do NOT use the `present` tool — return all findings as structured text.","Do NOT call `get_changed_files` — it returns ALL uncommitted diffs (100K+ tokens). Use `git diff <file>` if needed.",`No flow advancement. Only Orchestrator advances the flow.`,"Return status: `DONE` | `DONE_WITH_CONCERNS` | `NEEDS_CONTEXT` | `BLOCKED`. ≤200 words for normal status; full detail only if BLOCKED.",`Stay inside assigned files and boundary. Do not modify files outside scope.`,"Respect `readonly: true|false` flag in dispatch envelope. When readonly=true, do NOT modify files. When readonly=false, follow normal file-modification scope."]},Planner:{title:`The Strategic Architect`,description:`Autonomous planner that researches codebases and writes comprehensive TDD implementation plans`,compactRole:`TDD implementation plans`,argumentHint:null,toolRole:`planner`,sharedBase:`code-agent-base`,sharedProtocols:[`thinking-principles`,`planning-principles`,`layered-knowledge-operating-policy`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit reading plans, recall, and compressed context reuse`],[`multi-agents-development`,`For decomposition, dependency batches, and dispatch envelopes`],[`brainstorming`,`For new feature/behavior planning and design alternatives`],[`requirements-clarity`,`For vague or large requirements before planning`],[`present`,`For plan, dependency graph, risk matrix, and approval display`],[`c4-architecture`,`For architecture changes and C4 diagrams`],[`adr-skill`,`For non-trivial technical decisions and ADRs`],[`session-handoff`,`For context pressure or session end`],[`repo-access`,`For private or self-hosted repo access`],[`browser-use`,`For auth recovery or browser workflows`]]},Implementer:{title:`The Code Builder`,description:`Persistent implementation agent that writes code following TDD practices until all tasks are complete`,compactRole:`New features, wire up, build`,argumentHint:`Implementation task, feature, or phase from plan`,toolRole:`codeAgent`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`react`,`When implementing React components, hooks, or pages`],[`lesson-learned`,`After completing non-obvious implementation work`]]},Frontend:{title:`The UI Specialist`,description:`UI/UX specialist for React, styling, responsive design, and frontend implementation`,compactRole:`UI/UX, React, styling, responsive`,argumentHint:`UI component, styling task, or frontend feature`,toolRole:`codeAgent`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`react`,`When building React components — hooks, patterns, Server Components`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`frontend-design`,`When implementing UI/UX — design systems, accessibility, responsive patterns`],[`browser-use`,`When visual/browser verification is needed`],[`lesson-learned`,`After completing non-obvious frontend implementation work`]]},Refactor:{title:`The Code Sculptor`,description:`Code refactoring specialist that improves structure, readability, and maintainability`,compactRole:`Cleanup, simplify, DRY, extract`,argumentHint:`Code, component, or pattern to refactor`,toolRole:`refactor`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When refactoring TypeScript code — type patterns, generics, utility types`],[`lesson-learned`,`After completing refactor — extract principles from before/after diff`]]},Debugger:{title:`The Problem Solver`,description:`Expert debugger that diagnoses issues, traces errors, and provides solutions using AI Kit traces and compressed context before raw file reads`,compactRole:`Bug diagnosis, error tracing`,argumentHint:`Error message, stack trace, or description of issue`,toolRole:`debugger`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`browser-use`,`For browser/UI reproduction loops and JS-rendered failures`],[`repo-access`,`When debugging depends on private or enterprise repo access`],[`lesson-learned`,`After a non-obvious root cause or fix`]]},Security:{title:`The Vulnerability Hunter`,description:`Security specialist that analyzes code for vulnerabilities and compliance`,compactRole:`Vulnerability analysis, auth hardening`,argumentHint:`Code, feature, or component to security review`,toolRole:`security`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing code — security patterns, type safety`],[`repo-access`,`When security review requires private/enterprise repo access`],[`browser-use`,`When reviewing browser auth, sessions, cookies, or web security flows`]]},Documenter:{title:`The Knowledge Keeper`,description:`Documentation specialist that creates and maintains comprehensive project documentation`,compactRole:`Project documentation`,argumentHint:`Component, API, feature, or area to document`,toolRole:`documenter`,sharedBase:`code-agent-base`,sharedProtocols:[`thinking-principles`,`documentation-principles`,`layered-knowledge-operating-policy`],category:`documentation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`docs`,`When creating or updating project documentation — docs/ convention, architecture blueprints, Diátaxis framework`],[`present`,`When presenting documentation previews or architecture visuals to the user`],[`c4-architecture`,`When documenting architecture, containers, components, or deployment`],[`adr-skill`,`When docs involve technical decisions or ADR updates`],[`typescript`,`When documenting TypeScript APIs, public types, or generated docs`],[`session-handoff`,`When docs work spans sessions or context pressure rises`]]},Explorer:{title:`The Rapid Scout`,description:`Rapid codebase exploration to find files, usages, dependencies, and structural context`,compactRole:`Rapid codebase navigation`,argumentHint:`Find files, usages, and context related to: {topic or goal}`,toolRole:`explorer`,sharedBase:null,sharedProtocols:[`thinking-principles`,`layered-knowledge-operating-policy`],category:`exploration`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`]]},Researcher:{title:`The Context Gatherer`,description:`Deep analysis, architecture review, and multi-model decision protocol participant`,compactRole:`Multi-model deep research`,argumentHint:`Research question, problem statement, or subsystem to investigate`,toolRole:`researcher`,sharedBase:`researcher-base`,sharedProtocols:[`thinking-principles`,`layered-knowledge-operating-policy`],category:`research`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`lesson-learned`,`When analyzing past changes to extract engineering principles`],[`c4-architecture`,`When researching system architecture — produce C4 diagrams`],[`adr-skill`,`When the research involves a technical decision — draft an ADR`],[`repo-access`,`When research needs private or enterprise repository access`],[`browser-use`,`When web research needs login, JS rendering, or browser automation`]],variants:{Alpha:n({description:`Primary deep research agent — also serves as default Researcher`,lensName:`Contrarian`,lensDescription:`deep research`,lensPrompt:`actively look for flaws, fatal assumptions, and hidden risks in every approach. The best ideas survive adversarial pressure.`,identityIntro:`, the primary deep research agent. During multi-model decision sessions, you provide deep reasoning and nuanced system design.`,requiredOutputSection:`Depth Analysis`,requiredOutputItems:[`Deep-dive into ONE chosen subsystem (most structurally central to the question)`,`Full evidence chain: file:line citations for every structural claim`,"At least 2 `file_summary` extracts woven into the narrative"],focusAreas:[`For every proposed approach, actively seek the fatal flaw or hidden assumption`,`Ask: "Under what conditions does this approach fail catastrophically?"`,`Prefer uncomfortable truths over comfortable consensus`],variantSummary:`You are the DEFAULT researcher. When the Orchestrator needs breadth + depth, they
28
28
  dispatch you alone. Your lens: thorough, evidence-first, exhaustive + contrarian.`}),Beta:n({description:`Research variant — pragmatic analysis with focus on trade-offs and edge cases`,lensName:`First Principles`,lensDescription:`pragmatic analysis`,lensPrompt:`strip away assumptions, decompose to ground truths, and rebuild reasoning from scratch.`,identityIntro:`, a variant of the Researcher agent optimized for **pragmatic analysis**. Focus on trade-offs, edge cases, and practical constraints. Challenge assumptions and highlight risks the primary researcher may overlook.`,requiredOutputSection:`Failure Modes & Counter-Evidence`,requiredOutputItems:[`At least 3 adversarial claims challenging your own primary finding`,`For each counter-claim: the condition under which it would be TRUE, and the
29
- evidence (file:line or search receipt) that currently falsifies it`,"Any unresolved counter-evidence flagged as `⚠ UNRESOLVED`"],focusAreas:[`Strip every assumption: "Is this truly required, or just inherited convention?"`,`Decompose to ground truths, then rebuild the reasoning from scratch`,`If the current approach exists only because "that's how it's always been done", flag it`],variantSummary:"Your lens: pragmatic skepticism + first principles. Mark competing claims as `A` (Assumed)\nby default; challenge before promoting to `V`."}),Gamma:n({description:`Research variant — broad pattern matching across domains and technologies`,lensName:`Expansionist`,lensDescription:`cross-domain pattern matching`,lensPrompt:`look for the bigger opportunity, find what's undervalued, and identify patterns others dismiss.`,identityIntro:`, a variant of the Researcher agent optimized for **cross-domain pattern matching**. Draw connections from other domains, frameworks, and industries. Bring breadth where Alpha brings depth.`,requiredOutputSection:`Cross-Domain Analogies`,requiredOutputItems:[`At least 2 patterns from other tools/frameworks/domains that apply to the question`,"For each: the external source (cite via `web_search` or `web_fetch` receipt) and\n how it maps to our codebase",`One "missing pattern we should adopt" recommendation`],focusAreas:[`Ask: "What's the bigger opportunity everyone else is ignoring?"`,`Seek undervalued approaches and non-obvious connections across domains`,`Challenge narrow framing: "Is this really just an X problem, or is it also a Y problem?"`],variantSummary:"Your lens: cross-domain pattern matching + expansionist. Weight `web_search` + `web_fetch`\nhigher than peers. Assume the LLM's training data is stale — verify with fresh searches."}),Delta:n({description:`Research variant — implementation feasibility and performance implications`,lensName:`Executor`,lensDescription:`implementation feasibility`,lensPrompt:`focus on what can actually be built, the fastest path to value, and real-world constraints.`,identityIntro:`, a variant of the Researcher agent optimized for **implementation feasibility**. Focus on performance implications, scaling concerns, and concrete implementation paths. Ground theoretical proposals in practical reality.`,requiredOutputSection:`Implementation Cost & Feasibility`,requiredOutputItems:["Complexity snapshot: you MUST call `measure({ path })` on any file ≥ 50 LOC in the\n target subsystem at least once and quote the `cognitiveComplexity` result","Blast radius estimate: `blast_radius({ changed_files })` on the proposed edits",`Time/risk table: | Change | Lines | Risk | Effort |`,`Feasibility verdict: SAFE / RISKY / INFEASIBLE with one-line justification`],focusAreas:[`Ask: "Can this actually be built? What's the fastest path to a working version?"`,`Ground every proposal in concrete effort: lines of code, files changed, risk`,`Reject elegant theory that can't survive contact with the codebase`],variantSummary:'Your lens: implementation feasibility + executor. Prefer `measure` + `blast_radius` +\n`analyze({ items: [{aspect: "patterns", ...}] })` over abstract reasoning.'})}},"Code-Reviewer":{title:`The Quality Guardian`,description:`Code review specialist analyzing code for quality, security, performance, and maintainability`,compactRole:`Dual-perspective code review`,argumentHint:`File path, PR, or code to review`,toolRole:`reviewer`,sharedBase:`code-reviewer-base`,sharedProtocols:[`thinking-principles`,`review-principles`,`layered-knowledge-operating-policy`],category:`review`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing TypeScript code — type patterns, best practices`],[`lesson-learned`,`When review exposes a reusable engineering lesson`]],variants:{Alpha:r({roleName:`Code-Reviewer`,description:`Primary code reviewer`,lensName:`Compliance & Red-Team`,lensDescription:`compliance and red-teaming`,lensPrompt:`you hunt for correctness bugs, security holes, and contract violations that will break in production.`,identityIntro:`, the primary Code-Reviewer agent.`,focusAreas:[`**Correctness** — Logic errors, race conditions, null/undefined paths, off-by-one`,`**Security** — OWASP Top 10, input validation, secrets, injection vectors`,`**Contract compliance** — Does this honor its type signatures, API contracts, and invariants?`,`**Error handling** — What happens on the unhappy path? Missing try/catch, swallowed errors`],instinct:`Your instinct: "How does this break?" Think like an attacker and a pessimist.`,closing:`When in doubt, flag it — false positives are cheaper than missed bugs in production.`}),Beta:r({roleName:`Code-Reviewer`,description:`Code reviewer variant — different LLM perspective for dual review`,lensName:`Quality & Engineering Excellence`,lensDescription:`quality and engineering excellence`,lensPrompt:`you focus on maintainability, performance, testing, and whether the code will age well.`,identityIntro:`, the secondary Code-Reviewer agent.`,focusAreas:[`**Maintainability** — Naming clarity, single responsibility, cognitive complexity, DRY`,`**Performance** — N+1 queries, unnecessary allocations, missing caching, O(n²) where O(n) suffices`,`**Testing** — Coverage for new/changed logic, edge cases, test readability`,`**Patterns** — Consistency with existing codebase conventions, idiomatic usage`],instinct:`Your instinct: "Will a new team member understand this in 6 months?" Think like a mentor.`,closing:`Prefer actionable suggestions over vague concerns. Show the better version when possible.`})}},"Architect-Reviewer":{title:`The Structural Guardian`,description:`Reviews architecture for pattern adherence, SOLID compliance, dependency direction, and structural integrity`,compactRole:`Architecture review`,argumentHint:`Files, PR, or subsystem to architecture-review`,toolRole:`reviewer`,sharedBase:`architect-reviewer-base`,sharedProtocols:[`thinking-principles`,`review-principles`,`layered-knowledge-operating-policy`],category:`review`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`c4-architecture`,`When reviewing architectural diagrams or boundary changes`],[`adr-skill`,`When the review involves architecture decisions — reference or create ADRs`],[`docs`,`When architecture review should update durable documentation`]],extraBody:`You are **not** the Code-Reviewer agent. Code-Reviewer handles correctness, testing, security, and code quality. You handle the big picture: service boundaries, dependency direction, pattern adherence, and structural health.`,variants:{Alpha:r({roleName:`Architect-Reviewer`,description:`Primary architecture reviewer`,lensName:`Structural Prosecutor`,lensDescription:`structural prosecution`,lensPrompt:`you challenge architectural choices, find boundary violations, and test whether the design survives growth.`,identityIntro:`, the primary Architect-Reviewer agent.`,focusHeading:`Your primary focus areas:`,focusAreas:[`**Boundary violations** — Does this cross package/module boundaries it shouldn't?`,`**Dependency direction** — Are dependencies flowing inward? Any layer leakage?`,`**Hidden coupling** — Shared mutable state, implicit contracts, temporal coupling`,`**Scalability stress** — What breaks at 10x load, 10x data, 10x features?`],instinct:`Your instinct: "This design will fail when..." Challenge every architectural assumption.`,closing:`If a boundary is crossed, require justification or block.`}),Beta:r({roleName:`Architect-Reviewer`,description:`Architecture reviewer variant — different LLM perspective for dual review`,lensName:`Pragmatic Defense`,lensDescription:`pragmatic defense`,lensPrompt:`you evaluate whether the architecture is proportional to the problem, and defend reasonable trade-offs.`,identityIntro:`, the secondary Architect-Reviewer agent.`,focusHeading:`Your primary focus areas:`,focusAreas:[`**Proportionality** — Is the architecture proportional to the problem? Over-engineering is a defect.`,`**Trade-off validity** — Are the trade-offs explicitly acknowledged and reasonable?`,`**Migration path** — Can this evolve without a rewrite? Is there a clear upgrade path?`,`**Team ergonomics** — Can the team actually maintain this? Does it match their skills?`],instinct:`Your instinct: "Is this the simplest architecture that solves the actual problem?"`,closing:`Push back on unnecessary complexity. Defend working solutions against premature abstraction.`})}}};export{i as AGENTS};
29
+ evidence (file:line or search receipt) that currently falsifies it`,"Any unresolved counter-evidence flagged as `⚠ UNRESOLVED`"],focusAreas:[`Strip every assumption: "Is this truly required, or just inherited convention?"`,`Decompose to ground truths, then rebuild the reasoning from scratch`,`If the current approach exists only because "that's how it's always been done", flag it`],variantSummary:"Your lens: pragmatic skepticism + first principles. Mark competing claims as `A` (Assumed)\nby default; challenge before promoting to `V`."}),Gamma:n({description:`Research variant — broad pattern matching across domains and technologies`,lensName:`Expansionist`,lensDescription:`cross-domain pattern matching`,lensPrompt:`look for the bigger opportunity, find what's undervalued, and identify patterns others dismiss.`,identityIntro:`, a variant of the Researcher agent optimized for **cross-domain pattern matching**. Draw connections from other domains, frameworks, and industries. Bring breadth where Alpha brings depth.`,requiredOutputSection:`Cross-Domain Analogies`,requiredOutputItems:[`At least 2 patterns from other tools/frameworks/domains that apply to the question`,"For each: the external source (cite via `web_search` or `web_fetch` receipt) and\n how it maps to our codebase",`One "missing pattern we should adopt" recommendation`],focusAreas:[`Ask: "What's the bigger opportunity everyone else is ignoring?"`,`Seek undervalued approaches and non-obvious connections across domains`,`Challenge narrow framing: "Is this really just an X problem, or is it also a Y problem?"`],variantSummary:"Your lens: cross-domain pattern matching + expansionist. Weight `web_search` + `web_fetch`\nhigher than peers. Assume the LLM's training data is stale — verify with fresh searches."}),Delta:n({description:`Research variant — implementation feasibility and performance implications`,lensName:`Executor`,lensDescription:`implementation feasibility`,lensPrompt:`focus on what can actually be built, the fastest path to value, and real-world constraints.`,identityIntro:`, a variant of the Researcher agent optimized for **implementation feasibility**. Focus on performance implications, scaling concerns, and concrete implementation paths. Ground theoretical proposals in practical reality.`,requiredOutputSection:`Implementation Cost & Feasibility`,requiredOutputItems:["Complexity snapshot: you MUST call `measure({ path })` on any file ≥ 50 LOC in the\n target subsystem at least once and quote the `cognitiveComplexity` result","Blast radius estimate: `blast_radius({ files })` on the proposed edits",`Time/risk table: | Change | Lines | Risk | Effort |`,`Feasibility verdict: SAFE / RISKY / INFEASIBLE with one-line justification`],focusAreas:[`Ask: "Can this actually be built? What's the fastest path to a working version?"`,`Ground every proposal in concrete effort: lines of code, files changed, risk`,`Reject elegant theory that can't survive contact with the codebase`],variantSummary:'Your lens: implementation feasibility + executor. Prefer `measure` + `blast_radius` +\n`analyze({ items: [{aspect: "patterns", ...}] })` over abstract reasoning.'})}},"Code-Reviewer":{title:`The Quality Guardian`,description:`Code review specialist analyzing code for quality, security, performance, and maintainability`,compactRole:`Dual-perspective code review`,argumentHint:`File path, PR, or code to review`,toolRole:`reviewer`,sharedBase:`code-reviewer-base`,sharedProtocols:[`thinking-principles`,`review-principles`,`layered-knowledge-operating-policy`],category:`review`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing TypeScript code — type patterns, best practices`],[`lesson-learned`,`When review exposes a reusable engineering lesson`]],variants:{Alpha:r({roleName:`Code-Reviewer`,description:`Primary code reviewer`,lensName:`Compliance & Red-Team`,lensDescription:`compliance and red-teaming`,lensPrompt:`you hunt for correctness bugs, security holes, and contract violations that will break in production.`,identityIntro:`, the primary Code-Reviewer agent.`,focusAreas:[`**Correctness** — Logic errors, race conditions, null/undefined paths, off-by-one`,`**Security** — OWASP Top 10, input validation, secrets, injection vectors`,`**Contract compliance** — Does this honor its type signatures, API contracts, and invariants?`,`**Error handling** — What happens on the unhappy path? Missing try/catch, swallowed errors`],instinct:`Your instinct: "How does this break?" Think like an attacker and a pessimist.`,closing:`When in doubt, flag it — false positives are cheaper than missed bugs in production.`}),Beta:r({roleName:`Code-Reviewer`,description:`Code reviewer variant — different LLM perspective for dual review`,lensName:`Quality & Engineering Excellence`,lensDescription:`quality and engineering excellence`,lensPrompt:`you focus on maintainability, performance, testing, and whether the code will age well.`,identityIntro:`, the secondary Code-Reviewer agent.`,focusAreas:[`**Maintainability** — Naming clarity, single responsibility, cognitive complexity, DRY`,`**Performance** — N+1 queries, unnecessary allocations, missing caching, O(n²) where O(n) suffices`,`**Testing** — Coverage for new/changed logic, edge cases, test readability`,`**Patterns** — Consistency with existing codebase conventions, idiomatic usage`],instinct:`Your instinct: "Will a new team member understand this in 6 months?" Think like a mentor.`,closing:`Prefer actionable suggestions over vague concerns. Show the better version when possible.`})}},"Architect-Reviewer":{title:`The Structural Guardian`,description:`Reviews architecture for pattern adherence, SOLID compliance, dependency direction, and structural integrity`,compactRole:`Architecture review`,argumentHint:`Files, PR, or subsystem to architecture-review`,toolRole:`reviewer`,sharedBase:`architect-reviewer-base`,sharedProtocols:[`thinking-principles`,`review-principles`,`layered-knowledge-operating-policy`],category:`review`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`c4-architecture`,`When reviewing architectural diagrams or boundary changes`],[`adr-skill`,`When the review involves architecture decisions — reference or create ADRs`],[`docs`,`When architecture review should update durable documentation`]],extraBody:`You are **not** the Code-Reviewer agent. Code-Reviewer handles correctness, testing, security, and code quality. You handle the big picture: service boundaries, dependency direction, pattern adherence, and structural health.`,variants:{Alpha:r({roleName:`Architect-Reviewer`,description:`Primary architecture reviewer`,lensName:`Structural Prosecutor`,lensDescription:`structural prosecution`,lensPrompt:`you challenge architectural choices, find boundary violations, and test whether the design survives growth.`,identityIntro:`, the primary Architect-Reviewer agent.`,focusHeading:`Your primary focus areas:`,focusAreas:[`**Boundary violations** — Does this cross package/module boundaries it shouldn't?`,`**Dependency direction** — Are dependencies flowing inward? Any layer leakage?`,`**Hidden coupling** — Shared mutable state, implicit contracts, temporal coupling`,`**Scalability stress** — What breaks at 10x load, 10x data, 10x features?`],instinct:`Your instinct: "This design will fail when..." Challenge every architectural assumption.`,closing:`If a boundary is crossed, require justification or block.`}),Beta:r({roleName:`Architect-Reviewer`,description:`Architecture reviewer variant — different LLM perspective for dual review`,lensName:`Pragmatic Defense`,lensDescription:`pragmatic defense`,lensPrompt:`you evaluate whether the architecture is proportional to the problem, and defend reasonable trade-offs.`,identityIntro:`, the secondary Architect-Reviewer agent.`,focusHeading:`Your primary focus areas:`,focusAreas:[`**Proportionality** — Is the architecture proportional to the problem? Over-engineering is a defect.`,`**Trade-off validity** — Are the trade-offs explicitly acknowledged and reasonable?`,`**Migration path** — Can this evolve without a rewrite? Is there a clear upgrade path?`,`**Team ergonomics** — Can the team actually maintain this? Does it match their skills?`],instinct:`Your instinct: "Is this the simplest architecture that solves the actual problem?"`,closing:`Push back on unnecessary complexity. Defend working solutions against premature abstraction.`})}}};export{i as AGENTS};
@@ -7,8 +7,9 @@ ${t.map((e,t)=>` ${t+1}. ${e}`).join(`
7
7
  Execute these MCP calls at session start, before ANY other work:
8
8
 
9
9
  1. \`mcp__aikit__flow({ action: 'status' })\` — Check active flow state.
10
- 2. \`mcp__aikit__status({ includePrelude: true })\` — Load L0 workspace context (compact summary).
11
- 3. If workspaceCore is null → \`mcp__aikit__onboard({ path: "." })\` first, then status again.
10
+ 2. \`mcp__aikit__status({ includePrelude: true })\` — Load workspace skill + onboard context.
11
+ 3. If \`onboarded\` is false or \`onboard_context\` is null → \`mcp__aikit__onboard({ path: ".", mode: "generate" })\` first, then status again.
12
+ 4. If \`onboard_context.freshness.status\` is \`stale\` or \`unknown\`, or \`nextAction.kind === "update_onboard"\` → \`mcp__aikit__onboard({ path: ".", update: true })\` first, then status again.
12
13
 
13
14
  **Failure to execute these before any other action is a protocol violation.**
14
15
 
@@ -34,9 +35,13 @@ Auto-clarity exception: use fuller prose for security warnings, irreversible con
34
35
 
35
36
  When dispatching subagents, include this line: "Communication style: terse like smart caveman; technical substance intact; no filler; auto-clarity exception for security/irreversible/misread-prone sequences."
36
37
 
38
+ ## User-Facing Presentation
39
+
40
+ Use \`present({ schemaVersion: 1, title, blocks })\` for almost every substantive user response. If the response is more than 3 sentences, contains a list/table/checklist/plan/status/verdict/summary/progress/evidence map, or asks for approval/choice, use \`present\`. Prefer \`present\` even without actions for read-only summaries; add \`actions\` for approvals, confirmations, and selections. Plain text only for tiny status updates or one simple question that fits in 3 short sentences.
41
+
37
42
  ## Bootstrap
38
- 1. status({ includePrelude: true }) -> onboard({ path: "." }) if needed.
39
- 1a. For flow dispatch: status({ includePrelude: true }) → if onboard missing or workspace stale, onboard({ path: ".", update: true }) before any subagent dispatch.
43
+ 1. status({ includePrelude: true }) -> onboard({ path: ".", mode: "generate" }) if missing.
44
+ 1a. For flow dispatch: status({ includePrelude: true }) → if \`onboard_context\` missing, generate onboard; if \`onboard_context.freshness.status\` is \`stale\` or \`unknown\`, run onboard({ path: ".", update: true }) before any subagent dispatch.
40
45
  2. Apply layered knowledge protocol (see below).<!-- layered-header -->
41
46
  3. search({ query: "SESSION CHECKPOINT", origin: "curated" }) before planning.
42
47
  5. Load skills by trigger: aikit always; multi-agents-development before delegation; present before non-tiny output (preferBrowser=true by default; set preferBrowser:false for inline rendering — auto-falls back to browser if client doesn't support inline); brainstorming for design decisions.
@@ -70,7 +75,7 @@ Classify each step by agent role:
70
75
  For Mixed flows, each step inherits classification from its dispatched agent. Write-capable agents get \`readonly: false\`; all others \`readonly: true\`.
71
76
 
72
77
  ### Pre-Dispatch Staleness Check
73
- Before dispatching a write-capable agent, run \`status({ includePrelude: true })\` to verify onboard freshness. If workspace structure changed since last onboard (new/deleted/modified files), run \`onboard({ path: ".", update: true })\` first. Read-only dispatches skip this check (0 token cost). The \`readonly\` flag is a contractual convention, not runtime enforcement — subagents retain full MCP tool access.
78
+ Before dispatching a write-capable agent, run \`status({ includePrelude: true })\` to verify onboard freshness. If \`onboard_context\` is missing, generate it; if \`onboard_context.freshness.status\` is \`stale\` or \`unknown\`, run \`onboard({ path: ".", update: true })\` first. Read-only dispatches skip this check (0 token cost). The \`readonly\` flag is a contractual convention, not runtime enforcement — subagents retain full MCP tool access.
74
79
 
75
80
  ## Protocol Coverage Map
76
81
  - conversation-compression: before each dispatch batch, withdraw/profile context; after each batch, deposit status/files/decisions/blockers; never echo raw subagent output.
@@ -107,16 +112,16 @@ Every \`runSubagent\` prompt includes all of:
107
112
 
108
113
  1. **Agent + Goal** — exact specialist name, testable acceptance criteria.
109
114
  2. **Files + Boundary** — target files, do-not-touch list.
110
- 3. **Arch Context** — Pre-compress with AI Kit tools before including in prompt. pick by token budget: efficient → \`file_summary\` (T1=structure, T2=content), full → \`digest\`. Default efficient. **Never pass raw file contents — always compress first.** This eliminates subagent need for \`read_file\`.
115
+ 3. **Arch Context** — Pre-compress with AI Kit tools before including in prompt. pick by token budget: efficient → \`file_summary\` (T1=structure, T2=content), full → \`digest\`. Default efficient. **Never pass raw file contents — always compress first.** This eliminates subagent need for \`read_file\`.
111
116
  4. **Prior Knowledge** — \`knowledge({ action: "lesson", subAction: "list-lessons", topic: "<2-3 keywords>", minConfidence: 70 })\` + \`search({ query: "<task area>", category: "conventions", limit: 3 })\`. Include high-confidence results. Skip for Floor.
112
117
  5. **Artifacts Path** — active flow's run dir / artifacts path from \`flow({ action: 'status' })\`.
113
118
  6. **FORGE** — tier (from forge_classify), task_id, evidence requirements. Pass tier directly; Documenter/SKILL.md maps tier to docs generation depth internally. Reviewers add CRITICAL/HIGH claims into your task_id; never create their own.
114
- 7. **Flow Context** — "Call \`knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })\` as your FIRST action. Reuse withdrawn refs and L0 card refs before broad retrieval. Do NOT independently reload workspace-core or architecture cards when dispatch already carries applicable refs."
115
- 8. ${i().replace(/\n/g,`
119
+ 7. **Flow Context** — "Call \`knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })\` as your FIRST action. Reuse withdrawn refs plus supplied workspace skill/onboard context before broad retrieval. Do NOT independently rediscover repo basics when dispatch already carries applicable refs."
120
+ 8. ${i().replace(/\n/g,`
116
121
  `)}
117
- 9. **Self-Review** — checklist before declaring status: scope respected? tests pass? conventions followed?
118
- 10. **Return contract** — \`DONE\` | \`DONE_WITH_CONCERNS\` | \`NEEDS_CONTEXT\` | \`BLOCKED\`. ≤200 words: status, files, decisions. Full detail only if BLOCKED.
119
- 11. **Read-Only Mode** — \`readonly: true|false\`. Controls whether agent may modify files. Derived from flow type + step classification. Write-capable agents (Implementer, Refactor, Frontend, Debugger) receive \`false\`; all others \`true\`. Contractual convention — no runtime enforcement.
122
+ 9. **Self-Review** — checklist before declaring status: scope respected? tests pass? conventions followed?
123
+ 10. **Return contract** — \`DONE\` | \`DONE_WITH_CONCERNS\` | \`NEEDS_CONTEXT\` | \`BLOCKED\`. ≤200 words: status, files, decisions. Full detail only if BLOCKED.
124
+ 11. **Read-Only Mode** — \`readonly: true|false\`. Controls whether agent may modify files. Derived from flow type + step classification. Write-capable agents (Implementer, Refactor, Frontend, Debugger) receive \`false\`; all others \`true\`. Contractual convention — no runtime enforcement.
120
125
 
121
126
  Always pass \`agentName\`. Missing/empty is a dispatch bug.
122
127
 
@@ -126,7 +131,7 @@ Always pass \`agentName\`. Missing/empty is a dispatch bug.
126
131
 
127
132
  | Need | Use |
128
133
  |------|-----|
129
- | L0 session briefing | \`status({ includePrelude: true })\` — workspace-core available after \`onboard()\`. Flow card via flow context. |
134
+ | Workspace session context | \`status({ includePrelude: true })\` — workspace skill + onboard context available after \`onboard()\`. Flow context via L1 withdrawal. |
130
135
  | Assess scope before dispatch | \`file_summary\` |
131
136
  | Pre-populate subagent with context | \`file_summary\` |
132
137
  | L1 flow withdrawal | \`knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })\` — reuse before broad retrieval |
@@ -134,14 +139,14 @@ Always pass \`agentName\`. Missing/empty is a dispatch bug.
134
139
  | L3 evidence/provenance | \`search({ query })\` + \`knowledge({ action: 'lesson' })\` — focused retrieval only |
135
140
  | Understand error during emergency | \`file_summary({ files, tier: 'T2', query })\` — never raw-read |
136
141
  | Between phases: compress state | \`session_digest({ persist: true, focus: "<topic>" })\` |
137
- | After batch: persist summary | \`knowledge({ action: 'remember', scope: 'flow', ... })\` |
142
+ | After batch: persist summary | \`knowledge({ action: 'remember', scope: 'flow', ... })\` |
138
143
 
139
144
  \`read_file\` is ONLY for exact edit lines. Or when diagnosing an emergency with \`git diff --stat\` + \`check({})\`. No exceptions for planning or discovery.
140
145
 
141
146
  ## Evidence + Validation
142
147
  Use forge_classify for tier. Standard+ creates one Orchestrator-owned evidence_map task_id; reviewers add CRITICAL/HIGH claims into it; only Orchestrator runs gate.
143
148
  After implementation batches: check({}) + test_run({}) once, then blast_radius for shared/public changes.
144
- After write flow completion: onboard({ path, update: true }) → reindex({}) → produce_knowledge({}) to sync L0 cards and vector index. Verify with status({}). Read-only/Epilogue-only flows skip (0 token cost). If re-onboard fails, log warning and surface in flow status — do not block.
149
+ After write flow completion: onboard({ path, update: true }) → reindex({}) → produce_knowledge({}) to refresh onboard context, workspace skill inputs, and vector index. Verify with status({}). Read-only/Epilogue-only flows skip (0 token cost). If re-onboard fails, log warning and surface in flow status — do not block.
145
150
 
146
151
  ## Presentation
147
152
  Use present for summaries, reports, evidence maps, task plans, batch results, verdicts, progress, reviews, approval gates. Plain chat only for <=2 short status sentences or one simple question.
@@ -160,7 +165,7 @@ Use present for summaries, reports, evidence maps, task plans, batch results, ve
160
165
  Use web_fetch/http first. On auth failure, load repo-access; if exhausted, use AI Kit browser. Do not use system browser for agent-visible verification.
161
166
 
162
167
  ## End
163
- - After write flows: onboard({ path, update: true }) → reindex({}) → produce_knowledge({}). L0 card regen via \`briefing-card-compiler\` if structural change detected.
168
+ - After write flows: onboard({ path, update: true }) → reindex({}) → produce_knowledge({}). Refresh workspace skill/onboard context if structural change detected.
164
169
  - After read-only/epilogue-only flows: no reindex (0 token cost). remember decisions as normal.
165
170
  - If re-onboard/reindex fails: log warning, surface in flow status, do not block.
166
171
  - Flow-derived promotion: evidence-backed promotion candidates from final consolidation; confidence alone never promotes.
@@ -239,7 +244,7 @@ Use web_fetch/http first. On auth failure, load repo-access; if exhausted, use A
239
244
  ## Pre-Edit Checklist
240
245
 
241
246
  1. **Understand consumers** — \`graph({action:'find_nodes', name_pattern:'<target>'})\` → \`graph({action:'neighbors', node_id, direction:'incoming'})\`
242
- 2. **Compress, don't raw-read (HARD RULE)** — If you catch yourself about to call \`read_file\`, stop. Choose \`file_summary({ files, tier: 'T1', query })\` for structure-only, or \`file_summary({ files, tier: 'T2', query })\` for structure+content — one call, pick the right tier. \`read_file\` is ONLY for exact line content before \`replace_string_in_file\` — never for exploration or understanding.
247
+ 2. **Compress, don't raw-read (HARD RULE)** — If you catch yourself about to call \`read_file\`, stop. Choose \`file_summary({ files, tier: 'T1', query })\` for structure-only, or \`file_summary({ files, tier: 'T2', query })\` for structure+content — one call, pick the right tier. \`read_file\` is ONLY for exact line content before \`replace_string_in_file\` — never for exploration or understanding.
243
248
  3. **Snapshot risky edits** — \`checkpoint({action:'save', label:'pre-<scope>'})\` before cross-cutting changes
244
249
  4. **Estimate blast radius** — run \`blast_radius\` before and after shared/public symbol changes
245
250
  5. **TDD when tests exist** — failing test first, then minimum code
@@ -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.`,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`},"bash-guard":{id:`bash-guard`,event:`PreToolUse`,category:`guard`,description:`Deny grep/find/cat/ls/rg in Bash tool; redirect to MCP search, find, file_summary.`,llmBenefit:`Prevents context waste from raw shell code exploration. Pushes agent toward token-efficient MCP tools.`,script:`bash-guard.mjs`,matcher:[`fileSearch`],outputBudgetLines:0,executionModel:`child-process`,scope:`user`,failurePolicy:`deny-closed`,supportedPlatforms:[`claude`],unsupportedBehavior:`Skip — only meaningful on Claude Code with its Bash tool`,evidenceRequirements:`Hook script tested against grep/find/cat/ls/rg command patterns`,rollbackBehavior:`Remove from settings.json hooks block and delete script file`},"read-size-guard":{id:`read-size-guard`,event:`PreToolUse`,category:`guard`,description:`Deny Read tool on files exceeding 100 lines; redirect to mcp__aikit__file_summary for compressed context.`,llmBenefit:`Prevents wasting context budget on reading large files directly. file_summary provides compressed, structured views.`,script:`read-size-guard.mjs`,matcher:[`fileRead`],outputBudgetLines:0,executionModel:`child-process`,scope:`user`,failurePolicy:`deny-closed`,supportedPlatforms:[`claude`],unsupportedBehavior:`Skip — only meaningful on Claude Code with aikit MCP tools`,evidenceRequirements:`Hook script tested against large-file read 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`},"session-reminder":{id:`session-reminder`,event:`SessionStart`,category:`signal`,description:`Inject FORBIDDEN tool substitutions, mandatory first actions, orchestrator delegation protocol, and AI Kit tool routing at every session start as additionalContext.`,llmBenefit:`Reinforces tool routing discipline (grep→search, read→file_summary) and session-start protocol (flow status, onboard check) at the start of every session — harder for the model to skip than CLAUDE.md or agent instructions alone.`,script:`session-reminder.mjs`,outputBudgetLines:50,executionModel:`child-process`,scope:`user`,silentWhenHealthy:!1,failurePolicy:`allow-open`,matcher:[],supportedPlatforms:[`claude`],unsupportedBehavior:`Skip — only meaningful on Claude Code with its hooks runtime`,evidenceRequirements:`None (signal-only, no enforcement)`,rollbackBehavior:`Remove from settings.json hooks block and delete script file`}},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
+ 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`},"bash-guard":{id:`bash-guard`,event:`PreToolUse`,category:`guard`,description:`Deny grep/find/cat/ls/rg in Bash tool; redirect to MCP search, find, file_summary.`,llmBenefit:`Prevents context waste from raw shell code exploration. Pushes agent toward token-efficient MCP tools.`,script:`bash-guard.mjs`,matcher:[`fileSearch`],outputBudgetLines:0,executionModel:`child-process`,scope:`user`,failurePolicy:`deny-closed`,supportedPlatforms:[`claude`],unsupportedBehavior:`Skip — only meaningful on Claude Code with its Bash tool`,evidenceRequirements:`Hook script tested against grep/find/cat/ls/rg command patterns`,rollbackBehavior:`Remove from settings.json hooks block and delete script file`},"read-size-guard":{id:`read-size-guard`,event:`PreToolUse`,category:`guard`,description:`Deny Read tool on files exceeding 100 lines; redirect to mcp__aikit__file_summary for compressed context.`,llmBenefit:`Prevents wasting context budget on reading large files directly. file_summary provides compressed, structured views.`,script:`read-size-guard.mjs`,matcher:[`fileRead`],outputBudgetLines:0,executionModel:`child-process`,scope:`user`,failurePolicy:`deny-closed`,supportedPlatforms:[`claude`],unsupportedBehavior:`Skip — only meaningful on Claude Code with aikit MCP tools`,evidenceRequirements:`Hook script tested against large-file read 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`},"session-reminder":{id:`session-reminder`,event:`SessionStart`,category:`signal`,description:`Inject FORBIDDEN tool substitutions, mandatory first actions, orchestrator delegation protocol, and AI Kit tool routing at every session start as additionalContext.`,llmBenefit:`Reinforces tool routing discipline (grep→search, read→file_summary) and session-start protocol (flow status, onboard check) at the start of every session — harder for the model to skip than CLAUDE.md or agent instructions alone.`,script:`session-reminder.mjs`,outputBudgetLines:80,executionModel:`child-process`,scope:`user`,silentWhenHealthy:!1,failurePolicy:`allow-open`,matcher:[],supportedPlatforms:[`claude`],unsupportedBehavior:`Skip — only meaningful on Claude Code with its hooks runtime`,evidenceRequirements:`None (signal-only, no enforcement)`,rollbackBehavior:`Remove from settings.json hooks block and delete script file`}},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,5 +1,5 @@
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:`---
2
+ Load them when their preconditions are met.`,t={design:{contextProfile:`researcher`,workspaceContextInputs:[`workspace-skill`,`onboard-context`,`onboard-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`,workspaceContextInputs:[`workspace-skill`,`onboard-context`],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`,workspaceContextInputs:[`workspace-skill`,`onboard-context`,`onboard-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`,workspaceContextInputs:[`workspace-skill`,`onboard-context`],l1Fields:[`acceptanceCriteria`,`scope`,`decisions`,`retrievedRefs`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`artifacts`,`stepSummaries`],candidateLearnings:[],handoffArtifact:`tasks.md`,handoffFields:[`artifacts`,`stepSummaries`]},execute:{contextProfile:`implementer`,workspaceContextInputs:[],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`,workspaceContextInputs:[],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`,workspaceContextInputs:[`workspace-skill`,`onboard-context`],l1Fields:[`objective`,`acceptanceCriteria`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`decisions`,`summary`],candidateLearnings:[],handoffArtifact:`design-decisions.md`,handoffFields:[`decisions`]},assess:{contextProfile:`implementer`,workspaceContextInputs:[`workspace-skill`,`onboard-context`],l1Fields:[`objective`,`scope`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[`summary`,`retrievedRefs`],candidateLearnings:[],handoffArtifact:`assessment.md`,handoffFields:[`scope`,`retrievedRefs`]},"basic-implement":{contextProfile:`implementer`,workspaceContextInputs:[],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`,workspaceContextInputs:[],l1Fields:[`acceptanceCriteria`,`artifacts`,`verifiedClaims`],l2Refs:`none`,l3Evidence:`required`,updates:[`verifiedClaims`,`verifiedFinalOutcome`],candidateLearnings:[],handoffArtifact:`verify-report.md`,handoffFields:[`verifiedFinalOutcome`]},"docs-sync":{contextProfile:`documenter`,workspaceContextInputs:[],l1Fields:[`artifacts`,`stepSummaries`,`candidateLearnings`],l2Refs:`on-demand`,l3Evidence:`none`,updates:[],candidateLearnings:[`L2 candidate mapping from durable doc changes`],handoffArtifact:``,handoffFields:[]},"lesson-learned":{contextProfile:`documenter`,workspaceContextInputs:[],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
3
  name: _docs-sync
4
4
  description: Synchronize project documentation after flow completion
5
5
  skills: [docs]
@@ -25,7 +25,7 @@ Follow the \`docs\` skill's **Flow-Aware Sync** workflow:
25
25
 
26
26
  ## Knowledge Contract
27
27
 
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.
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 workspace context or L3.
29
29
 
30
30
  ## Completion Criteria
31
31
 
@@ -276,7 +276,7 @@ Write \`{{artifacts_path}}/design-decisions.md\` to disk. **You MUST create this
276
276
 
277
277
  ## Knowledge Contract
278
278
 
279
- This step has a \`researcher\` context profile. It loads \`workspace-core\` and \`architecture\` L0 cards, reads objective/criteria/scope from L1, retrieves L2 on demand, and seeds design decisions into L1. Architectural decisions with evidence are learning candidates.
279
+ This step has a \`researcher\` context profile. It uses workspace skill plus onboard architecture context, reads objective/criteria/scope from L1, retrieves L2 on demand, and seeds design decisions into L1. Architectural decisions with evidence are learning candidates.
280
280
 
281
281
  ## Produces
282
282
 
@@ -965,7 +965,7 @@ ${n}
965
965
 
966
966
  ## Knowledge Contract
967
967
 
968
- This step has an \`implementer\` context profile. It loads \`workspace-core\`, reads objective and scope from L1, and retrieves L2 on demand.
968
+ This step has an \`implementer\` context profile. It uses workspace skill plus onboard context, reads objective and scope from L1, and retrieves L2 on demand.
969
969
 
970
970
  ## Completion Criteria
971
971
 
@@ -1065,7 +1065,7 @@ Write \`{{artifacts_path}}/design-decisions.md\` to disk. **You MUST create this
1065
1065
 
1066
1066
  ## Knowledge Contract
1067
1067
 
1068
- This step has a \`researcher\` context profile. It loads \`workspace-core\` L0 cards and seeds decisions into L1.
1068
+ This step has a \`researcher\` context profile. It uses workspace skill plus onboard context and seeds decisions into L1.
1069
1069
 
1070
1070
  ## Produces
1071
1071
 
@@ -1 +1 @@
1
- const e={sessionStart:{description:`Run at the start of every agent session`,actions:[`status({})`,`knowledge({ action: "list" })`,`search({ query: "SESSION CHECKPOINT", origin: "curated" })`],rationale:`Resume prior work, load existing knowledge`},sessionEnd:{description:`Run at the end of every agent session with context-pressure-aware handoff behavior`,actions:["Check context pressure from the last `status({})` response before writing the checkpoint","If `contextPressure > 70` and a flow is active: load the `session-handoff` skill",'Create compact handoff: `knowledge({ action: "remember", scope: "flow", category: "session", title: "Session Handoff: <flow-topic>", content: "<compact format: State + Decisions + Next Steps + Blockers + Assumptions>" })`',`Keep flow state in .flows/ only; write the full handoff file to ~/.aikit/workspaces/<workspace-hash>/handoffs/ using the skill's create protocol`,"If `contextPressure > 85`: this handoff is MANDATORY before ending the session, and present the handoff summary to the user for confirmation",'If `contextPressure <= 70` or no flow is active: use the standard session checkpoint `knowledge({ action: "remember", title: "Session checkpoint: <topic>", content: "Done: ... / Decisions: ... / Next: ...", category: "session" })`'],rationale:`Persist decisions for future sessions and prevent context loss when pressure is high`},beforeCodeChange:{description:`Run before modifying any code`,actions:[`search({ query: "<what you are changing>" })`,`scope_map({ task: "<description>" })`],rationale:`Check for prior decisions and understand impact`},beforeCommit:{description:`Run before committing changes`,actions:[`check({})`,`test_run({})`,`blast_radius({ changed_files: ["..."] })`],rationale:`Validate changes before they enter version control`}};export{e as HOOKS};
1
+ const e={sessionStart:{description:`Run at the start of every agent session`,actions:[`status({})`,`knowledge({ action: "list" })`,`search({ query: "SESSION CHECKPOINT", origin: "curated" })`],rationale:`Resume prior work, load existing knowledge`},sessionEnd:{description:`Run at the end of every agent session with context-pressure-aware handoff behavior`,actions:["Check context pressure from the last `status({})` response before writing the checkpoint","If `contextPressure > 70` and a flow is active: load the `session-handoff` skill",'Create compact handoff: `knowledge({ action: "remember", scope: "flow", category: "session", title: "Session Handoff: <flow-topic>", content: "<compact format: State + Decisions + Next Steps + Blockers + Assumptions>" })`',`Keep flow state in .flows/ only; write the full handoff file to ~/.aikit/workspaces/<workspace-hash>/handoffs/ using the skill's create protocol`,"If `contextPressure > 85`: this handoff is MANDATORY before ending the session, and present the handoff summary to the user for confirmation",'If `contextPressure <= 70` or no flow is active: use the standard session checkpoint `knowledge({ action: "remember", title: "Session checkpoint: <topic>", content: "Done: ... / Decisions: ... / Next: ...", category: "session" })`'],rationale:`Persist decisions for future sessions and prevent context loss when pressure is high`},beforeCodeChange:{description:`Run before modifying any code`,actions:[`search({ query: "<what you are changing>" })`,`scope_map({ task: "<description>" })`],rationale:`Check for prior decisions and understand impact`},beforeCommit:{description:`Run before committing changes`,actions:[`check({})`,`test_run({})`,`blast_radius({ files: ["..."] })`],rationale:`Validate changes before they enter version control`}};export{e as HOOKS};
@@ -1,4 +1,4 @@
1
- import{SERVER_NAME as e}from"./mcp.mjs";import{generateForbiddenTable as t}from"./policies.mjs";function n(e){return`
1
+ import{generateForbiddenTable as e}from"./policies.mjs";function t(e){return`
2
2
  ## Flow Context Bootstrap
3
3
 
4
4
  When dispatched as a subagent within an active flow:
@@ -17,42 +17,42 @@ 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 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(`
20
+ ---`}function n(){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 r(...e){return e.filter(Boolean).join(`
21
21
 
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://skill/SKILL.md` 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})
22
+ `)}function i({title:e=`Knowledge Recall`,intro:t,commands:n,followUp:i}={}){let a=[``,`### Retrieval-First Knowledge Access`,``,`**Always follow progressive discovery: workspace context → exact-topic search/refs → broad scans.**`,``,'1. **Start with workspace context** — `status({ includePrelude: true })`; if `onboard_context` is missing run `onboard({ path: ".", mode: "generate" })`; if `onboard_context.freshness.status` is `stale` or `unknown` run `onboard({ path: ".", update: true })`; read `aikit://skill/SKILL.md` only when full guidance is needed','2. **Search exact topic** — `search({ query: "<specific-topic>" })` — results include `ctxc_` refs','3. **Reuse refs** — `file_summary({ 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 workspace context + 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 r(`## Pre-Task: ${e} (MANDATORY)`,t,["```",...(Array.isArray(n)?n:[n]).filter(Boolean),"```"].join(`
24
+ `),i,a)}function a(){return r(`## 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 o=1,s=Object.freeze({version:1,workspaceContextDir:`onboard`,sessionStart:{requiredSurfaces:[`workspace-skill`,`onboard-context`],maxAdditionalSurfaces:1,activeFlowPreference:`flow-context`,totalTokenBudget:2100},retrievalOrder:[`workspace-context`,`l1`,`l2-on-demand`,`l3-evidence-only`],noFlowFallback:`workspace-context-plus-l2-with-turn-local-context`,degradedFallback:`prelude-manifest-canonical-markdown`,lifecycleAuthority:`opaque-owner-capability`,autoKnowledgeMode:`observer-only`,workspaceContextBudgets:Object.freeze({"workspace-skill":{min:400,max:1200},"onboard-context":{min:500,max:1200},"flow-context":{min:500,max:900}})});function c(e={}){let{audience:t=`agent`}=e,n=s,r=`## Layered Knowledge Protocol (v${n.version})
25
25
 
26
- AI Kit delivers knowledge through four layers:
26
+ AI Kit delivers knowledge through startup workspace context plus L1-L3:
27
27
 
28
- - **L0Generated Briefing Cards**: Fast, task-ready workspace setup. \`workspace-core\` available as local resource \`aikit://l0/workspace-core\` (full card) and via \`status({ includePrelude: true })\` (compact summary), both populated after \`onboard({ path, mode: 'generate' })\` runs for the workspace. Treat this card as already-loaded workspace context: consume it before broad \`search\`, \`scope_map\`, \`digest\`, or repeated \`file_summary\`. If workspaceCore null → run onboard first. If a flow is active, \`workflow:<flow>\` loaded via flow context (replaces task card). Total budget: ${n.sessionStart.totalTokenBudget} tokens.
28
+ - **Workspace Context Workspace Skill + Onboard Context**: Fast, task-ready workspace setup. \`status({ includePrelude: true })\` returns the workspace skill preview/resource pointer plus \`onboard_context\` (freshness verdict, package map, architecture pointers, project profile, read order). Treat fresh onboard context as already-loaded workspace context: read \`aikit://skill/SKILL.md\` when full repo-specific guidance is needed, and use onboard files before broad \`search\`, \`scope_map\`, \`digest\`, or repeated \`file_summary\`. If \`onboarded\` is false or \`onboard_context\` is null → run \`onboard({ path: ".", mode: "generate" })\` first, then status again. If \`onboard_context.freshness.status\` is \`stale\` or \`unknown\` run \`onboard({ path: ".", update: true })\`, then status again. Total budget: ${n.sessionStart.totalTokenBudget} tokens.
29
29
  - **L1 — Flow Working Context**: Active run state, current step, and role-filtered dispatch context. Withdraw via \`knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })\`.
30
30
  - **L2 — Canonical Curated Knowledge**: Durable workspace archive managed by CuratedKnowledgeManager. Retrieve on demand via \`search()\` or \`knowledge({ action: 'read' })\`.
31
31
  - **L3 — Evidence Archive**: Auto-knowledge observations and tool-output evidence. Inspect only for provenance, conflict review, or promotion assessment. Never auto-injected.
32
32
 
33
33
  ### Hot Path
34
- 1. Session start → fetch \`aikit://l0/workspace-core\` resource (full card) or \`status({ includePrelude: true })\` (compact summary). Prerequisite: \`onboard({ path, mode: 'generate' })\` must have run for the workspace. If workspaceCore null → run onboard first, then status again.
35
- 2. Before broad repo scans, extract and reuse the L0 facts: workspace shape, package map, tool surfaces, key entry points, constraints, and known pitfalls. If L0 answers enough, skip \`scope_map\`/wide \`search\` and go straight to task-specific retrieval.
36
- 3. If flow active, \`workflow:<flow>\` loaded via flow context; use L1 snapshot + dispatch refs before broad retrieval. If no flow, may add one task card via \`file_summary\`.
34
+ 1. Session start → run \`status({ includePrelude: true })\` to get workspace skill + onboard context. Prerequisite: \`onboard({ path, mode: 'generate' })\` must have run for the workspace. If \`onboard_context\` is null → run onboard first, then status again. If freshness is \`stale\` or \`unknown\` → run \`onboard({ path: ".", update: true })\`, then status again.
35
+ 2. Before broad repo scans, extract and reuse fresh workspace skill/onboard facts: workspace shape, package map, architecture pointers, tool surfaces, key entry points, constraints, and known pitfalls. If this context answers enough, skip \`scope_map\`/wide \`search\` and go straight to task-specific retrieval.
36
+ 3. If flow active, use L1 snapshot + dispatch refs before broad retrieval. If no flow, may add one task card via \`file_summary\`.
37
37
  4. Retrieve L2 on demand.
38
38
  5. Inspect L3 only for evidence, provenance, or promotion.
39
39
 
40
40
  ### No-Flow Fallback
41
- - Keep L1 absent; workspace-core available via status after onboard; optionally one task card.
41
+ - Keep L1 absent; workspace skill + onboard context available via status after onboard; optionally one task card.
42
42
  - L2 on demand; turn-local scratch, no L1 synthesis.
43
43
 
44
44
  ### Degraded Fallback
45
- - Missing L0 card after regeneration → use \`status({ includePrelude: true })\` as compact fallback, then only task-specific L2 retrieval; do not replace L0 with a workspace-wide scan.
45
+ - Missing workspace skill/onboard context after regeneration → use \`status({ includePrelude: true })\` as compact fallback, then only task-specific L2 retrieval; do not replace the missing startup context with a workspace-wide scan.
46
46
  - Unavailable L1 → read persisted FlowRunMeta without mutation.
47
47
  - Unavailable indexed L2 → read canonical curated markdown directly.
48
48
  - Mark missing evidence unresolved; block promotion.
49
49
  `;return t===`skill`?r+`
50
50
  ### Skill Routing
51
- - Load L0 card families listed in \`LAYERED_KNOWLEDGE_OPERATING_POLICY.l0Budgets\`.
51
+ - Use \`status({ includePrelude: true })\` for workspace skill + onboard context; read \`aikit://skill/SKILL.md\` only when full guidance is needed.
52
52
  - Route L1 withdrawal by configured profile; never promote.
53
53
  - Emit L3 evidence as observer-only; never navigate flow state.`:t===`flow`?r+`
54
54
  ### Step Contracts
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
+ Each built-in flow step declares workspace context inputs, L1 fields, L2 refs, L3 evidence, context updates, candidate learnings, and handoff artifacts. The step knowledge contract drives role-aware L1 projection.`:r}const l=r(`## 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 u(){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 files by path/pattern | `find({ glob, pattern })` — returns paths + preview | `grep_search` / `ls` |\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({ files })` — trace affected files from changes | Manual caller tracing |\n| Complexity metrics | `measure({ path })` | Line counting / wc |\n| Workspace skill + onboard context | `status({ includePrelude: true })`, `aikit://skill/SKILL.md` when full guidance is needed | Raw file discovery |\n| Known issues / recurring lessons | `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 d=r(`## AI Kit Tools`,"The AI Kit MCP server provides search, analysis, memory, validation, and coordination tools. Available tools vary by platform and version — run `list_tools` at session start to see the exact set on your platform. Tool names use short form (e.g. `search`, `file_summary`) in instructions; your runtime may prefix them (e.g. `mcp__aikit__search`).",``,"If AI Kit tools are unavailable or missing, run `npx -y @vpxa/aikit@latest init --user`, then reload the client."),f={"code-agent-base":`# Code Agent - Shared Kernel
56
56
 
57
57
  > Shared protocol for code-writing agents. Role files add only role-specific behavior.
58
58
 
@@ -72,7 +72,7 @@ Each built-in flow step declares knowledge inputs (L0 card types, L1 fields, L2
72
72
  - Use terse style if requested by Orchestrator.
73
73
  - End with one status: \`DONE\` | \`DONE_WITH_CONCERNS\` | \`NEEDS_CONTEXT\` | \`BLOCKED\`.
74
74
 
75
- ${d()}
75
+ ${u()}
76
76
 
77
77
  ## Protocol Coverage
78
78
  - conversation-compression: prefer provided compressed context; stash/remember concise findings before context changes; never paste raw long output.
@@ -82,9 +82,9 @@ ${d()}
82
82
  - access protocol: \`401\`/\`403\`/\`404\`/\`407\`, login HTML, CAPTCHA, SSO, or repo auth failure -> \`NEEDS_CONTEXT\` with receipt.
83
83
  - context-cache protocol: search/reuse \`ctxc_...\`, stash, or flow withdrawal before rereading same path/topic.
84
84
 
85
- ${t()}
85
+ ${e()}
86
86
 
87
- ${r()}
87
+ ${n()}
88
88
 
89
89
  ## Work Loop
90
90
  1. Restate scope and success criteria.
@@ -119,9 +119,9 @@ Instructions use short names such as \`status\`, \`file_summary\`, \`search\`. R
119
119
 
120
120
  > Researchers are read-only subagents for discovery, trade-offs, and decision input.
121
121
 
122
- ${n(`researcher`)}
122
+ ${t(`researcher`)}
123
123
 
124
- ${d()}
124
+ ${u()}
125
125
 
126
126
  ## Method
127
127
  1. Start from Orchestrator question + provided context.
@@ -149,9 +149,9 @@ Status: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
149
149
 
150
150
  > Review changed behavior, tests, correctness, security, maintainability, patterns, and type safety.
151
151
 
152
- ${n(`reviewer`)}
152
+ ${t(`reviewer`)}
153
153
 
154
- ${d()}
154
+ ${u()}
155
155
 
156
156
  ## Method
157
157
  1. Use provided diff/context first; run \`blast_radius\` when scope is unclear.
@@ -181,9 +181,9 @@ Approve only with zero CRITICAL/HIGH findings.
181
181
 
182
182
  > Review structure: dependency direction, boundaries, public contracts, pattern fit, testability.
183
183
 
184
- ${n(`reviewer`)}
184
+ ${t(`reviewer`)}
185
185
 
186
- ${d()}
186
+ ${u()}
187
187
 
188
188
  ## Method
189
189
  1. Use provided design/diff/context first.
@@ -430,7 +430,7 @@ evidence_map({ action: "gate", task_id: "add-user-api" }) → YIELD ✅
430
430
  - **Surface conflicts.** If two patterns contradict, pick one (more recent / more tested). Explain why. Flag the other.
431
431
  - **Checkpoint.** After every significant step, summarize what was done, what’s verified, what’s left.
432
432
  - **Fail loud.** “Completed” is wrong if anything was skipped. Default to surfacing uncertainty.
433
- `,"layered-knowledge-operating-policy":l({audience:`agent`}),"engineering-principles":`# Engineering Principles
433
+ `,"layered-knowledge-operating-policy":c({audience:`agent`}),"engineering-principles":`# Engineering Principles
434
434
 
435
435
  > Operating constraints for code-writing agents. Violating these is a defect.
436
436
 
@@ -519,7 +519,7 @@ Reduces per-request token consumption by 40-70% (from ~85K to ~25-50K). Cache hi
519
519
  - ALWAYS deposit findings BEFORE compressing
520
520
  - Keep each step-summary under 2000 characters
521
521
  - If a step produced errors or blockers, include those verbatim (do not compress)
522
- - On completion: knowledge({action: flush, scope: flow:<run-id>})`},m={"execution-state":`# Execution State: {Task Title}
522
+ - On completion: knowledge({action: flush, scope: flow:<run-id>})`},p={"execution-state":`# Execution State: {Task Title}
523
523
 
524
524
  **Status:** PLANNING | IN_PROGRESS | REVIEW | COMPLETED | BLOCKED
525
525
  **Started:** {timestamp}
@@ -571,4 +571,4 @@ Reduces per-request token consumption by 40-70% (from ~85K to ~25-50K). Cache hi
571
571
 
572
572
  ## Alternatives Considered
573
573
  {Other approaches evaluated and why they were rejected - keeps the "why not" alongside the "why"}
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};
574
+ `};export{d as AIKIT_INSTALL_HINT_SECTION,s as LAYERED_KNOWLEDGE_OPERATING_POLICY,o as LAYERED_KNOWLEDGE_OPERATING_POLICY_VERSION,l as PLATFORM_OUTPUT_RULES_SECTION,f as PROTOCOLS,p as TEMPLATES,u as aiKitToolPreference,a as postTaskLesson,i as preTaskKnowledgeRecall,c as renderLayeredKnowledgeOperatingPolicyV1};