@vpxa/aikit 0.1.380 → 0.1.381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/claude-desktop/dist/manifest.json +1 -1
- package/packages/cli/dist/index.js +3 -3
- package/packages/cli/dist/{init-BTsNYC02.js → init-Be3nyugf.js} +1 -1
- package/packages/cli/dist/{templates-CRs_gkfS.js → templates-CK9mSHyJ.js} +24 -24
- package/packages/server/dist/bin.js +2 -2
- package/packages/server/dist/{config-DZskEKrY.js → config-CTYSUkDf.js} +1 -1
- package/packages/server/dist/{curated-manager-CBKTmAjM.js → curated-manager-D4MOFQ-t.js} +1 -1
- package/packages/server/dist/{dashboard-static-NghHzTNh.js → dashboard-static-BbHMHkQ3.js} +1 -1
- package/packages/server/dist/index.d.ts +1 -1
- package/packages/server/dist/index.js +2 -2
- package/packages/server/dist/{observations-CfglxBMB.js → observations-BhMmh4uj.js} +1 -1
- package/packages/server/dist/{observations-CrQU_HVm.js → observations-Cri43dvk.js} +1 -1
- package/packages/server/dist/{register-tools-Dgu64Px5.js → register-tools-0E-d3SIk.js} +147 -138
- package/packages/server/dist/{register-tools-jgdif5r4.js → register-tools-fdniAqWz.js} +147 -138
- package/packages/server/dist/{server-C43D7SrT.js → server-C4qsakCZ.js} +6 -6
- package/packages/server/dist/{server-BmVdf84Q.js → server-DHdcyAmX.js} +7 -7
- package/packages/server/dist/{server-http-BCpGwi0k.js → server-http-CC39yGVF.js} +1 -1
- package/packages/server/dist/{server-http-YQ9jxThI.js → server-http-DlTdz6ch.js} +1 -1
- package/packages/server/dist/{server-stdio-CuLAgQjc.js → server-stdio-CTbBp6wO.js} +1 -1
- package/packages/server/dist/{server-stdio-3hhuJU8B.js → server-stdio-Colzu8Wb.js} +1 -1
- package/packages/server/dist/{settings-static-DcTUiqr7.js → settings-static-DV2hXZgq.js} +1 -1
- package/packages/server/dist/{startup-maintenance-B4xWqEjc.js → startup-maintenance-CxAICs-n.js} +1 -1
- package/packages/tools/dist/index.d.ts +23 -3
- package/packages/tools/dist/index.js +111 -105
- package/scaffold/dist/adapters/_shared.mjs +1 -1
- package/scaffold/dist/adapters/hermes.mjs +1 -1
- package/scaffold/dist/definitions/agents.mjs +1 -1
- package/scaffold/dist/definitions/exec-hooks.mjs +1 -1
- package/scaffold/dist/definitions/hooks.mjs +1 -1
- package/scaffold/dist/definitions/protocols.mjs +20 -20
- package/scaffold/dist/definitions/skills/aikit.mjs +10 -4
- package/scaffold/dist/definitions/skills/browser-use.mjs +1 -1
- package/scaffold/dist/definitions/skills/orchestrator.mjs +45 -8
|
@@ -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
|
|
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
|
|
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({
|
|
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};
|
|
@@ -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 +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({
|
|
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{
|
|
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,21 +17,21 @@ When dispatched as a subagent within an active flow:
|
|
|
17
17
|
|
|
18
18
|
${e===`<PROFILE>`?`**Profile:** Check your role → implementer | documenter | reviewer | researcher | debugger`:`**Profile:** \`${e}\``}
|
|
19
19
|
|
|
20
|
-
---`}function
|
|
20
|
+
---`}function 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
|
|
23
|
-
`);return
|
|
24
|
-
`),
|
|
22
|
+
`)}function i({title:e=`Knowledge Recall`,intro:t,commands:n,followUp:i}={}){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** — `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 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 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,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 c(e={}){let{audience:t=`agent`}=e,n=s,r=`## Layered Knowledge Protocol (v${n.version})
|
|
25
25
|
|
|
26
26
|
AI Kit delivers knowledge through four layers:
|
|
27
27
|
|
|
28
|
-
- **L0 — Generated Briefing Cards**: Fast, task-ready workspace setup. \`workspace-core\` available
|
|
28
|
+
- **L0 — Generated Briefing Cards**: Fast, task-ready workspace setup. \`workspace-core\` available via \`status({ includePrelude: true })\` (compact summary), 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.
|
|
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 →
|
|
34
|
+
1. Session start → run \`status({ includePrelude: true })\` to get compact workspace-core summary. Prerequisite: \`onboard({ path, mode: 'generate' })\` must have run for the workspace. If workspaceCore null → run onboard first, then status again.
|
|
35
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
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\`.
|
|
37
37
|
4. Retrieve L2 on demand.
|
|
@@ -52,7 +52,7 @@ AI Kit delivers knowledge through four layers:
|
|
|
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
|
|
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 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| L0 briefing card (workspace-core) | `status({ includePrelude: true })` (compact summary), `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 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
|
-
${
|
|
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
|
-
${
|
|
85
|
+
${e()}
|
|
86
86
|
|
|
87
|
-
${
|
|
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
|
-
${
|
|
122
|
+
${t(`researcher`)}
|
|
123
123
|
|
|
124
|
-
${
|
|
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
|
-
${
|
|
152
|
+
${t(`reviewer`)}
|
|
153
153
|
|
|
154
|
-
${
|
|
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
|
-
${
|
|
184
|
+
${t(`reviewer`)}
|
|
185
185
|
|
|
186
|
-
${
|
|
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":
|
|
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>})`},
|
|
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{
|
|
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};
|
|
@@ -14,12 +14,16 @@ metadata:
|
|
|
14
14
|
|
|
15
15
|
Use AI Kit as compression, memory, validation, and coordination layer. Each call should reduce uncertainty or token load.
|
|
16
16
|
|
|
17
|
+
## Communicating With the User
|
|
18
|
+
|
|
19
|
+
**Use \`present({ schemaVersion: 1, title, blocks })\` for ALL non-trivial output.** This is the preferred way to show summaries, results, evidence maps, task plans, reviews, comparisons, dashboards, charts, timelines, and batch results to the user. Plain text is only for 1-2 sentence status updates or simple questions. The \`present\` tool renders rich, structured output that the user can interact with.
|
|
20
|
+
|
|
17
21
|
## Session Loop
|
|
18
22
|
|
|
19
23
|
Start:
|
|
20
24
|
1. status({ includePrelude: true }).
|
|
21
25
|
2. If prelude.workspaceCore is null → run \`onboard({ path, mode: 'generate' })\`, then \`status({ includePrelude: true })\` again.
|
|
22
|
-
3. **L0 session start**:
|
|
26
|
+
3. **L0 session start**: Run \`status({ includePrelude: true })\` for compact workspace-core summary. Extract workspace shape, package map, tool surfaces, key entry points, constraints, and known pitfalls before broad retrieval. If L0 answers enough, skip \`scope_map\`/wide \`search\`. If a flow is active, workflow card loaded via flow context. ≤ 2,100 tokens.
|
|
23
27
|
4. search({ query: "SESSION CHECKPOINT", origin: "curated" }).
|
|
24
28
|
5. flow({ action: 'status' }) when active flow may exist — use L1 snapshot before broad retrieval.
|
|
25
29
|
6. scope_map({ task }) only when L0 + checkpoint do not identify a narrow workset.
|
|
@@ -38,9 +42,11 @@ End:
|
|
|
38
42
|
|
|
39
43
|
## Retrieval Ladder — Layered (L0-L3)
|
|
40
44
|
|
|
45
|
+
> This table maps knowledge layers to tool needs. For the canonical quick-reference tool decision table, see \`aiKitToolPreference()\` in protocols.mjs.
|
|
46
|
+
|
|
41
47
|
| Layer | Need | Tool |
|
|
42
48
|
|-------|------|------|
|
|
43
|
-
| **L0** | Session briefing (after onboard) |
|
|
49
|
+
| **L0** | Session briefing (after onboard) | \`status({ includePrelude: true })\` (compact summary). Run \`onboard\` first if card missing. Consume before broad scans. |
|
|
44
50
|
| **L0** | Architecture overview | \`architecture\` briefing card |
|
|
45
51
|
| **L0** | Known issues | \`known-issues\` briefing card |
|
|
46
52
|
| **L0** | Flow-specific context | \`workflow:<flow>\` briefing card |
|
|
@@ -55,7 +61,7 @@ End:
|
|
|
55
61
|
| **L2** | Impact | \`blast_radius\` |
|
|
56
62
|
| **L2** | Type/lint/test | \`check\` / \`test_run\` |
|
|
57
63
|
| **L3** | Evidence, provenance, conflict review | \`search\` with \`knowledge({ action: 'lesson' })\` — focused only |
|
|
58
|
-
| **General** | Tool choice unknown | \`list_tools\`
|
|
64
|
+
| **General** | Tool choice unknown | \`list_tools({ intent: "<task>" })\` (use intent param for planner-ranked results) or \`search({ query: "tool to <do X>" })\` |
|
|
59
65
|
|
|
60
66
|
Raw read_file only for exact edit lines after compressed tools identify target.
|
|
61
67
|
|
|
@@ -85,7 +91,7 @@ Review decayed/stale entries periodically with knowledge({ action: 'flagged' }).
|
|
|
85
91
|
Flows guide multi-step work. Read active step before acting. FORGE handles tiering/evidence/gates; load references only when main skill is too thin.
|
|
86
92
|
|
|
87
93
|
### Layered Knowledge Protocol
|
|
88
|
-
- **L0** → Generated briefing cards: load \`workspace-core\` at session start via \`
|
|
94
|
+
- **L0** → Generated briefing cards: load \`workspace-core\` at session start via \`status({ includePrelude: true })\` (compact summary). Requires \`onboard()\` first — if card null, run \`onboard\` before session start. Consume L0 as the default workspace map before \`search\`, \`scope_map\`, \`digest\`, or repeated \`file_summary\`; add \`workflow:<flow>\` if flow active, or one task card if no flow. Use \`file_summary({ tier: 'T1' })\` for structure, or \`file_summary({ tier: 'T2', query })\` for content only after L0 narrows the workset. Token-bounded.
|
|
89
95
|
- **L1** → Flow working context. Withdraw before dispatch; reuse before broad retrieval.
|
|
90
96
|
- **L2** → Canonical curated knowledge. Retrieve on demand; never preload broadly.
|
|
91
97
|
- **L3** → Evidence/auto-knowledge. Inspect only for provenance, conflict, or promotion assessment.
|
|
@@ -450,7 +450,7 @@ browser({ action: 'eval', pageId, code: 'localStorage.getItem("authToken")' })
|
|
|
450
450
|
| Console + eval hybrid | \`console\` | consoleSubAction: get, expression (evaluates JS) |
|
|
451
451
|
| Compare changes | \`diff\` | (compares to previous snapshot) |
|
|
452
452
|
|
|
453
|
-
For full parameter details: \`
|
|
453
|
+
For full parameter details: \`list_tools({ intent: "browser automation" })\` or check the tool's schema
|
|
454
454
|
|
|
455
455
|
## Principles
|
|
456
456
|
|
|
@@ -14,19 +14,40 @@ metadata:
|
|
|
14
14
|
|
|
15
15
|
YOU MUST FOLLOW THIS PROTOCOL ON EVERY TASK. You are an orchestrator, not an implementer.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Priority Ladder (conflict resolution order)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
1. Safety + user approval.
|
|
20
|
+
2. Tool/bootstrap correctness.
|
|
21
|
+
3. Delegation boundary.
|
|
22
|
+
4. Evidence + verification.
|
|
23
|
+
5. Context budget.
|
|
24
|
+
6. Terse communication.
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
## MANDATORY FIRST ACTIONS (session start)
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
Execute these before ANY other work:
|
|
29
|
+
1. \`flow({ action: 'status' })\` — Check active flow state.
|
|
30
|
+
2. \`status({ includePrelude: true })\` — Load L0 workspace context plus workspace skill summary.
|
|
31
|
+
3. If workspaceCore null → \`onboard({ path: "." })\` first, then status again.
|
|
32
|
+
4. \`skill({ name: 'aikit' })\` — Load the AI Kit skill for tool routing, retrieval ladder, and communication patterns.
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
On platforms without native \`skill()\` support, the AI Kit instructions are already in your system prompt via other channels.
|
|
26
35
|
|
|
27
|
-
**
|
|
36
|
+
**Workspace skill:** \`status({ includePrelude: true })\` gives you the compact summary. For full content (conventions, commands, lessons): read \`aikit://skill/SKILL.md\` MCP resource on demand.
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
## Delegation Rules
|
|
39
|
+
|
|
40
|
+
**RULE 1 — Decompose everything.** Break every task into independent, parallelizable subtasks.
|
|
41
|
+
|
|
42
|
+
**RULE 2 — Delegate, never implement.** For every subtask, spawn a sub-agent via Task(). If you catch yourself about to edit a file directly, STOP. Spawn a sub-agent.
|
|
43
|
+
|
|
44
|
+
**RULE 3 — Wait and synthesize.** After all sub-agents complete, consolidate their outputs.
|
|
45
|
+
|
|
46
|
+
**RULE 4 — No direct coding.** You NEVER write, edit, or create files yourself. That is sub-agent work.
|
|
47
|
+
|
|
48
|
+
**RULE 5 — Parallel fan-out.** Subtasks without data dependencies MUST run in parallel.
|
|
49
|
+
|
|
50
|
+
**RULE 6 — Full cycle per phase.** Each phase (Plan → Implement → Review → Verify) gets its own delegation cycle.
|
|
30
51
|
|
|
31
52
|
## Exceptions (ONLY these)
|
|
32
53
|
|
|
@@ -35,4 +56,20 @@ You MAY write code directly ONLY when:
|
|
|
35
56
|
- You are fixing a sub-agent's output (typo, quick patch)
|
|
36
57
|
- There is no sub-agent available for the required skill
|
|
37
58
|
|
|
38
|
-
|
|
59
|
+
## Dispatch Envelope (every subagent prompt)
|
|
60
|
+
|
|
61
|
+
Every subagent dispatch MUST include:
|
|
62
|
+
1. Agent + Goal — specialist name, acceptance criteria
|
|
63
|
+
2. Files + Boundary — target files, do-not-touch list
|
|
64
|
+
3. Arch Context — compress with file_summary/digest before including
|
|
65
|
+
4. Prior Knowledge — search lessons + conventions
|
|
66
|
+
5. FORGE — tier, task_id, evidence requirements
|
|
67
|
+
6. Flow Context — withdraw context FIRST, reuse refs
|
|
68
|
+
7. Constraints — no present tool, no flow advance, stay in scope
|
|
69
|
+
8. Return contract — DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED (≤200 words)
|
|
70
|
+
|
|
71
|
+
## Emergency Recovery
|
|
72
|
+
|
|
73
|
+
STOP → ASSESS (\`git diff --stat\` + \`check({})\`) → CONTAIN (1-3 files: fix, widespread: stash) → RECOVER (stash first) → DOCUMENT (remember what went wrong).
|
|
74
|
+
|
|
75
|
+
Max 2 retries per task. Same failure twice → stop loop, change plan.`}];export{e as default};
|