@complexthings/superpowers-agent 10.0.2 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/.agents/superpowers-agent +17 -222
  2. package/.github/copilot-instructions.md +0 -9
  3. package/AGENTS.md +19 -140
  4. package/README.md +79 -507
  5. package/package.json +1 -7
  6. package/.agents/docs/SUPERPOWERS.md +0 -37
  7. package/.agents/skills/.gitkeep +0 -0
  8. package/.agents/skills/claude-handoff/SKILL.md +0 -18
  9. package/.agents/skills/code-review/SKILL.md +0 -89
  10. package/.agents/skills/codebase-design/DEEPENING.md +0 -37
  11. package/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +0 -44
  12. package/.agents/skills/codebase-design/SKILL.md +0 -114
  13. package/.agents/skills/design-an-interface/SKILL.md +0 -94
  14. package/.agents/skills/diagnosing-bugs/SKILL.md +0 -134
  15. package/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -41
  16. package/.agents/skills/domain-modeling/ADR-FORMAT.md +0 -47
  17. package/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
  18. package/.agents/skills/domain-modeling/SKILL.md +0 -74
  19. package/.agents/skills/fable-mode/SKILL.md +0 -95
  20. package/.agents/skills/git-guardrails-claude-code/SKILL.md +0 -95
  21. package/.agents/skills/git-guardrails-claude-code/scripts/block-dangerous-git.sh +0 -25
  22. package/.agents/skills/grill-me/SKILL.md +0 -7
  23. package/.agents/skills/grill-with-docs/SKILL.md +0 -7
  24. package/.agents/skills/grilling/SKILL.md +0 -14
  25. package/.agents/skills/handoff/SKILL.md +0 -16
  26. package/.agents/skills/i-have-adhd/SKILL.md +0 -120
  27. package/.agents/skills/implement/SKILL.md +0 -11
  28. package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
  29. package/.agents/skills/improve-codebase-architecture/SKILL.md +0 -66
  30. package/.agents/skills/loop-me/SKILL.md +0 -32
  31. package/.agents/skills/prototype/LOGIC.md +0 -79
  32. package/.agents/skills/prototype/SKILL.md +0 -30
  33. package/.agents/skills/prototype/UI.md +0 -112
  34. package/.agents/skills/qa/SKILL.md +0 -130
  35. package/.agents/skills/request-refactor-plan/SKILL.md +0 -68
  36. package/.agents/skills/research/SKILL.md +0 -12
  37. package/.agents/skills/resolving-merge-conflicts/SKILL.md +0 -14
  38. package/.agents/skills/scaffold-exercises/SKILL.md +0 -106
  39. package/.agents/skills/setup-matt-pocock-skills/SKILL.md +0 -127
  40. package/.agents/skills/setup-matt-pocock-skills/domain.md +0 -51
  41. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +0 -45
  42. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +0 -46
  43. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +0 -30
  44. package/.agents/skills/setup-matt-pocock-skills/triage-labels.md +0 -15
  45. package/.agents/skills/skill-creator/LICENSE.txt +0 -202
  46. package/.agents/skills/skill-creator/SKILL.md +0 -485
  47. package/.agents/skills/skill-creator/agents/analyzer.md +0 -274
  48. package/.agents/skills/skill-creator/agents/comparator.md +0 -202
  49. package/.agents/skills/skill-creator/agents/grader.md +0 -223
  50. package/.agents/skills/skill-creator/assets/eval_review.html +0 -146
  51. package/.agents/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  52. package/.agents/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  53. package/.agents/skills/skill-creator/references/schemas.md +0 -430
  54. package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
  55. package/.agents/skills/skill-creator/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  56. package/.agents/skills/skill-creator/scripts/__pycache__/run_eval.cpython-314.pyc +0 -0
  57. package/.agents/skills/skill-creator/scripts/__pycache__/utils.cpython-314.pyc +0 -0
  58. package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  59. package/.agents/skills/skill-creator/scripts/generate_report.py +0 -326
  60. package/.agents/skills/skill-creator/scripts/improve_description.py +0 -247
  61. package/.agents/skills/skill-creator/scripts/package_skill.py +0 -136
  62. package/.agents/skills/skill-creator/scripts/quick_validate.py +0 -103
  63. package/.agents/skills/skill-creator/scripts/run_eval.py +0 -310
  64. package/.agents/skills/skill-creator/scripts/run_loop.py +0 -328
  65. package/.agents/skills/skill-creator/scripts/utils.py +0 -47
  66. package/.agents/skills/tdd/SKILL.md +0 -36
  67. package/.agents/skills/tdd/mocking.md +0 -59
  68. package/.agents/skills/tdd/tests.md +0 -77
  69. package/.agents/skills/teach/GLOSSARY-FORMAT.md +0 -35
  70. package/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +0 -46
  71. package/.agents/skills/teach/MISSION-FORMAT.md +0 -31
  72. package/.agents/skills/teach/RESOURCES-FORMAT.md +0 -32
  73. package/.agents/skills/teach/SKILL.md +0 -140
  74. package/.agents/skills/to-spec/SKILL.md +0 -75
  75. package/.agents/skills/to-tickets/SKILL.md +0 -114
  76. package/.agents/skills/triage/AGENT-BRIEF.md +0 -207
  77. package/.agents/skills/triage/OUT-OF-SCOPE.md +0 -105
  78. package/.agents/skills/triage/SKILL.md +0 -112
  79. package/.agents/skills/ubiquitous-language/SKILL.md +0 -93
  80. package/.agents/skills/wayfinder/SKILL.md +0 -127
  81. package/.agents/skills/writing-great-skills/GLOSSARY.md +0 -201
  82. package/.agents/skills/writing-great-skills/SKILL.md +0 -83
  83. package/.agents/templates/AGENTS.md.template +0 -27
  84. package/.agents/templates/SUPERPOWERS.md.template +0 -37
  85. package/skills/collaboration/brainstorming/SKILL.md +0 -66
  86. package/skills/collaboration/brainstorming/skill.json +0 -9
  87. package/skills/collaboration/leveraging-cli-tools/SKILL.md +0 -110
  88. package/skills/collaboration/leveraging-cli-tools/references/copilot-instructions.md +0 -30
  89. package/skills/collaboration/leveraging-cli-tools/scripts/setup-ponytail.sh +0 -185
  90. package/skills/collaboration/leveraging-cli-tools/scripts/setup-rtk.sh +0 -217
  91. package/skills/collaboration/leveraging-cli-tools/skill.json +0 -9
  92. package/skills/meta/create-skill-json/SKILL.md +0 -370
  93. package/skills/meta/create-skill-json/skill.json +0 -9
  94. package/skills/meta/create-skill-json/test-scenarios.md +0 -29
  95. package/skills/setup-skills/SKILL.md +0 -54
  96. package/skills/setup-skills/skill.json +0 -8
@@ -1,227 +1,22 @@
1
1
  #!/bin/sh
2
2
  // 2>/dev/null; exec "$(command -v bun 2>/dev/null || echo node)" "$0" "$@"
3
- import{readFileSync as lz,writeFileSync as iz,existsSync as Uz}from"fs";import{join as l}from"path";import{execSync as dQ}from"child_process";import{homedir as cz,platform as kQ}from"os";import{join as w,parse as PQ,dirname as nz}from"path";import{existsSync as g}from"fs";import{fileURLToPath as gQ}from"url";var mQ=gQ(import.meta.url),Zz=nz(mQ),hQ=()=>{let z=cz();switch(kQ()){case"darwin":return w(z,"Library","Application Support","Code","User");case"win32":return w(z,"AppData","Roaming","Code","User");case"linux":return w(z,".config","Code","User");default:return w(z,".config","Code","User")}},uQ=()=>{let z=process.cwd(),Q=PQ(z).root;while(z!==Q){if(g(w(z,".agents")))return z;z=nz(z)}return process.cwd()},_={home:cz(),vscodeUserDir:hQ(),projectRoot:uQ(),get projectClaudeSkills(){return w(this.projectRoot,".claude","skills")},get projectAgentsSkills(){return w(this.projectRoot,".agents","skills")},get projectCopilotSkills(){return w(this.projectRoot,".copilot","skills")},get projectOpencodeSkills(){return w(this.projectRoot,".opencode","skill")},get projectSkillsDir(){return w(this.projectRoot,"skills")},get homePersonalSkills(){return w(this.home,".agents","skills")},get homeClaudeSkills(){return w(this.home,".claude","skills")},get homeCopilotSkills(){return w(this.home,".copilot","skills")},get claudeSettings(){return w(this.home,".claude","settings.json")},get copilotHooksDir(){return process.env.COPILOT_HOME?w(process.env.COPILOT_HOME,"hooks"):w(this.home,".copilot","hooks")},get homeOpencodeSkills(){return w(this.home,".config","opencode","skill")},get bootstrap(){return w(this.projectRoot,".agents","superpowers-bootstrap.md")},get superpowersRepo(){let z=w(Zz,"..","..","..");if(g(w(z,"skills"))&&g(w(z,".agents","superpowers-agent")))return z;let Q=w(Zz,"..");if(g(w(Q,"skills"))&&g(w(Q,".agents","superpowers-agent")))return Q;return w(this.home,".agents","superpowers")},get homeSuperpowersSkills(){return w(this.superpowersRepo,"skills")},get isSuperpowersRepo(){let z=w(Zz,"..","..","..");if(g(w(z,"skills"))&&g(w(z,".agents","superpowers-agent")))return!0;let Q=w(Zz,"..");return g(w(Q,"skills"))&&g(w(Q,".agents","superpowers-agent"))}};var Jz=()=>({auto_update:!0,last_update_check:null,last_updated_commit:null}),zz=()=>{let z=l(_.superpowersRepo,".config.json");try{if(!Uz(z))return Jz();let Q=lz(z,"utf8");return{...Jz(),...JSON.parse(Q)}}catch{return Jz()}},az=(z)=>{let Q=l(_.superpowersRepo,".config.json"),$={...zz(),...z};try{iz(Q,JSON.stringify($,null,2))}catch(Z){console.log(`Warning: couldn't save config: ${Z.message}`)}},S=(z)=>{let Q=z?l(_.home,".agents","config.json"):l(process.cwd(),".agents","config.json");if(!Uz(Q))return{};try{let X=lz(Q,"utf8");return JSON.parse(X)}catch(X){return{}}},m=(z,Q)=>{let X=Q?l(_.home,".agents"):l(process.cwd(),".agents"),$=l(X,"config.json");try{if(!Uz(X))dQ(`mkdir -p "${X}"`,{stdio:"pipe"});return iz($,JSON.stringify(z,null,2),"utf8"),!0}catch(Z){throw Error(`Failed to write config: ${Z.message}`)}},P=(z=!1)=>{return S(z).repositories||{}},oz=(z,Q,X)=>{let $=S(X);if(!$.repositories)$.repositories={};$.repositories[z]=Q,m($,X)};function rz(z=!0){return S(z).installedSkills||{}}function _z(z,Q=!0){let X=S(Q);if(X.installedSkills)delete X.installedSkills[z];m(X,Q)}function sz(){return S(!0).installedAgents||{}}import{readFileSync as pQ}from"fs";import{join as Iz,dirname as cQ}from"path";import{fileURLToPath as nQ}from"url";import{existsSync as tz}from"fs";import{execSync as lQ}from"child_process";var iQ=nQ(import.meta.url),Lz=cQ(iQ),k=()=>{try{let z=Iz(Lz,"package.json");if(!tz(z))z=Iz(Lz,"..","package.json");if(!tz(z))z=Iz(Lz,"..","..","package.json");return JSON.parse(pQ(z,"utf8")).version||"0.0.0"}catch{return"0.0.0"}},i=()=>{let z=k();console.log(`^^SAV:${z}^^`)},$z=async()=>{try{let Q=lQ('curl -sS "https://registry.npmjs.org/@complexthings/superpowers-agent/latest"',{encoding:"utf8",timeout:1e4}),X=JSON.parse(Q);if(!X.version)return k();return X.version}catch(z){throw Error(`Failed to fetch remote version: ${z.message}`)}},Yz=(z,Q)=>{let X=z.split(".").map(Number),$=Q.split(".").map(Number);for(let Z=0;Z<3;Z++){let Y=X[Z]||0,H=$[Z]||0;if(Y>H)return!0;if(Y<H)return!1}return!1};var ez=()=>{let z=zz();console.log("Current configuration:"),console.log(JSON.stringify(z,null,2))},zQ=()=>{let z=process.argv[3],Q=process.argv[4];if(!z||Q===void 0){console.log(`Usage: .agents/superpowers-agent config-set <key> <value>
4
-
5
- Available keys:
6
- auto_update (true/false) - Enable/disable automatic updates during bootstrap
7
-
8
- Examples:
9
- .agents/superpowers-agent config-set auto_update false
10
- .agents/superpowers-agent config-set auto_update true`);return}let X=Q;if(Q==="true")X=!0;else if(Q==="false")X=!1;az({[z]:X}),console.log(`✓ Set ${z} = ${X}`)},QQ=()=>{i();let z=P(!0),Q=P(!1),X=[];for(let[Y,H]of Object.entries(z))X.push({alias:Y,url:H,source:"global"});for(let[Y,H]of Object.entries(Q)){let q=X.findIndex((V)=>V.alias===Y);if(q>=0)X[q]={alias:Y,url:H,source:"project"};else X.push({alias:Y,url:H,source:"project"})}if(X.length===0){console.log(`No repository aliases configured.
11
-
12
- Add a repository using:
13
- superpowers-agent add-repository <git-url> [--as=@alias]`);return}let $=Math.max(5,...X.map((Y)=>Y.alias.length)),Z=Math.max(3,...X.map((Y)=>Y.url.length));console.log(`Repositories:
14
- `),console.log(`${"Alias".padEnd($)} ${"URL".padEnd(Z)} Source`);for(let Y of X)console.log(`${Y.alias.padEnd($)} ${Y.url.padEnd(Z)} (${Y.source})`);console.log(`
15
- Total: ${X.length} repository alias(es)`)};var qz=async()=>{try{let z=k(),Q=await $z();return{hasUpdates:Yz(Q,z),localVersion:z,remoteVersion:Q}}catch{return{hasUpdates:!1,localVersion:k(),remoteVersion:"",error:!0}}};var wz={npm:"npm install -g @complexthings/superpowers-agent",pnpm:"pnpm add -g @complexthings/superpowers-agent",yarn:"yarn global add @complexthings/superpowers-agent",bun:"bun add -g @complexthings/superpowers-agent",deno:"deno install -g -A -n superpowers-agent npm:@complexthings/superpowers-agent"},Oz=(z=_.superpowersRepo)=>{let Q=String(z).toLowerCase().replace(/\\/g,"/");if(Q.includes("/.bun/")||Q.includes("/bun/install"))return"bun";if(Q.includes("/pnpm"))return"pnpm";if(Q.includes("/yarn"))return"yarn";if(Q.includes("/.deno/")||Q.includes("/deno/"))return"deno";return"npm"},Tz=async()=>{console.log(`# Checking for Superpowers updates...
16
- `);let z=await qz();if(z.error){console.log("⚠️ Could not check for updates (network issue)");return}if(!z.hasUpdates){console.log(`✓ Already up to date (v${z.localVersion})`);return}console.log(`\uD83D\uDCE6 Update available: v${z.localVersion} → v${z.remoteVersion}
17
- `);let Q=Oz();console.log(` To update, run:
18
- `),console.log(` ${wz[Q]}`),console.log(` superpowers-agent bootstrap && superpowers-agent setup-skills
19
- `)},XQ=async()=>{i();let z=k();console.log(`Current version: ${z}`);try{let Q=await $z();if(console.log(`Latest version: ${Q}`),Yz(Q,z))console.log("Update available: Yes"),process.exit(1);else console.log("You are up to date"),process.exit(0)}catch(Q){console.log(`Error checking for updates: ${Q.message}`),process.exit(1)}},ZQ=()=>{let z=k();console.log(z)};import{existsSync as N,readFileSync as s,writeFileSync as r,rmSync as Cz,lstatSync as fX,readdirSync as kX}from"fs";import{join as M,dirname as jz,parse as a}from"path";import{execSync as f}from"child_process";import{platform as PX}from"os";import{existsSync as oQ}from"fs";import{join as rQ}from"path";import{execSync as aQ}from"child_process";var p=(z)=>{try{return aQ(`which ${z}`,{stdio:"pipe",timeout:2000}),!0}catch{return!1}};var D={opencode:{check:()=>p("opencode"),cli:!0,name:"OpenCode",installUrl:"https://opencode.ai/docs/installation",bootstrapCommand:"install-opencode-commands"},claude:{check:()=>p("claude"),cli:!0,name:"Claude Code",installUrl:"https://code.claude.com/docs/en/installation",bootstrapCommand:"install-claude-commands"},copilot:{check:()=>p("copilot"),cli:!0,name:"GitHub Copilot",bootstrapCommand:"install-copilot-prompts"},pi:{check:()=>p("pi"),cli:!0,name:"Pi Coding Agent"},codex:{check:()=>p("codex"),cli:!0,name:"OpenAI Codex"}},$Q=()=>{let z=[];if(D.copilot.check())z.push("github-copilot");if(D.claude.check())z.push("claude-code");if(D.opencode.check())z.push("opencode");return z},YQ={"claude-code":".claude","github-copilot":".github",opencode:".opencode",pi:".pi",codex:".codex"},sQ={"claude-code":"claude","github-copilot":"copilot",opencode:"opencode",pi:"pi",codex:"codex"},tQ=(z,Q)=>{let X=YQ[Q];return X?oQ(rQ(z,X)):!1},qQ=(z)=>{return Object.keys(YQ).filter((Q)=>{let X=sQ[Q];return tQ(z,Q)||D[X].check()})},WQ=["github-copilot","opencode","pi","codex"];import{existsSync as Mz,readdirSync as mZ,lstatSync as eQ,symlinkSync as HQ,unlinkSync as zX,mkdirSync as QX,readlinkSync as XX}from"fs";import{join as Nz,dirname as uZ}from"path";import{platform as ZX}from"os";var vz=(z)=>{try{return eQ(z).isSymbolicLink()}catch{return!1}},$X=(z,Q)=>{try{if(!vz(z))return!1;return XX(z)===Q}catch{return!1}},BQ=()=>{let z=Nz(_.superpowersRepo,".opencode","plugins","superpowers-agent.js"),Q=Nz(_.home,".config","opencode","plugins"),X=Nz(Q,"superpowers-agent.js");if(console.log("Installing OpenCode plugin symlink..."),!Mz(z))return console.log("⚠️ Source plugin not found, skipping symlink creation"),console.log(` Expected at: ${z}`),{created:!1,error:"Source plugin not found"};if($X(X,z))return console.log("✓ Plugin symlink already exists and is correct"),{created:!1,existed:!0};if(Mz(X)&&!vz(X))return console.log("⚠️ Warning: A file already exists at the destination path"),console.log(` Path: ${X}`),console.log(" Skipping symlink creation to avoid overwriting existing file"),console.log(" To use superpowers-agent plugin, manually remove or rename the existing file"),{created:!1,error:"File already exists at destination"};if(!Mz(Q))try{QX(Q,{recursive:!0}),console.log(`✓ Created ${Q.replace(_.home,"~")}`)}catch(Z){return console.log(`⚠️ Failed to create plugins directory: ${Z.message}`),{created:!1,error:`Failed to create directory: ${Z.message}`}}if(vz(X))try{zX(X)}catch(Z){return console.log(`⚠️ Failed to remove existing symlink: ${Z.message}`),{created:!1,error:`Failed to remove existing symlink: ${Z.message}`}}let $=ZX();try{if($==="win32")HQ(z,X,"file");else HQ(z,X);let Z=z.replace(_.home,"~"),Y=X.replace(_.home,"~");return console.log(`✓ Created symlink: ${Y}`),console.log(` -> ${Z}`),{created:!0}}catch(Z){if($==="win32"&&Z.code==="EPERM")return console.log("⚠️ Windows requires Developer Mode or admin privileges for symlinks"),console.log(" Enable Developer Mode: Settings > Update & Security > For developers"),{created:!1,error:"Windows symlink permission denied"};return console.log(`⚠️ Failed to create symlink: ${Z.message}`),{created:!1,error:`Failed to create symlink: ${Z.message}`}}};import{existsSync as VQ,readdirSync as lZ,readFileSync as YX,writeFileSync as qX,mkdirSync as WX,copyFileSync as HX}from"fs";import{join as aZ,dirname as BX}from"path";var VX="superpowers-agent session-context",EX="superpowers-agent session-context --format=claude 2>/dev/null || true",KX="startup|resume|clear|compact",EQ=(z=_.claudeSettings)=>{let Q={},X=!1,$;if(VQ(z)){X=!0;let G;try{G=YX(z,"utf8")}catch(E){return{error:!0,message:`Failed to read settings.json: ${E.message}`}}try{Q=G.trim()?JSON.parse(G):{}}catch(E){return{error:!0,message:`settings.json is not valid JSON, leaving it untouched: ${E.message}`}}let B=new Date().toISOString().split("T")[0];$=`${z}.backup-${B}`;try{HX(z,$)}catch(E){return{error:!0,message:`Failed to back up settings.json: ${E.message}`}}}if(typeof Q!=="object"||Q===null||Array.isArray(Q))return{error:!0,message:"settings.json root is not an object"};Q.hooks=Q.hooks||{};let Z=Array.isArray(Q.hooks.SessionStart)?Q.hooks.SessionStart:[],Y=(G)=>{try{return JSON.stringify(G).includes(VX)}catch{return!1}},H=Z.some(Y),q=Z.filter((G)=>!Y(G)),V={matcher:KX,hooks:[{type:"command",command:EX}]};Q.hooks.SessionStart=[...q,V];let W=BX(z);if(!VQ(W))try{WX(W,{recursive:!0})}catch(G){return{error:!0,message:`Failed to create ${W}: ${G.message}`}}try{qX(z,JSON.stringify(Q,null,2)+`
20
- `,"utf8")}catch(G){return{error:!0,message:`Failed to write settings.json: ${G.message}`}}if(!X)return{created:!0};if(H)return{existed:!0,updated:!0,backup:$};return{updated:!0,backup:$}};import{existsSync as Az,readdirSync as tZ,readFileSync as GX,writeFileSync as JX,mkdirSync as UX}from"fs";import{join as _X}from"path";var IX="superpowers.json",LX=()=>({version:1,hooks:{sessionStart:[{type:"command",bash:"superpowers-agent session-context --format=copilot 2>/dev/null || true",powershell:"superpowers-agent session-context --format=copilot 2>$null; exit 0",timeoutSec:15}]}}),KQ=(z=_.copilotHooksDir)=>{let Q=_X(z,IX),X=JSON.stringify(LX(),null,2)+`
21
- `;if(Az(Q)){let Z;try{Z=GX(Q,"utf8")}catch(Y){return{error:!0,message:`Failed to read ${Q}: ${Y.message}`}}if(Z===X)return{existed:!0,path:Q}}if(!Az(z))try{UX(z,{recursive:!0})}catch(Z){return{error:!0,message:`Failed to create ${z}: ${Z.message}`}}let $=Az(Q);try{JX(Q,X,"utf8")}catch(Z){return{error:!0,message:`Failed to write ${Q}: ${Z.message}`}}return $?{updated:!0,path:Q}:{created:!0,path:Q}};import{existsSync as u,readdirSync as wX,lstatSync as OX,symlinkSync as Qz,unlinkSync as Wz,mkdirSync as GQ,readlinkSync as TX}from"fs";import{join as h,dirname as JQ,basename as MX}from"path";import{homedir as c,platform as UQ}from"os";var Hz=[{name:"claude",parentDir:()=>h(c(),".claude"),skillsDir:()=>h(c(),".claude","skills")},{name:"copilot",parentDir:()=>h(c(),".copilot"),skillsDir:()=>h(c(),".copilot","skills")},{name:"opencode",parentDir:()=>h(c(),".config","opencode"),skillsDir:()=>h(c(),".config","opencode","skill")}],n=(z)=>{try{return OX(z).isSymbolicLink()}catch{return!1}},_Q=(z,Q)=>{try{if(!n(z))return!1;return TX(z)===Q}catch{return!1}},IQ=(z,Q)=>{if(!u(z))return{created:!1,existed:!1,error:`Source does not exist: ${z}`};if(_Q(Q,z))return{created:!1,existed:!0};if(u(Q)||n(Q))if(n(Q))try{Wz(Q)}catch(Z){return{created:!1,existed:!1,error:`Failed to remove existing symlink: ${Z.message}`}}else return{created:!1,existed:!1,error:`Target exists and is not a symlink: ${Q}`};let X=JQ(Q);if(!u(X))try{GQ(X,{recursive:!0})}catch(Z){return{created:!1,existed:!1,error:`Failed to create parent directory: ${Z.message}`}}let $=UQ();try{if($==="win32")Qz(z,Q,"junction");else Qz(z,Q,"dir");return{created:!0,existed:!1}}catch(Z){if($==="win32"&&Z.code==="EPERM")return{created:!1,existed:!1,error:"Windows requires Developer Mode or admin privileges for symlinks. Enable Developer Mode: Settings > Update & Security > For developers"};return{created:!1,existed:!1,error:`Failed to create symlink: ${Z.message}`}}},Fz=(z)=>{if(!u(z)&&!n(z))return{removed:!1,error:"Symlink does not exist"};if(!n(z))return{removed:!1,error:"Target is not a symlink"};try{return Wz(z),{removed:!0}}catch(Q){return{removed:!1,error:`Failed to remove symlink: ${Q.message}`}}};var LQ=(z,Q,X="skills")=>{let $=S(!0);if(!$.symlinks||!$.symlinks[z])return;if(X==="superpowers")$.symlinks[z].superpowers=null;else{let Z=$.symlinks[z].skills||[];$.symlinks[z].skills=Z.filter((Y)=>Y!==Q)}m($,!0)};var NX=[".claude/skills",".github/skills",".opencode/skill"],wQ=(z)=>{let Q={created:0,skipped:0};for(let X of NX){let $=h(z,X),Z=JQ($);if(!u(Z)){Q.skipped++;continue}if(u($)&&!n($)){Q.skipped++;continue}if(n($))try{Wz($)}catch{Q.skipped++;continue}try{Qz("../.agents/skills",$,"dir"),Q.created++}catch{Q.skipped++}}return Q},OQ=(z,Q=[])=>{let X;try{X=wX(z,{withFileTypes:!0})}catch{return Q}let $=!1,Z=[];for(let Y of X){if(!Y.isDirectory()&&Y.name==="SKILL.md")$=!0;if(Y.isDirectory()&&!Y.name.startsWith("."))Z.push(h(z,Y.name))}if($)Q.push(z);for(let Y of Z)OQ(Y,Q);return Q},bz=(z=_.homePersonalSkills)=>{let Q=_.homeSuperpowersSkills;if(!u(Q))return{created:0,existed:0,updated:0,errors:[`Skills directory not found: ${Q}`]};if(!u(z))try{GQ(z,{recursive:!0})}catch(Z){return{created:0,existed:0,updated:0,errors:[`Failed to create ${z}: ${Z.message}`]}}let X=OQ(Q),$={created:0,existed:0,updated:0,errors:[]};for(let Z of X){let Y=MX(Z),H=h(z,Y);if(_Q(H,Z)){$.existed++;continue}if(n(H))try{Wz(H),$.updated++}catch(V){$.errors.push(`Failed to remove stale symlink ${H}: ${V.message}`);continue}else if(u(H)){$.errors.push(`Skipped ${H}: path exists and is not a symlink`);continue}let q=UQ();try{if(q==="win32")Qz(Z,H,"junction");else Qz(Z,H,"dir");let V=H.replace(c(),"~"),W=Z.replace(c(),"~");console.log(` ✓ ${V} -> ${W}`),$.created++}catch(V){$.errors.push(`Failed to create symlink ${H}: ${V.message}`)}}return $};import{existsSync as vX,lstatSync as AX,readdirSync as FX,readlinkSync as bX,unlinkSync as CX}from"fs";import{basename as jX,join as xX,resolve as TQ,sep as DX}from"path";var RX=new Set(["preserving-productive-tensions","dispatching-parallel-agents","executing-plans","finishing-a-development-branch","receiving-code-review","requesting-code-review","subagent-driven-development","using-git-worktrees","writing-plans","defense-in-depth","root-cause-tracing","systematic-debugging","verification-before-completion","finding-skills","create-agents-md","creating-prompts","using-superpowers","writing-prompts","collision-zone-thinking","inversion-exercise","meta-pattern-recognition","scale-game","simplification-cascades","when-stuck","tracing-knowledge-lineages","condition-based-waiting","test-driven-development","testing-anti-patterns","using-a-skill"]),yX=(z,Q)=>z===Q||z.startsWith(`${Q}${DX}`),SX=({skillDir:z,bundledSkillsDir:Q,retiredSkillNames:X=RX})=>{let $=[],Z=0,Y=TQ(Q);if(!vX(z))return{removed:$,skipped:Z};let H;try{H=FX(z)}catch{return{removed:$,skipped:Z}}for(let q of H){let V=xX(z,q);try{if(!AX(V).isSymbolicLink())continue;let W=TQ(z,bX(V));if(!yX(W,Y)||!X.has(jX(W))){Z++;continue}CX(V),$.push(V)}catch{Z++}}return{removed:$,skipped:Z}},MQ=()=>{let z=[_.homePersonalSkills,_.homeClaudeSkills],Q=[],X=0;for(let $ of z){let Z=SX({skillDir:$,bundledSkillsDir:_.homeSuperpowersSkills});Q.push(...Z.removed),X+=Z.skipped}return{removed:Q,skipped:X}};var xz=(z)=>{let Q=jz(z),X=a(z).base;if(N(Q)){for(let Y of kX(Q))if(Y.startsWith(`${X}.backup`))Cz(M(Q,Y))}let $=new Date().toISOString().split("T")[0],Z=`${z}.backup-${$}`;return f(`cp "${z}" "${Z}"`,{stdio:"pipe"}),Z},Bz=(z,Q,X,$=!0)=>{let Z=N(z);if(!Z&&!$)return{updated:!1,created:!1,skipped:!0};let Y=Q,H=new Date().toISOString().split("T")[0];Y=Y.replace(/\{\{DATE\}\}/g,H),Y=Y.replace(/\{\{SUPERPOWERS_PATH\}\}/g,_.superpowersRepo);let q=`<!-- SUPERPOWERS_SKILLS_START -->
22
- ${Y}
23
- <!-- SUPERPOWERS_SKILLS_END -->`;if(Z){let V;try{V=xz(z)}catch(J){return{updated:!1,error:!0,message:`Failed to backup: ${J.message}`}}let W;try{W=s(z,"utf8")}catch(J){return{updated:!1,error:!0,message:`Failed to read: ${J.message}`}}let G="<!-- SUPERPOWERS_SKILLS_START -->",B="<!-- SUPERPOWERS_SKILLS_END -->",E;if(W.includes(G)&&W.includes(B)){let J=new RegExp(`${G}[\\s\\S]*?${B}`,"g");E=W.replace(J,q)}else{let J=W.match(/^#\s+.+$/m);if(J){let O=W.indexOf(`
24
- `,J.index)+1;E=W.slice(0,O)+`
25
- `+q+`
26
- `+W.slice(O)}else E=q+`
27
-
28
- `+W}try{return r(z,E,"utf8"),{updated:!0,created:!1,backup:V}}catch(J){return{updated:!1,error:!0,message:`Failed to write: ${J.message}`}}}else try{let V=jz(z);if(!N(V))f(`mkdir -p "${V}"`,{stdio:"pipe"});let B=`# ${a(z).base.toUpperCase()}
29
-
30
- `+q;return r(z,B,"utf8"),{updated:!1,created:!0}}catch(V){return{updated:!1,created:!1,error:!0,message:`Failed to create: ${V.message}`}}},gX=()=>{console.log("Installing Unix aliases...");let z=M(_.superpowersRepo,".agents","superpowers-agent"),Q=M(_.home,".local","bin"),X=M(Q,"superpowers-agent"),$=M(Q,"superpowers");if(!N(z)){console.log("⚠️ superpowers-agent executable not found");return}if(!N(Q))try{f(`mkdir -p "${Q}"`,{stdio:"pipe"}),console.log(`✓ Created ${Q}`)}catch(Y){console.log(`⚠️ Failed to create ${Q}: ${Y.message}`);return}try{if(N(X))f(`rm "${X}"`,{stdio:"pipe"});f(`ln -s "${z}" "${X}"`,{stdio:"pipe"}),console.log(`✓ Created symlink: superpowers-agent -> ${z}`)}catch(Y){console.log(`⚠️ Failed to create superpowers-agent symlink: ${Y.message}`)}try{if(N($))f(`rm "${$}"`,{stdio:"pipe"});f(`ln -s "${z}" "${$}"`,{stdio:"pipe"}),console.log(`✓ Created symlink: superpowers -> ${z}`)}catch(Y){console.log(`⚠️ Failed to create superpowers symlink: ${Y.message}`)}if(!(process.env.PATH||"").includes(Q))console.log(`
31
- ⚠️ Warning: ${Q} is not in your PATH`),console.log(" Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):"),console.log(` export PATH="$HOME/.local/bin:$PATH"
32
- `)},mX=()=>{console.log("Installing Windows aliases..."),console.log("✓ Windows alias installation (implementation pending)")},Dz=()=>{let z=PX();if(console.log(`## Installing Universal Aliases
33
- `),z==="win32")return mX();else return gX()},hX=(z)=>{let Q=M(_.superpowersRepo,".github","copilot-instructions.md"),X=M(z,".github","copilot-instructions.md"),$="<!-- SUPERPOWERS_-_INSTRUCTIONS_START -->",Z="<!-- SUPERPOWERS_-_INSTRUCTIONS_END -->";if(!N(Q))return{error:!0,message:"Source template not found"};let Y;try{Y=s(Q,"utf8")}catch(V){return{error:!0,message:`Failed to read source template: ${V.message}`}}if(!Y.includes("<!-- SUPERPOWERS_-_INSTRUCTIONS_START -->")||!Y.includes("<!-- SUPERPOWERS_-_INSTRUCTIONS_END -->"))return{error:!0,message:"Template is missing required markers"};let H=Y.match(new RegExp("<!-- SUPERPOWERS_-_INSTRUCTIONS_START -->[\\s\\S]*?<!-- SUPERPOWERS_-_INSTRUCTIONS_END -->"))[0],q=jz(X);try{if(!N(q))f(`mkdir -p "${q}"`,{stdio:"pipe"})}catch(V){return{error:!0,message:`Failed to create .github directory: ${V.message}`}}if(N(X)){let V;try{V=s(X,"utf8")}catch(G){return{error:!0,message:`Failed to read existing file: ${G.message}`}}let W;try{W=xz(X)}catch(G){return{error:!0,message:`Failed to backup: ${G.message}`}}if(V.includes("<!-- SUPERPOWERS_-_INSTRUCTIONS_START -->")&&V.includes("<!-- SUPERPOWERS_-_INSTRUCTIONS_END -->")){let G=new RegExp("<!-- SUPERPOWERS_-_INSTRUCTIONS_START -->[\\s\\S]*?<!-- SUPERPOWERS_-_INSTRUCTIONS_END -->","g"),B=V.replace(G,H);try{return r(X,B,"utf8"),{updated:!0,backup:W}}catch(E){return{error:!0,message:`Failed to update: ${E.message}`}}}else{let G=V.trimEnd()+`
34
-
35
- `+Y.trim()+`
36
- `;try{return r(X,G,"utf8"),{updated:!0,backup:W}}catch(B){return{error:!0,message:`Failed to append: ${B.message}`}}}}else try{return r(X,Y,"utf8"),{created:!0}}catch(V){return{error:!0,message:`Failed to create: ${V.message}`}}},NQ=()=>{i(),console.log(`# Setting up Superpowers skills for this project
37
- `);let z=process.cwd(),Q=M(z,".agents"),X=M(Q,"skills"),$=M(z,"AGENTS.md"),Z=M(Q,"AGENTS.md"),Y=N($)?$:Z,H=M(_.superpowersRepo,".agents","templates","AGENTS.md.template");if(!N(H)){console.log(`✗ Error: AGENTS.md template not found
38
- Expected at: ${H}
39
- Please update your Superpowers installation`);return}if(!N(Q))try{f(`mkdir -p "${Q}"`,{stdio:"pipe"}),console.log("✓ Created .agents/ directory")}catch(L){console.log(`✗ Failed to create .agents/ directory: ${L.message}`);return}else console.log("✓ .agents/ directory exists");if(!N(X))try{f(`mkdir -p "${X}"`,{stdio:"pipe"}),f(`touch "${M(X,".gitkeep")}"`,{stdio:"pipe"}),console.log("✓ Created .agents/skills/ directory")}catch(L){console.log(`✗ Failed to create skills directory: ${L.message}`);return}else console.log("✓ .agents/skills/ directory exists");let q=wQ(z);console.log(`✓ Synced per-harness skills symlinks (${q.created} created, ${q.skipped} skipped)`);let V=M(Q,"docs"),W=M(V,"SUPERPOWERS.md"),G=M(_.superpowersRepo,".agents","templates","SUPERPOWERS.md.template");if(!N(V))try{f(`mkdir -p "${V}"`,{stdio:"pipe"}),console.log("✓ Created .agents/docs/ directory")}catch(L){console.log(`⚠️ Failed to create docs directory: ${L.message}`)}else console.log("✓ .agents/docs/ directory exists");let B=N(Y);if(B)try{let L=xz(Y);console.log(`✓ Backed up existing AGENTS.md to ${a(L).base}`)}catch(L){console.log(`✗ Failed to backup AGENTS.md: ${L.message}`);return}let E;try{E=s(H,"utf8")}catch(L){console.log(`✗ Failed to read template: ${L.message}`);return}let J=k();if(E=E.replace(/\{\{VERSION\}\}/g,J),N(G))try{let L=s(G,"utf8"),o=new Date().toISOString().split("T")[0];L=L.replace(/\{\{VERSION\}\}/g,J),L=L.replace(/\{\{DATE\}\}/g,o),r(W,L,"utf8"),console.log("✓ Created .agents/docs/SUPERPOWERS.md")}catch(L){console.log(`⚠️ Failed to create SUPERPOWERS.md: ${L.message}`)}else console.log("⚠️ SUPERPOWERS.md.template not found");let O=qQ(z),U=M(z,"CLAUDE.md"),v=M(Q,"CLAUDE.md");console.log(`
40
- Detected platforms for project: ${O.join(", ")||"none"}
41
- `);let C=O.filter((L)=>WQ.includes(L)),j=Bz(Y,E,C,!B);if(j.created)console.log(`✓ Created AGENTS.md with platform tool mappings (${Y===$?"root":".agents/"})`);else if(j.updated)console.log(`✓ Updated AGENTS.md with platform tool mappings (${Y===$?"root":".agents/"})`);else if(j.error)console.log("⚠️ Failed to update AGENTS.md");let A=N(U)?U:v,R=Bz(A,E,["claude-code"],!1);if(R.created)console.log(`✓ Created CLAUDE.md with Claude Code tool mappings (${A===U?"root":".agents/"})`);else if(R.updated){if(console.log(`✓ Updated CLAUDE.md with Claude Code tool mappings (${A===U?"root":".agents/"})`),R.backup)console.log(` Backed up to ${a(R.backup).base}`)}else if(R.skipped)console.log("ℹ️ Skipped CLAUDE.md (does not exist)");else if(R.error)console.log("⚠️ Failed to update CLAUDE.md");let K=M(z,".github","copilot-instructions.md"),I={skipped:!0};if(O.includes("github-copilot")){if(I=hX(z),I.created)console.log("✓ Created .github/copilot-instructions.md with Superpowers instructions");else if(I.updated){if(console.log("✓ Updated .github/copilot-instructions.md with Superpowers instructions"),I.backup)console.log(` Backed up to ${a(I.backup).base}`)}else if(I.error)console.log(`⚠️ Failed to update .github/copilot-instructions.md: ${I.message||""}`)}else console.log("ℹ️ Skipped .github/copilot-instructions.md (GitHub Copilot not detected)");let y=!N($)&&!N(Z);if(N(K)&&y){let L=Bz(K,E,["github-copilot"],!1);if(L.updated){if(console.log("✓ Updated .github/copilot-instructions.md with GitHub Copilot tool mappings"),L.backup)console.log(` Backed up to ${a(L.backup).base}`)}else if(L.error)console.log("⚠️ Failed to update .github/copilot-instructions.md with tool mappings")}else if(N(K)&&!y)console.log("ℹ️ Skipped .github/copilot-instructions.md tool mappings (AGENTS.md exists, using that instead)");else if(!N(K)&&!O.includes("github-copilot"))console.log("ℹ️ Skipped .github/copilot-instructions.md tool mappings (does not exist)");let F=`
42
- # Setup complete!
43
-
44
- Your project now has:
45
- - .agents/ directory structure`;if(j.updated||j.created)F+=`
46
- - AGENTS.md with universal skills instructions`;if(R.updated||R.created)F+=`
47
- - CLAUDE.md with Claude Code skills instructions`;if(I.updated||I.created)F+=`
48
- - .github/copilot-instructions.md with Superpowers instructions`;F+=`
49
- - .agents/skills/ ready for project-specific skills`,F+=`
50
- - .agents/docs/SUPERPOWERS.md for detailed reference
51
- `,console.log(F)},uX=()=>{let z=[...["brainstorming.prompt.md","execute-plan.prompt.md","write-plan.prompt.md","setup-skills.prompt.md","create-meta-prompt.md","finding-skills.prompt.md","skills.prompt.md","use-skill.prompt.md","using-a-skill.prompt.md"].map((X)=>M(_.vscodeUserDir,"prompts",X)),...["brainstorm.md","create-meta-prompt.md","execute-plan.md","finding-skills.md","skills.md","use-skill.md","using-a-skill.md","write-plan.md","setup-skills.md"].map((X)=>M(_.home,".claude","commands",X)),...["brainstorm.md","create-meta-prompt.md","execute-plan.md","finding-skills.md","skills.md","use-skill.md","using-a-skill.md","write-plan.md","setup-skills.md"].map((X)=>M(_.home,".config","opencode","command",X))],Q=0;for(let X of z)if(N(X))try{Cz(X),Q++}catch($){console.log(` ⚠️ Could not remove ${X}: ${$.message}`)}if(Q>0)console.log(`✓ Removed ${Q} legacy prompt/command file${Q!==1?"s":""}`);else console.log("✓ No legacy prompt/command files found")},dX=()=>{let z=0;for(let Q of Hz){let X=Q.skillsDir(),$=M(X,"superpowers");try{if(fX($).isSymbolicLink())Cz($),console.log(`✓ Removed legacy superpowers symlink from ${X.replace(_.home,"~")}`),z++}catch{}}if(z===0)console.log("✓ No legacy superpowers directory symlinks found")},vQ=async()=>{i(),console.log(`# Superpowers Bootstrap for Agents
52
- # ==================================
53
- `);let z=process.argv.includes("--no-update"),X=new Set(["copilot","claude","opencode"].filter((H)=>process.argv.includes(`--force-${H}`))),$=X.size>0;if(!z){let H=zz(),q=await qz();if(q.error)console.log(`## Update Check
54
-
55
- ⚠️ Could not check for updates (network issue)
56
-
57
- ---
58
- `);else if(q.hasUpdates)console.log(`## Update Available
59
- `),console.log(`⚠️ Update available: v${q.localVersion} → v${q.remoteVersion}
60
- To update, run: \`${wz[Oz()]}\``),console.log(`
61
- ---
62
- `)}if(!$)Dz(),console.log(`---
63
- `);if(!$)console.log(`## Cleaning Up Legacy Files
64
- `),uX(),console.log(`
65
- ---
66
- `);if(!$||X.has("copilot")){if(console.log(`## GitHub Copilot Integration
67
- `),console.log("✓ Skill symlinks handled in sync step below"),p("copilot")||N(M(_.home,".copilot"))||X.has("copilot")){let q=KQ();if(q.created)console.log(`✓ Installed Copilot sessionStart hook -> ${q.path.replace(_.home,"~")}`);else if(q.updated)console.log(`✓ Updated Copilot sessionStart hook -> ${q.path.replace(_.home,"~")}`);else if(q.existed)console.log("✓ Copilot sessionStart hook already up to date");else if(q.error)console.log(`⚠️ Failed to install Copilot sessionStart hook: ${q.message}`)}else console.log("ℹ️ Skipped Copilot sessionStart hook (Copilot CLI not detected; run with --force-copilot to install anyway)");console.log(`
68
- ---
69
- `)}if(!$||X.has("claude")){if(console.log(`## Claude Code Integration
70
- `),!D.claude.check()&&!X.has("claude"))console.log(`⚠️ Skipped (${D.claude.name} CLI not detected)
71
- \uD83D\uDCA1 To enable Claude Code integration:
72
- 1. Install Claude Code: ${D.claude.installUrl}
73
- 2. Run: superpowers-agent bootstrap --force-claude`);else{console.log("✓ Skill symlinks handled in sync step below");let q=EQ();if(q.created)console.log(`✓ Installed SessionStart hook -> ${_.claudeSettings.replace(_.home,"~")}`);else if(q.updated){if(console.log(`✓ ${q.existed?"Refreshed":"Added"} SessionStart hook in ${_.claudeSettings.replace(_.home,"~")}`),q.backup)console.log(` Backed up to ${a(q.backup).base}`)}else if(q.error)console.log(`⚠️ Failed to install SessionStart hook: ${q.message}`)}console.log(`
74
- ---
75
- `)}if(!$||X.has("opencode")){if(console.log(`## OpenCode Integration
76
- `),D.opencode.check())BQ();else console.log(`⚠️ Skipped (${D.opencode.name} CLI not detected)
77
- \uD83D\uDCA1 To enable OpenCode integration:
78
- 1. Install OpenCode: ${D.opencode.installUrl}
79
- 2. Run: superpowers-agent ${D.opencode.bootstrapCommand}`);console.log(`
80
- ---
81
- `)}if(!$){console.log(`## Generating Platform-Specific Files
82
- `);let H=$Q();console.log(`Detected platforms: ${H.join(", ")||"none"}
83
- `);let q=M(_.superpowersRepo,".agents","templates","AGENTS.md.template"),V="";try{V=s(q,"utf8")}catch(W){console.log(`⚠️ Could not read AGENTS.md template: ${W.message}
84
- `)}if(V){let W=k();V=V.replace(/\{\{VERSION\}\}/g,W);let G=M(_.home,".agents","AGENTS.md"),B=Bz(G,V,H,!0);if(B.created)console.log(`✓ Created ${G}`);else if(B.updated)console.log(`✓ Updated ${G}`)}console.log(`
85
- ---
86
- `)}console.log(`## Cleaning Up Legacy Superpowers Dir Symlinks
87
- `),dX(),console.log(`
88
- ---
89
- `),console.log(`## Syncing Repo Skills -> ~/.agents/skills/
90
- `);let Z=bz();if(Z.created>0||Z.updated>0)console.log(` ✓ ${Z.created} created, ${Z.updated} updated, ${Z.existed} already current`);else if(Z.errors.length>0)for(let H of Z.errors)console.log(` ⚠️ ${H}`);else console.log(` ✓ ${Z.existed} skill symlinks already up to date`);if(console.log(`
91
- ---
92
- `),N(M(_.home,".claude"))){console.log(`## Syncing Repo Skills -> ~/.claude/skills/
93
- `);let H=bz(_.homeClaudeSkills);if(H.created>0||H.updated>0)console.log(` ✓ ${H.created} created, ${H.updated} updated, ${H.existed} already current`);else if(H.errors.length>0)for(let q of H.errors)console.log(` ⚠️ ${q}`);else console.log(` ✓ ${H.existed} skill symlinks already up to date`);console.log(`
94
- ---
95
- `)}console.log(`## Reconciling Retired Repo-Managed Skill Symlinks
96
- `);let Y=MQ();if(Y.removed.length>0){console.log(` ✓ Removed ${Y.removed.length} retired skill symlink(s):`);for(let H of Y.removed)console.log(` - ${H}`)}else console.log(" ✓ No retired repo-managed skill symlinks found");console.log(`
97
- ---
98
- `),console.log(`# Bootstrap Complete!
99
- `),console.log("✓ All integrations installed"),console.log("✓ Skills system ready"),console.log(`✓ Skill symlinks synced
100
- `),console.log("Next steps:"),console.log(" - Use your platform's native skill tool to see available skills"),console.log(" - Run `superpowers-agent setup-skills` in your project directory")};import{existsSync as b,readFileSync as Ez,mkdirSync as sX,rmSync as gz,cpSync as tX,lstatSync as eX}from"fs";import{join as T,dirname as Kz,parse as Xz,sep as zZ}from"path";import{execSync as x}from"child_process";import{homedir as d}from"os";import{createInterface as QZ}from"readline";import{readFileSync as pX,existsSync as fz,unlinkSync as cX,lstatSync as nX,mkdirSync as lX}from"fs";import{join as iX,dirname as aX}from"path";import{join as t}from"path";import{homedir as Rz}from"os";var yz={github:{name:"github",sourceDir:".github/agents",sourceExt:".agent.md",getDestDir:()=>t(_.vscodeUserDir,"prompts"),getExtraDestDirs:()=>[t(Rz(),".copilot","agents")],destExt:".agent.md"},opencode:{name:"opencode",sourceDir:".opencode/agents",sourceExt:".md",getDestDir:()=>t(Rz(),".config","opencode","agents"),destExt:".md"},claude:{name:"claude",sourceDir:".claude/agents",sourceExt:".md",getDestDir:()=>t(Rz(),".claude","agents"),destExt:".md"}};function AQ(z,Q,X){let $=yz[Q];if(!$)return null;return t(z,$.sourceDir,`${X}${$.sourceExt}`)}function FQ(z,Q){let X=yz[z];if(!X)return[];return[X.getDestDir(),...X.getExtraDestDirs?X.getExtraDestDirs():[]].map((Z)=>t(Z,`${Q}${X.destExt}`))}function Sz(){return Object.keys(yz)}function oX(z){if(!z||typeof z!=="object")return{valid:!1,error:"agents.json must be a JSON object"};if(!z.version||typeof z.version!=="string")return{valid:!1,error:'agents.json must have a "version" string field'};if(!z.agents||typeof z.agents!=="object")return{valid:!1,error:'agents.json must have an "agents" object field'};let Q=Sz(),X=[];for(let[$,Z]of Object.entries(z.agents)){if(!Q.includes($)){X.push($);continue}if(!Array.isArray(Z))return{valid:!1,error:`agents.${$} must be an array of agent names`};for(let Y of Z)if(typeof Y!=="string")return{valid:!1,error:`agents.${$} must contain only string agent names`}}return{valid:!0,data:z,skippedPlatforms:X}}function rX(z,Q){if(!fz(z))return{installed:!1,error:`Source file not found: ${z}`};if(fz(Q))try{if(!nX(Q).isSymbolicLink())cX(Q)}catch($){}lX(aX(Q),{recursive:!0});let X=IQ(z,Q);if(X.error)return{installed:!1,error:X.error};return{installed:!0}}function kz(z,Q={}){let X=iX(z,"agents.json");if(!fz(X))return;let $;try{$=JSON.parse(pX(X,"utf8"))}catch(J){console.log(`
101
- ⚠ Could not parse agents.json: ${J.message}`);return}let Z=oX($);if(!Z.valid){console.log(`
102
- ⚠ Invalid agents.json: ${Z.error}`);return}for(let J of Z.skippedPlatforms)console.log(` ⚠ Skipping unknown platform: ${J}`);let Y=$.repository||"unknown",H=$.version,q=Q.isUpdate?"Updating":"Installing",V=Q.isUpdate?"Updated":"Installed";console.log(`
103
- \uD83D\uDCE6 Found agents.json (${Y} v${H})`);let W=Sz(),G=0,B=0,E=[];for(let[J,O]of Object.entries($.agents)){if(!W.includes(J))continue;console.log(`
104
- ${q} ${J} agents:`);for(let U of O){let v=AQ(z,J,U),C=FQ(J,U),j=[],A=[];for(let R of C){let K=rX(v,R);if(K.installed)j.push(R);else A.push(K.error)}if(j.length>0)console.log(` ✓ ${U}`),E.push({platformKey:J,agentName:U,sourcePath:v,destPaths:j}),G++;else console.log(` ✗ ${U}: ${A.join("; ")}`),B++}}if(E.length>0){let J=S(!0);if(!J.installedAgents)J.installedAgents={};if(!J.installedAgents[Y])J.installedAgents[Y]={version:H,agents:{}};J.installedAgents[Y].version=H;for(let{platformKey:O,agentName:U,sourcePath:v,destPaths:C}of E){if(!J.installedAgents[Y].agents[O])J.installedAgents[Y].agents[O]={};J.installedAgents[Y].agents[O][U]={source:v,destination:C[0],destinations:C,installedAt:new Date().toISOString()}}m(J,!0)}if(G>0)console.log(`
105
- ${V} ${G} agent(s)${B>0?` (${B} failed)`:""}`)}var bQ=(z,Q)=>{if(Q.type==="local"){let $=z;for(let Z=0;Z<10;Z++){if(b(T($,"agents.json")))return $;let Y=Kz($);if(Y===$)break;$=Y}return z}let X=T(".agents","tmp");if(z.includes(X)){let $=z.indexOf(X),Y=z.substring($+X.length+1).split(zZ)[0];return T(z.substring(0,$),".agents","tmp",Y)}return z},CQ=(z,Q)=>{let X=T(d(),".agents","repos"),$=Q.replace(/^@/,"").replace(/[^a-zA-Z0-9_-]/g,"_"),Z=T(X,$);try{if(sX(X,{recursive:!0}),b(Z))gz(Z,{recursive:!0,force:!0});return tX(z,Z,{recursive:!0}),Z}catch(Y){return console.log(` Warning: Could not persist repository for agents: ${Y.message}`),null}},mz=(z)=>{let Q=z.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)\/(.+)$/);if(Q){let[,Z,Y,H,q]=Q;return{type:"git-tree",repoUrl:`https://github.com/${Z}/${Y}.git`,branch:H,path:q,original:z}}let X=z.match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);if(X){let[,Z,Y]=X;return{type:"git-repo",repoUrl:`git@github.com:${Z}/${Y}.git`,branch:null,path:null,original:z}}let $=z.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?$/);if($){let[,Z,Y]=$;return{type:"git-repo",repoUrl:`https://github.com/${Z}/${Y}.git`,branch:null,path:null,original:z}}if(b(z))return{type:"local",path:z,original:z};return null},hz=(z)=>{let Q=z.includes("--global")||z.includes("-g"),X=z.includes("--project")||z.includes("-p");if(Q)return T(d(),".agents","skills");if(X)return T(process.cwd(),".agents","skills");let $=T(process.cwd(),".agents","config.json"),Z=T(d(),".agents","config.json");for(let Y of[$,Z])if(b(Y))try{if(JSON.parse(Ez(Y,"utf8")).installLocation==="project")return T(process.cwd(),".agents","skills")}catch(H){}return T(d(),".agents","skills")},uz=(z,Q)=>{let X=T(d(),".agents","tmp",`skill-install-${Date.now()}`);try{if(x(`mkdir -p "${X}"`,{stdio:"pipe"}),Q)x(`git clone --branch ${Q} --depth 1 "${z}" "${X}"`,{stdio:"pipe",timeout:30000});else x(`git clone --depth 1 "${z}" "${X}"`,{stdio:"pipe",timeout:30000});return X}catch($){try{x(`rm -rf "${X}"`,{stdio:"pipe"})}catch{}throw Error(`Failed to clone repository: ${$.message}`)}},e=(z)=>{let Q=T(z,"skill.json");if(!b(Q))return null;try{let X=Ez(Q,"utf8");return JSON.parse(X)}catch(X){throw Error(`Failed to read skill.json: ${X.message}`)}},Vz=(z,Q,X,$)=>{let Z=T(z,Q);if(!b(Z)){$.errors.push(`Skill directory not found: ${Q}`);return}let Y=e(Z);if(!Y){$.errors.push(`No skill.json found in: ${Q}`);return}let H=Y.name||Q,q=H.split("/").pop()||H,V=T(X,q),W=Kz(V);try{x(`mkdir -p "${W}"`,{stdio:"pipe"})}catch(G){$.errors.push(`Failed to create directory ${W}: ${G.message}`);return}try{if(b(V))x(`rm -rf "${V}"`,{stdio:"pipe"});x(`cp -R "${Z}" "${V}"`,{stdio:"pipe"}),$.installed.push({name:q,path:V,title:Y.title||Y.description||q})}catch(G){$.errors.push(`Failed to install ${Q}: ${G.message}`)}},jQ=(z,Q,X,$,Z=null)=>{let Y=S($);if(!Y.installedSkills)Y.installedSkills={};let H={source:z,installBase:Q,installedAt:new Date().toISOString(),skills:X.installed.map((q)=>({name:q.name,path:q.path}))};if(Y.installedSkills[z]=H,Z&&Z!==z)Y.installedSkills[Z]=H;m(Y,$)},xQ=()=>{let z=process.argv.slice(3),Q=z.find((B)=>!B.startsWith("-")),X=z.filter((B)=>B.startsWith("-"));if(!Q){console.log(`Usage: superpowers-agent add <url-or-path|@alias> [skill-path] [options]
106
-
107
- Options:
108
- --global, -g Install skills globally in ~/.agents/skills/ (default)
109
- --project, -p Install skills in current project's .agents/skills/
110
-
111
- Examples:
112
- superpowers-agent add https://github.com/example/skills
113
- superpowers-agent add https://github.com/example/repo/tree/main/skills
114
- superpowers-agent add ~/my-local-skills
115
- superpowers-agent add https://github.com/example/skills --project
116
- superpowers-agent add ~/my-local-skills --global
117
- superpowers-agent add @myrepo path/to/skill
118
- superpowers-agent add @myrepo path/to/skills --project
119
-
120
- Description:
121
- Installs skill(s) from a Git repository, local directory, or repository alias.
122
- Supports repositories with single or multiple skills.
123
- Reads skill.json to determine skill names and installation paths.
124
-
125
- Repository aliases can be added using:
126
- superpowers-agent add-repository <git-url> [--as=@alias]`);return}console.log(`Installing skill(s)...
127
- `);let $=!X.includes("--project")&&!X.includes("-p"),Z=null,Y=null,H=null;if(Q.startsWith("@")){let B=Q;H=B,Y=z.find((U,v)=>v>0&&!U.startsWith("-")&&U!==B);let E=P(!1),J=P(!0);if(E[B])Z=E[B],console.log(`Using project repository alias: ${B}`);else if(J[B])Z=J[B],console.log(`Using global repository alias: ${B}`);else{console.log(`Error: Repository alias not found: ${B}`),console.log(`
128
- Available aliases:`);let U={...J,...E};if(Object.keys(U).length===0)console.log(" (none)"),console.log(`
129
- Add a repository using:`),console.log(" superpowers-agent add-repository <git-url>");else for(let[v,C]of Object.entries(U))console.log(` ${v} -> ${C}`);return}let O=b(Z);if(Y)if(O)Q=T(Z,Y),console.log(`Repository path: ${Z}`),console.log(`Skill path: ${Y}
130
- `);else Q=Z,console.log(`Repository URL: ${Z}`),console.log(`Skill path: ${Y}
131
- `);else if(Q=Z,O)console.log(`Repository path: ${Z}
132
- `);else console.log(`Repository URL: ${Z}
133
- `)}let q=mz(Q);if(!q){console.log(`Error: Invalid URL or path not found: ${Q}`);return}if(Y&&q.type==="git-repo"&&!q.path)q.path=Y;let V=hz(X);console.log(`Install location: ${V}
134
- `);let W,G=!1;try{if(q.type==="git-repo"||q.type==="git-tree"){if(console.log(`Cloning repository: ${q.repoUrl}`),q.branch)console.log(`Branch: ${q.branch}`);if(W=uz(q.repoUrl,q.branch),G=!0,q.path){if(W=T(W,q.path),!b(W))throw Error(`Path not found in repository: ${q.path}`)}console.log("")}else W=q.path;let B=e(W);if(!B)throw Error("No skill.json found in source directory");let E={installed:[],errors:[],source:q.original};if(B.skills&&Array.isArray(B.skills)){console.log(`Found ${B.skills.length} skill(s) to install
135
- `);for(let U of B.skills)Vz(W,U,V,E)}else{let U=B.name||Xz(W).base;Vz(Kz(W),Xz(W).base,V,E)}let J=bQ(W,q),O=T(J,"agents.json");if(b(O)){let U=J;if(G){let v;try{v=JSON.parse(Ez(O,"utf8"))}catch{}let C=v?.repository||q.original,j=CQ(J,C);if(j)U=j}kz(U,{isUpdate:!1})}if(G&&W)try{let U=W.split("/.agents/tmp/")[0]+"/.agents/tmp/"+W.split("/.agents/tmp/")[1].split("/")[0];x(`rm -rf "${U}"`,{stdio:"pipe"})}catch{}if(console.log(`
136
- **Successfully installed skills:**`),console.log(`- Source: ${E.source}`),E.installed.length>0)for(let U of E.installed)console.log(` - Installed: ${U.name} at ${U.path}`),console.log(` ${U.title}`);if(E.errors.length>0){console.log(`
137
- **Errors:**`);for(let U of E.errors)console.log(` - ${U}`)}if(E.installed.length===0&&E.errors.length===0)console.log(" No skills were installed");if(E.installed.length>0)jQ(q.original,V,E,$,H)}catch(B){if(G&&W)try{let E=W.split("/.agents/tmp/")[0]+"/.agents/tmp/"+W.split("/.agents/tmp/")[1].split("/")[0];x(`rm -rf "${E}"`,{stdio:"pipe"})}catch{}console.log(`
138
- Error: ${B.message}`)}},DQ=()=>{let z=process.argv.slice(3),Q=z.find((B)=>!B.startsWith("-")),X=z.filter((B)=>B.startsWith("-"));if(!Q){console.log(`Usage: superpowers-agent pull <url-or-path|@alias> [skill-path] [options]
139
-
140
- Options:
141
- --global, -g Update skills globally in ~/.agents/skills/ (default)
142
- --project, -p Update skills in current project's .agents/skills/
143
-
144
- Examples:
145
- superpowers-agent pull https://github.com/example/skills
146
- superpowers-agent pull https://github.com/example/repo/tree/main/skills
147
- superpowers-agent pull ~/my-local-skills
148
- superpowers-agent pull https://github.com/example/skills --project
149
- superpowers-agent pull ~/my-local-skills --global
150
- superpowers-agent pull @myrepo
151
- superpowers-agent pull @myrepo path/to/skill
152
- superpowers-agent pull @myrepo path/to/skills --project
153
-
154
- Description:
155
- Updates or adds skill(s) from a Git repository, local directory, or repository alias.
156
- If skills already exist, they will be updated (replaced).
157
- If skills don't exist, they will be added.
158
- Supports repositories with single or multiple skills.
159
- Reads skill.json to determine skill names and installation paths.
160
-
161
- Repository aliases can be added using:
162
- superpowers-agent add-repository <git-url> [--as=@alias]`);return}console.log(`Updating skill(s)...
163
- `);let $=!X.includes("--project")&&!X.includes("-p"),Z=null,Y=null,H=null;if(Q.startsWith("@")){let B=Q;H=B,Y=z.find((U,v)=>v>0&&!U.startsWith("-")&&U!==B);let E=P(!1),J=P(!0);if(E[B])Z=E[B],console.log(`Using project repository alias: ${B}`);else if(J[B])Z=J[B],console.log(`Using global repository alias: ${B}`);else{console.log(`Error: Repository alias not found: ${B}`),console.log(`
164
- Available aliases:`);let U={...J,...E};if(Object.keys(U).length===0)console.log(" (none)"),console.log(`
165
- Add a repository using:`),console.log(" superpowers-agent add-repository <git-url>");else for(let[v,C]of Object.entries(U))console.log(` ${v} -> ${C}`);return}let O=b(Z);if(Y)if(O)Q=T(Z,Y),console.log(`Repository path: ${Z}`),console.log(`Skill path: ${Y}
166
- `);else Q=Z,console.log(`Repository URL: ${Z}`),console.log(`Skill path: ${Y}
167
- `);else if(Q=Z,O)console.log(`Repository path: ${Z}
168
- `);else console.log(`Repository URL: ${Z}
169
- `)}let q=mz(Q);if(!q){console.log(`Error: Invalid URL or path not found: ${Q}`);return}if(Y&&q.type==="git-repo"&&!q.path)q.path=Y;let V=hz(X);console.log(`Install location: ${V}
170
- `);let W,G=!1;try{if(q.type==="git-repo"||q.type==="git-tree"){if(console.log(`Cloning repository: ${q.repoUrl}`),q.branch)console.log(`Branch: ${q.branch}`);if(W=uz(q.repoUrl,q.branch),G=!0,q.path){if(W=T(W,q.path),!b(W))throw Error(`Path not found in repository: ${q.path}`)}console.log("")}else W=q.path;let B=e(W);if(!B)throw Error("No skill.json found in source directory");let E={installed:[],errors:[],source:q.original};if(B.skills&&Array.isArray(B.skills)){console.log(`Found ${B.skills.length} skill(s) to update
171
- `);for(let U of B.skills)Vz(W,U,V,E)}else{let U=B.name||Xz(W).base;Vz(Kz(W),Xz(W).base,V,E)}let J=bQ(W,q),O=T(J,"agents.json");if(b(O)){let U=J;if(G){let v;try{v=JSON.parse(Ez(O,"utf8"))}catch{}let C=v?.repository||q.original,j=CQ(J,C);if(j)U=j}kz(U,{isUpdate:!0})}if(G&&W)try{let U=W.split("/.agents/tmp/")[0]+"/.agents/tmp/"+W.split("/.agents/tmp/")[1].split("/")[0];x(`rm -rf "${U}"`,{stdio:"pipe"})}catch{}if(console.log(`
172
- **Successfully updated skills:**`),console.log(`- Source: ${E.source}`),E.installed.length>0)for(let U of E.installed)console.log(` - Updated: ${U.name} at ${U.path}`),console.log(` ${U.title}`);if(E.errors.length>0){console.log(`
173
- **Errors:**`);for(let U of E.errors)console.log(` - ${U}`)}if(E.installed.length===0&&E.errors.length===0)console.log(" No skills were updated");if(E.installed.length>0)jQ(q.original,V,E,$,H)}catch(B){if(G&&W)try{let E=W.split("/.agents/tmp/")[0]+"/.agents/tmp/"+W.split("/.agents/tmp/")[1].split("/")[0];x(`rm -rf "${E}"`,{stdio:"pipe"})}catch{}console.log(`
174
- Error: ${B.message}`)}},XZ=(z)=>new Promise((Q)=>{let X=QZ({input:process.stdin,output:process.stdout});X.question(z,($)=>{X.close(),Q($.trim())})}),Pz=(z)=>{try{return eX(z).isSymbolicLink()}catch{return!1}},RQ=async()=>{let z=process.argv.slice(3),Q=z.find((K)=>!K.startsWith("-")),X=z.filter((K)=>K.startsWith("-"));if(!Q){console.log(`Usage: superpowers-agent rm <url-or-path|@alias> [options]
175
-
176
- Options:
177
- --global, -g Remove globally installed skills (default)
178
- --project, -p Remove project-installed skills
179
-
180
- Examples:
181
- superpowers-agent rm https://github.com/example/skills
182
- superpowers-agent rm @myrepo
183
- superpowers-agent rm ~/my-local-skills`);return}let $=!X.includes("--project")&&!X.includes("-p"),Z=Q,Y=null;if(Q.startsWith("@")){Y=Q;let K=P(!1),I=P(!0);if(K[Q])Z=K[Q];else if(I[Q])Z=I[Q];else{console.log(`Error: Repository alias not found: ${Q}`);return}}let H=rz($),q=H[Q]||H[Z],V=q?.installBase||hz(X),W=[];if(q)W=q.skills;else{console.log(`No tracking data found. Attempting to re-resolve skills from source...
184
- `);let K=mz(Z);if(!K){console.log(`Error: Invalid URL or path not found: ${Z}`);return}let I,y=!1;try{if(K.type==="git-repo"||K.type==="git-tree"){if(console.log(`Cloning repository: ${K.repoUrl}`),I=uz(K.repoUrl,K.branch),y=!0,K.path){if(I=T(I,K.path),!b(I))throw Error(`Path not found in repository: ${K.path}`)}}else I=K.path;let F=e(I);if(!F)throw Error("No skill.json found in source");let L=F.skills&&Array.isArray(F.skills)?F.skills:[F.name||Xz(I).base];for(let o of L){let Gz=o;if(F.skills){let dz=T(I,o);if(b(dz)){let pz=e(dz);if(pz?.name)Gz=pz.name}}W.push({name:Gz,path:T(V,Gz)})}if(y)try{let o=I.split("/.agents/tmp/")[0]+"/.agents/tmp/"+I.split("/.agents/tmp/")[1].split("/")[0];x(`rm -rf "${o}"`,{stdio:"pipe"})}catch{}}catch(F){if(y&&I)try{let L=I.split("/.agents/tmp/")[0]+"/.agents/tmp/"+I.split("/.agents/tmp/")[1].split("/")[0];x(`rm -rf "${L}"`,{stdio:"pipe"})}catch{}console.log(`Error resolving source: ${F.message}`);return}}let G=W.filter((K)=>b(K.path)||Pz(K.path)),B=[];for(let K of W)for(let I of Hz){let y=T(I.skillsDir(),K.name);if(b(y)||Pz(y))B.push({platform:I.name,path:y})}let E=sz(),J=Y||Z,O=[];if(E[J])for(let[,K]of Object.entries(E[J].agents||{}))for(let[,I]of Object.entries(K)){let y=I.destinations||(I.destination?[I.destination]:[]);for(let F of y)if(F&&(b(F)||Pz(F)))O.push({path:F})}let U=J.replace(/^@/,"").replace(/[^a-zA-Z0-9_-]/g,"_"),v=T(d(),".agents","repos",U),C=b(v),j=d(),A=(K)=>K.replace(j,"~");if(G.length===0&&B.length===0&&O.length===0&&!C){console.log("Nothing to remove.");return}if(console.log("Will remove:"),G.length>0){console.log(" Skills:");for(let K of G)console.log(` ${A(K.path)}`)}if(B.length>0){console.log(" Platform symlinks:");for(let K of B)console.log(` ${A(K.path)}`)}if(O.length>0){console.log(" Agents:");for(let K of O)console.log(` ${A(K.path)}`)}if(C)console.log(" Persisted repo:"),console.log(` ${A(v)}`);if((await XZ(`
185
- Proceed? [y/N] `)).toLowerCase()!=="y"){console.log("Aborted.");return}for(let K of B){let I=Fz(K.path);if(I.removed)console.log(`Removed symlink: ${A(K.path)}`),LQ(K.platform,K.path,"skills");else if(I.error==="Symlink does not exist")console.log(`Already removed: ${A(K.path)}`);else console.log(`Warning: ${A(K.path)}: ${I.error}`)}for(let K of O){let I=Fz(K.path);if(I.removed)console.log(`Removed agent: ${A(K.path)}`);else if(I.error==="Symlink does not exist")console.log(`Already removed: ${A(K.path)}`);else console.log(`Warning: ${A(K.path)}: ${I.error}`)}if(C)try{gz(v,{recursive:!0,force:!0}),console.log(`Removed persisted repo: ${A(v)}`)}catch(K){console.log(`Warning: Failed to remove persisted repo: ${K.message}`)}for(let K of G){if(!b(K.path)){console.log(`Already removed: ${A(K.path)}`);continue}try{gz(K.path,{recursive:!0,force:!0}),console.log(`Removed skill: ${A(K.path)}`)}catch(I){console.log(`Warning: Failed to remove ${A(K.path)}: ${I.message}`)}}if(_z(Q,$),Z!==Q)_z(Z,$);if(E[J]){let K=S(!0);if(K.installedAgents)delete K.installedAgents[J],m(K,!0)}console.log(`
186
- Done.`)},yQ=()=>{let z=process.argv.slice(3),Q=z.find((W)=>!W.startsWith("-")),X=z.filter((W)=>W.startsWith("-"));if(!Q){console.log(`Usage: superpowers-agent add-repository <git-url> [options]
187
-
188
- Options:
189
- --global, -g Add repository globally in ~/.agents/config.json (default)
190
- --project, -p Add repository in current project's .agents/config.json
191
- --as=<alias> Specify custom alias for the repository
192
-
193
- Examples:
194
- superpowers-agent add-repository https://github.com/example/skills.git
195
- superpowers-agent add-repository https://github.com/example/skills.git --as=@myskills
196
- superpowers-agent add-repository https://github.com/example/skills.git --project
197
- superpowers-agent add-repository https://github.com/example/skills.git --as=@custom --global
198
-
199
- Description:
200
- Adds a skill repository alias to your configuration.
201
- The repository's skill.json will be read to determine the default alias.
202
- Use --as to specify a custom alias.
203
- After adding, you can install skills using: superpowers-agent add @alias path/to/skill`);return}console.log(`Adding repository...
204
- `);let $=X.some((W)=>W==="--global"||W==="-g"),Z=X.some((W)=>W==="--project"||W==="-p"),Y=X.find((W)=>W.startsWith("--as=")),H=Y?Y.split("=")[1]:null,q=Z?!1:!0,V;try{console.log(`Cloning repository: ${Q}`),V=T(d(),".agents","tmp",`repo-add-${Date.now()}`),x(`mkdir -p "${V}"`,{stdio:"pipe"}),x(`git clone --depth 1 "${Q}" "${V}"`,{stdio:"pipe",timeout:30000}),console.log("");let W=e(V);if(!W)throw Error("No skill.json found in repository");let G;if(H)G=H;else if(W.repository)G=W.repository;else{let J=Q.match(/\/([^/]+?)(?:\.git)?$/);if(J)G="@"+J[1];else throw Error("Could not determine repository alias. Use --as=@alias to specify manually.")}oz(G,Q,q),x(`rm -rf "${V}"`,{stdio:"pipe"});let B=q?"globally":"in project",E=q?T(d(),".agents","config.json"):T(process.cwd(),".agents","config.json");console.log(`✓ Repository added ${B}`),console.log(` Alias: ${G}`),console.log(` URL: ${Q}`),console.log(` Config: ${E}`),console.log(`
205
- You can now install skills using:`),console.log(` superpowers-agent add ${G} <path-to-skill>`)}catch(W){if(V)try{x(`rm -rf "${V}"`,{stdio:"pipe"})}catch{}console.log(`
206
- Error: ${W.message}`)}};var ZZ=()=>`<EXTREMELY_IMPORTANT>
207
- ${"---\n\n**YOU MUST read and use the `leveraging-cli-tools` skill** the moment a task involves using BASH, searching code, parsing JSON/YAML, finding files, structural refactors, data wrangling, or any command that floods your context with verbose output (logs, CI logs, test runs). Load it with your skill tool BEFORE you reach for grep/find/sed or before you read large command output. It routes you to high-performance tools (rg, jq, fd, yq, ast-grep, gh, sd) and reduces output to just the signal — cutting token cost and latency 5-50x. Skipping it wastes tokens and time on work the right tool does instantly."}
208
- </EXTREMELY_IMPORTANT>`,$Z=(z="raw")=>{let Q=ZZ();if(z==="claude")return JSON.stringify({hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:Q}});if(z==="copilot")return JSON.stringify({additionalContext:Q});return Q},SQ=()=>{let z=process.argv.find((X)=>X.startsWith("--format=")),Q=z?z.split("=")[1]:"raw";process.stdout.write($Z(Q)+`
209
- `)};var fQ={bootstrap:vQ,version:ZQ,"check-updates":()=>{XQ().catch((z)=>{console.error(z.message),process.exit(1)})},update:()=>{Tz().catch((z)=>{console.error(z.message),process.exit(1)})},"config-get":ez,"config-set":zQ,"setup-skills":NQ,"session-context":SQ,add:xQ,"add-repository":yQ,"list-repositories":QQ,pull:DQ,rm:RQ,"install-aliases":Dz,default:()=>{console.log(`Superpowers for Agents
3
+ import{readFileSync as a}from"fs";import{join as E,dirname as i}from"path";import{fileURLToPath as t}from"url";import{existsSync as R}from"fs";import{execSync as e}from"child_process";var qq=t(import.meta.url),v=i(qq),C=()=>{try{let q=E(v,"package.json");if(!R(q))q=E(v,"..","package.json");if(!R(q))q=E(v,"..","..","package.json");return JSON.parse(a(q,"utf8")).version||"0.0.0"}catch{return"0.0.0"}},y=()=>{let q=C();console.log(`^^SAV:${q}^^`)},F=async()=>{try{let z=e('curl -sS "https://registry.npmjs.org/@complexthings/superpowers-agent/latest"',{encoding:"utf8",timeout:1e4}),Q=JSON.parse(z);if(!Q.version)return C();return Q.version}catch(q){throw Error(`Failed to fetch remote version: ${q.message}`)}},w=(q,z)=>{let Q=q.split(".").map(Number),X=z.split(".").map(Number);for(let Z=0;Z<3;Z++){let W=Q[Z]||0,Y=X[Z]||0;if(W>Y)return!0;if(W<Y)return!1}return!1};var S=async()=>{try{let q=C(),z=await F();return{hasUpdates:w(z,q),localVersion:q,remoteVersion:z}}catch{return{hasUpdates:!1,localVersion:C(),remoteVersion:"",error:!0}}};import{copyFileSync as f,existsSync as I,lstatSync as Fq,mkdirSync as g,readFileSync as u,renameSync as wq,unlinkSync as k,writeFileSync as p}from"fs";import{basename as d,join as $}from"path";import{homedir as D,platform as zq}from"os";import{join as J,parse as Jq,dirname as j}from"path";import{existsSync as H}from"fs";import{fileURLToPath as Qq}from"url";var Wq=Qq(import.meta.url),L=j(Wq),Xq=()=>{let q=D();switch(zq()){case"darwin":return J(q,"Library","Application Support","Code","User");case"win32":return J(q,"AppData","Roaming","Code","User");case"linux":return J(q,".config","Code","User");default:return J(q,".config","Code","User")}},Zq=()=>{let q=process.cwd(),z=Jq(q).root;while(q!==z){if(H(J(q,".agents")))return q;q=j(q)}return process.cwd()},G={home:D(),vscodeUserDir:Xq(),projectRoot:Zq(),get projectClaudeSkills(){return J(this.projectRoot,".claude","skills")},get projectAgentsSkills(){return J(this.projectRoot,".agents","skills")},get projectCopilotSkills(){return J(this.projectRoot,".copilot","skills")},get projectOpencodeSkills(){return J(this.projectRoot,".opencode","skill")},get projectSkillsDir(){return J(this.projectRoot,"skills")},get homePersonalSkills(){return J(this.home,".agents","skills")},get homeClaudeSkills(){return J(this.home,".claude","skills")},get homeCopilotSkills(){return J(this.home,".copilot","skills")},get claudeSettings(){return J(this.home,".claude","settings.json")},get copilotHooksDir(){return process.env.COPILOT_HOME?J(process.env.COPILOT_HOME,"hooks"):J(this.home,".copilot","hooks")},get homeOpencodeSkills(){return J(this.home,".config","opencode","skill")},get bootstrap(){return J(this.projectRoot,".agents","superpowers-bootstrap.md")},get superpowersRepo(){let q=J(L,"..","..","..");if(H(J(q,"skills"))&&H(J(q,".agents","superpowers-agent")))return q;let z=J(L,"..");if(H(J(z,"skills"))&&H(J(z,".agents","superpowers-agent")))return z;return J(this.home,".agents","superpowers")},get homeSuperpowersSkills(){return J(this.superpowersRepo,"skills")},get isSuperpowersRepo(){let q=J(L,"..","..","..");if(H(J(q,"skills"))&&H(J(q,".agents","superpowers-agent")))return!0;let z=J(L,"..");return H(J(z,"skills"))&&H(J(z,".agents","superpowers-agent"))}};import{existsSync as $q,lstatSync as Yq,readdirSync as Bq,readlinkSync as Hq,unlinkSync as Cq}from"fs";import{basename as Gq,join as Oq,resolve as P,sep as Uq}from"path";var Iq=new Set(["preserving-productive-tensions","dispatching-parallel-agents","executing-plans","finishing-a-development-branch","receiving-code-review","requesting-code-review","subagent-driven-development","using-git-worktrees","writing-plans","defense-in-depth","root-cause-tracing","systematic-debugging","verification-before-completion","finding-skills","create-agents-md","creating-prompts","using-superpowers","writing-prompts","collision-zone-thinking","inversion-exercise","meta-pattern-recognition","scale-game","simplification-cascades","when-stuck","tracing-knowledge-lineages","condition-based-waiting","test-driven-development","testing-anti-patterns","using-a-skill"]),Kq=(q,z)=>q===z||q.startsWith(`${z}${Uq}`),m=({skillDir:q,bundledSkillsDir:z,retiredSkillNames:Q=Iq})=>{let X=[],Z=0,W=P(z);if(!$q(q))return{removed:X,skipped:Z};let Y;try{Y=Bq(q)}catch{return{removed:X,skipped:Z}}for(let O of Y){let B=Oq(q,O);try{if(!Yq(B).isSymbolicLink())continue;let U=P(q,Hq(B));if(!Kq(U,W)||!Q.has(Gq(U))){Z++;continue}Cq(B),X.push(B)}catch{Z++}}return{removed:X,skipped:Z}};var Lq="superpowers-agent session-context",M="<!-- SUPERPOWERS_SKILLS_START -->",_="<!-- SUPERPOWERS_SKILLS_END -->",xq=`Superpowers is retired; this section no longer manages anything.
4
+ See https://skills.sh for what replaced it.`,Nq={has:()=>!0},h=()=>new Date().toISOString().split("T")[0],Tq=(q)=>{try{return Fq(q).isSymbolicLink()}catch{return!1}},Aq=(q,z)=>{if(!I(z))g(z,{recursive:!0});let Q=$(z,d(q));try{wq(q,Q)}catch{f(q,Q),k(q)}return Q},x=(q,z,Q)=>{if(Tq(z))return k(z),{artifact:q,path:z,action:"removed-symlink"};if(!I(z))return{artifact:q,path:z,action:"absent"};let X=Aq(z,Q);return{artifact:q,path:z,action:"backed-up",backup:X}},Vq=(q,z)=>{if(!I(q))return{artifact:"claude-session-hook",path:q,action:"absent"};let Q=u(q,"utf8"),X=Q.trim()?JSON.parse(Q):{},Z=Array.isArray(X?.hooks?.SessionStart)?X.hooks.SessionStart:[],W=(B)=>{try{return JSON.stringify(B).includes(Lq)}catch{return!1}};if(!Z.some(W))return{artifact:"claude-session-hook",path:q,action:"absent"};let Y=`${q}.backup-${h()}`;f(q,Y);let O=Z.filter((B)=>!W(B));if(O.length)X.hooks.SessionStart=O;else delete X.hooks.SessionStart;return p(q,JSON.stringify(X,null,2)+`
5
+ `,"utf8"),{artifact:"claude-session-hook",path:q,action:"removed",backup:Y}},Eq=(q,z)=>{if(!I(q))return{artifact:"agents-md",path:q,action:"absent"};let Q=u(q,"utf8");if(!Q.includes(M)||!Q.includes(_))return{artifact:"agents-md",path:q,action:"absent"};if(!I(z))g(z,{recursive:!0});let X=$(z,d(q));f(q,X);let Z=new RegExp(`${M}[\\s\\S]*?${_}`,"g"),W=Q.replace(Z,`${M}
6
+ ${xq}
7
+ ${_}`);return p(q,W,"utf8"),{artifact:"agents-md",path:q,action:"rewritten",backup:X}},N=({home:q=G.home,projectRoot:z=G.projectRoot,backupDir:Q=$(q,".agents",`retirement-backup-${h()}`),settingsPath:X=$(q,".claude","settings.json"),copilotHooksDir:Z=G.copilotHooksDir,bundledSkillsDir:W=G.homeSuperpowersSkills,agentsMdPath:Y=$(q,".agents","AGENTS.md")}={})=>{let O=[$(q,".agents","skills"),$(q,".claude","skills"),$(q,".copilot","skills"),$(q,".config","opencode","skill"),$(z,".claude","skills"),$(z,".copilot","skills"),$(z,".opencode","skill")],B=[["claude-session-hook",()=>Vq(X,Q)],["copilot-session-hook",()=>x("copilot-session-hook",$(Z,"superpowers.json"),Q)],["opencode-plugin",()=>x("opencode-plugin",$(q,".config","opencode","plugins","superpowers-agent.js"),Q)],...O.map((K)=>["skill-symlinks",()=>{let{removed:A,skipped:V}=m({skillDir:K,bundledSkillsDir:W,retiredSkillNames:Nq});return{artifact:"skill-symlinks",path:K,action:"removed-symlink",removed:A,skipped:V}}]),["shim",()=>x("shim",$(q,".local","bin","superpowers"),Q)],["shim",()=>x("shim",$(q,".local","bin","superpowers-agent"),Q)],["agents-md",()=>Eq(Y,Q)]],U=[],b=[];for(let[K,A]of B)try{U.push(A())}catch(V){b.push({artifact:K,action:"failed",message:V.message})}return{backupDir:Q,handled:U,failed:b}},c=()=>{console.error("Superpowers is retired — see https://skills.sh for what replaced it.")},T=({backupDir:q,handled:z,failed:Q})=>{let X=z.filter((W)=>W.action!=="absent");console.log(`Retirement cleanup: ${X.length} artifact(s) removed, ${Q.length} failed.`);for(let W of X)console.log(` ${W.action}: ${W.artifact}${W.path?` (${W.path})`:""}`);for(let W of Q)console.log(` failed: ${W.artifact} — ${W.message}`);console.log(`
8
+ Backup: ${q}`);let Z=X.filter((W)=>W.backup);if(Z.length){console.log("Restore with:");for(let W of Z)console.log(` cp "${W.backup}" "${W.path}"`)}console.log(`
9
+ Skills now live at https://skills.sh — try: npx skills`)};var vq={npm:"npm install -g @complexthings/superpowers-agent",pnpm:"pnpm add -g @complexthings/superpowers-agent",yarn:"yarn global add @complexthings/superpowers-agent",bun:"bun add -g @complexthings/superpowers-agent",deno:"deno install -g -A -n superpowers-agent npm:@complexthings/superpowers-agent"},Mq=(q=G.superpowersRepo)=>{let z=String(q).toLowerCase().replace(/\\/g,"/");if(z.includes("/.bun/")||z.includes("/bun/install"))return"bun";if(z.includes("/pnpm"))return"pnpm";if(z.includes("/yarn"))return"yarn";if(z.includes("/.deno/")||z.includes("/deno/"))return"deno";return"npm"},l=async()=>{T(N()),console.log(`
10
+ # Checking for Superpowers updates...
11
+ `);let q=await S();if(q.error){console.log("⚠️ Could not check for updates (network issue)");return}if(!q.hasUpdates){console.log(`✓ Already up to date (v${q.localVersion})`);return}console.log(`\uD83D\uDCE6 Update available: v${q.localVersion} → v${q.remoteVersion}
12
+ `);let z=Mq();console.log(` To update, run:
13
+ `),console.log(` ${vq[z]}
14
+ `)},o=async()=>{y();let q=C();console.log(`Current version: ${q}`);try{let z=await F();if(console.log(`Latest version: ${z}`),w(z,q))console.log("Update available: Yes"),process.exit(1);else console.log("You are up to date"),process.exit(0)}catch(z){console.log(`Error checking for updates: ${z.message}`),process.exit(1)}},s=()=>{let q=C();console.log(q)};var n=()=>{T(N())};var r={bootstrap:n,version:s,"check-updates":()=>{o().catch((q)=>{console.error(q.message),process.exit(1)})},update:()=>{l().catch((q)=>{console.error(q.message),process.exit(1)})},default:()=>{console.log(`Superpowers for Agents
210
15
  Usage:
211
- superpowers-agent bootstrap [--no-update] [--force] # Run complete bootstrap
212
- superpowers-agent version # Show current version
213
- superpowers-agent check-updates # Check for updates
214
- superpowers-agent update # Show how to update to the latest version
215
- superpowers-agent config-get # Show configuration
216
- superpowers-agent config-set <key> <value> # Update configuration
217
- superpowers-agent setup-skills # Initialize project skills
218
- superpowers-agent session-context [--format=claude|copilot|raw] # Print session-start context (used by hooks)
219
- superpowers-agent add <url-or-path|@alias> [path] [options] # Install skills
220
- superpowers-agent add-repository <git-url> [--as=@alias] [opts] # Add repository alias
221
- superpowers-agent list-repositories # List configured repository aliases
222
- superpowers-agent pull <url-or-path|@alias> [path] [options] # Update skills
223
- superpowers-agent rm <url-or-path|@alias> [options] # Remove skills
224
- superpowers-agent install-aliases # Install universal aliases (superpowers, superpowers-agent)
16
+ superpowers-agent bootstrap # Remove everything this package installed
17
+ superpowers-agent version # Show current version
18
+ superpowers-agent check-updates # Check for updates
19
+ superpowers-agent update # Clean up, then show how to update
225
20
 
226
21
  Documentation: https://github.com/complexthings/superpowers
227
- `)}},YZ=process.argv[2]||"default",qZ=fQ[YZ]||fQ.default;try{let z=qZ();if(z&&typeof z.then==="function")z.catch((Q)=>{console.error(`Error: ${Q.message}`),process.exit(1)})}catch(z){console.error(`Error: ${z.message}`),process.exit(1)}
22
+ `)}};c();var _q=process.argv[2]||"default",fq=r[_q]||r.default;try{let q=fq();if(q&&typeof q.then==="function")q.catch((z)=>{console.error(`Error: ${z.message}`),process.exit(1)})}catch(q){console.error(`Error: ${q.message}`),process.exit(1)}
@@ -1,12 +1,3 @@
1
- <!-- SUPERPOWERS_-_INSTRUCTIONS_START -->
2
- # Superpowers Skills
3
-
4
- [superpowers-agent Docs](../.agents/docs/SUPERPOWERS.md)
5
-
6
- Use your platform's native skill tool to discover and load installed skills relevant to the task. If no native tool is available, inspect the configured skill directories and read the needed `SKILL.md` file.
7
- <!-- SUPERPOWERS_-_INSTRUCTIONS_END -->
8
-
9
- <!-- rtk-instructions v2 -->
10
1
  # RTK — Token-Optimized CLI
11
2
 
12
3
  **rtk** is a CLI proxy that filters and compresses command outputs, saving 60-90% tokens.
package/AGENTS.md CHANGED
@@ -1,153 +1,32 @@
1
1
  # AGENTS.md
2
2
 
3
- <!-- SUPERPOWERS_SKILLS_START -->
4
- ## 🎯 SKILLS
3
+ ## Project
5
4
 
6
- Skills extend your capabilities with proven workflows.
5
+ Superpowers Agent is retired at v11.0.0; use [`npx skills`](https://skills.sh) instead. It was an
6
+ npm-published CLI for installing reusable agent skills and integrations. Its CLI source is in
7
+ `.agents/src/`. The bundled skills, harness hooks and skill symlinks are gone; `bootstrap` and
8
+ `update` now run Retirement Cleanup and nothing else. See
9
+ [ADR 0008](docs/adr/0008-retire-superpowers-agent.md).
7
10
 
8
- ### Discover Skills First
11
+ ## Development
9
12
 
10
- **Before starting any task**, check for relevant skills:
11
- 1. Use your native skill tool to list available skills.
12
- 2. Review skill descriptions/frontmatter to identify relevant ones.
13
-
14
- ### Skill Loading Rules
15
-
16
- - Load skills **JIT only** — never preload to "understand" them.
17
- - Follow skill instructions **exactly as written** — no skimming, no shortcuts.
18
- - If a skill has a checklist, create a todo for **each item** — no mental tracking.
19
- - Simple tasks benefit from skills as much as complex ones.
20
-
21
- **Skill priority (highest to lowest):** Project → Personal
22
-
23
- ### Using Tools with Skills
24
-
25
- 1. **Native skill tool** — load skills via your platform's native skill tool.
26
- 2. **Symlinked skills** — Superpowers skills are symlinked into your platform's skills directory.
27
- 3. **Fallback** — if a skill isn't found via the native tool, inspect the configured skill directories and read its `SKILL.md` directly.
28
- 4. **Tool equivalence** — when a skill references a tool you don't have, substitute your equivalent.
29
-
30
- ### Why Skills Matter
31
-
32
- Skills encode proven techniques that prevent mistakes. Not using them means repeating solved problems and missing edge cases.
33
-
34
- **If a skill exists for your task, you MUST use it.**
35
-
36
- ---
37
-
38
- ## Version Check
39
-
40
- Periodically, e.g. once per day check the version of superpowers-agent:
41
- 1. **CURRENT_VERSION** — run a `superpowers-agent` command and extract `X.Y.Z` from the `^^SAV:X.Y.Z^^` string in its output.
42
- 2. **NPM_LATEST_VERSION** — run `npm view @complexthings/superpowers-agent version`.
43
- 3. Compare by **semver precedence, not string comparison** (e.g. `9.10.0` > `9.9.0`). If NPM_LATEST_VERSION is newer, tell the user — do not run these yourself:
44
- > Your superpowers-agent has updates (`CURRENT_VERSION` → `NPM_LATEST_VERSION`). Run:
45
- > ```sh
46
- > npm install -g @complexthings/superpowers-agent
47
- > superpowers-agent bootstrap && superpowers-agent setup-skills
48
- > ```
49
- If versions match, or either lookup fails (e.g. no network), continue silently.
50
-
51
- ---
52
-
53
- *Generated by Superpowers on 2026-07-12*
54
- <!-- SUPERPOWERS_SKILLS_END -->
55
-
56
- ## What This Project Is
57
-
58
- **Superpowers Agent** is a CLI (`superpowers-agent`, alias `superpowers`) that manages reusable markdown-based "skills" for AI coding assistants. It delivers skills to Claude, GitHub Copilot, Cursor, Gemini, OpenCode, and Codex. Skills live in `skills/` (this repo) and `.agents/skills/`, and bootstrap symlinks them into each assistant's config directory. Published to npm as `@complexthings/superpowers-agent`.
59
-
60
- ## Build & Development
61
-
62
- The CLI source lives in `.agents/` and is built with **Bun** (`packageManager: bun@1.3.8`). Run scripts from the `.agents/` directory:
13
+ Run these from `.agents/`:
63
14
 
64
15
  ```bash
65
- cd .agents
66
- bun run build # Build minified ESM bundle → .agents/superpowers-agent
67
- bun run watch # Build in watch mode
68
- bun run dev # Run CLI from source (bun src/cli.js)
69
- bun run dev:link # Symlink the `superpowers-agent` bin to the dev source
70
- bun run production:link # Symlink the bin to the built bundle
16
+ bun test
17
+ bun run build
18
+ bun run dev
71
19
  ```
72
20
 
73
- The build (`.agents/build.js`) uses the `Bun.build` API, so it must run under **bun**, not node. Output is `.agents/superpowers-agent` a polyglot shebang script that execs `bun` if present, otherwise `node`.
74
-
75
- The CLI has **no runtime dependencies** (pure Node.js/Bun built-ins). The only dev dependency is `husky`. Node engines: `^20 || ^22 || ^24`.
76
-
77
- ## Testing
78
-
79
- Run the automated test suite from `.agents` with `bun test`. There is no root-level test script; run CLI commands directly for manual acceptance checks.
80
-
81
- ## Architecture
82
-
83
- ### Source (`.agents/src/`)
84
-
85
- | Layer | Files | Responsibility |
86
- |-------|-------|---------------|
87
- | CLI entry | `cli.js` | Command dispatch table |
88
- | Commands | `commands/bootstrap.js`, `update.js`, `simple-commands.js` | Command implementations |
89
- | Core | `core/config.js`, `paths.js`, `platform-detection.js`, `git.js` | Config, path resolution, platform detection, git helpers |
90
- | Skills | `skills/finder.js`, `locator.js`, `installer.js`, `executor.js`, `parser.js` | Skill discovery, install, execution pipeline |
91
- | Agents | `agents/installer.js`, `agents/platforms.js` | Install agent definitions (`.github/agents/*.agent.md`, `.opencode/agents/*.md`) into platform dirs |
92
- | Integrations | `integrations/claude.js`, `codex.js`, `copilot.js`, `cursor.js`, `gemini.js`, `opencode.js` | Per-platform symlink/config setup |
93
- | Utils | `utils/symlinks.js`, `frontmatter.js`, `output.js`, `file-ops.js` | Shared helpers |
94
-
95
- ### Skill Discovery Priority (highest → lowest)
96
-
97
- 1. `.agents/skills/` — project-level
98
- 2. `~/.agents/skills/` — personal cross-project
99
- 3. `~/.agents/superpowers/skills/` — bundled community skills
100
-
101
- ### CLI Commands
102
-
103
- From `.agents/src/cli.js` dispatch table:
104
-
105
- - **Core:** `bootstrap [--no-update] [--force]`, `version`, `check-updates`, `update [--no-reinstall]`
106
- - **Config:** `config-get`, `config-set <key> <value>`
107
- - **Skills:** `setup-skills`, `session-context [--format=claude|copilot|raw]`
108
- - **Install/manage skills:** `add <url-or-path|@alias> [path]`, `add-repository <git-url> [--as=@alias]`, `list-repositories`, `pull <url-or-path|@alias>`, `rm <url-or-path|@alias>`
109
- - **Integrations:** `install-cursor-hooks`, `install-aliases`
110
-
111
- ### Key Flows
112
-
113
- - **`bootstrap`** → detects installed AI platforms → symlinks skills into each platform's skills dir → writes platform config files
114
- - **Native skill tools** → discover and load skills from their configured directories
115
- - **`add <url-or-path|@alias>`** → clones a git repo or copies a local path → installs skills into `~/.agents/superpowers/skills/`
116
- - **`update`** → checks the npm registry for a newer version → reports if an update is available
117
-
118
- ### Skill Structure
119
-
120
- Each skill is a directory with a `SKILL.md` file:
121
-
122
- ```
123
- skills/
124
- └── <category>/
125
- └── <skill-name>/
126
- ├── SKILL.md # Frontmatter (name, description) + instructions
127
- ├── scripts/ # Optional support scripts
128
- └── resources/ # Optional templates/data
129
- ```
130
-
131
- `SKILL.md` frontmatter fields: `name`, `description`, and optional `metadata` (e.g. `version`). The set of bundled skills and their lockfile state are tracked in `skill.json` and `skills-lock.json` at the repo root.
132
-
133
- ## Versioning & Publishing
134
-
135
- The `.husky/pre-commit` hook keeps the root `package.json` and `.agents/package.json` versions in sync: on commit it picks the higher of the two, writes both, refreshes lockfiles, rebuilds the bundle (`cd .agents && bun install && bun run build`), and stages the affected files. Don't hand-edit one version without the other.
136
-
137
- The package is published to npm as `@complexthings/superpowers-agent` (registry auth via the `COMPLEX_THINGS_NPM_TOKEN` in `.npmrc`). The current version is whatever `package.json` reports — do not hardcode it elsewhere.
138
-
139
- ## Agent skills
140
-
141
- ### Issue tracker
142
-
143
- Issues and PRDs are tracked as GitHub issues on `complexthings/superpowers`, managed via the `gh` CLI. See `docs/agents/issue-tracker.md`.
144
-
145
- ### Triage labels
21
+ `bun run build` writes the distributable CLI to `.agents/superpowers-agent`. The project is ESM and has no runtime dependencies; Bun is the development toolchain.
146
22
 
147
- The five canonical triage roles use their default label strings (`needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`). See `docs/agents/triage-labels.md`.
23
+ ## Change boundaries
148
24
 
149
- ### Domain docs
25
+ - Keep `package.json` and `.agents/package.json` versions aligned. The pre-commit hook reconciles a mismatch, refreshes lockfiles, rebuilds the CLI, and stages the affected files.
26
+ - Use terms from `CONTEXT.md`: **Retirement Cleanup** and **Retirement Backup Directory**. **Session-context hook**, **CLI-tool nudge** and **repo-managed skill symlink** are retired terms — use them only when describing what cleanup removes.
150
27
 
151
- Single-context layout — one `CONTEXT.md` + `docs/adr/` at the repo root (created lazily). See `docs/agents/domain.md`.
28
+ ## Conditional guidance
152
29
 
153
- @RTK.md
30
+ - For issue work, read `docs/agents/issue-tracker.md`; it governs the GitHub issue workflow and excludes external PRs from triage.
31
+ - Before applying triage labels, read `docs/agents/triage-labels.md`; it maps canonical roles to this repository’s labels and identifies labels that may need creating.
32
+ - Before work that depends on domain decisions, read `docs/agents/domain.md`; it governs the lazy `CONTEXT.md`/ADR layout and conflict handling.