@vpxa/aikit 0.1.277 → 0.1.279
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 +2 -1
- package/packages/cli/dist/index.js +3 -3
- package/packages/cli/dist/{init-jjI8OFjT.js → init-D9pqZcbt.js} +1 -1
- package/packages/cli/dist/{templates-CDa0UuoE.js → templates-BvYW6rrq.js} +15 -14
- package/packages/server/dist/bin.js +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/{server-CkCRBlz4.js → server-BFwmsrI5.js} +135 -135
- package/packages/server/dist/{server-DlE6A6sd.js → server-Bi0xdSS7.js} +135 -135
- package/packages/server/package.json +1 -0
- package/packages/tool-routing/dist/index.d.mts +164 -0
- package/packages/tool-routing/dist/index.mjs +403 -0
- package/packages/tool-routing/package.json +26 -0
- package/packages/tools/dist/index.d.ts +2 -0
- package/packages/tools/dist/index.js +72 -72
- package/packages/tools/package.json +1 -0
- package/scaffold/dist/adapters/claude-code.mjs +1 -1
- package/scaffold/dist/adapters/codex.mjs +1 -1
- package/scaffold/dist/adapters/copilot.mjs +17 -17
- package/scaffold/dist/adapters/flows.mjs +1 -1
- package/scaffold/dist/adapters/gemini.mjs +1 -1
- package/scaffold/dist/adapters/hooks.mjs +1 -1
- package/scaffold/dist/adapters/intellij.mjs +1 -1
- package/scaffold/dist/adapters/opencode.mjs +1 -1
- package/scaffold/dist/adapters/skills.mjs +1 -1
- package/scaffold/dist/adapters/zed.mjs +1 -1
- package/scaffold/dist/definitions/agents.mjs +1 -1
- package/scaffold/dist/definitions/bodies.mjs +10 -1
- package/scaffold/dist/definitions/policies.mjs +2 -2
- package/scaffold/dist/definitions/protocols.mjs +88 -27
- package/scaffold/dist/definitions/skills/c4-architecture.mjs +1 -1
- package/scaffold/dist/definitions/skills/index.mjs +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AGENTS as e}from"
|
|
1
|
+
import{AGENTS as e}from"../../definitions/agents.mjs";import{AGENT_BODIES as t}from"../../definitions/bodies.mjs";import{HOOKS as n}from"../../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as a}from"../../definitions/models.mjs";import{PROMPTS as o}from"../../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as s,PLATFORM_OUTPUT_RULES_SECTION as c,PROTOCOLS as l}from"../../definitions/protocols.mjs";import{AIKIT_TOOLS as u,CLAUDE_CODE_TOOL_MAP as d,IDE_CAPABILITIES as f}from"../../definitions/tools.mjs";import{buildAgentTable as p,buildCompactAgentTable as m,buildHooksSection as h,buildMcpConfigJson as g,buildSkillsSection as _,lowerFirst as v}from"../../adapters/_shared.mjs";import{generateHooks as y}from"../../adapters/hooks.mjs";const b=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
|
|
2
2
|
`),x=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
|
|
3
3
|
`),S=[`## Flows`,``,"This project uses aikit's pluggable flow system. Use `flow({ action: 'status' })` to check if a flow is active.",`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`].join(`
|
|
4
4
|
`);function C(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function w(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function T(e){let t=(f[e]||[]).flatMap(e=>d[e]||[]),n=u.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function E(e,t){let n=[];return n.push(`# aikit ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AGENTS as e}from"
|
|
1
|
+
import{AGENTS as e}from"../../definitions/agents.mjs";import{AGENT_BODIES as t}from"../../definitions/bodies.mjs";import{MCP_SERVER_ENTRY as n,SERVER_NAME as r}from"../../definitions/mcp.mjs";import{getAgentModelConfig as i}from"../../definitions/models.mjs";import{PROTOCOLS as a}from"../../definitions/protocols.mjs";import{buildCompactAgentTable as o,buildSkillsSection as s,lowerFirst as c}from"../../adapters/_shared.mjs";function l(e,t){let n=t.args.map(e=>JSON.stringify(e)).join(`, `);return`[mcp_servers.${e}]\ncommand = ${JSON.stringify(t.command)}\nargs = [${n}]\n`}function u(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function d(e){return JSON.stringify(String(e))}function f(e){let t=String(e).replace(/\r\n/g,`
|
|
2
2
|
`).trim();return t?`"""\n${t}\n"""`:`""`}function p(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function m(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&a[e.sharedBase]&&t.push(a[e.sharedBase]);for(let n of e.sharedProtocols||[])a[n]&&t.push(a[n]);return t}function h({name:e,description:t,identity:n,body:r,skills:i,additionalSections:a}){return[n?`You are the **${e}**${n}`:`You are the **${e}**, ${c(t)}.`,r,...a||[],s(i)].filter(Boolean).join(`
|
|
3
3
|
|
|
4
4
|
`).trim()}function g({name:e,description:t,developerInstructions:n,modelConfig:r}){let i=[`name = ${d(e)}`,`description = ${d(t)}`];return r?.primary&&i.push(`model = ${d(r.primary)}`),r?.reasoningEffort&&i.push(`model_reasoning_effort = ${d(r.reasoningEffort)}`),i.push(`developer_instructions = ${f(n)}`,``),i.join(`
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{AGENTS as e}from"
|
|
2
|
-
`),
|
|
3
|
-
`);function
|
|
4
|
-
`)}`}function
|
|
5
|
-
`)}`:``,
|
|
1
|
+
import{AGENTS as e}from"../../definitions/agents.mjs";import{AGENT_BODIES as t}from"../../definitions/bodies.mjs";import{VARIANT_GROUPS as n,getPrimaryAgentModel as r}from"../../definitions/models.mjs";import{PROMPTS as i}from"../../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as a,PLATFORM_OUTPUT_RULES_SECTION as o,PROTOCOLS as s,TEMPLATES as c}from"../../definitions/protocols.mjs";import{IDE_CAPABILITIES as l}from"../../definitions/tools.mjs";import{buildCompactAgentTable as u}from"../../adapters/_shared.mjs";import{generateHooks as d,getHookScriptFiles as f}from"../../adapters/hooks.mjs";import{generateForbiddenTable as p}from"../../definitions/policies.mjs";const m={terminal:`execute/runInTerminal`,problems:`read/problems`,readFile:`read/readFile`,lastCommand:`read/terminalLastCommand`,subagent:`agent/runSubagent`,createFile:`edit/createFile`,editFiles:`edit/editFiles`,rename:`edit/rename`,createDirectory:`edit/createDirectory`,search:`search/changes, search/codebase, search/usages`,web:`web/fetch, web/githubRepo`,todo:`todo`,memory:`vscode/memory`,newWorkspace:`vscode/newWorkspace`,reviewPlan:`vscode/reviewPlan`,askQuestions:`vscode/askQuestions`,resolveMemoryFileUri:`vscode/resolveMemoryFileUri`,runCommand:`vscode/runCommand`,switchAgent:`vscode/switchAgent`,killTerminal:`execute/killTerminal`,createTask:`execute/createAndRunTask`,terminalSel:`read/terminalSelection`,fileSearch:`search/fileSearch`,listDir:`search/listDirectory`,textSearch:`search/textSearch`,searchSubagent:`search/searchSubagent`};function h(e){return`[${[...(l[e]||[]).map(e=>m[e]).filter(Boolean),`aikit/*`].join(`, `)}]`}function g(e){return r(`copilot`,e,`Auto (copilot)`)}const _=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
|
|
2
|
+
`),v=[`## Flows`,``,"This project uses aikit's pluggable flow system. Use `flow({ action: 'status' })` to check if a flow is active.",`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`].join(`
|
|
3
|
+
`);function y(){let t=[];for(let[i,a]of Object.entries(e))if(a.variants)for(let e of n[i]||[]){let n=`${i}-${e}`,o=r(`copilot`,n,`Unknown`),s=(a.variants[e]||{}).description||a.description;t.push(`| **${n}** | ${s} | ${o} | ${a.category} |`)}else{let e=r(`copilot`,i,`Unknown`);t.push(`| **${i}** | ${a.description} | ${e} | ${a.category} |`)}return`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${t.join(`
|
|
4
|
+
`)}`}function b(e,t,r){let i=`${e}-${t}`,a=r.variants[t]||{},o=g(i),c=a.description||r.description,l=a.identity||(t===n[e]?.[0]?`, the primary ${e} agent.`:`, a variant of ${e}. Same responsibilities, different model perspective.`),u=r.sharedBase&&s[r.sharedBase]?`\n\n${s[r.sharedBase]}`:``,d=r.extraBody?`\n\n${r.extraBody}`:``,f=a.bodyAddendum?`\n\n${a.bodyAddendum}`:``,p=(r.sharedProtocols||[]).map(e=>s[e]?`\n\n${s[e]}`:``).join(``),m=r.skills?.length?`\n\n## Skills (load on demand)\n\n| Skill | When to load |\n|-------|--------------|\n${r.skills.map(([e,t])=>`| ${e} | ${t} |`).join(`
|
|
5
|
+
`)}`:``,_=r.title||e;return`---
|
|
6
6
|
description: '${c}'
|
|
7
|
-
${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${
|
|
7
|
+
${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${h(r.toolRole)}
|
|
8
8
|
model: ${o}
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# ${i} - ${
|
|
11
|
+
# ${i} - ${_}
|
|
12
12
|
|
|
13
13
|
You are **${i}**${l}${d}
|
|
14
|
-
${u}${p}${f}${
|
|
14
|
+
${u}${p}${f}${m}
|
|
15
15
|
|
|
16
|
-
${
|
|
17
|
-
`}function
|
|
16
|
+
${v}
|
|
17
|
+
`}function x(n,r){let i=g(n),a=typeof t[n]==`function`?t[n](u(e)):t[n]||``,o=r.sharedBase&&s[r.sharedBase]?`\n\n${s[r.sharedBase]}`:``,c=(r.sharedProtocols||[]).map(e=>s[e]?`\n\n${s[e]}`:``).join(``),l=r.title||n,d=r.skills?.length?`\n## Skills (load on demand)\n\n| Skill | When to load |\n|-------|--------------|\n${r.skills.map(([e,t])=>`| ${e} | ${t} |`).join(`
|
|
18
18
|
`)}\n`:``;return`---
|
|
19
19
|
description: '${r.description}'
|
|
20
|
-
${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${
|
|
20
|
+
${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${h(r.toolRole)}
|
|
21
21
|
model: ${i}
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -27,20 +27,20 @@ You are the **${n}**, ${r.description.toLowerCase().replace(/^./,e=>e.toLowerCas
|
|
|
27
27
|
|
|
28
28
|
${a}${o}${c}${d}
|
|
29
29
|
|
|
30
|
-
${n===`Orchestrator`?
|
|
31
|
-
`}function
|
|
30
|
+
${n===`Orchestrator`?_:v}
|
|
31
|
+
`}function S(e,t){return`---
|
|
32
32
|
description: "${t.description}"
|
|
33
33
|
agent: "${t.agent}"
|
|
34
34
|
---
|
|
35
35
|
|
|
36
36
|
${t.content}
|
|
37
|
-
`}function
|
|
37
|
+
`}function C(){return`# Agents
|
|
38
38
|
|
|
39
39
|
This directory contains AI agent definitions generated by \`@vpxa/aikit init\`.
|
|
40
40
|
|
|
41
41
|
## Agent Roster
|
|
42
42
|
|
|
43
|
-
${
|
|
43
|
+
${y()}
|
|
44
44
|
|
|
45
45
|
## Multi-Model Pattern
|
|
46
46
|
|
|
@@ -73,5 +73,5 @@ To regenerate after changing models or agent definitions:
|
|
|
73
73
|
cd knowledge-base
|
|
74
74
|
node scaffold/generate.mjs
|
|
75
75
|
\`\`\`
|
|
76
|
-
`}function
|
|
77
|
-
`)}function
|
|
76
|
+
`}function w(){return[`# aikit — Copilot Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`These rules are enforced by AI Kit compliance checking. Violations are flagged in reports and reduce your compliance score.`,``,p(),``,a,``].join(`
|
|
77
|
+
`)}function T(){let t=[];if(f().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`copilot-instructions.md`,content:w()});for(let[r,i]of Object.entries(e))if(i.variants)for(let e of n[r]||[])t.push({path:`agents/${r}-${e}.agent.md`,content:b(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:x(r,i)});for(let[e,n]of Object.entries(s))t.push({path:`agents/_shared/${e}.md`,content:`${n}\n`});for(let[e,n]of Object.entries(c))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:C()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:S(e,n)});let r=d(`copilot`,`~/.copilot/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{T as generateCopilot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FLOWS as e}from"
|
|
1
|
+
import{FLOWS as e}from"../../definitions/flows.mjs";function t(){let t=[];for(let[n,r]of Object.entries(e))for(let{file:e,content:i}of r)t.push({path:`${n}/${e}`,content:i});return t}export{t as generateFlows};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AGENTS as e}from"
|
|
1
|
+
import{AGENTS as e}from"../../definitions/agents.mjs";import{AGENT_BODIES as t}from"../../definitions/bodies.mjs";import{HOOKS as n}from"../../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../../definitions/mcp.mjs";import{PROMPTS as a}from"../../definitions/prompts.mjs";import{PROTOCOLS as o}from"../../definitions/protocols.mjs";import{buildAgentTable as s,buildCompactAgentTable as c,buildHooksSection as l,buildMcpConfigJson as u,buildPromptSections as d,buildSkillsSection as f,lowerFirst as p}from"../../adapters/_shared.mjs";const m=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
|
|
2
2
|
`),h=[`## Flows`,``,"This project uses aikit's pluggable flow system. Use `flow({ action: 'status' })` to check if a flow is active.",`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`].join(`
|
|
3
3
|
`);function g(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function _(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&o[e.sharedBase]&&t.push(o[e.sharedBase]);for(let n of e.sharedProtocols||[])o[n]&&t.push(o[n]);return t}function v(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function y(e){return v().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
|
|
4
4
|
`)}function b(e,t,n){let r=_(t),i=f(t.skills),a=e===`Orchestrator`?m:h,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EXEC_HOOKS as e,HOOK_EVENTS as t,HOOK_TOOL_MATCHERS as n}from"
|
|
1
|
+
import{EXEC_HOOKS as e,HOOK_EVENTS as t,HOOK_TOOL_MATCHERS as n}from"../../definitions/exec-hooks.mjs";const r={PreCompact:3e3,PostToolUse:3e3},i={copilot:`hooks.json`,claude:`hooks-settings.json`,copilotCli:`hooks.json`};function a(e,t){return(e.matcher||[]).flatMap(e=>{let r=n[e];if(!r)throw Error(`Unknown hook matcher: ${e}`);return r[t]||[]})}function o(e,t,n,i){let o=`${n}/${e.script}`;return a(e,i),i===`copilot`?{event:t,steps:[{type:`command`,command:`node`,args:[o],timeout:r[e.event]||5e3}]}:i===`claude`?{type:`command`,command:`node ${o}`}:{command:`node`,args:[o]}}function s(n,r){if(n===`copilot`){let a=Object.values(e).map(e=>{let i=t[e.event]?.[n];if(!i)throw Error(`Unsupported hook event ${e.event} for ${n}`);return o(e,i,r,n)});return[{path:i[n],content:JSON.stringify({hooks:a},null,2)}]}let a={};for(let i of Object.values(e)){let e=t[i.event]?.[n];if(!e)throw Error(`Unsupported hook event ${i.event} for ${n}`);a[e]||=[],a[e].push(o(i,e,r,n))}return[{path:i[n],content:JSON.stringify({hooks:a},null,2)}]}function c(){return[`_runtime.mjs`,...Object.values(e).map(e=>e.script)]}export{s as generateHooks,c as getHookScriptFiles};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{AGENTS as e}from"
|
|
1
|
+
import{AGENTS as e}from"../../definitions/agents.mjs";import{MCP_SERVER_ENTRY as t,SERVER_NAME as n}from"../../definitions/mcp.mjs";import{PROMPTS as r}from"../../definitions/prompts.mjs";import{buildMcpConfigJson as i,buildPromptFile as a,lowerFirst as o}from"../../adapters/_shared.mjs";function s(e){return e?.length?[`## Skills`,``,`| Skill | When to load |`,`|-------|--------------|`,...e.map(([e,t])=>`| ${e} | ${t} |`),``]:[]}function c(e,t,n,r,i){let a=[`# ${e} - ${t||e}`,``,`> ${n}`,``,`You are the **${e}**, ${o(n)}.`,``];return i&&a.push(i.trim(),``),a.push(...s(r)),a.join(`
|
|
2
2
|
`)}function l(){let o=[];o.push({path:`mcp.json`,content:`${i({serverName:n,mcpEntry:t,configKey:`mcpServers`})}\n`});for(let[e,t]of Object.entries(r))o.push({path:`.aiassistant/prompts/aikit-${e}.md`,content:a({title:`aikit ${e}`,content:[`> ${t.description}`,``,t.content.trim(),``].join(`
|
|
3
3
|
`)})});for(let[t,n]of Object.entries(e)){if(n.variants){for(let[e,r]of Object.entries(n.variants)){let i=`${t}-${e}`,a=r.description||n.description;o.push({path:`.aiassistant/prompts/agent-${i}.md`,content:c(i,n.title,a,n.skills,r.bodyAddendum)})}continue}o.push({path:`.aiassistant/prompts/agent-${t}.md`,content:c(t,n.title,n.description,n.skills)})}return o}export{l as generateIntelliJ};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AGENTS as e}from"
|
|
1
|
+
import{AGENTS as e}from"../../definitions/agents.mjs";import{AGENT_BODIES as t}from"../../definitions/bodies.mjs";import{HOOKS as n}from"../../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../../definitions/mcp.mjs";import{PROMPTS as a}from"../../definitions/prompts.mjs";import{PROTOCOLS as o}from"../../definitions/protocols.mjs";import{buildAgentTable as s,buildCompactAgentTable as c,buildHooksSection as l,buildPromptSections as u,buildSkillsSection as d,lowerFirst as f}from"../../adapters/_shared.mjs";const p=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
|
|
2
2
|
`),m=[`## Flows`,``,"This project uses aikit's pluggable flow system. Use `flow({ action: 'status' })` to check if a flow is active.",`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`].join(`
|
|
3
3
|
`);function h(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function g(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&o[e.sharedBase]&&t.push(o[e.sharedBase]);for(let n of e.sharedProtocols||[])o[n]&&t.push(o[n]);return t}function _(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function v(e){return _().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
|
|
4
4
|
`)}const y={orchestrator:{edit:`allow`,bash:`allow`},planner:{edit:`allow`,bash:`allow`},codeAgent:{edit:`allow`,bash:`allow`},refactor:{edit:`allow`,bash:`allow`},debugger:{edit:`allow`,bash:`allow`},security:{edit:`allow`,bash:`allow`},documenter:{edit:`allow`,bash:`deny`},explorer:{edit:`deny`,bash:`deny`},researcher:{edit:`deny`,bash:`deny`},reviewer:{edit:`deny`,bash:`deny`}};function b(e){let t=e.category===`orchestration`&&e.title===`The Master Conductor`?`primary`:`subagent`,n=y[e.toolRole]||{edit:`deny`,bash:`deny`},r=[`---`,`description: ${e.description}`,`mode: ${t}`,`permission:`];for(let[e,t]of Object.entries(n))r.push(` ${e}: ${t}`);return r.push(`---`),r.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SKILLS as e}from"
|
|
1
|
+
import{SKILLS as e}from"../../definitions/skills/index.mjs";import{ALL_BLOCK_DOCS as t,BLOCK_DOCS_BY_SKILL as n,BLOCK_TYPE_LIST as r}from"../../generated/block-docs.mjs";const i={bySkill:n,all:t,typeList:r};function a(){let t=[];for(let[n,r]of Object.entries(e)){let e=typeof r==`function`?r({blockDocs:i}):r;for(let{file:r,content:i}of e)t.push({path:`${n}/${r}`,content:i})}return t}export{a as generateSkills};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{AGENTS as e}from"
|
|
1
|
+
import{AGENTS as e}from"../../definitions/agents.mjs";import{MCP_SERVER_ENTRY as t,SERVER_NAME as n}from"../../definitions/mcp.mjs";import{PROMPTS as r}from"../../definitions/prompts.mjs";import{buildAgentPrompt as i,buildMcpConfigJson as a,buildPromptFile as o}from"../../adapters/_shared.mjs";function s(){let s=[];s.push({path:`.zed/settings.json`,content:`${a({serverName:n,mcpEntry:t,configKey:`context_servers`})}\n`});for(let[e,t]of Object.entries(r))s.push({path:`.zed/prompts/aikit-${e}.md`,content:o({title:`aikit ${e}`,content:[`> ${t.description}`,``,t.content.trim(),``].join(`
|
|
2
2
|
`)})});for(let[t,n]of Object.entries(e)){let e=n.title||t;if(n.variants){for(let[r,a]of Object.entries(n.variants)){let o=`${t}-${r}`,c=a.description||n.description;s.push({path:`.zed/prompts/agent-${o}.md`,content:i({name:o,title:e,description:c,skills:n.skills,bodyAddendum:a.bodyAddendum})})}continue}s.push({path:`.zed/prompts/agent-${t}.md`,content:i({name:t,title:e,description:n.description,skills:n.skills})})}return s}export{s as generateZed};
|
|
@@ -24,6 +24,6 @@ ${l}
|
|
|
24
24
|
${e(a)}
|
|
25
25
|
|
|
26
26
|
${o}
|
|
27
|
-
${s}`}}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,sharedProtocols:[`decision-protocol`,`forge-protocol`,`thinking-principles`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit recall, flow status, search, and ctx ref reuse`]]},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`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit reading plans, recall, and compressed context reuse`]]},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`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`]]},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`],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`]]},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`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`]]},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`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`]]},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`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing code — security patterns, type safety`]]},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`],category:`documentation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`present`,`When presenting documentation previews or architecture visuals to the user`],[`docs`,`When creating or updating project documentation — docs/ convention, architecture blueprints, Diátaxis framework`]]},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`],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`],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`]],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 `compact`/`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
|
|
27
|
+
${s}`}}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,sharedProtocols:[`conversation-compression`,`decision-protocol`,`forge-protocol`,`thinking-principles`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit recall, flow status, search, and ctx ref reuse`]]},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`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit reading plans, recall, and compressed context reuse`]]},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`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`]]},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`],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`]]},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`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`]]},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`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`]]},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`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing code — security patterns, type safety`]]},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`],category:`documentation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`present`,`When presenting documentation previews or architecture visuals to the user`],[`docs`,`When creating or updating project documentation — docs/ convention, architecture blueprints, Diátaxis framework`]]},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`],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`],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`]],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 `compact`/`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
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({ 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`],category:`review`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing TypeScript code — type patterns, best practices`]],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`],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`]],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,4 +1,4 @@
|
|
|
1
|
-
import{postTaskLesson as e,preTaskKnowledgeRecall as t}from"
|
|
1
|
+
import{postTaskLesson as e,preTaskKnowledgeRecall as t}from"../../definitions/protocols.mjs";const n=()=>``,r={Orchestrator:e=>`You orchestrate full lifecycle: **planning → implementation → review → recovery → commit**. You own contract: what, order, owner. \`multi-agents-development\` owns decomposition, dispatch, review craft. **Load that skill before delegation.**
|
|
2
2
|
|
|
3
3
|
## Critical Rules
|
|
4
4
|
|
|
@@ -26,6 +26,15 @@ import{postTaskLesson as e,preTaskKnowledgeRecall as t}from"./protocols.mjs";con
|
|
|
26
26
|
|
|
27
27
|
> **HARD RULE (Orchestrator):** When gathering context yourself, use \`search\`/\`file_summary\`/\`compact\`/\`digest\`, NOT \`read_file\`/\`grep_search\`. Use \`check({})\`/\`test_run({})\`, NOT \`run_in_terminal\` for tsc/lint/test.
|
|
28
28
|
|
|
29
|
+
## Conversation Compression (MANDATORY for multi-dispatch tasks)
|
|
30
|
+
|
|
31
|
+
Before dispatching the next subagent, compress the previous subagent's result.
|
|
32
|
+
Load the \`conversation-compression\` protocol for exact steps.
|
|
33
|
+
|
|
34
|
+
**Why:** Each subagent result appended raw to the conversation adds 3-10K tokens.
|
|
35
|
+
After 3+ dispatches, the context balloons to 80K+ tokens, reducing quality and increasing cost.
|
|
36
|
+
Compressing between dispatches keeps the context lean (25-50K) and cache hit rate high.
|
|
37
|
+
|
|
29
38
|
## Output Rules (HARD RULE)
|
|
30
39
|
**Plain text is allowed only when ALL are true:**
|
|
31
40
|
- Response is 1-2 short sentences.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
`)}function
|
|
1
|
+
import{DEFAULT_ROUTES as e}from"../../../packages/tool-routing/dist/index.mjs";function t(e){let t=e.toolName;if(e.commandPatterns&&e.commandPatterns.length>0){let n=e.description.match(/^(.*?)\s*→/);n&&(t=n[1].trim())}else if(e.heuristic){let n=e.description.match(/^(.*?)\s*→/);n&&(t=n[1].trim())}return{id:e.id,forbidden:t,alternative:e.alternative,severity:e.severity,reason:e.reason,matchPattern:e.commandPatterns?null:e.toolName,commandPatterns:e.commandPatterns??null,heuristic:e.heuristic??null}}const n=e.map(t);function r(){return[`| NEVER use this | USE THIS AI Kit TOOL INSTEAD | Why |`,`|---|---|---|`,...n.filter(e=>e.severity===`error`).map(e=>`| \`${e.forbidden}\` | \`${e.alternative}\` | ${e.reason} |`)].join(`
|
|
2
|
+
`)}function i(){return n.map(e=>({id:e.id,description:`${e.forbidden} → use ${e.alternative}`,toolMatch:e.matchPattern,commandPatterns:e.commandPatterns??null,heuristic:e.heuristic??null}))}export{n as POLICIES,r as generateForbiddenTable,i as generateScorerRules};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
import{generateForbiddenTable as e}from"../../definitions/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,10 +17,10 @@ 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
|
-
`),i)}function
|
|
22
|
+
`)}function i({title:e=`Knowledge Recall`,intro:t,commands:n,followUp:i}={}){return r(`## Pre-Task: ${e} (MANDATORY)`,t,["```",...(Array.isArray(n)?n:[n]).filter(Boolean),"```"].join(`
|
|
23
|
+
`),i)}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=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."),s=r(`## 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 `aikit` MCP server and user instructions become available."),c={"code-agent-base":`# Code Agent — Shared Base Instructions
|
|
24
24
|
|
|
25
25
|
> Shared protocol for code-writing agents. Agent-specific files should not duplicate it.
|
|
26
26
|
|
|
@@ -47,19 +47,7 @@ Before other work:
|
|
|
47
47
|
|
|
48
48
|
Use AI Kit retrieval/compression first. Native tools are fallback only.
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|---|---|---|
|
|
52
|
-
| \`read_file\` to understand a file | \`file_summary({ path })\` | Structure first |
|
|
53
|
-
| \`read_file\` to find code | \`compact({ path, query })\` | Fresh compression: \`compact({ path, query })\`; \`query\` is required unless \`ref\` is supplied |
|
|
54
|
-
| Multiple \`read_file\` calls | \`digest({ sources, query: "<task description>" })\` | Compress multi-file context |
|
|
55
|
-
| Cached ctxc ref to refocus prior output | \`compact({ ref })\` or \`compact({ ref, query? })\` | \`ctxc_...\` values are reversible refs, not ids or file paths |
|
|
56
|
-
| \`grep_search\` / \`semantic_search\` | \`search({ query })\` | Indexed search |
|
|
57
|
-
| \`grep_search\` for a symbol | \`symbol({ name })\` | Def + refs |
|
|
58
|
-
| \`run_in_terminal\` for tsc/lint | \`check({})\` | Narrow validation |
|
|
59
|
-
| \`run_in_terminal\` for test | \`test_run({})\` | Structured tests |
|
|
60
|
-
| Editing without reading | \`file_summary\` then targeted \`read_file\` | Safer edits |
|
|
61
|
-
| \`get_changed_files\` | \`run_in_terminal\` with \`git diff <specific-file>\` | Diff only target file |
|
|
62
|
-
| \`run_in_terminal\` for code edits | \`replace_string_in_file\` | Avoid shell-edit loops |
|
|
50
|
+
${e()}
|
|
63
51
|
|
|
64
52
|
> **Path Note:** \`compact({ path, query })\` and \`file_summary({ path })\` accept any absolute path. Cached \`ctxc_...\` values are reversible refs passed as \`ref\` to \`compact({ ref })\` or \`compact({ ref, query? })\`; do not invent a separate \`read\`/\`id\` contract.
|
|
65
53
|
|
|
@@ -358,7 +346,7 @@ Verify each before returning handoff:
|
|
|
358
346
|
|
|
359
347
|
---
|
|
360
348
|
|
|
361
|
-
${
|
|
349
|
+
${t(`<PROFILE>`)}
|
|
362
350
|
|
|
363
351
|
## Handoff Format
|
|
364
352
|
|
|
@@ -405,7 +393,7 @@ Follow **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-age
|
|
|
405
393
|
|
|
406
394
|
Start with pre-analyzed artifacts.
|
|
407
395
|
|
|
408
|
-
${
|
|
396
|
+
${t(`researcher`)}
|
|
409
397
|
|
|
410
398
|
## Research Methodology
|
|
411
399
|
|
|
@@ -498,7 +486,7 @@ Follow **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-age
|
|
|
498
486
|
2. If onboard shows ❌ → Run \`onboard({ path: '.' })\` and wait for completion
|
|
499
487
|
3. If onboard shows ✅ → Read relevant onboard artifacts using \`compact({ path: '<Onboard Directory>/<file>' })\` — especially \`patterns.md\` and \`api-surface.md\` for review context
|
|
500
488
|
|
|
501
|
-
${
|
|
489
|
+
${t(`reviewer`)}
|
|
502
490
|
|
|
503
491
|
## Review Workflow
|
|
504
492
|
|
|
@@ -550,7 +538,7 @@ ${e(`reviewer`)}
|
|
|
550
538
|
- **FAILED** for any CRITICAL finding
|
|
551
539
|
- Check test coverage on changed code
|
|
552
540
|
|
|
553
|
-
${
|
|
541
|
+
${n()}
|
|
554
542
|
`,"architect-reviewer-base":`# Architect-Reviewer — Shared Base Instructions
|
|
555
543
|
|
|
556
544
|
> Shared methodology for Architect-Reviewer variants. Do not duplicate.
|
|
@@ -563,7 +551,7 @@ Follow **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-age
|
|
|
563
551
|
2. If onboard shows ❌ → Run \`onboard({ path: '.' })\` and wait for completion
|
|
564
552
|
3. If onboard shows ✅ → Read relevant onboard artifacts using \`compact({ path: '<Onboard Directory>/<file>' })\` — especially \`structure.md\`, \`dependencies.md\`, and \`diagram.md\` for architecture context
|
|
565
553
|
|
|
566
|
-
${
|
|
554
|
+
${t(`reviewer`)}
|
|
567
555
|
|
|
568
556
|
## Review Workflow
|
|
569
557
|
|
|
@@ -611,7 +599,7 @@ ${e(`reviewer`)}
|
|
|
611
599
|
- **BLOCKED** — Fundamental design flaw requiring rethink
|
|
612
600
|
- Validate dependency direction
|
|
613
601
|
|
|
614
|
-
${
|
|
602
|
+
${n()}
|
|
615
603
|
|
|
616
604
|
## Graph-Assisted Layer Verification
|
|
617
605
|
|
|
@@ -864,7 +852,80 @@ evidence_map({ action: "gate", task_id: "add-user-api" }) → YIELD ✅
|
|
|
864
852
|
10. **Token budgets are binding.** Per-task: 4,000 tokens. Per-session: 30,000 tokens. Surface breaches; do not silently overrun.
|
|
865
853
|
11. **Checkpoint.** After every significant step, summarize what was done, what’s verified, what’s left.
|
|
866
854
|
12. **Fail loud.** “Completed” is wrong if tests were skipped. Default to surfacing uncertainty over false confidence.
|
|
867
|
-
|
|
855
|
+
`,"conversation-compression":`## Conversation Compression Protocol
|
|
856
|
+
|
|
857
|
+
> Use between subagent dispatches to prevent conversation context bloat (>80K tokens per request observed).
|
|
858
|
+
|
|
859
|
+
### When to compress
|
|
860
|
+
|
|
861
|
+
After EVERY subagent dispatch returns, BEFORE dispatching the next subagent.
|
|
862
|
+
|
|
863
|
+
Skip compression for:
|
|
864
|
+
- The FIRST dispatch (nothing to compress yet)
|
|
865
|
+
- Error/blocker results (include verbatim)
|
|
866
|
+
|
|
867
|
+
### Dispatch Loop Integration
|
|
868
|
+
|
|
869
|
+
The compression protocol fits into the Orchestrator existing dispatch loop as three steps:
|
|
870
|
+
|
|
871
|
+
> LOOP for each batch:
|
|
872
|
+
> Box 1 - WITHDRAW (before dispatching, skip first batch):
|
|
873
|
+
> - knowledge({action: withdraw, scope: flow, profile: <role>, budget: 4000})
|
|
874
|
+
> - Gives compressed context from prior steps
|
|
875
|
+
> Box 2 - DISPATCH:
|
|
876
|
+
> - runSubagent({agentName, prompt})
|
|
877
|
+
> - Include withdrawn context under ## Prior Context section
|
|
878
|
+
> - Subagent returns result
|
|
879
|
+
> Box 3 - DEPOSIT (skip for last batch):
|
|
880
|
+
> - knowledge({action: remember, scope: flow,
|
|
881
|
+
> title: step-summary: <task>,
|
|
882
|
+
> content: <key findings, files, decisions, blockers>,
|
|
883
|
+
> category: context})
|
|
884
|
+
> - Stores compressed summary for next iteration
|
|
885
|
+
> Then NEXT BATCH
|
|
886
|
+
|
|
887
|
+
### Full Example - 3-dispatch task
|
|
888
|
+
|
|
889
|
+
Batch 1 (first, no withdraw):
|
|
890
|
+
|
|
891
|
+
> 1. runSubagent({agentName: Explorer, prompt: Research auth module})
|
|
892
|
+
> 2. Explorer returns 5K result
|
|
893
|
+
> 3. knowledge({action: remember, scope: flow,
|
|
894
|
+
> title: step-summary: auth research,
|
|
895
|
+
> content: Findings: JWT-based, RS256, 3 files, keep JWT.,
|
|
896
|
+
> category: context})
|
|
897
|
+
> 4. Append only the summary (500 chars), NOT the full result
|
|
898
|
+
|
|
899
|
+
Batch 2:
|
|
900
|
+
|
|
901
|
+
> 1. knowledge({action: withdraw, scope: flow,
|
|
902
|
+
> profile: implementer, budget: 4000})
|
|
903
|
+
> 2. Include in prompt under ## Prior Context
|
|
904
|
+
> 3. runSubagent({agentName: Implementer, prompt})
|
|
905
|
+
> 4. Implementer returns 8K result
|
|
906
|
+
> 5. knowledge({action: remember, scope: flow,
|
|
907
|
+
> title: step-summary: login endpoint,
|
|
908
|
+
> content: <key findings>, category: context})
|
|
909
|
+
> 6. Append only the summary
|
|
910
|
+
|
|
911
|
+
Batch 3 (last, no deposit):
|
|
912
|
+
|
|
913
|
+
> 1. knowledge({action: withdraw, scope: flow,
|
|
914
|
+
> profile: reviewer, budget: 4000})
|
|
915
|
+
> 2. Include in review prompt
|
|
916
|
+
> 3. runSubagent({agentName: Code-Reviewer-Alpha, prompt})
|
|
917
|
+
> 4. Done
|
|
918
|
+
|
|
919
|
+
### Expected benefit
|
|
920
|
+
|
|
921
|
+
Reduces per-request token consumption by 40-70% (from ~85K to ~25-50K). Cache hit rate improves.
|
|
922
|
+
|
|
923
|
+
### Rules
|
|
924
|
+
- Do NOT compress the FIRST dispatch
|
|
925
|
+
- ALWAYS deposit findings BEFORE compressing
|
|
926
|
+
- Keep each step-summary under 2000 characters
|
|
927
|
+
- If a step produced errors or blockers, include those verbatim (do not compress)
|
|
928
|
+
- On completion: knowledge({action: flush, scope: flow:<run-id>})`},l={"execution-state":`# Execution State: {Task Title}
|
|
868
929
|
|
|
869
930
|
**Status:** PLANNING | IN_PROGRESS | REVIEW | COMPLETED | BLOCKED
|
|
870
931
|
**Started:** {timestamp}
|
|
@@ -900,7 +961,7 @@ evidence_map({ action: "gate", task_id: "add-user-api" }) → YIELD ✅
|
|
|
900
961
|
{If superseding, link: "Supersedes DR-NNN."}
|
|
901
962
|
|
|
902
963
|
## Decision
|
|
903
|
-
{What was decided and why
|
|
964
|
+
{What was decided and why - 2-5 sentences max}
|
|
904
965
|
|
|
905
966
|
## Decision Analysis Summary
|
|
906
967
|
| Model | Recommendation | Key Reasoning |
|
|
@@ -915,5 +976,5 @@ evidence_map({ action: "gate", task_id: "add-user-api" }) → YIELD ✅
|
|
|
915
976
|
**Risks:** {what could go wrong, and any mitigations}
|
|
916
977
|
|
|
917
978
|
## Alternatives Considered
|
|
918
|
-
{Other approaches evaluated and why they were rejected
|
|
919
|
-
`};export{
|
|
979
|
+
{Other approaches evaluated and why they were rejected - keeps the "why not" alongside the "why"}
|
|
980
|
+
`};export{s as AIKIT_INSTALL_HINT_SECTION,o as PLATFORM_OUTPUT_RULES_SECTION,c as PROTOCOLS,l as TEMPLATES,a as postTaskLesson,i as preTaskKnowledgeRecall};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{INJECT_VIEWER_SCRIPT as e}from"
|
|
1
|
+
import{INJECT_VIEWER_SCRIPT as e}from"../../../definitions/skills/_shared-viewer-inject.mjs";function t(){return[{file:`references/c4-syntax.md`,content:`# C4 Mermaid Quick Reference
|
|
2
2
|
|
|
3
3
|
Use this as a syntax reminder, not a full encyclopedia.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"
|
|
1
|
+
import e from"../../../definitions/skills/adr-skill.mjs";import t from"../../../definitions/skills/aikit.mjs";import n from"../../../definitions/skills/brainstorming.mjs";import r from"../../../definitions/skills/browser-use.mjs";import i from"../../../definitions/skills/c4-architecture.mjs";import a from"../../../definitions/skills/docs.mjs";import o from"../../../definitions/skills/frontend-design.mjs";import s from"../../../definitions/skills/lesson-learned.mjs";import c from"../../../definitions/skills/multi-agents-development.mjs";import l from"../../../definitions/skills/present.mjs";import u from"../../../definitions/skills/react.mjs";import d from"../../../definitions/skills/repo-access.mjs";import f from"../../../definitions/skills/requirements-clarity.mjs";import p from"../../../definitions/skills/session-handoff.mjs";import m from"../../../definitions/skills/typescript.mjs";const h={"adr-skill":e,aikit:t,brainstorming:n,"c4-architecture":i,docs:a,"frontend-design":o,"lesson-learned":s,"multi-agents-development":c,present:l,react:u,"repo-access":d,"requirements-clarity":f,"session-handoff":p,typescript:m,"browser-use":r};export{h as SKILLS};
|