@vpxa/aikit 0.1.362 → 0.1.363

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpxa/aikit",
3
- "version": "0.1.362",
3
+ "version": "0.1.363",
4
4
  "type": "module",
5
5
  "description": "Local-first AI developer toolkit — knowledge base, code analysis, context management, and developer tools for LLM agents",
6
6
  "license": "MIT",
@@ -2,7 +2,7 @@
2
2
  "manifest_version": "0.3",
3
3
  "name": "AI Kit",
4
4
  "display_name": "AI Kit",
5
- "version": "0.1.362",
5
+ "version": "0.1.363",
6
6
  "description": "Local-first AI developer toolkit — knowledge base, code analysis, context management, and developer tools for LLM agents",
7
7
  "author": {
8
8
  "name": "AnVPX",
@@ -36,7 +36,7 @@ After install, verify with:
36
36
  Options:
37
37
  --version <version> Install a specific version instead of latest
38
38
  --offline <path> Install from a local tarball (no network needed)
39
- --help, -h Show this help`;function sr(e){if(!rr.test(e))throw Error(`Invalid semver version: ${JSON.stringify(e)}`)}async function cr(){let e=await fetch(`https://registry.npmjs.org/${ar}/latest`,{signal:AbortSignal.timeout(1e4)});if(!e.ok)throw Error(`Failed to fetch latest version from npm registry (HTTP ${e.status})`);let t=await e.json();if(!t.version)throw Error(`npm registry response missing "version" field`);return t.version}function lr(e){let t=k(e,`packages`,`server`,`dist`,`bin.js`);if(!x(t))throw Error(`Server entry point not found at ${t}. The installation may be incomplete or corrupted.`);let n=k(e,`node_modules`);if(!x(n))throw Error(`node_modules not found at ${n}. Production dependencies may not have been installed.`)}function ur(e){let t=k(e,`package.json`),n=JSON.parse(C(t,`utf-8`));if(!n.version)throw Error(`No "version" field in ${t}`);return n.version}function dr(e){x(q)||S(q,{recursive:!0});let t=k(q,`current-version.json.tmp`);D(t,`${JSON.stringify({version:e},null,2)}\n`),T(t,ir)}function fr(e){let t=w(e).filter(e=>e.endsWith(`.tgz`));return t.length>0?t[0]:null}function pr(e,t){K.debug(`Extracting...`),z(`tar -xzf "${t}"`,{cwd:e,stdio:`pipe`,timeout:6e4});let n=k(e,`package`);if(!x(n))throw Error(`Expected "package/" directory not found after extraction`);return K.debug(`Installing production dependencies...`),z(`npm ${Fe.join(` `)}`,{cwd:n,stdio:`pipe`,timeout:3e5}),n}function mr(e,t){let n=k(J,`v${t}`);x(J)||S(J,{recursive:!0}),x(n)&&(K.debug(`Removing previous installation...`,{target:n}),E(n,{recursive:!0})),T(e,n),dr(t),Ie(J,t),K.debug(`Installation complete`,{package:`${ar}@${t}`,target:n})}function hr(){let e={win32:`win32`,darwin:`darwin`,linux:`linux`},t={x64:`x64`,arm64:`arm64`},n=e[Me()],r=t[je()];return!n||!r?(K.warn(`Unknown platform, falling back to npm pack`,{platform:Me(),arch:je()}),``):`${n}-${r}`}function gr(e){let t=hr();if(!t)return null;let n=`aikit-v${e}-${t}.tar.gz`,r=k(k(q,`cache`,`tarballs`),n);return x(r)?r:null}function _r(e,t){let n=k(J,`v${t}-staging`);x(n)&&E(n,{recursive:!0}),S(n,{recursive:!0});try{K.debug(`Extracting prebuilt tarball...`),z(`tar -xzf "${e}"`,{cwd:n,stdio:`pipe`,timeout:6e4});let r=k(n,`aikit-v${t}-${hr()}`);if(!x(r)){let e=k(n,`package`);if(x(e)){K.debug(`Validating installation...`),lr(e),mr(e,t);return}throw Error(`Expected directory not found after extracting prebuilt tarball`)}K.debug(`Validating installation...`),lr(r),mr(r,t)}finally{x(n)&&E(n,{recursive:!0})}}function vr(e){sr(e);let t=gr(e);if(t){K.debug(`Found prebuilt tarball`,{path:t}),_r(t,e);return}let n=k(J,`v${e}-staging`);x(n)&&E(n,{recursive:!0}),S(n,{recursive:!0});try{K.debug(`Downloading...`,{package:`${ar}@${e}`}),z(`npm pack ${ar}@${e} 2>${process.platform===`win32`?`NUL`:`/dev/null`}`,{cwd:n,stdio:`pipe`,timeout:12e4});let t=fr(n);if(!t)throw Error(`No .tgz file found after npm pack`);let r=pr(n,t);K.debug(`Validating installation...`),lr(r),mr(r,e)}finally{x(n)&&E(n,{recursive:!0})}}function yr(e){sr(e);let t=k(J,`v${e}`);try{lr(t),dr(e)}catch{vr(e)}}function br(e){if(!x(e))throw Error(`Tarball not found: ${e}`);let t=k(J,`_offline-detect-${Date.now()}`);S(t,{recursive:!0});let n;try{z(`tar -xzf "${e}"`,{cwd:t,stdio:`pipe`,timeout:6e4}),n=ur(k(t,`package`))}finally{x(t)&&E(t,{recursive:!0})}K.debug(`Installing from local tarball...`,{package:`${ar}@${n}`});let r=k(J,`v${n}-staging`);x(r)&&E(r,{recursive:!0}),S(r,{recursive:!0});try{Te(e,k(r,`offline-${n}.tgz`));let t=pr(r,`offline-${n}.tgz`);return K.debug(`Validating installation...`),lr(t),mr(t,n),n}finally{x(r)&&E(r,{recursive:!0})}}async function xr(e){try{let t=k(J,`v${e}`,`packages`,`server`,`dist`,`bin.js`);if(!x(t)){K.warn(`Server entry not found — skipping MCP registration`,{serverPath:t});return}let n={command:g.command,args:g.args?[...g.args]:void 0,type:g.type};if(process.platform!==`win32`){let e=process.env.PATH;e&&(n.env={PATH:e});try{let e=fn(`which`,[`node`],{encoding:`utf-8`,timeout:3e3}).trim();e&&x(e)&&(n.command=e)}catch{}}let r=await nr({scope:`user`});if(r.length===0){K.info(`No supported IDEs detected for MCP registration`);return}for(let e of r)try{(await e.readConfig())?.[e.configKey]?.aikit&&(await e.unregisterMcp(p),K.info(`Migrated ${e.name}: old '${p}' → '${F}'`))}catch{}let i=0;for(let e of r)try{await e.registerMcp(F,n),i++}catch(t){K.warn(`Failed to register MCP for ${e.name}`,{error:t.message})}i>0&&K.info(`MCP server configured for ${i} IDE(s) — using '${F}'`)}catch(e){K.warn(`MCP registration failed`,{error:e.message})}}const Sr=[{name:`install`,description:`Install AI Kit to ~/.aikit/versions/ (one-time setup for fast local startup)`,usage:or,run:async e=>{let t=e.indexOf(`--version`),n=e.indexOf(`--offline`),r=t!==-1&&t+1<e.length,i=n!==-1&&n+1<e.length;if(e.includes(`--help`)||e.includes(`-h`)){console.log(or);return}if(i){let t=e[n+1];await xr(br(t)),K.debug(`Install complete — restart your IDE to use the new version`);return}let a;r?a=e[t+1]:(K.debug(`Checking npm registry for latest version...`),a=await cr(),K.debug(`Latest version detected`,{version:a})),vr(a),await xr(a),K.debug(`Install complete — restart your IDE to use the new version`)}}];function Cr(){let e=wr();if(e)return e;let t={command:g.command,args:g.args?[...g.args]:void 0,type:g.type};if(process.platform!==`win32`){let e=process.env.PATH;e&&(t.env={PATH:e});try{let e=fn(`which`,[`node`],{encoding:`utf-8`,timeout:3e3}).trim();e&&x(e)&&(t.command=e)}catch{}}return t}function wr(){let e=k(N(),`.aikit`,`current-version.json`);if(!x(e))return null;try{let t=JSON.parse(C(e,`utf-8`));if(typeof t.version!=`string`||t.version.length===0||!x(k(k(N(),`.aikit`,`versions`,`v${t.version}`),`packages`,`server`,`dist`,`bin.js`)))return null;let n={command:g.command,args:g.args?[...g.args]:void 0,type:g.type};if(process.platform!==`win32`){let e=process.env.PATH;e&&(n.env={PATH:e});try{let e=fn(`which`,[`node`],{encoding:`utf-8`,timeout:3e3}).trim();e&&x(e)&&(n.command=e)}catch{}}return n}catch{return null}}const Tr=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`]);function Er(e,t,n){let r=j(N(),`.copilot`,`instructions`,`copilot-instructions.md`);!x(r)||n.has(r)||(S(O(r),{recursive:!0}),D(r,`---\napplyTo: "**"\n---\n\n${e}\n---\n\n${t}`,`utf-8`),n.add(r))}function Dr(e,t=!1){if(!Tr.has(e.name))return;let n=j(O(e.getConfigPath()),`settings.json`),r={};if(x(n))try{let e=C(n,`utf-8`);r=JSON.parse(e)}catch{console.log(` ${e.name}: skipped settings.json (invalid JSON)`);return}let i=!1;for(let[e,n]of Object.entries(ve))if(typeof n==`object`&&n){let t=typeof r[e]==`object`&&r[e]!==null?r[e]:{},a={...t,...n};JSON.stringify(a)!==JSON.stringify(t)&&(r[e]=a,i=!0)}else(t||!(e in r))&&(r[e]=n,i=!0);i&&(D(n,`${JSON.stringify(r,null,2)}\n`,`utf-8`),console.log(` ${e.name}: updated settings.json`))}async function Or(r,o,s,c,l=!1){let u=new Map,d=new Set,f=he(`aikit`,s),ee=ye(`aikit`,s);for(let e of o)e.getScaffoldRoot()!==null&&u.set(e.id,e);if(Er(f,ee,d),u.size===0){d.size>0?console.log(` Instruction files: ${[...d].join(`, `)}`):console.log(` No IDEs with global scaffold support detected.`);return}let te=await n(r,`copilot`),ne=await n(r,`opencode`),re=await n(r,`hermes-agent`),ie=await n(r,`claude-code`),ae=e=>{let t=new Map;for(let n of e){let e=n.path.indexOf(`/`);if(e===-1)continue;let r=n.path.substring(0,e);if(r===`agents`||r===`prompts`){let i=t.get(r)??[];i.push({path:n.path.substring(e+1),content:n.content}),t.set(r,i)}else if(r===`.opencode`){let r=n.path.indexOf(`/`,e+1);if(r!==-1&&n.path.substring(e+1,r)===`agents`){let e=t.get(`agents`)??[];e.push({path:n.path.substring(r+1),content:n.content}),t.set(`agents`,e)}}else if(r===`.claude`){let r=n.path.indexOf(`/`,e+1);if(r!==-1&&n.path.substring(e+1,r)===`agents`){let e=t.get(`agents`)??[];e.push({path:n.path.substring(r+1),content:n.content}),t.set(`agents`,e)}}}return t},oe=ae(te),se=ae(ne),ce=ae(re),p=ae(ie),le=await n(r,`skills`),ue=new Set;for(let e of le){let t=e.path.indexOf(`/`);t!==-1&&ue.add(e.path.substring(0,t))}let m=await n(r,`flows`),de=new Set;for(let e of m){let t=e.path.indexOf(`/`);t!==-1&&de.add(e.path.substring(0,t))}let fe=await n(r,`claude-code`),h=j(r,`scaffold`,`general`,`hooks`,`scripts`),g=x(h)?h:j(import.meta.dirname,`../../../../../scaffold/general/hooks/scripts`),pe=be(),_=new Set,v=new Set,ge=new Set,y=(n,r,o,s)=>{let u=s.get(o);if(!n||!r||!u||u.length===0)return;let d=`${o}:${r}:${n}`;if(_.has(d))return;_.add(d);let f=e(r)??a(c);f.version=c,i(u,n,f,o,l),t(r,f),ge.add(O(r))},_e=(n,r,o,s)=>{if(!n||!r||s.length===0)return;let u=`${o}:${r}:${n}`;if(_.has(u))return;if(_.add(u),o===`flows`&&!v.has(n)){for(let e of de){let t=j(n,e,`skills`);x(t)&&(E(t,{recursive:!0,force:!0}),console.log(` ${O(r)}: migrated ${e} flow to steps/ layout`))}v.add(n)}let d=e(r)??a(c);d.version=c,i(s,n,d,o,l),t(r,d),ge.add(O(r))},ve=(e,t,n)=>{!e||!t||_e(e,t,`hooks`,[...me(n,j(e,`scripts`).replace(/\\/g,`/`)),...pe.map(e=>({path:`scripts/${e}`,content:C(j(g,e),`utf-8`)}))])};for(let e of u.values()){let t=e.getScaffoldPaths(),n=e.family===`opencode`?se:e.family===`hermes`?ce:e.family===`claude`?p:oe;y(t.agents,t.manifest,`agents`,n),y(t.prompts,t.manifest,`prompts`,n),_e(t.skills,t.manifest,`skills`,le),_e(t.flows,t.manifest,`flows`,m),_e(t.commands,t.manifest,`commands`,fe),ve(t.hooks,t.manifest,e.family===`claude`?`claude`:`copilot`)}for(let e of ge)console.log(` ${e}: scaffold updated (${ue.size} skills)`);for(let e of u.values()){let t=e.getScaffoldPaths().instructions;!t||d.has(t)||(S(O(t),{recursive:!0}),D(t,e.buildInstructionContent(f,ee),`utf-8`),d.add(t))}d.size>0&&console.log(` Instruction files: ${[...d].join(`, `)}`)}function kr(e){let t=[];for(let n of e){let e=n.getScaffoldRoot();if(e){if(Tr.has(n.name)){let r=n.getInstructionsRoot()??e;t.push(j(r,`kb.instructions.md`)),t.push(j(r,`aikit.instructions.md`))}else if(n.name===`Cursor`||n.name===`Cursor Nightly`)t.push(j(e,`rules`,`kb.mdc`));else if(n.name===`Windsurf`)t.push(j(e,`rules`,`kb.md`));else if(n.family===`claude`){let n=j(e,`agents`);if(x(n)){for(let e of w(n))if(e.endsWith(`.agent.md`)){let r=j(n,e);De(r),t.push(r)}}}}}for(let e of t)x(e)&&(De(e),console.log(` Removed legacy file: ${e}`))}async function Ar(e){let t=F,n=ce(),r=JSON.parse(C(j(n,`package.json`),`utf-8`)).version;console.log(`Initializing @vpxa/aikit v${r}...\n`);let i=Le();S(i,{recursive:!0}),console.log(` Global data store: ${i}`),console.log(` Managed runtime: v${r}`),yr(r),Ue({version:1,workspaces:{}}),console.log(` Created registry.json`);let a=await nr({scope:`user`});if(a.length===0)console.log(`
39
+ --help, -h Show this help`;function sr(e){if(!rr.test(e))throw Error(`Invalid semver version: ${JSON.stringify(e)}`)}async function cr(){let e=await fetch(`https://registry.npmjs.org/${ar}/latest`,{signal:AbortSignal.timeout(1e4)});if(!e.ok)throw Error(`Failed to fetch latest version from npm registry (HTTP ${e.status})`);let t=await e.json();if(!t.version)throw Error(`npm registry response missing "version" field`);return t.version}function lr(e){let t=k(e,`packages`,`server`,`dist`,`bin.js`);if(!x(t))throw Error(`Server entry point not found at ${t}. The installation may be incomplete or corrupted.`);let n=k(e,`node_modules`);if(!x(n))throw Error(`node_modules not found at ${n}. Production dependencies may not have been installed.`)}function ur(e){let t=k(e,`package.json`),n=JSON.parse(C(t,`utf-8`));if(!n.version)throw Error(`No "version" field in ${t}`);return n.version}function dr(e){x(q)||S(q,{recursive:!0});let t=k(q,`current-version.json.tmp`);D(t,`${JSON.stringify({version:e},null,2)}\n`),T(t,ir)}function fr(e){let t=w(e).filter(e=>e.endsWith(`.tgz`));return t.length>0?t[0]:null}function pr(e,t){K.debug(`Extracting...`),z(`tar -xzf "${t}"`,{cwd:e,stdio:`pipe`,timeout:6e4});let n=k(e,`package`);if(!x(n))throw Error(`Expected "package/" directory not found after extraction`);return K.debug(`Installing production dependencies...`),z(`npm ${Fe.join(` `)}`,{cwd:n,stdio:`pipe`,timeout:3e5}),n}function mr(e,t){let n=k(J,`v${t}`);x(J)||S(J,{recursive:!0}),x(n)&&(K.debug(`Removing previous installation...`,{target:n}),E(n,{recursive:!0})),T(e,n),dr(t),Ie(J,t),K.debug(`Installation complete`,{package:`${ar}@${t}`,target:n})}function hr(){let e={win32:`win32`,darwin:`darwin`,linux:`linux`},t={x64:`x64`,arm64:`arm64`},n=e[Me()],r=t[je()];return!n||!r?(K.warn(`Unknown platform, falling back to npm pack`,{platform:Me(),arch:je()}),``):`${n}-${r}`}function gr(e){let t=hr();if(!t)return null;let n=`aikit-v${e}-${t}.tar.gz`,r=k(k(q,`cache`,`tarballs`),n);return x(r)?r:null}function _r(e,t){let n=k(J,`v${t}-staging`);x(n)&&E(n,{recursive:!0}),S(n,{recursive:!0});try{K.debug(`Extracting prebuilt tarball...`),z(`tar -xzf "${e}"`,{cwd:n,stdio:`pipe`,timeout:6e4});let r=k(n,`aikit-v${t}-${hr()}`);if(!x(r)){let e=k(n,`package`);if(x(e)){K.debug(`Validating installation...`),lr(e),mr(e,t);return}throw Error(`Expected directory not found after extracting prebuilt tarball`)}K.debug(`Validating installation...`),lr(r),mr(r,t)}finally{x(n)&&E(n,{recursive:!0})}}function vr(e){sr(e);let t=gr(e);if(t){K.debug(`Found prebuilt tarball`,{path:t}),_r(t,e);return}let n=k(J,`v${e}-staging`);x(n)&&E(n,{recursive:!0}),S(n,{recursive:!0});try{K.debug(`Downloading...`,{package:`${ar}@${e}`}),z(`npm pack ${ar}@${e} 2>${process.platform===`win32`?`NUL`:`/dev/null`}`,{cwd:n,stdio:`pipe`,timeout:12e4});let t=fr(n);if(!t)throw Error(`No .tgz file found after npm pack`);let r=pr(n,t);K.debug(`Validating installation...`),lr(r),mr(r,e)}finally{x(n)&&E(n,{recursive:!0})}}function yr(e){sr(e);let t=k(J,`v${e}`);try{lr(t),dr(e)}catch{vr(e)}}function br(e){if(!x(e))throw Error(`Tarball not found: ${e}`);let t=k(J,`_offline-detect-${Date.now()}`);S(t,{recursive:!0});let n;try{z(`tar -xzf "${e}"`,{cwd:t,stdio:`pipe`,timeout:6e4}),n=ur(k(t,`package`))}finally{x(t)&&E(t,{recursive:!0})}K.debug(`Installing from local tarball...`,{package:`${ar}@${n}`});let r=k(J,`v${n}-staging`);x(r)&&E(r,{recursive:!0}),S(r,{recursive:!0});try{Te(e,k(r,`offline-${n}.tgz`));let t=pr(r,`offline-${n}.tgz`);return K.debug(`Validating installation...`),lr(t),mr(t,n),n}finally{x(r)&&E(r,{recursive:!0})}}async function xr(e){try{let t=k(J,`v${e}`,`packages`,`server`,`dist`,`bin.js`);if(!x(t)){K.warn(`Server entry not found — skipping MCP registration`,{serverPath:t});return}let n={command:g.command,args:g.args?[...g.args]:void 0,type:g.type};if(process.platform!==`win32`){let e=process.env.PATH;e&&(n.env={PATH:e});try{let e=fn(`which`,[`node`],{encoding:`utf-8`,timeout:3e3}).trim();e&&x(e)&&(n.command=e)}catch{}}let r=await nr({scope:`user`});if(r.length===0){K.info(`No supported IDEs detected for MCP registration`);return}for(let e of r)try{(await e.readConfig())?.[e.configKey]?.aikit&&(await e.unregisterMcp(p),K.info(`Migrated ${e.name}: old '${p}' → '${F}'`))}catch{}let i=0;for(let e of r)try{await e.registerMcp(F,n),i++}catch(t){K.warn(`Failed to register MCP for ${e.name}`,{error:t.message})}i>0&&K.info(`MCP server configured for ${i} IDE(s) — using '${F}'`)}catch(e){K.warn(`MCP registration failed`,{error:e.message})}}const Sr=[{name:`install`,description:`Install AI Kit to ~/.aikit/versions/ (one-time setup for fast local startup)`,usage:or,run:async e=>{let t=e.indexOf(`--version`),n=e.indexOf(`--offline`),r=t!==-1&&t+1<e.length,i=n!==-1&&n+1<e.length;if(e.includes(`--help`)||e.includes(`-h`)){console.log(or);return}if(i){let t=e[n+1];await xr(br(t)),K.debug(`Install complete — restart your IDE to use the new version`);return}let a;r?a=e[t+1]:(K.debug(`Checking npm registry for latest version...`),a=await cr(),K.debug(`Latest version detected`,{version:a})),vr(a),await xr(a),K.debug(`Install complete — restart your IDE to use the new version`)}}];function Cr(){let e=wr();if(e)return e;let t={command:g.command,args:g.args?[...g.args]:void 0,type:g.type};if(process.platform!==`win32`){let e=process.env.PATH;e&&(t.env={PATH:e});try{let e=fn(`which`,[`node`],{encoding:`utf-8`,timeout:3e3}).trim();e&&x(e)&&(t.command=e)}catch{}}return t}function wr(){let e=k(N(),`.aikit`,`current-version.json`);if(!x(e))return null;try{let t=JSON.parse(C(e,`utf-8`));if(typeof t.version!=`string`||t.version.length===0||!x(k(k(N(),`.aikit`,`versions`,`v${t.version}`),`packages`,`server`,`dist`,`bin.js`)))return null;let n={command:g.command,args:g.args?[...g.args]:void 0,type:g.type};if(process.platform!==`win32`){let e=process.env.PATH;e&&(n.env={PATH:e});try{let e=fn(`which`,[`node`],{encoding:`utf-8`,timeout:3e3}).trim();e&&x(e)&&(n.command=e)}catch{}}return n}catch{return null}}const Tr=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`]);function Er(e,t,n){let r=j(N(),`.copilot`,`instructions`,`copilot-instructions.md`);!x(r)||n.has(r)||(S(O(r),{recursive:!0}),D(r,`---\napplyTo: "**"\n---\n\n${e}\n---\n\n${t}`,`utf-8`),n.add(r))}function Dr(e,t=!1){if(!Tr.has(e.name))return;let n=j(O(e.getConfigPath()),`settings.json`),r={};if(x(n))try{let e=C(n,`utf-8`);r=JSON.parse(e)}catch{console.log(` ${e.name}: skipped settings.json (invalid JSON)`);return}let i=!1;for(let[e,n]of Object.entries(ve))if(typeof n==`object`&&n){let t=typeof r[e]==`object`&&r[e]!==null?r[e]:{},a={...t,...n};JSON.stringify(a)!==JSON.stringify(t)&&(r[e]=a,i=!0)}else(t||!(e in r))&&(r[e]=n,i=!0);i&&(D(n,`${JSON.stringify(r,null,2)}\n`,`utf-8`),console.log(` ${e.name}: updated settings.json`))}async function Or(r,o,s,c,l=!1){let u=new Map,d=new Set,f=he(`aikit`,s),ee=ye(`aikit`,s);for(let e of o)e.getScaffoldRoot()!==null&&u.set(e.id,e);if(Er(f,ee,d),u.size===0){d.size>0?console.log(` Instruction files: ${[...d].join(`, `)}`):console.log(` No IDEs with global scaffold support detected.`);return}let te=await n(r,`copilot`),ne=await n(r,`opencode`),re=await n(r,`hermes`),ie=await n(r,`claude-code`),ae=e=>{let t=new Map;for(let n of e){let e=n.path.indexOf(`/`);if(e===-1)continue;let r=n.path.substring(0,e);if(r===`agents`||r===`prompts`){let i=t.get(r)??[];i.push({path:n.path.substring(e+1),content:n.content}),t.set(r,i)}else if(r===`.opencode`){let r=n.path.indexOf(`/`,e+1);if(r!==-1&&n.path.substring(e+1,r)===`agents`){let e=t.get(`agents`)??[];e.push({path:n.path.substring(r+1),content:n.content}),t.set(`agents`,e)}}else if(r===`.claude`){let r=n.path.indexOf(`/`,e+1);if(r!==-1&&n.path.substring(e+1,r)===`agents`){let e=t.get(`agents`)??[];e.push({path:n.path.substring(r+1),content:n.content}),t.set(`agents`,e)}}}return t},oe=ae(te),se=ae(ne),ce=ae(re),p=ae(ie),le=await n(r,`skills`),ue=new Set;for(let e of le){let t=e.path.indexOf(`/`);t!==-1&&ue.add(e.path.substring(0,t))}let m=await n(r,`flows`),de=new Set;for(let e of m){let t=e.path.indexOf(`/`);t!==-1&&de.add(e.path.substring(0,t))}let fe=await n(r,`claude-code`),h=j(r,`scaffold`,`general`,`hooks`,`scripts`),g=x(h)?h:j(import.meta.dirname,`../../../../../scaffold/general/hooks/scripts`),pe=be(),_=new Set,v=new Set,ge=new Set,y=(n,r,o,s)=>{let u=s.get(o);if(!n||!r||!u||u.length===0)return;let d=`${o}:${r}:${n}`;if(_.has(d))return;_.add(d);let f=e(r)??a(c);f.version=c,i(u,n,f,o,l),t(r,f),ge.add(O(r))},_e=(n,r,o,s)=>{if(!n||!r||s.length===0)return;let u=`${o}:${r}:${n}`;if(_.has(u))return;if(_.add(u),o===`flows`&&!v.has(n)){for(let e of de){let t=j(n,e,`skills`);x(t)&&(E(t,{recursive:!0,force:!0}),console.log(` ${O(r)}: migrated ${e} flow to steps/ layout`))}v.add(n)}let d=e(r)??a(c);d.version=c,i(s,n,d,o,l),t(r,d),ge.add(O(r))},ve=(e,t,n)=>{!e||!t||_e(e,t,`hooks`,[...me(n,j(e,`scripts`).replace(/\\/g,`/`)),...pe.map(e=>({path:`scripts/${e}`,content:C(j(g,e),`utf-8`)}))])};for(let e of u.values()){let t=e.getScaffoldPaths(),n=e.family===`opencode`?se:e.family===`hermes`?ce:e.family===`claude`?p:oe;y(t.agents,t.manifest,`agents`,n),y(t.prompts,t.manifest,`prompts`,n),_e(t.skills,t.manifest,`skills`,le),_e(t.flows,t.manifest,`flows`,m),_e(t.commands,t.manifest,`commands`,fe),ve(t.hooks,t.manifest,e.family===`claude`?`claude`:`copilot`)}for(let e of ge)console.log(` ${e}: scaffold updated (${ue.size} skills)`);for(let e of u.values()){let t=e.getScaffoldPaths().instructions;!t||d.has(t)||(S(O(t),{recursive:!0}),D(t,e.buildInstructionContent(f,ee),`utf-8`),d.add(t))}d.size>0&&console.log(` Instruction files: ${[...d].join(`, `)}`)}function kr(e){let t=[];for(let n of e){let e=n.getScaffoldRoot();if(e){if(Tr.has(n.name)){let r=n.getInstructionsRoot()??e;t.push(j(r,`kb.instructions.md`)),t.push(j(r,`aikit.instructions.md`))}else if(n.name===`Cursor`||n.name===`Cursor Nightly`)t.push(j(e,`rules`,`kb.mdc`));else if(n.name===`Windsurf`)t.push(j(e,`rules`,`kb.md`));else if(n.family===`claude`){let n=j(e,`agents`);if(x(n)){for(let e of w(n))if(e.endsWith(`.agent.md`)){let r=j(n,e);De(r),t.push(r)}}}}}for(let e of t)x(e)&&(De(e),console.log(` Removed legacy file: ${e}`))}async function Ar(e){let t=F,n=ce(),r=JSON.parse(C(j(n,`package.json`),`utf-8`)).version;console.log(`Initializing @vpxa/aikit v${r}...\n`);let i=Le();S(i,{recursive:!0}),console.log(` Global data store: ${i}`),console.log(` Managed runtime: v${r}`),yr(r),Ue({version:1,workspaces:{}}),console.log(` Created registry.json`);let a=await nr({scope:`user`});if(a.length===0)console.log(`
40
40
  No supported IDEs detected. You can manually add the MCP server config.`);else{console.log(`\n Detected ${a.length} IDE(s):`);let n=wr();if(!n)throw Error(`Managed runtime v${r} was installed but its MCP server entry could not be resolved.`);for(let e of a)try{await e.registerMcp(t,n),console.log(` ${e.name}: configured ${t}`)}catch(t){console.log(` ${e.name}: failed to configure (${t.message})`)}for(let t of a)Dr(t,e.force)}console.log(`
41
41
  Installing scaffold files:`),await Or(n,a,t,r,e.force),kr(a),console.log(`
42
42
  User-level AI Kit installation complete!`),console.log(`
@@ -12,4 +12,4 @@ import{renderLayeredKnowledgeOperatingPolicyV1 as e}from"../definitions/protocol
12
12
  `)}`:`| Agent | Purpose | Category |\n|-------|---------|----------|\n${r.join(`
13
13
  `)}`}function _(e){let t=[];for(let[n,r]of Object.entries(e)){if(n===`Orchestrator`)continue;let e=r.compactRole||r.description;if(r.variants){let i=Object.keys(r.variants);t.push(`| **${n}-${i.join(`/`)}** | ${e} |`)}else t.push(`| **${n}** | ${e} |`)}return`| Agent | Role |\n|-------|------|\n${t.join(`
14
14
  `)}`}function v({serverName:e,mcpEntry:t,configKey:n,extraServerFields:r}){let i={...t};return r&&Object.assign(i,r),JSON.stringify({[n]:{[e]:i}},null,2)}function y({flowTool:t=`flow`,isLifecycleOwner:n=!0}={}){let r=[`## Flows`,``,`This project uses aikit's pluggable flow system. Check flow status with the \`${t}\` MCP tool.`,``];return n?r.push(e({audience:`agent`}),``,`Use \`${t}({ action: 'list' })\` to see available flows and \`${t}({ action: 'start', name, topic })\` to begin one.`,``,`If a flow is active, follow the current step's skill instructions. Advance with \`${t}({ action: 'step', advance: 'next' })\`.`):r.push(`This project uses aikit's pluggable flow system. Use \`${t}({ action: 'status' })\` to check if a flow is active.`,`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`),r.join(`
15
- `)}function b({flowTool:e=`flow`}={}){return y({flowTool:e,isLifecycleOwner:!1})}export{r as buildAgentPrompt,g as buildAgentTable,_ as buildCompactAgentTable,l as buildEventBusNote,y as buildFlowSection,m as buildHooksSection,i as buildInlineAgentSection,v as buildMcpConfigJson,a as buildPromptFile,o as buildPromptSections,n as buildSkillsSection,b as buildSubagentFlowSection,t as lowerFirst};
15
+ `)}function b({flowTool:e=`flow`}={}){return y({flowTool:e,isLifecycleOwner:!1})}const x=`You MUST follow the Orchestrator Protocol: decompose every task into subtasks, delegate via Task()/sub-agents, and synthesize results. You are an orchestrator, not an implementer. Never write code directly unless the change is trivially small (≤5 lines, one file) or you are fixing a sub-agent's output. When in doubt, delegate.`;function S(e){return[`# ${x}`,``,...e]}export{x as ORCHESTRATOR_DIRECTIVE,r as buildAgentPrompt,g as buildAgentTable,_ as buildCompactAgentTable,l as buildEventBusNote,y as buildFlowSection,m as buildHooksSection,i as buildInlineAgentSection,v as buildMcpConfigJson,a as buildPromptFile,o as buildPromptSections,n as buildSkillsSection,b as buildSubagentFlowSection,S as injectOrchestratorDirective,t as lowerFirst};
@@ -1,8 +1,8 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as a}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as o}from"../definitions/platform-capabilities.mjs";import{PROMPTS as s}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as c,PLATFORM_OUTPUT_RULES_SECTION as l,PROTOCOLS as u}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as d,CLAUDE_CODE_TOOL_MAP as f,IDE_CAPABILITIES as p}from"../definitions/tools.mjs";import{buildAgentTable as m,buildCompactAgentTable as h,buildFlowSection as g,buildHooksSection as _,buildMcpConfigJson as v,buildSkillsSection as y,lowerFirst as b}from"./_shared.mjs";const x=g({flowTool:`flow`,isLifecycleOwner:!0}),S=g({flowTool:`flow`,isLifecycleOwner:!0}),C=g({flowTool:`flow`,isLifecycleOwner:!1});function w(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function T(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function E(e){let t=(p[e]||[]).flatMap(e=>f[e]||[]),n=d.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function D(e,t){let n=[];return n.push(`# ${i} ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
2
- `)}function O(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function k(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&u[e.sharedBase]&&t.push(u[e.sharedBase]);for(let n of e.sharedProtocols||[])u[n]&&t.push(u[n]);return t}function A(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function j(e){return A().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
3
- `)}function M(t=m(e,a(`claude-code`))){return[`# ${i} — Claude Code Agents`,``,l,``,c,``,`## MCP Server`,``,`Server name: \`${i}\``,"Configured in `.mcp.json` (project) and `~/.claude.json` (user-global — `claude mcp add --scope user` format).","Default agent: `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator automatically.",``,`## Agents`,``,t,``,`## Agent Files`,``,j(`.claude/agents`),``,`## Commands`,``,"Slash commands live under `.claude/commands/`.",``,`## Session Protocol`,``,_(n,o[`claude-code`]),``].join(`
4
- `)}function N(){return[`# ${i} — Claude Code Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Full sub-agent instructions live in `.claude/agents/`.","Slash commands live in `.claude/commands/`.","MCP server config lives in `.mcp.json` (project) and `~/.claude.json` (user-global — written by `claude mcp add --scope user`).","Default agent set to `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator, no `/agent` command needed.",``,"Start with `AGENTS.md`, then open the specific sub-agent file you want to use.",``,l,``,c,``].join(`
5
- `)}function P(e,t,n,r,a){let o=E(t.toolRole),s=k(t),c=y(t.skills),l=e===`Orchestrator`?[x,S]:[C],u=[n,...s,t.bodyAddendum,c,...l].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as a}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as o}from"../definitions/platform-capabilities.mjs";import{PROMPTS as s}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as c,PLATFORM_OUTPUT_RULES_SECTION as l,PROTOCOLS as u}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as d,CLAUDE_CODE_TOOL_MAP as f,IDE_CAPABILITIES as p}from"../definitions/tools.mjs";import{buildAgentTable as m,buildCompactAgentTable as h,buildFlowSection as g,buildHooksSection as _,buildMcpConfigJson as v,buildSkillsSection as y,injectOrchestratorDirective as b,lowerFirst as x}from"./_shared.mjs";const S=g({flowTool:`flow`,isLifecycleOwner:!0}),C=g({flowTool:`flow`,isLifecycleOwner:!0}),w=g({flowTool:`flow`,isLifecycleOwner:!1});function T(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function E(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function D(e){let t=(p[e]||[]).flatMap(e=>f[e]||[]),n=d.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function O(e,t){let n=[];return n.push(`# ${i} ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
2
+ `)}function k(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function A(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&u[e.sharedBase]&&t.push(u[e.sharedBase]);for(let n of e.sharedProtocols||[])u[n]&&t.push(u[n]);return t}function j(){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 M(e){return j().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
3
+ `)}function N(t=m(e,a(`claude-code`))){return[`# ${i} — Claude Code Agents`,``,l,``,c,``,`## MCP Server`,``,`Server name: \`${i}\``,"Configured in `.mcp.json` (project) and `~/.claude.json` (user-global — `claude mcp add --scope user` format).","Default agent: `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator automatically.",``,`## Agents`,``,t,``,`## Agent Files`,``,M(`.claude/agents`),``,`## Commands`,``,"Slash commands live under `.claude/commands/`.",``,`## Session Protocol`,``,_(n,o[`claude-code`]),``].join(`
4
+ `)}function P(){return b([`# ${i} — Claude Code Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Full sub-agent instructions live in `.claude/agents/`.","Slash commands live in `.claude/commands/`.","MCP server config lives in `.mcp.json` (project) and `~/.claude.json` (user-global — written by `claude mcp add --scope user`).","Default agent set to `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator, no `/agent` command needed.",``,"Start with `AGENTS.md`, then open the specific sub-agent file you want to use.",``,l,``,c,``]).join(`
5
+ `)}function F(e,t,n,r,a){let o=D(t.toolRole),s=A(t),c=y(t.skills),l=e===`Orchestrator`?[S,C]:[w],u=[n,...s,t.bodyAddendum,c,...l].filter(Boolean).join(`
6
6
 
7
- `).trim(),d=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${b(t.description)}.`,f=a?.[e],p=o.length>0?`tools: [${o.join(`, `)}]`:null,m=t.skills?.length>0?`skills: [${t.skills.map(([e])=>e).join(`, `)}]`:null,h=[`---`,`name: ${w(e)}`,`description: ${T(t.description)}`,...f?[`model: ${T(f)}`]:[],...p?[p]:[],`mcpServers:`,` - ${i}`,...m?[m]:[],`---`,``,`# ${e} - ${t.title||e}`,``,d];return u&&h.push(``,u),h.push(``),h.join(`
8
- `)}function F(){let t=[],n=a(`claude-code`),o=m(e,n),c=h(e);t.push({path:`.mcp.json`,content:`${v({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`}),t.push({path:`CLAUDE.md`,content:N()}),t.push({path:`AGENTS.md`,content:M(o)});for(let[e,n]of Object.entries(s))t.push({path:`.claude/commands/aikit-${e}.md`,content:D(e,n)});for(let[r,i]of Object.entries(e)){let e=O(r,c);if(i.variants){for(let[a,s]of Object.entries(i.variants)){let c=`${r}-${a}`;t.push({path:`.claude/agents/${c}.md`,content:P(c,{...i,description:s.description||i.description,identity:s.identity,bodyAddendum:s.bodyAddendum},e,o,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:P(r,i,e,o,n)})}return t}export{x as CLAUDE_FLOWS_SECTION,S as CLAUDE_ORCHESTRATOR_FLOW_ROUTING_SECTION,F as generateClaudeCode};
7
+ `).trim(),d=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${x(t.description)}.`,f=a?.[e],p=o.length>0?`tools: [${o.join(`, `)}]`:null,m=t.skills?.length>0?`skills: [${t.skills.map(([e])=>e).join(`, `)}]`:null,h=[`---`,`name: ${T(e)}`,`description: ${E(t.description)}`,...f?[`model: ${E(f)}`]:[],...p?[p]:[],`mcpServers:`,` - ${i}`,...m?[m]:[],`---`,``,`# ${e} - ${t.title||e}`,``,d];return u&&h.push(``,u),h.push(``),h.join(`
8
+ `)}function I(){let t=[],n=a(`claude-code`),o=m(e,n),c=h(e);t.push({path:`.mcp.json`,content:`${v({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`}),t.push({path:`CLAUDE.md`,content:P()}),t.push({path:`AGENTS.md`,content:N(o)});for(let[e,n]of Object.entries(s))t.push({path:`.claude/commands/aikit-${e}.md`,content:O(e,n)});for(let[r,i]of Object.entries(e)){let e=k(r,c);if(i.variants){for(let[a,s]of Object.entries(i.variants)){let c=`${r}-${a}`;t.push({path:`.claude/agents/${c}.md`,content:F(c,{...i,description:s.description||i.description,identity:s.identity,bodyAddendum:s.bodyAddendum},e,o,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:F(r,i,e,o,n)})}return t}export{S as CLAUDE_FLOWS_SECTION,C as CLAUDE_ORCHESTRATOR_FLOW_ROUTING_SECTION,I as generateClaudeCode};
@@ -1,7 +1,7 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as a}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as o}from"../definitions/platform-capabilities.mjs";import{PROMPTS as s}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as c,PLATFORM_OUTPUT_RULES_SECTION as l,PROTOCOLS as u}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as d,CLAUDE_CODE_TOOL_MAP as f,IDE_CAPABILITIES as p}from"../definitions/tools.mjs";import{buildAgentTable as m,buildCompactAgentTable as h,buildFlowSection as g,buildHooksSection as _,buildSkillsSection as v,lowerFirst as y}from"./_shared.mjs";const b=g({flowTool:`flow`,isLifecycleOwner:!0}),x=g({flowTool:`flow`,isLifecycleOwner:!1});function S(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function C(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function w(e){let t=(p[e]||[]).flatMap(e=>f[e]||[]),n=d.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function T(e,t){let n=[];return n.push(`# ${i} ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
2
- `)}function E(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function D(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&u[e.sharedBase]&&t.push(u[e.sharedBase]);for(let n of e.sharedProtocols||[])u[n]&&t.push(u[n]);return t}function O(){return[`# ${i} — Claude Desktop Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","MCP server config lives in `claude_desktop_config.json`.",``,l,``,c,``,_(n,o[`claude-desktop`]),``].join(`
3
- `)}function k(e){return[`# ${i} — Claude Desktop Agents`,``,l,``,c,``,`## MCP Server`,``,`Server name: \`${i}\``,"Configured in `claude_desktop_config.json`.",``,`## Agents`,``,e,``,_(n,o[`claude-desktop`]),``].join(`
4
- `)}function A(e,t,n,r,i){let a=w(t.toolRole),o=D(t),s=v(t.skills),c=e===`Orchestrator`?[b,x]:[x],l=[n,...o,t.bodyAddendum,s,...c].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{getPlatformPrimaryModelMap as a}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as o}from"../definitions/platform-capabilities.mjs";import{PROMPTS as s}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as c,PLATFORM_OUTPUT_RULES_SECTION as l,PROTOCOLS as u}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as d,CLAUDE_CODE_TOOL_MAP as f,IDE_CAPABILITIES as p}from"../definitions/tools.mjs";import{buildAgentTable as m,buildCompactAgentTable as h,buildFlowSection as g,buildHooksSection as _,buildSkillsSection as v,injectOrchestratorDirective as y,lowerFirst as b}from"./_shared.mjs";const x=g({flowTool:`flow`,isLifecycleOwner:!0}),S=g({flowTool:`flow`,isLifecycleOwner:!1});function C(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function w(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function T(e){let t=(p[e]||[]).flatMap(e=>f[e]||[]),n=d.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function E(e,t){let n=[];return n.push(`# ${i} ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
2
+ `)}function D(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function O(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&u[e.sharedBase]&&t.push(u[e.sharedBase]);for(let n of e.sharedProtocols||[])u[n]&&t.push(u[n]);return t}function k(){return y([`# ${i} — Claude Desktop Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","MCP server config lives in `claude_desktop_config.json`.",``,l,``,c,``,_(n,o[`claude-desktop`]),``]).join(`
3
+ `)}function A(e){return[`# ${i} — Claude Desktop Agents`,``,l,``,c,``,`## MCP Server`,``,`Server name: \`${i}\``,"Configured in `claude_desktop_config.json`.",``,`## Agents`,``,e,``,_(n,o[`claude-desktop`]),``].join(`
4
+ `)}function j(e,t,n,r,i){let a=T(t.toolRole),o=O(t),s=v(t.skills),c=e===`Orchestrator`?[x,S]:[S],l=[n,...o,t.bodyAddendum,s,...c].filter(Boolean).join(`
5
5
 
6
- `).trim(),u=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${y(t.description)}.`,d=i?.[e],f=a.length>0?`tools: [${a.join(`, `)}]`:null;t.skills?.length>0&&`${t.skills.map(([e])=>e).join(`, `)}`;let p=[`---`,`name: ${S(e)}`,`description: ${C(t.description)}`,...d?[`model: ${C(d)}`]:[],...f?[f]:[],`---`,``,`# ${e} - ${t.title||e}`,``,u];return l&&p.push(``,l),p.push(``),p.join(`
7
- `)}function j(){let t=[],n=a(`claude-desktop`),o=m(e,n),c=h(e);t.push({path:`claude_desktop_config.json`,content:`${JSON.stringify({mcpServers:{[i]:{command:r.command,args:r.args}}},null,2)}\n`}),t.push({path:`CLAUDE.md`,content:O()}),t.push({path:`AGENTS.md`,content:k(o)});for(let[e,n]of Object.entries(s))t.push({path:`.claude/commands/aikit-${e}.md`,content:T(e,n)});for(let[r,i]of Object.entries(e)){let e=E(r,c);if(i.variants){for(let[a,s]of Object.entries(i.variants)){let c=`${r}-${a}`;t.push({path:`.claude/agents/${c}.md`,content:A(c,{...i,description:s.description||i.description,identity:s.identity,bodyAddendum:s.bodyAddendum},e,o,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:A(r,i,e,o,n)})}return t}export{j as generateClaudeDesktop};
6
+ `).trim(),u=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${b(t.description)}.`,d=i?.[e],f=a.length>0?`tools: [${a.join(`, `)}]`:null,p=t.skills?.length>0?`skills: [${t.skills.map(([e])=>e).join(`, `)}]`:null,m=[`---`,`name: ${C(e)}`,`description: ${w(t.description)}`,...d?[`model: ${w(d)}`]:[],...f?[f]:[],...p?[p]:[],`---`,``,`# ${e} - ${t.title||e}`,``,u];return l&&m.push(``,l),m.push(``),m.join(`
7
+ `)}function M(){let t=[],n=a(`claude-desktop`),o=m(e,n),c=h(e);t.push({path:`claude_desktop_config.json`,content:`${JSON.stringify({mcpServers:{[i]:{command:r.command,args:r.args}}},null,2)}\n`}),t.push({path:`CLAUDE.md`,content:k()}),t.push({path:`AGENTS.md`,content:A(o)});for(let[e,n]of Object.entries(s))t.push({path:`.claude/commands/aikit-${e}.md`,content:E(e,n)});for(let[r,i]of Object.entries(e)){let e=D(r,c);if(i.variants){for(let[a,s]of Object.entries(i.variants)){let c=`${r}-${a}`;t.push({path:`.claude/agents/${c}.md`,content:j(c,{...i,description:s.description||i.description,identity:s.identity,bodyAddendum:s.bodyAddendum},e,o,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:j(r,i,e,o,n)})}return t}export{M as generateClaudeDesktop};
@@ -1,8 +1,8 @@
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,buildFlowSection as d,buildSubagentFlowSection as f}from"./_shared.mjs";import{generateForbiddenTable as p}from"../definitions/policies.mjs";import{generateHooks as m,getHookScriptFiles as h}from"./hooks.mjs";const g={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 _(e){return`[${[...(l[e]||[]).map(e=>g[e]).filter(Boolean),`aikit/*`].join(`, `)}]`}function v(e){return r(`copilot`,e,`Auto (copilot)`)}const y=d({flowTool:`flow`,isLifecycleOwner:!0}),b=f({flowTool:`flow`});function x(){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(`
2
- `)}`}function S(e,t,r){let i=`${e}-${t}`,a=r.variants[t]||{},o=v(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(`
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,buildFlowSection as d,buildSubagentFlowSection as f,injectOrchestratorDirective as p}from"./_shared.mjs";import{generateForbiddenTable as m}from"../definitions/policies.mjs";import{generateHooks as h,getHookScriptFiles as g}from"./hooks.mjs";const _={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 v(e){return`[${[...(l[e]||[]).map(e=>_[e]).filter(Boolean),`aikit/*`].join(`, `)}]`}function y(e){return r(`copilot`,e,`Auto (copilot)`)}const b=d({flowTool:`flow`,isLifecycleOwner:!0}),x=f({flowTool:`flow`});function S(){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(`
2
+ `)}`}function C(e,t,r){let i=`${e}-${t}`,a=r.variants[t]||{},o=y(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(`
3
3
  `)}`:``,h=r.title||e;return`---
4
4
  description: '${c}'
5
- ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${_(r.toolRole)}
5
+ ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${v(r.toolRole)}
6
6
  model: ${o}
7
7
  ---
8
8
 
@@ -11,11 +11,11 @@ model: ${o}
11
11
  You are **${i}**${l}${d}
12
12
  ${u}${p}${f}${m}
13
13
 
14
- ${b}
15
- `}function C(n,r){let i=v(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(`
14
+ ${x}
15
+ `}function w(n,r){let i=y(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(`
16
16
  `)}\n`:``;return`---
17
17
  description: '${r.description}'
18
- ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${_(r.toolRole)}
18
+ ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${v(r.toolRole)}
19
19
  model: ${i}
20
20
  ---
21
21
 
@@ -25,20 +25,20 @@ You are the **${n}**, ${r.description.toLowerCase().replace(/^./,e=>e.toLowerCas
25
25
 
26
26
  ${a}${o}${c}${d}
27
27
 
28
- ${n===`Orchestrator`?y:b}
29
- `}function w(e,t){return`---
28
+ ${n===`Orchestrator`?b:x}
29
+ `}function T(e,t){return`---
30
30
  description: "${t.description}"
31
31
  agent: "${t.agent}"
32
32
  ---
33
33
 
34
34
  ${t.content}
35
- `}function T(){return`# Agents
35
+ `}function E(){return`# Agents
36
36
 
37
37
  This directory contains AI agent definitions generated by \`@vpxa/aikit init\`.
38
38
 
39
39
  ## Agent Roster
40
40
 
41
- ${x()}
41
+ ${S()}
42
42
 
43
43
  ## Multi-Model Pattern
44
44
 
@@ -64,5 +64,5 @@ To regenerate after changing models or agent definitions:
64
64
  cd knowledge-base
65
65
  node scaffold/generate.mjs
66
66
  \`\`\`
67
- `}function E(){return[`# AI Kit — Copilot Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`These rules are enforced by AI Kit compliance checking. Violations are flagged in reports and reduce your compliance score.`,``,p(),``,a,``].join(`
68
- `)}function D(){let t=[];if(h().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`copilot-instructions.md`,content:E()});for(let[r,i]of Object.entries(e))if(i.variants)for(let e of n[r]||[])t.push({path:`agents/${r}-${e}.agent.md`,content:S(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:C(r,i)});for(let[e,n]of Object.entries(c))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:T()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:w(e,n)});let r=m(`copilot`,`~/.copilot/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{D as generateCopilot};
67
+ `}function D(){return p([`# AI Kit — Copilot Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`These rules are enforced by AI Kit compliance checking. Violations are flagged in reports and reduce your compliance score.`,``,m(),``,a,``]).join(`
68
+ `)}function O(){let t=[];if(g().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`copilot-instructions.md`,content:D()});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:C(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:w(r,i)});for(let[e,n]of Object.entries(c))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:E()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:T(e,n)});let r=h(`copilot`,`~/.copilot/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{O as generateCopilot};
@@ -1,7 +1,7 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s}from"../definitions/protocols.mjs";import{buildAgentTable as c,buildCompactAgentTable as l,buildFlowSection as u,buildHooksSection as d,buildMcpConfigJson as f,buildPromptSections as p,buildSkillsSection as m,lowerFirst as h}from"./_shared.mjs";const g=u({flowTool:`flow`,isLifecycleOwner:!0}),_=u({flowTool:`flow`,isLifecycleOwner:!1});function v(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function y(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&s[e.sharedBase]&&t.push(s[e.sharedBase]);for(let n of e.sharedProtocols||[])s[n]&&t.push(s[n]);return t}function b(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function x(e){return b().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
2
- `)}function S(e,t,n){let r=y(t),i=m(t.skills),a=e===`Orchestrator`?g:_,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s}from"../definitions/protocols.mjs";import{buildAgentTable as c,buildCompactAgentTable as l,buildFlowSection as u,buildHooksSection as d,buildMcpConfigJson as f,buildPromptSections as p,buildSkillsSection as m,injectOrchestratorDirective as h,lowerFirst as g}from"./_shared.mjs";const _=u({flowTool:`flow`,isLifecycleOwner:!0}),v=u({flowTool:`flow`,isLifecycleOwner:!1});function y(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function b(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&s[e.sharedBase]&&t.push(s[e.sharedBase]);for(let n of e.sharedProtocols||[])s[n]&&t.push(s[n]);return t}function x(){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 S(e){return x().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
2
+ `)}function C(e,t,n){let r=b(t),i=m(t.skills),a=e===`Orchestrator`?_:v,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
3
3
 
4
- `).trim();return[`# ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${h(t.description)}.`,...o?[``,o]:[],``].join(`
5
- `)}function C(){let t=c(e);return[`# ${i} — Gemini CLI Agents`,``,"This workspace keeps the root `GEMINI.md` intentionally small. Full agent instructions are split into per-agent files under `.gemini/agents/`.",``,`## MCP Server`,``,`Server name: \`${i}\``,"Configure in `.gemini/settings.json` (already done if scaffold was deployed).",``,`## Agents`,``,t,``,`## Agent Files`,``,x(`.gemini/agents`),``,`## Prompts`,``,p(o),``,`## Session Protocol`,``,d(n,a.gemini),``].join(`
6
- `)}function w(){return[`# ${i} — Gemini CLI Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Per-agent instructions are emitted under `.gemini/agents/`.","MCP server config lives in `.gemini/settings.json`.",``,"Start with `AGENTS.md`, then open the specific agent file you want to use.",``].join(`
7
- `)}function T(){let t=[{path:`.gemini/settings.json`,content:`${f({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`},{path:`GEMINI.md`,content:w()},{path:`AGENTS.md`,content:C()}],n=l(e);for(let[r,i]of Object.entries(e)){let e=v(r,n);if(i.variants){for(let[n,a]of Object.entries(i.variants)){let o=`${r}-${n}`;t.push({path:`.gemini/agents/${o}.md`,content:S(o,{...i,description:a.description||i.description,identity:a.identity,bodyAddendum:a.bodyAddendum},e)})}continue}t.push({path:`.gemini/agents/${r}.md`,content:S(r,i,e)})}return t}export{T as generateGemini};
4
+ `).trim();return[`# ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${g(t.description)}.`,...o?[``,o]:[],``].join(`
5
+ `)}function w(){let t=c(e);return[`# ${i} — Gemini CLI Agents`,``,"This workspace keeps the root `GEMINI.md` intentionally small. Full agent instructions are split into per-agent files under `.gemini/agents/`.",``,`## MCP Server`,``,`Server name: \`${i}\``,"Configure in `.gemini/settings.json` (already done if scaffold was deployed).",``,`## Agents`,``,t,``,`## Agent Files`,``,S(`.gemini/agents`),``,`## Prompts`,``,p(o),``,`## Session Protocol`,``,d(n,a.gemini),``].join(`
6
+ `)}function T(){return h([`# ${i} — Gemini CLI Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Per-agent instructions are emitted under `.gemini/agents/`.","MCP server config lives in `.gemini/settings.json`.",``,"Start with `AGENTS.md`, then open the specific agent file you want to use.",``]).join(`
7
+ `)}function E(){let t=[{path:`.gemini/settings.json`,content:`${f({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`},{path:`GEMINI.md`,content:T()},{path:`AGENTS.md`,content:w()}],n=l(e);for(let[r,i]of Object.entries(e)){let e=y(r,n);if(i.variants){for(let[n,a]of Object.entries(i.variants)){let o=`${r}-${n}`;t.push({path:`.gemini/agents/${o}.md`,content:C(o,{...i,description:a.description||i.description,identity:a.identity,bodyAddendum:a.bodyAddendum},e)})}continue}t.push({path:`.gemini/agents/${r}.md`,content:C(r,i,e)})}return t}export{E as generateGemini};
@@ -1,6 +1,56 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{PLATFORM_HOOK_CAPABILITIES as r}from"../definitions/platform-capabilities.mjs";import{PROMPTS as i}from"../definitions/prompts.mjs";import{PROTOCOLS as a}from"../definitions/protocols.mjs";import{buildAgentTable as o,buildCompactAgentTable as s,buildFlowSection as c,buildHooksSection as l,buildPromptSections as u,buildSkillsSection as d,lowerFirst as f}from"./_shared.mjs";const p=c({flowTool:`flow`,isLifecycleOwner:!0}),m=c({flowTool:`flow`,isLifecycleOwner:!1});function h(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function g(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&a[e.sharedBase]&&t.push(a[e.sharedBase]);for(let n of e.sharedProtocols||[])a[n]&&t.push(a[n]);return t}function _(){let t=o(e),a=s(e),c=u(i),d=[];for(let[t,n]of Object.entries(e)){let e=h(t,a);if(n.variants){for(let[r,i]of Object.entries(n.variants)){let a=`${t}-${r}`;d.push(v(a,{...n,description:i.description||n.description,identity:i.identity,bodyAddendum:i.bodyAddendum},e))}continue}d.push(v(t,n,e))}return[`# AI Kit — Hermes Agent Instructions`,``,"This project uses **AI Kit** (`@vpxa/aikit`), a local-first MCP server that provides search,",`code analysis, persistent memory, context compression, and guided development flows.`,``,`The AI Kit MCP server is registered in your Hermes config and its 64 tools are available`,"as `mcp_aikit_*` tool calls in every conversation.",``,`## MCP Server`,``,"Server name: `AI Kit`","Configured via `hermes mcp add` (user-level). Tools are auto-discovered at session start.",``,`## Skills-First Rule`,``,`**Before starting ANY task, check available skills.** If a skill matches your task domain`,`— load it first. Skills contain domain-specific patterns, templates, and constraints.`,``,`## Available Tools (64)`,``,`AI Kit provides tools across the following categories:`,``,`| Category | Tools |`,`|----------|-------|`,"| **Search & Discovery** | `search`, `find`, `symbol`, `trace`, `lookup`, `scope_map`, `file_summary`, `dead_symbols` |","| **Code Analysis** | `analyze`, `blast_radius`, `audit`, `graph`, `health`, `check` |","| **Context Compression** | `file_summary`, `digest` |","| **Memory & Knowledge** | `knowledge`, `remember`, `read`, `update`, `forget`, `list`, `stash` |","| **FORGE Quality Gates** | `forge_classify`, `forge_ground`, `evidence_map`, `compliance_score` |","| **Development Workflows** | `flow`, `onboard`, `reindex`, `status`, `guide`, `config` |","| **Testing & Build** | `test_run`, `parse_output`, `check`, `eval` |","| **Code Manipulation** | `rename`, `codemod`, `data_transform`, `diff_parse`, `git_context`, `replay` |","| **Web & HTTP** | `web_search`, `web_fetch`, `http` |","| **Present & Visualize** | `present`, `signal`, `session_digest` |","| **Sandbox & Process** | `process`, `watch`, `workset`, `lane`, `queue`, `restore`, `delegate` |","| **Utilities** | `encode`, `regex_test`, `measure`, `changelog`, `schema_validate`, `env`, `time` |","| **Browser** | `browser` |",``,`## Important: Prefer AI Kit Tools Over Generic Shell Commands`,``,`When working in this project, use AI Kit MCP tools instead of generic alternatives:`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search (vector + keyword + BM25) across all indexed content |","| `read_file` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| `cd` + `ls` | `mcp_aikit_analyze` | Structural analysis with tree views |","| Running tests in terminal | `mcp_aikit_test_run` | Structured test output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,`## Agents`,``,t,``,`## Agent Instructions`,``,d.join(`
2
- `),``,`## Prompts`,``,c,``,p,``,`## Session Protocol`,``,l(n,r.hermes),``].join(`
3
- `)}function v(e,t,n){let r=g(t),i=d(t.skills),a=e===`Orchestrator`?p:m,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{VARIANT_GROUPS as r,getPrimaryAgentModel as i}from"../definitions/models.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s,TEMPLATES as c}from"../definitions/protocols.mjs";import{IDE_CAPABILITIES as l}from"../definitions/tools.mjs";import{buildAgentTable as u,buildCompactAgentTable as d,buildFlowSection as f,buildHooksSection as p,buildPromptSections as m,buildSkillsSection as h,injectOrchestratorDirective as g,lowerFirst as _}from"./_shared.mjs";import{generateHooks as v,getHookScriptFiles as y}from"./hooks.mjs";const b=f({flowTool:`flow`,isLifecycleOwner:!0}),x=f({flowTool:`flow`,isLifecycleOwner:!1});function S(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function C(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&s[e.sharedBase]&&t.push(s[e.sharedBase]);for(let n of e.sharedProtocols||[])s[n]&&t.push(s[n]);return t}const w={terminal:`terminal`,problems:`mcp_aikit_check`,readFile:`read_file`,lastCommand:`terminal`,subagent:`delegate_task`,createFile:`write_file`,editFiles:`patch`,rename:`write_file`,createDirectory:`terminal(mkdir)`,search:`search_files, mcp_aikit_search, mcp_aikit_find`,web:`web_search, web_extract, mcp_aikit_web_search, mcp_aikit_web_fetch`,todo:`todo`,memory:`memory`,newWorkspace:`terminal(cd)`,reviewPlan:`clarify`,askQuestions:`clarify`,resolveMemoryFileUri:`read_file`,runCommand:`terminal`,switchAgent:`delegate_task`,killTerminal:`process(kill)`,createTask:`todo`,terminalSel:`terminal`,fileSearch:`search_files`,listDir:`search_files(target=files)`,textSearch:`search_files(target=content)`,searchSubagent:`delegate_task`,browser:`mcp_aikit_browser, browser_navigate`};function T(e){let t=(l[e]||[]).map(e=>{let t=w[e];return t?t.split(`,`).map(e=>e.trim()):null}).filter(Boolean).flat();return`[${[...new Set(t),`aikit/*`].join(`, `)}]`}function E(e){return i(`hermes`,e,`Auto (hermes)`)}function D(e){let t=[[/`runSubagent`/g,"`delegate_task`"],[/`runSubagent\(/g,"`delegate_task("],[/\brunSubagent\b/g,`delegate_task`],[/`editFiles`/g,"`patch`"],[/`createFile`/g,"`write_file`"],[/`edit\/createFile`/g,"`write_file`"],[/`edit\/editFiles`/g,"`patch`"],[/`run_in_terminal`/g,"`terminal`"],[/`execute\/runInTerminal`/g,"`terminal`"],[/`execute\/killTerminal`/g,"`process(kill)`"],[/`grep_search`/g,"`search_files`"],[/`search\/codebase`/g,"`mcp_aikit_search`"],[/`search\/changes`/g,"`search_files`"],[/`search\/usages`/g,"`mcp_aikit_symbol` / `mcp_aikit_trace`"],[/`search\/textSearch`/g,"`search_files`"],[/`search\/searchSubagent`/g,"`delegate_task`"],[/`web\/fetch`/g,"`web_extract` / `mcp_aikit_web_fetch`"],[/`web\/githubRepo`/g,"`terminal(git ...)`"],[/`web\/webSearch`/g,"`web_search` / `mcp_aikit_web_search`"],[/`vscode\/memory`/g,"`memory`"],[/`vscode\/runCommand`/g,"`terminal`"],[/`vscode\/switchAgent`/g,"`delegate_task`"],[/`vscode\/newWorkspace`/g,"`terminal(cd)`"],[/`vscode\/reviewPlan`/g,"`clarify`"],[/`vscode\/askQuestions`/g,"`clarify`"],[/`vscode\/resolveMemoryFileUri`/g,"`read_file`"],[/`read\/readFile`/g,"`read_file`"],[/`read\/terminalLastCommand`/g,"`terminal`"],[/`read\/terminalSelection`/g,"`terminal`"],[/`read\/problems`/g,"`mcp_aikit_check`"],[/`agent\/runSubagent`/g,"`delegate_task`"],[/`execute\/createAndRunTask`/g,"`todo` / `delegate_task`"],[/`read_file` \(for understanding\)/g,"`read_file` (Hermes)"],[/(copilot)/g,`(hermes)`],[/runSubagent\(\{agentName:/g,`delegate_task({goal:`],[/runSubagent\(\{/g,`delegate_task({`]],n=e;for(let[e,r]of t)n=n.replace(e,r);return n}function O(){let t=u(e),r=d(e),i=m(o),s=[];for(let[t,n]of Object.entries(e)){let e=S(t,r);if(n.variants){for(let[r,i]of Object.entries(n.variants)){let a=`${t}-${r}`;s.push(k(a,{...n,description:i.description||n.description,identity:i.identity,bodyAddendum:i.bodyAddendum},e))}continue}s.push(k(t,n,e))}return g([`# AI Kit — Hermes Agent Instructions`,``,"This project uses **AI Kit** (`@vpxa/aikit`), a local-first MCP server that provides search,",`code analysis, persistent memory, context compression, and guided development flows.`,``,`The AI Kit MCP server is registered in your Hermes config and its 64 tools are available`,"as `mcp_aikit_*` tool calls in every conversation.",``,`## MCP Server`,``,"Server name: `AI Kit`","Configured via `hermes mcp add` (user-level). Tools are auto-discovered at session start.",``,`## Skills-First Rule`,``,`**Before starting ANY task, check available skills.** If a skill matches your task domain`,`— load it first. Skills contain domain-specific patterns, templates, and constraints.`,``,`## Available Tools (64)`,``,`AI Kit provides tools across the following categories:`,``,`| Category | Tools |`,`|----------|-------|`,"| **Search & Discovery** | `search`, `find`, `symbol`, `trace`, `lookup`, `scope_map`, `file_summary`, `dead_symbols` |","| **Code Analysis** | `analyze`, `blast_radius`, `audit`, `graph`, `health`, `check` |","| **Context Compression** | `file_summary`, `digest` |","| **Memory & Knowledge** | `knowledge`, `remember`, `read`, `update`, `forget`, `list`, `stash` |","| **FORGE Quality Gates** | `forge_classify`, `forge_ground`, `evidence_map`, `compliance_score` |","| **Development Workflows** | `flow`, `onboard`, `reindex`, `status`, `guide`, `config` |","| **Testing & Build** | `test_run`, `parse_output`, `check`, `eval` |","| **Code Manipulation** | `rename`, `codemod`, `data_transform`, `diff_parse`, `git_context`, `replay` |","| **Web & HTTP** | `web_search`, `web_fetch`, `http` |","| **Present & Visualize** | `present`, `signal`, `session_digest` |","| **Sandbox & Process** | `process`, `watch`, `workset`, `lane`, `queue`, `restore`, `delegate` |","| **Utilities** | `encode`, `regex_test`, `measure`, `changelog`, `schema_validate`, `env`, `time` |","| **Browser** | `browser` |",``,`## Important: Prefer AI Kit Tools Over Generic Shell Commands`,``,`When working in this project, use AI Kit MCP tools instead of generic alternatives:`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search (vector + keyword + BM25) across all indexed content |","| `read_file` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| `cd` + `ls` | `mcp_aikit_analyze` | Structural analysis with tree views |","| Running tests in terminal | `mcp_aikit_test_run` | Structured test output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,`## Agents`,``,t,``,`## Agent Instructions`,``,s.join(`
2
+ `),``,`## Prompts`,``,i,``,b,``,`## Session Protocol`,``,p(n,a.hermes),``]).join(`
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
 
5
- `).trim();return[`## ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${f(t.description)}.`,...o?[``,o]:[],``].join(`
6
- `)}function y(){return[{path:`AGENTS.md`,content:_()}]}export{y as generateHermes};
5
+ `).trim();return[`## ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${_(t.description)}.`,...o?[``,o]:[],``].join(`
6
+ `)}function A(e,t,n){let i=`${e}-${t}`,a=n.variants[t]||{},o=E(i),c=a.description||n.description,l=a.identity||(t===r[e]?.[0]?`, the primary ${e} agent.`:`, a variant of ${e}. Same responsibilities, different model perspective.`),u=n.sharedBase&&s[n.sharedBase]?`\n\n${s[n.sharedBase]}`:``;u=D(u);let d=n.extraBody?`\n\n${D(n.extraBody)}`:``,f=a.bodyAddendum?`\n\n${D(a.bodyAddendum)}`:``,p=(n.sharedProtocols||[]).map(e=>{let t=s[e];return t?`\n\n${D(t)}`:``}).join(``),m=n.skills?.length?`\n\n## Skills (load on demand)\n\n${n.skills.map(([e,t])=>`- \`${e}\`: ${t}`).join(`
7
+ `)}`:``,h=n.title||e;return`---
8
+ description: '${c}'
9
+ ${n.argumentHint?`argument-hint: "${n.argumentHint}"\n`:``}tools: ${T(n.toolRole)}
10
+ model: ${o}
11
+ ---
12
+
13
+ # ${i} - ${h}
14
+
15
+ You are **${i}**${l}${d}
16
+ ${u}${p}${f}${m}
17
+
18
+ ${x}
19
+ `}function j(e,n,r){let i=E(e),a=typeof t[e]==`function`?t[e](r):t[e]||``;a=D(a);let o=n.sharedBase&&s[n.sharedBase]?`\n\n${s[n.sharedBase]}`:``;o=D(o);let c=(n.sharedProtocols||[]).map(e=>{let t=s[e];return t?`\n\n${D(t)}`:``}).join(``),l=n.title||e,u=n.skills?.length?`\n## Skills (load on demand)\n\n${n.skills.map(([e,t])=>`- \`${e}\`: ${t}`).join(`
20
+ `)}\n`:``;return`---
21
+ description: '${n.description}'
22
+ ${n.argumentHint?`argument-hint: "${n.argumentHint}"\n`:``}tools: ${T(n.toolRole)}
23
+ model: ${i}
24
+ ---
25
+
26
+ # ${e} - ${l}
27
+
28
+ You are the **${e}**, ${n.description.toLowerCase().replace(/^./,e=>e.toLowerCase())}
29
+
30
+ ${a}${o}${c}${u}
31
+
32
+ ${e===`Orchestrator`?b:x}
33
+ `}function M(e,t){return`---
34
+ description: "${t.description}"
35
+ agent: "${t.agent}"
36
+ ---
37
+
38
+ ${t.content}
39
+ `}function N(){return`# Hermes Agents
40
+
41
+ This directory contains AI agent definitions generated by \`@vpxa/aikit init\` for **Hermes Agent**.
42
+
43
+ ## Agent Roster
44
+
45
+ ${u(e)}
46
+
47
+ ## Multi-Model Pattern
48
+
49
+ Variant agents (Researcher-Alpha/Beta/Gamma/Delta, Code-Reviewer-Alpha/Beta, Architect-Reviewer-Alpha/Beta) share the same inlined methodology. They differ only in which LLM model backs them — enabling multi-model decision analysis and dual-review workflows.
50
+
51
+ ## Tools
52
+
53
+ Hermes provides native tools (\`terminal\`, \`read_file\`, \`write_file\`, \`patch\`, \`search_files\`, \`delegate_task\`, etc.)
54
+ plus AI Kit MCP tools (\`mcp_aikit_search\`, \`mcp_aikit_knowledge\`, etc.) for code analysis, memory, and context compression.
55
+
56
+ See \`AGENTS.md\` (in Hermes config directory) for complete tool usage guidance.`}function P(){let t=[];if(y().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`AGENTS.md`,content:O()});let n=d(e);for(let[i,a]of Object.entries(e))if(a.variants)for(let e of r[i]||[])t.push({path:`agents/${i}-${e}.agent.md`,content:A(i,e,a)});else t.push({path:`agents/${i}.agent.md`,content:j(i,a,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:N()});for(let[e,n]of Object.entries(o))t.push({path:`prompts/aikit-${e}.prompt.md`,content:M(e,n)});let i=v(`hermes`,`~/.hermes/hooks/scripts`);return t.push(...i.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{P as generateHermes};
@@ -1,8 +1,8 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s}from"../definitions/protocols.mjs";import{buildAgentTable as c,buildCompactAgentTable as l,buildFlowSection as u,buildHooksSection as d,buildPromptSections as f,buildSkillsSection as p,lowerFirst as m}from"./_shared.mjs";const h=u({flowTool:`flow`,isLifecycleOwner:!0}),g=u({flowTool:`flow`,isLifecycleOwner:!1});function _(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function v(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&s[e.sharedBase]&&t.push(s[e.sharedBase]);for(let n of e.sharedProtocols||[])s[n]&&t.push(s[n]);return t}function y(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function b(e){return y().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
2
- `)}const x={orchestrator:{edit:`allow`,bash:`allow`},planner:{edit:`allow`,bash:`allow`},codeAgent:{edit:`allow`,bash:`allow`},refactor:{edit:`allow`,bash:`allow`},debugger:{edit:`allow`,bash:`allow`},security:{edit:`allow`,bash:`allow`},documenter:{edit:`allow`,bash:`deny`},explorer:{edit:`deny`,bash:`deny`},researcher:{edit:`deny`,bash:`deny`},reviewer:{edit:`deny`,bash:`deny`}};function S(e){let t=e.category===`orchestration`&&e.title===`The Master Conductor`?`primary`:`subagent`,n=x[e.toolRole]||{edit:`deny`,bash:`deny`},r=[`---`,`description: ${e.description}`,`mode: ${t}`,`permission:`];for(let[e,t]of Object.entries(n))r.push(` ${e}: ${t}`);return r.push(`---`),r.join(`
3
- `)}function C(e,t,n){let r=v(t),i=p(t.skills),a=e===`Orchestrator`?h:g,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{PLATFORM_HOOK_CAPABILITIES as a}from"../definitions/platform-capabilities.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s}from"../definitions/protocols.mjs";import{buildAgentTable as c,buildCompactAgentTable as l,buildFlowSection as u,buildHooksSection as d,buildPromptSections as f,buildSkillsSection as p,injectOrchestratorDirective as m,lowerFirst as h}from"./_shared.mjs";const g=u({flowTool:`flow`,isLifecycleOwner:!0}),_=u({flowTool:`flow`,isLifecycleOwner:!1});function v(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function y(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&s[e.sharedBase]&&t.push(s[e.sharedBase]);for(let n of e.sharedProtocols||[])s[n]&&t.push(s[n]);return t}function b(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function x(e){return b().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
2
+ `)}const S={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 C(e){let t=e.category===`orchestration`&&e.title===`The Master Conductor`?`primary`:`subagent`,n=S[e.toolRole]||{edit:`deny`,bash:`deny`},r=[`---`,`description: ${e.description}`,`mode: ${t}`,`permission:`];for(let[e,t]of Object.entries(n))r.push(` ${e}: ${t}`);return r.push(`---`),r.join(`
3
+ `)}function w(e,t,n){let r=y(t),i=p(t.skills),a=e===`Orchestrator`?g:_,o=[n,...r,t.bodyAddendum,i,a].filter(Boolean).join(`
4
4
 
5
- `).trim(),s=[`# ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${m(t.description)}.`,...o?[``,o]:[],``].join(`
6
- `);return`${S(t)}\n\n${s}`}function w(){let t=c(e);return[`# ${i} — OpenCode Agents`,``,"This workspace keeps the root `OPENCODE.md` intentionally small. Full agent instructions are split into per-agent files under `.opencode/agents/`.",``,`## MCP Server`,``,`Server name: \`${i}\``,"Configure in `.opencode/opencode.json` (already done if scaffold was deployed).",``,`## Agents`,``,t,``,`## Agent Files`,``,b(`.opencode/agents`),``,`## Prompts`,``,f(o),``,`## Session Protocol`,``,d(n,a.opencode),``].join(`
7
- `)}function T(){return[`# ${i} — OpenCode Instructions`,``,"Detailed workspace instructions live in `OPENCODE.md`.","Per-agent instructions are emitted under `.opencode/agents/`.","MCP server config lives in `.opencode/opencode.json`.",``,"Start with `OPENCODE.md`, then open the specific agent file you want to use.",``].join(`
8
- `)}function E(e,t){let{type:n,...r}=t;return JSON.stringify({mcp:{[e]:{type:`local`,command:[r.command,...r.args]}}},null,2)}function D(){let t=[{path:`.opencode/opencode.json`,content:`${E(i,r)}\n`},{path:`OPENCODE.md`,content:T()},{path:`AGENTS.md`,content:w()}],n=l(e);for(let[r,i]of Object.entries(e)){let e=_(r,n);if(i.variants){for(let[n,a]of Object.entries(i.variants)){let o=`${r}-${n}`;t.push({path:`.opencode/agents/${o}.md`,content:C(o,{...i,description:a.description||i.description,identity:a.identity,bodyAddendum:a.bodyAddendum},e)})}continue}t.push({path:`.opencode/agents/${r}.md`,content:C(r,i,e)})}return t}export{D as generateOpencode};
5
+ `).trim(),s=[`# ${e} - ${t.title||e}`,``,`> ${t.description}`,``,t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${h(t.description)}.`,...o?[``,o]:[],``].join(`
6
+ `);return`${C(t)}\n\n${s}`}function T(){let t=c(e);return[`# ${i} — OpenCode Agents`,``,"This workspace keeps the root `OPENCODE.md` intentionally small. Full agent instructions are split into per-agent files under `.opencode/agents/`.",``,`## MCP Server`,``,`Server name: \`${i}\``,"Configure in `.opencode/opencode.json` (already done if scaffold was deployed).",``,`## Agents`,``,t,``,`## Agent Files`,``,x(`.opencode/agents`),``,`## Prompts`,``,f(o),``,`## Session Protocol`,``,d(n,a.opencode),``].join(`
7
+ `)}function E(){return m([`# ${i} — OpenCode Instructions`,``,"Detailed workspace instructions live in `OPENCODE.md`.","Per-agent instructions are emitted under `.opencode/agents/`.","MCP server config lives in `.opencode/opencode.json`.",``,"Start with `OPENCODE.md`, then open the specific agent file you want to use.",``]).join(`
8
+ `)}function D(e,t){let{type:n,...r}=t;return JSON.stringify({mcp:{[e]:{type:`local`,command:[r.command,...r.args]}}},null,2)}function O(){let t=[{path:`.opencode/opencode.json`,content:`${D(i,r)}\n`},{path:`OPENCODE.md`,content:E()},{path:`AGENTS.md`,content:T()}],n=l(e);for(let[r,i]of Object.entries(e)){let e=v(r,n);if(i.variants){for(let[n,a]of Object.entries(i.variants)){let o=`${r}-${n}`;t.push({path:`.opencode/agents/${o}.md`,content:w(o,{...i,description:a.description||i.description,identity:a.identity,bodyAddendum:a.bodyAddendum},e)})}continue}t.push({path:`.opencode/agents/${r}.md`,content:w(r,i,e)})}return t}export{O as generateOpencode};
@@ -1 +1 @@
1
- const e=[`SessionStart`,`PreToolUse`,`PostToolUse`,`PreCommit`,`SessionEnd`],t=[`native`,`eventbus`,`middleware`,`none`],n=[`full`,`partial`,`eventbus`,`middleware`,`none`],r={"claude-code":{SessionStart:`native`,PreToolUse:`native`,PostToolUse:`native`,PreCommit:`native`,SessionEnd:`native`,overall:`full`,label:`Claude Code`},"claude-desktop":{SessionStart:`eventbus`,PreToolUse:`none`,PostToolUse:`eventbus`,PreCommit:`none`,SessionEnd:`eventbus`,overall:`eventbus`,label:`Claude Desktop`},cursor:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Cursor`},windsurf:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Windsurf`},copilot:{SessionStart:`none`,PreToolUse:`native`,PostToolUse:`native`,PreCommit:`none`,SessionEnd:`none`,overall:`partial`,label:`GitHub Copilot`},hermes:{SessionStart:`middleware`,PreToolUse:`middleware`,PostToolUse:`middleware`,PreCommit:`none`,SessionEnd:`middleware`,overall:`middleware`,label:`Hermes Agent (legacy)`},"hermes-agent":{SessionStart:`middleware`,PreToolUse:`middleware`,PostToolUse:`middleware`,PreCommit:`none`,SessionEnd:`middleware`,overall:`middleware`,label:`Hermes Agent`},codex:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Codex CLI`},gemini:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Gemini CLI`},opencode:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`OpenCode`},zed:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Zed`},intellij:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`IntelliJ`}};function i(){let i=new Set(e),a=[`overall`,`label`];for(let[o,s]of Object.entries(r)){for(let e of i)if(!(e in s))throw Error(`Capability matrix: platform "${o}" is missing event "${e}". Add it to PLATFORM_HOOK_CAPABILITIES.${o}.`);for(let e of a)if(!(e in s))throw Error(`Capability matrix: platform "${o}" is missing "${e}". Add it to PLATFORM_HOOK_CAPABILITIES.${o}.`);if(typeof s.label!=`string`||s.label.length===0)throw Error(`Capability matrix: platform "${o}" has empty or missing "label". Set a non-empty label.`);if(!n.includes(s.overall))throw Error(`Capability matrix: platform "${o}" has invalid overall "${s.overall}". Valid: ${n.join(`, `)}.`);let r=e.every(e=>s[e]===`none`);if(r&&s.overall!==`none`)throw Error(`Capability matrix: platform "${o}" has all events 'none' but overall="${s.overall}". Set overall to 'none'.`);if(s.overall===`none`&&!r)throw Error(`Capability matrix: platform "${o}" has overall='none' but individual events are not all 'none'. Set each event to 'none' or change overall.`);for(let e of i)if(!t.includes(s[e]))throw Error(`Capability matrix: platform "${o}" event "${e}" has invalid level "${s[e]}". Valid: ${t.join(`, `)}.`)}}function a(e){let t=Object.keys(r),n=new Set(e);for(let e of t)n.has(e)||console.warn(`Capability matrix: platform "${e}" has no corresponding adapter in generate.mjs ADAPTERS. Hook generation for this platform will be skipped.`)}export{e as HOOK_EVENTS,r as PLATFORM_HOOK_CAPABILITIES,i as validateCapabilityMatrix,a as validateMatrixAdapterAlignment};
1
+ const e=[`SessionStart`,`PreToolUse`,`PostToolUse`,`PreCommit`,`SessionEnd`],t=[`native`,`eventbus`,`middleware`,`none`],n=[`full`,`partial`,`eventbus`,`middleware`,`none`],r={"claude-code":{SessionStart:`native`,PreToolUse:`native`,PostToolUse:`native`,PreCommit:`native`,SessionEnd:`native`,overall:`full`,label:`Claude Code`},"claude-desktop":{SessionStart:`eventbus`,PreToolUse:`none`,PostToolUse:`eventbus`,PreCommit:`none`,SessionEnd:`eventbus`,overall:`eventbus`,label:`Claude Desktop`},cursor:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Cursor`},windsurf:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Windsurf`},copilot:{SessionStart:`none`,PreToolUse:`native`,PostToolUse:`native`,PreCommit:`none`,SessionEnd:`none`,overall:`partial`,label:`GitHub Copilot`},hermes:{SessionStart:`middleware`,PreToolUse:`middleware`,PostToolUse:`middleware`,PreCommit:`none`,SessionEnd:`middleware`,overall:`middleware`,label:`Hermes Agent`},codex:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Codex CLI`},gemini:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Gemini CLI`},opencode:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`OpenCode`},zed:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`Zed`},intellij:{SessionStart:`none`,PreToolUse:`none`,PostToolUse:`none`,PreCommit:`none`,SessionEnd:`none`,overall:`none`,label:`IntelliJ`}};function i(){let i=new Set(e),a=[`overall`,`label`];for(let[o,s]of Object.entries(r)){for(let e of i)if(!(e in s))throw Error(`Capability matrix: platform "${o}" is missing event "${e}". Add it to PLATFORM_HOOK_CAPABILITIES.${o}.`);for(let e of a)if(!(e in s))throw Error(`Capability matrix: platform "${o}" is missing "${e}". Add it to PLATFORM_HOOK_CAPABILITIES.${o}.`);if(typeof s.label!=`string`||s.label.length===0)throw Error(`Capability matrix: platform "${o}" has empty or missing "label". Set a non-empty label.`);if(!n.includes(s.overall))throw Error(`Capability matrix: platform "${o}" has invalid overall "${s.overall}". Valid: ${n.join(`, `)}.`);let r=e.every(e=>s[e]===`none`);if(r&&s.overall!==`none`)throw Error(`Capability matrix: platform "${o}" has all events 'none' but overall="${s.overall}". Set overall to 'none'.`);if(s.overall===`none`&&!r)throw Error(`Capability matrix: platform "${o}" has overall='none' but individual events are not all 'none'. Set each event to 'none' or change overall.`);for(let e of i)if(!t.includes(s[e]))throw Error(`Capability matrix: platform "${o}" event "${e}" has invalid level "${s[e]}". Valid: ${t.join(`, `)}.`)}}function a(e){let t=Object.keys(r),n=new Set(e);for(let e of t)n.has(e)||console.warn(`Capability matrix: platform "${e}" has no corresponding adapter in generate.mjs ADAPTERS. Hook generation for this platform will be skipped.`)}export{e as HOOK_EVENTS,r as PLATFORM_HOOK_CAPABILITIES,i as validateCapabilityMatrix,a as validateMatrixAdapterAlignment};
@@ -1 +1 @@
1
- import e from"./adr-skill.mjs";import t from"./aikit.mjs";import n from"./brainstorming.mjs";import r from"./browser-use.mjs";import i from"./c4-architecture.mjs";import a from"./docs.mjs";import o from"./frontend-design.mjs";import s from"./lesson-learned.mjs";import c from"./multi-agents-development.mjs";import l from"./present.mjs";import u from"./react.mjs";import d from"./repo-access.mjs";import f from"./requirements-clarity.mjs";import p from"./session-handoff.mjs";import m from"./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};
1
+ import e from"./adr-skill.mjs";import t from"./aikit.mjs";import n from"./brainstorming.mjs";import r from"./browser-use.mjs";import i from"./c4-architecture.mjs";import a from"./docs.mjs";import o from"./frontend-design.mjs";import s from"./lesson-learned.mjs";import c from"./multi-agents-development.mjs";import l from"./orchestrator.mjs";import u from"./present.mjs";import d from"./react.mjs";import f from"./repo-access.mjs";import p from"./requirements-clarity.mjs";import m from"./session-handoff.mjs";import h from"./typescript.mjs";const g={"adr-skill":e,aikit:t,brainstorming:n,"c4-architecture":i,docs:a,"frontend-design":o,"lesson-learned":s,"multi-agents-development":c,orchestrator:l,present:u,react:d,"repo-access":f,"requirements-clarity":p,"session-handoff":m,typescript:h,"browser-use":r};export{g as SKILLS};
@@ -0,0 +1,38 @@
1
+ var e=[{file:`SKILL.md`,content:`---
2
+ name: orchestrator
3
+ description: "Orchestration protocol: decompose every task, delegate to sub-agents via Task(), never implement directly. Enforced for all Orchestrator sessions."
4
+ metadata:
5
+ category: orchestration
6
+ domain: workflow
7
+ applicability: always
8
+ inputs: [task-description]
9
+ outputs: [decomposition, delegation, synthesis]
10
+ relatedSkills: [aikit, multi-agents-development]
11
+ ---
12
+
13
+ # Orchestrator Protocol — MANDATORY
14
+
15
+ YOU MUST FOLLOW THIS PROTOCOL ON EVERY TASK. You are an orchestrator, not an implementer.
16
+
17
+ ## Hard Rules
18
+
19
+ **RULE 1 — Decompose everything.** Every task gets a TODO list via \`TodoWrite\` in your first response. Break it into independent, parallelizable subtasks.
20
+
21
+ **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.
22
+
23
+ **RULE 3 — Wait and synthesize.** After all sub-agents complete, consolidate their outputs. Only then deliver the final result to the user.
24
+
25
+ **RULE 4 — No direct coding.** You NEVER write, edit, or create files yourself. That is sub-agent work. If you think you need to write code, you need a sub-agent.
26
+
27
+ **RULE 5 — Parallel fan-out.** Subtasks without data dependencies MUST run in parallel. Do not serialize independent work.
28
+
29
+ **RULE 6 — Full cycle per phase.** Each phase (Plan → Implement → Review → Verify) gets its own delegation cycle. Do not skip phases.
30
+
31
+ ## Exceptions (ONLY these)
32
+
33
+ You MAY write code directly ONLY when:
34
+ - The change is trivially small (≤5 lines, one file)
35
+ - You are fixing a sub-agent's output (typo, quick patch)
36
+ - There is no sub-agent available for the required skill
37
+
38
+ When in doubt, delegate. When unsure, spawn an extra sub-agent.`}];export{e as default};
@@ -1,54 +0,0 @@
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,buildFlowSection as d}from"./_shared.mjs";import{generateForbiddenTable as f}from"../definitions/policies.mjs";import{generateHooks as p,getHookScriptFiles as m}from"./hooks.mjs";const h={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 g(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 _(e){let t=(l[e]||[]).map(e=>{let t=h[e];return t?t.split(`,`).map(e=>e.trim()):null}).filter(Boolean).flat();return`[${[...new Set(t),`aikit/*`].join(`, `)}]`}function v(e){return r(`hermes`,e,`Auto (hermes)`)}const y=d({flowTool:`mcp_aikit_flow`,isLifecycleOwner:!0}),b=d({flowTool:`mcp_aikit_flow`,isLifecycleOwner:!1});function x(){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(`hermes`,n,`Unknown`),s=(a.variants[e]||{}).description||a.description;t.push(`| **${n}** | ${s} | ${o} | ${a.category} |`)}else{let e=r(`hermes`,i,`Unknown`);t.push(`| **${i}** | ${a.description} | ${e} | ${a.category} |`)}return`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${t.join(`
2
- `)}`}function S(e,t,r){let i=`${e}-${t}`,a=r.variants[t]||{},o=v(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]}`:``;u=g(u);let d=r.extraBody?`\n\n${g(r.extraBody)}`:``,f=a.bodyAddendum?`\n\n${g(a.bodyAddendum)}`:``,p=(r.sharedProtocols||[]).map(e=>{let t=s[e];return t?`\n\n${g(t)}`:``}).join(``),m=r.skills?.length?`\n\n## Skills (load on demand)\n\n${r.skills.map(([e,t])=>`- \`${e}\`: ${t}`).join(`
3
- `)}`:``,h=r.title||e;return`---
4
- description: '${c}'
5
- ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${_(r.toolRole)}
6
- model: ${o}
7
- ---
8
-
9
- # ${i} - ${h}
10
-
11
- You are **${i}**${l}${d}
12
- ${u}${p}${f}${m}
13
-
14
- ${b}
15
- `}function C(n,r){let i=v(n),a=typeof t[n]==`function`?t[n](u(e)):t[n]||``;a=g(a);let o=r.sharedBase&&s[r.sharedBase]?`\n\n${s[r.sharedBase]}`:``;o=g(o);let c=(r.sharedProtocols||[]).map(e=>{let t=s[e];return t?`\n\n${g(t)}`:``}).join(``),l=r.title||n,d=r.skills?.length?`\n## Skills (load on demand)\n\n${r.skills.map(([e,t])=>`- \`${e}\`: ${t}`).join(`
16
- `)}\n`:``;return`---
17
- description: '${r.description}'
18
- ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${_(r.toolRole)}
19
- model: ${i}
20
- ---
21
-
22
- # ${n} - ${l}
23
-
24
- You are the **${n}**, ${r.description.toLowerCase().replace(/^./,e=>e.toLowerCase())}
25
-
26
- ${a}${o}${c}${d}
27
-
28
- ${n===`Orchestrator`?y:b}
29
- `}function w(e,t){return`---
30
- description: "${t.description}"
31
- agent: "${t.agent}"
32
- ---
33
-
34
- ${t.content}
35
- `}function T(){return`# Hermes Agents
36
-
37
- This directory contains AI agent definitions generated by \`@vpxa/aikit init\` for **Hermes Agent**.
38
-
39
- ## Agent Roster
40
-
41
- ${x()}
42
-
43
- ## Multi-Model Pattern
44
-
45
- Variant agents (Researcher-Alpha/Beta/Gamma/Delta, Code-Reviewer-Alpha/Beta, Architect-Reviewer-Alpha/Beta) share the same inlined methodology. They differ only in which LLM model backs them — enabling multi-model decision analysis and dual-review workflows.
46
-
47
- ## Tools
48
-
49
- Hermes provides native tools (\`terminal\`, \`read_file\`, \`write_file\`, \`patch\`, \`search_files\`, \`delegate_task\`, etc.)
50
- plus AI Kit MCP tools (\`mcp_aikit_search\`, \`mcp_aikit_knowledge\`, etc.) for code analysis, memory, and context compression.
51
-
52
- See \`AGENTS.md\` (in Hermes config directory) for complete tool usage guidance.
53
- `}function E(){return[`# AI Kit — Hermes Agent Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`Hermes provides native tools (terminal, read_file, write_file, patch, search_files, delegate_task, etc.)`,`plus AI Kit MCP tools (mcp_aikit_*) for code analysis, memory, and context compression.`,``,`### When to Use AI Kit Tools`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search across all indexed content |","| `cat` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| Running tests in terminal | `mcp_aikit_test_run` | Structured output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,f(),``,a,``].join(`
54
- `)}function D(){let t=[];if(m().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`hermes-instructions.md`,content:E()});for(let[r,i]of Object.entries(e))if(i.variants)for(let e of n[r]||[])t.push({path:`agents/${r}-${e}.agent.md`,content:S(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:C(r,i)});for(let[e,n]of Object.entries(c))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:T()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:w(e,n)});let r=p(`hermes`,`~/.hermes/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{D as generateHermesAgent};