@chankov/agent-skills 0.1.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 (320) hide show
  1. package/.claude/commands/build.md +18 -0
  2. package/.claude/commands/code-simplify.md +22 -0
  3. package/.claude/commands/design-agent.md +14 -0
  4. package/.claude/commands/doctor.md +13 -0
  5. package/.claude/commands/plan.md +16 -0
  6. package/.claude/commands/prime.md +22 -0
  7. package/.claude/commands/review.md +16 -0
  8. package/.claude/commands/setup.md +19 -0
  9. package/.claude/commands/ship.md +17 -0
  10. package/.claude/commands/spec.md +15 -0
  11. package/.claude/commands/test.md +19 -0
  12. package/.opencode/commands/as-build.md +17 -0
  13. package/.opencode/commands/as-code-simplify.md +16 -0
  14. package/.opencode/commands/as-design-agent.md +15 -0
  15. package/.opencode/commands/as-doctor.md +11 -0
  16. package/.opencode/commands/as-plan.md +16 -0
  17. package/.opencode/commands/as-prime.md +22 -0
  18. package/.opencode/commands/as-review.md +15 -0
  19. package/.opencode/commands/as-setup.md +11 -0
  20. package/.opencode/commands/as-ship.md +16 -0
  21. package/.opencode/commands/as-spec.md +16 -0
  22. package/.opencode/commands/as-test.md +21 -0
  23. package/.pi/agents/agent-chain.yaml +49 -0
  24. package/.pi/agents/bowser.md +19 -0
  25. package/.pi/agents/pi-pi/agent-expert.md +98 -0
  26. package/.pi/agents/pi-pi/cli-expert.md +41 -0
  27. package/.pi/agents/pi-pi/config-expert.md +63 -0
  28. package/.pi/agents/pi-pi/ext-expert.md +43 -0
  29. package/.pi/agents/pi-pi/keybinding-expert.md +134 -0
  30. package/.pi/agents/pi-pi/pi-orchestrator.md +57 -0
  31. package/.pi/agents/pi-pi/prompt-expert.md +70 -0
  32. package/.pi/agents/pi-pi/skill-expert.md +42 -0
  33. package/.pi/agents/pi-pi/theme-expert.md +40 -0
  34. package/.pi/agents/pi-pi/tui-expert.md +85 -0
  35. package/.pi/agents/teams.yaml +31 -0
  36. package/.pi/damage-control-rules.yaml +278 -0
  37. package/.pi/extensions/chrome-devtools-mcp/README.md +39 -0
  38. package/.pi/extensions/chrome-devtools-mcp/index.ts +61 -0
  39. package/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  40. package/.pi/extensions/compact-and-continue/README.md +42 -0
  41. package/.pi/extensions/compact-and-continue/index.ts +120 -0
  42. package/.pi/extensions/compact-and-continue/package.json +6 -0
  43. package/.pi/extensions/mcp-bridge/README.md +46 -0
  44. package/.pi/extensions/mcp-bridge/index.ts +206 -0
  45. package/.pi/extensions/mcp-bridge/package.json +6 -0
  46. package/.pi/extensions/package-lock.json +1143 -0
  47. package/.pi/extensions/package.json +9 -0
  48. package/.pi/harnesses/agent-chain/README.md +37 -0
  49. package/.pi/harnesses/agent-chain/index.ts +795 -0
  50. package/.pi/harnesses/agent-chain/package.json +6 -0
  51. package/.pi/harnesses/agent-team/README.md +38 -0
  52. package/.pi/harnesses/agent-team/index.ts +732 -0
  53. package/.pi/harnesses/agent-team/package.json +6 -0
  54. package/.pi/harnesses/coms/README.md +36 -0
  55. package/.pi/harnesses/coms/index.ts +1595 -0
  56. package/.pi/harnesses/coms/package.json +6 -0
  57. package/.pi/harnesses/coms-net/README.md +46 -0
  58. package/.pi/harnesses/coms-net/index.ts +1637 -0
  59. package/.pi/harnesses/coms-net/package.json +6 -0
  60. package/.pi/harnesses/damage-control/README.md +38 -0
  61. package/.pi/harnesses/damage-control/index.ts +207 -0
  62. package/.pi/harnesses/damage-control/package.json +6 -0
  63. package/.pi/harnesses/damage-control-continue/README.md +37 -0
  64. package/.pi/harnesses/damage-control-continue/index.ts +234 -0
  65. package/.pi/harnesses/damage-control-continue/package.json +6 -0
  66. package/.pi/harnesses/minimal/README.md +27 -0
  67. package/.pi/harnesses/minimal/index.ts +32 -0
  68. package/.pi/harnesses/minimal/package.json +6 -0
  69. package/.pi/harnesses/package-lock.json +35 -0
  70. package/.pi/harnesses/package.json +9 -0
  71. package/.pi/harnesses/pi-pi/README.md +39 -0
  72. package/.pi/harnesses/pi-pi/index.ts +631 -0
  73. package/.pi/harnesses/pi-pi/package.json +6 -0
  74. package/.pi/harnesses/purpose-gate/README.md +27 -0
  75. package/.pi/harnesses/purpose-gate/index.ts +82 -0
  76. package/.pi/harnesses/purpose-gate/package.json +6 -0
  77. package/.pi/harnesses/session-replay/README.md +28 -0
  78. package/.pi/harnesses/session-replay/index.ts +214 -0
  79. package/.pi/harnesses/session-replay/package.json +6 -0
  80. package/.pi/harnesses/subagent-widget/README.md +36 -0
  81. package/.pi/harnesses/subagent-widget/index.ts +479 -0
  82. package/.pi/harnesses/subagent-widget/package.json +6 -0
  83. package/.pi/harnesses/system-select/README.md +39 -0
  84. package/.pi/harnesses/system-select/index.ts +165 -0
  85. package/.pi/harnesses/system-select/package.json +6 -0
  86. package/.pi/harnesses/tilldone/README.md +35 -0
  87. package/.pi/harnesses/tilldone/index.ts +724 -0
  88. package/.pi/harnesses/tilldone/package.json +6 -0
  89. package/.pi/harnesses/tool-counter/README.md +31 -0
  90. package/.pi/harnesses/tool-counter/index.ts +100 -0
  91. package/.pi/harnesses/tool-counter/package.json +6 -0
  92. package/.pi/harnesses/tool-counter-widget/README.md +27 -0
  93. package/.pi/harnesses/tool-counter-widget/index.ts +66 -0
  94. package/.pi/harnesses/tool-counter-widget/package.json +6 -0
  95. package/.pi/prompts/build.md +24 -0
  96. package/.pi/prompts/code-simplify.md +22 -0
  97. package/.pi/prompts/doctor.md +13 -0
  98. package/.pi/prompts/plan.md +16 -0
  99. package/.pi/prompts/review.md +16 -0
  100. package/.pi/prompts/setup.md +19 -0
  101. package/.pi/prompts/ship.md +17 -0
  102. package/.pi/prompts/spec.md +15 -0
  103. package/.pi/prompts/test.md +19 -0
  104. package/.pi/skills/bowser/SKILL.md +114 -0
  105. package/.versions/0.1.0/.claude/commands/build.md +18 -0
  106. package/.versions/0.1.0/.claude/commands/code-simplify.md +22 -0
  107. package/.versions/0.1.0/.claude/commands/design-agent.md +14 -0
  108. package/.versions/0.1.0/.claude/commands/doctor.md +13 -0
  109. package/.versions/0.1.0/.claude/commands/plan.md +16 -0
  110. package/.versions/0.1.0/.claude/commands/prime.md +22 -0
  111. package/.versions/0.1.0/.claude/commands/review.md +16 -0
  112. package/.versions/0.1.0/.claude/commands/setup.md +19 -0
  113. package/.versions/0.1.0/.claude/commands/ship.md +17 -0
  114. package/.versions/0.1.0/.claude/commands/spec.md +15 -0
  115. package/.versions/0.1.0/.claude/commands/test.md +19 -0
  116. package/.versions/0.1.0/.opencode/commands/as-build.md +17 -0
  117. package/.versions/0.1.0/.opencode/commands/as-code-simplify.md +16 -0
  118. package/.versions/0.1.0/.opencode/commands/as-design-agent.md +15 -0
  119. package/.versions/0.1.0/.opencode/commands/as-doctor.md +11 -0
  120. package/.versions/0.1.0/.opencode/commands/as-plan.md +16 -0
  121. package/.versions/0.1.0/.opencode/commands/as-prime.md +22 -0
  122. package/.versions/0.1.0/.opencode/commands/as-review.md +15 -0
  123. package/.versions/0.1.0/.opencode/commands/as-setup.md +11 -0
  124. package/.versions/0.1.0/.opencode/commands/as-ship.md +16 -0
  125. package/.versions/0.1.0/.opencode/commands/as-spec.md +16 -0
  126. package/.versions/0.1.0/.opencode/commands/as-test.md +21 -0
  127. package/.versions/0.1.0/.pi/agents/agent-chain.yaml +49 -0
  128. package/.versions/0.1.0/.pi/agents/bowser.md +19 -0
  129. package/.versions/0.1.0/.pi/agents/pi-pi/agent-expert.md +98 -0
  130. package/.versions/0.1.0/.pi/agents/pi-pi/cli-expert.md +41 -0
  131. package/.versions/0.1.0/.pi/agents/pi-pi/config-expert.md +63 -0
  132. package/.versions/0.1.0/.pi/agents/pi-pi/ext-expert.md +43 -0
  133. package/.versions/0.1.0/.pi/agents/pi-pi/keybinding-expert.md +134 -0
  134. package/.versions/0.1.0/.pi/agents/pi-pi/pi-orchestrator.md +57 -0
  135. package/.versions/0.1.0/.pi/agents/pi-pi/prompt-expert.md +70 -0
  136. package/.versions/0.1.0/.pi/agents/pi-pi/skill-expert.md +42 -0
  137. package/.versions/0.1.0/.pi/agents/pi-pi/theme-expert.md +40 -0
  138. package/.versions/0.1.0/.pi/agents/pi-pi/tui-expert.md +85 -0
  139. package/.versions/0.1.0/.pi/agents/teams.yaml +31 -0
  140. package/.versions/0.1.0/.pi/damage-control-rules.yaml +278 -0
  141. package/.versions/0.1.0/.pi/extensions/chrome-devtools-mcp/README.md +39 -0
  142. package/.versions/0.1.0/.pi/extensions/chrome-devtools-mcp/index.ts +61 -0
  143. package/.versions/0.1.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  144. package/.versions/0.1.0/.pi/extensions/compact-and-continue/README.md +42 -0
  145. package/.versions/0.1.0/.pi/extensions/compact-and-continue/index.ts +120 -0
  146. package/.versions/0.1.0/.pi/extensions/compact-and-continue/package.json +6 -0
  147. package/.versions/0.1.0/.pi/extensions/mcp-bridge/README.md +46 -0
  148. package/.versions/0.1.0/.pi/extensions/mcp-bridge/index.ts +206 -0
  149. package/.versions/0.1.0/.pi/extensions/mcp-bridge/package.json +6 -0
  150. package/.versions/0.1.0/.pi/extensions/package-lock.json +1143 -0
  151. package/.versions/0.1.0/.pi/extensions/package.json +9 -0
  152. package/.versions/0.1.0/.pi/harnesses/agent-chain/README.md +37 -0
  153. package/.versions/0.1.0/.pi/harnesses/agent-chain/index.ts +795 -0
  154. package/.versions/0.1.0/.pi/harnesses/agent-chain/package.json +6 -0
  155. package/.versions/0.1.0/.pi/harnesses/agent-team/README.md +38 -0
  156. package/.versions/0.1.0/.pi/harnesses/agent-team/index.ts +732 -0
  157. package/.versions/0.1.0/.pi/harnesses/agent-team/package.json +6 -0
  158. package/.versions/0.1.0/.pi/harnesses/coms/README.md +36 -0
  159. package/.versions/0.1.0/.pi/harnesses/coms/index.ts +1595 -0
  160. package/.versions/0.1.0/.pi/harnesses/coms/package.json +6 -0
  161. package/.versions/0.1.0/.pi/harnesses/coms-net/README.md +46 -0
  162. package/.versions/0.1.0/.pi/harnesses/coms-net/index.ts +1637 -0
  163. package/.versions/0.1.0/.pi/harnesses/coms-net/package.json +6 -0
  164. package/.versions/0.1.0/.pi/harnesses/damage-control/README.md +38 -0
  165. package/.versions/0.1.0/.pi/harnesses/damage-control/index.ts +207 -0
  166. package/.versions/0.1.0/.pi/harnesses/damage-control/package.json +6 -0
  167. package/.versions/0.1.0/.pi/harnesses/damage-control-continue/README.md +37 -0
  168. package/.versions/0.1.0/.pi/harnesses/damage-control-continue/index.ts +234 -0
  169. package/.versions/0.1.0/.pi/harnesses/damage-control-continue/package.json +6 -0
  170. package/.versions/0.1.0/.pi/harnesses/minimal/README.md +27 -0
  171. package/.versions/0.1.0/.pi/harnesses/minimal/index.ts +32 -0
  172. package/.versions/0.1.0/.pi/harnesses/minimal/package.json +6 -0
  173. package/.versions/0.1.0/.pi/harnesses/package-lock.json +35 -0
  174. package/.versions/0.1.0/.pi/harnesses/package.json +9 -0
  175. package/.versions/0.1.0/.pi/harnesses/pi-pi/README.md +39 -0
  176. package/.versions/0.1.0/.pi/harnesses/pi-pi/index.ts +631 -0
  177. package/.versions/0.1.0/.pi/harnesses/pi-pi/package.json +6 -0
  178. package/.versions/0.1.0/.pi/harnesses/purpose-gate/README.md +27 -0
  179. package/.versions/0.1.0/.pi/harnesses/purpose-gate/index.ts +82 -0
  180. package/.versions/0.1.0/.pi/harnesses/purpose-gate/package.json +6 -0
  181. package/.versions/0.1.0/.pi/harnesses/session-replay/README.md +28 -0
  182. package/.versions/0.1.0/.pi/harnesses/session-replay/index.ts +214 -0
  183. package/.versions/0.1.0/.pi/harnesses/session-replay/package.json +6 -0
  184. package/.versions/0.1.0/.pi/harnesses/subagent-widget/README.md +36 -0
  185. package/.versions/0.1.0/.pi/harnesses/subagent-widget/index.ts +479 -0
  186. package/.versions/0.1.0/.pi/harnesses/subagent-widget/package.json +6 -0
  187. package/.versions/0.1.0/.pi/harnesses/system-select/README.md +39 -0
  188. package/.versions/0.1.0/.pi/harnesses/system-select/index.ts +165 -0
  189. package/.versions/0.1.0/.pi/harnesses/system-select/package.json +6 -0
  190. package/.versions/0.1.0/.pi/harnesses/tilldone/README.md +35 -0
  191. package/.versions/0.1.0/.pi/harnesses/tilldone/index.ts +724 -0
  192. package/.versions/0.1.0/.pi/harnesses/tilldone/package.json +6 -0
  193. package/.versions/0.1.0/.pi/harnesses/tool-counter/README.md +31 -0
  194. package/.versions/0.1.0/.pi/harnesses/tool-counter/index.ts +100 -0
  195. package/.versions/0.1.0/.pi/harnesses/tool-counter/package.json +6 -0
  196. package/.versions/0.1.0/.pi/harnesses/tool-counter-widget/README.md +27 -0
  197. package/.versions/0.1.0/.pi/harnesses/tool-counter-widget/index.ts +66 -0
  198. package/.versions/0.1.0/.pi/harnesses/tool-counter-widget/package.json +6 -0
  199. package/.versions/0.1.0/.pi/prompts/build.md +24 -0
  200. package/.versions/0.1.0/.pi/prompts/code-simplify.md +22 -0
  201. package/.versions/0.1.0/.pi/prompts/doctor.md +13 -0
  202. package/.versions/0.1.0/.pi/prompts/plan.md +16 -0
  203. package/.versions/0.1.0/.pi/prompts/review.md +16 -0
  204. package/.versions/0.1.0/.pi/prompts/setup.md +19 -0
  205. package/.versions/0.1.0/.pi/prompts/ship.md +17 -0
  206. package/.versions/0.1.0/.pi/prompts/spec.md +15 -0
  207. package/.versions/0.1.0/.pi/prompts/test.md +19 -0
  208. package/.versions/0.1.0/.pi/skills/bowser/SKILL.md +114 -0
  209. package/.versions/0.1.0/.version +1 -0
  210. package/.versions/0.1.0/agents/builder.md +6 -0
  211. package/.versions/0.1.0/agents/code-reviewer.md +93 -0
  212. package/.versions/0.1.0/agents/documenter.md +6 -0
  213. package/.versions/0.1.0/agents/plan-reviewer.md +22 -0
  214. package/.versions/0.1.0/agents/planner.md +6 -0
  215. package/.versions/0.1.0/agents/scout.md +6 -0
  216. package/.versions/0.1.0/agents/security-auditor.md +97 -0
  217. package/.versions/0.1.0/agents/test-engineer.md +89 -0
  218. package/.versions/0.1.0/hooks/SIMPLIFY-IGNORE.md +90 -0
  219. package/.versions/0.1.0/hooks/hooks.json +14 -0
  220. package/.versions/0.1.0/hooks/session-start.sh +20 -0
  221. package/.versions/0.1.0/hooks/simplify-ignore-test.sh +247 -0
  222. package/.versions/0.1.0/hooks/simplify-ignore.sh +302 -0
  223. package/.versions/0.1.0/references/accessibility-checklist.md +159 -0
  224. package/.versions/0.1.0/references/performance-checklist.md +121 -0
  225. package/.versions/0.1.0/references/prompting-patterns.md +380 -0
  226. package/.versions/0.1.0/references/security-checklist.md +134 -0
  227. package/.versions/0.1.0/references/testing-patterns.md +236 -0
  228. package/.versions/0.1.0/skills/api-and-interface-design/SKILL.md +294 -0
  229. package/.versions/0.1.0/skills/browser-testing-with-devtools/SKILL.md +335 -0
  230. package/.versions/0.1.0/skills/ci-cd-and-automation/SKILL.md +390 -0
  231. package/.versions/0.1.0/skills/code-review-and-quality/SKILL.md +347 -0
  232. package/.versions/0.1.0/skills/code-simplification/SKILL.md +331 -0
  233. package/.versions/0.1.0/skills/context-engineering/SKILL.md +291 -0
  234. package/.versions/0.1.0/skills/debugging-and-error-recovery/SKILL.md +300 -0
  235. package/.versions/0.1.0/skills/deprecation-and-migration/SKILL.md +206 -0
  236. package/.versions/0.1.0/skills/designing-agents/SKILL.md +394 -0
  237. package/.versions/0.1.0/skills/designing-agents/pi-harness-authoring.md +213 -0
  238. package/.versions/0.1.0/skills/documentation-and-adrs/SKILL.md +278 -0
  239. package/.versions/0.1.0/skills/frontend-ui-engineering/SKILL.md +322 -0
  240. package/.versions/0.1.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
  241. package/.versions/0.1.0/skills/guided-workspace-setup/SKILL.md +293 -0
  242. package/.versions/0.1.0/skills/idea-refine/SKILL.md +178 -0
  243. package/.versions/0.1.0/skills/idea-refine/examples.md +238 -0
  244. package/.versions/0.1.0/skills/idea-refine/frameworks.md +99 -0
  245. package/.versions/0.1.0/skills/idea-refine/refinement-criteria.md +113 -0
  246. package/.versions/0.1.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
  247. package/.versions/0.1.0/skills/incremental-implementation/SKILL.md +279 -0
  248. package/.versions/0.1.0/skills/performance-optimization/SKILL.md +350 -0
  249. package/.versions/0.1.0/skills/planning-and-task-breakdown/SKILL.md +237 -0
  250. package/.versions/0.1.0/skills/security-and-hardening/SKILL.md +349 -0
  251. package/.versions/0.1.0/skills/shipping-and-launch/SKILL.md +309 -0
  252. package/.versions/0.1.0/skills/source-driven-development/SKILL.md +194 -0
  253. package/.versions/0.1.0/skills/spec-driven-development/SKILL.md +237 -0
  254. package/.versions/0.1.0/skills/test-driven-development/SKILL.md +379 -0
  255. package/.versions/0.1.0/skills/using-agent-skills/SKILL.md +176 -0
  256. package/CHANGELOG.md +14 -0
  257. package/LICENSE +21 -0
  258. package/README.md +359 -0
  259. package/agents/builder.md +6 -0
  260. package/agents/code-reviewer.md +93 -0
  261. package/agents/documenter.md +6 -0
  262. package/agents/plan-reviewer.md +22 -0
  263. package/agents/planner.md +6 -0
  264. package/agents/scout.md +6 -0
  265. package/agents/security-auditor.md +97 -0
  266. package/agents/test-engineer.md +89 -0
  267. package/bin/cli.js +375 -0
  268. package/bin/lib/detect-agent.js +37 -0
  269. package/bin/lib/doctor.js +209 -0
  270. package/bin/snapshot-version.js +71 -0
  271. package/docs/agent-skills-setup.md +187 -0
  272. package/docs/copilot-setup.md +94 -0
  273. package/docs/cursor-setup.md +67 -0
  274. package/docs/gemini-cli-setup.md +113 -0
  275. package/docs/getting-started.md +162 -0
  276. package/docs/npm-install.md +169 -0
  277. package/docs/opencode-setup.md +241 -0
  278. package/docs/pi-extensions.md +163 -0
  279. package/docs/pi-setup.md +416 -0
  280. package/docs/skill-anatomy.md +129 -0
  281. package/docs/windsurf-setup.md +48 -0
  282. package/hooks/SIMPLIFY-IGNORE.md +90 -0
  283. package/hooks/hooks.json +14 -0
  284. package/hooks/session-start.sh +20 -0
  285. package/hooks/simplify-ignore-test.sh +247 -0
  286. package/hooks/simplify-ignore.sh +302 -0
  287. package/package.json +86 -0
  288. package/references/accessibility-checklist.md +159 -0
  289. package/references/performance-checklist.md +121 -0
  290. package/references/prompting-patterns.md +380 -0
  291. package/references/security-checklist.md +134 -0
  292. package/references/testing-patterns.md +236 -0
  293. package/skills/api-and-interface-design/SKILL.md +294 -0
  294. package/skills/browser-testing-with-devtools/SKILL.md +335 -0
  295. package/skills/ci-cd-and-automation/SKILL.md +390 -0
  296. package/skills/code-review-and-quality/SKILL.md +347 -0
  297. package/skills/code-simplification/SKILL.md +331 -0
  298. package/skills/context-engineering/SKILL.md +291 -0
  299. package/skills/debugging-and-error-recovery/SKILL.md +300 -0
  300. package/skills/deprecation-and-migration/SKILL.md +206 -0
  301. package/skills/designing-agents/SKILL.md +394 -0
  302. package/skills/designing-agents/pi-harness-authoring.md +213 -0
  303. package/skills/documentation-and-adrs/SKILL.md +278 -0
  304. package/skills/frontend-ui-engineering/SKILL.md +322 -0
  305. package/skills/git-workflow-and-versioning/SKILL.md +316 -0
  306. package/skills/guided-workspace-setup/SKILL.md +293 -0
  307. package/skills/idea-refine/SKILL.md +178 -0
  308. package/skills/idea-refine/examples.md +238 -0
  309. package/skills/idea-refine/frameworks.md +99 -0
  310. package/skills/idea-refine/refinement-criteria.md +113 -0
  311. package/skills/idea-refine/scripts/idea-refine.sh +15 -0
  312. package/skills/incremental-implementation/SKILL.md +279 -0
  313. package/skills/performance-optimization/SKILL.md +350 -0
  314. package/skills/planning-and-task-breakdown/SKILL.md +237 -0
  315. package/skills/security-and-hardening/SKILL.md +349 -0
  316. package/skills/shipping-and-launch/SKILL.md +309 -0
  317. package/skills/source-driven-development/SKILL.md +194 -0
  318. package/skills/spec-driven-development/SKILL.md +237 -0
  319. package/skills/test-driven-development/SKILL.md +379 -0
  320. package/skills/using-agent-skills/SKILL.md +176 -0
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: documenter
3
+ description: Documentation and README generation
4
+ tools: read,write,edit,grep,find,ls
5
+ ---
6
+ You are a documentation agent. Write clear, concise documentation. Update READMEs, add inline comments where needed, and generate usage examples. Match the project's existing doc style.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: plan-reviewer
3
+ description: Plan critic — reviews, challenges, and validates implementation plans
4
+ tools: read,grep,find,ls
5
+ ---
6
+ You are a plan reviewer agent. Your job is to critically evaluate implementation plans.
7
+
8
+ For each plan you review:
9
+ - Challenge assumptions — are they grounded in the actual codebase?
10
+ - Identify missing steps, edge cases, or dependencies the planner overlooked
11
+ - Flag risks: breaking changes, migration concerns, performance pitfalls
12
+ - Check feasibility — can each step actually be done with the tools and patterns available?
13
+ - Evaluate ordering — are steps in the right sequence? Are there hidden dependencies?
14
+ - Call out scope creep or over-engineering
15
+
16
+ Output a structured critique with:
17
+ 1. **Strengths** — what the plan gets right
18
+ 2. **Issues** — concrete problems ranked by severity
19
+ 3. **Missing** — steps or considerations the plan omitted
20
+ 4. **Recommendations** — specific, actionable changes to improve the plan
21
+
22
+ Be direct and specific. Reference actual files and patterns from the codebase when possible. Do NOT modify files.
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: planner
3
+ description: Architecture and implementation planning
4
+ tools: read,grep,find,ls
5
+ ---
6
+ You are a planner agent. Analyze requirements and produce clear, actionable implementation plans. Identify files to change, dependencies, and risks. Output a numbered step-by-step plan. Do NOT modify files.
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: scout
3
+ description: Fast recon and codebase exploration
4
+ tools: read,grep,find,ls
5
+ ---
6
+ You are a scout agent. Investigate the codebase quickly and report findings concisely. Do NOT modify any files. Focus on structure, patterns, and key entry points.
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: security-auditor
3
+ description: Security engineer focused on vulnerability detection, threat modeling, and secure coding practices. Use for security-focused code review, threat analysis, or hardening recommendations.
4
+ tools: read,bash,grep,find,ls
5
+ ---
6
+
7
+ # Security Auditor
8
+
9
+ You are an experienced Security Engineer conducting a security review. Your role is to identify vulnerabilities, assess risk, and recommend mitigations. You focus on practical, exploitable issues rather than theoretical risks.
10
+
11
+ ## Review Scope
12
+
13
+ ### 1. Input Handling
14
+ - Is all user input validated at system boundaries?
15
+ - Are there injection vectors (SQL, NoSQL, OS command, LDAP)?
16
+ - Is HTML output encoded to prevent XSS?
17
+ - Are file uploads restricted by type, size, and content?
18
+ - Are URL redirects validated against an allowlist?
19
+
20
+ ### 2. Authentication & Authorization
21
+ - Are passwords hashed with a strong algorithm (bcrypt, scrypt, argon2)?
22
+ - Are sessions managed securely (httpOnly, secure, sameSite cookies)?
23
+ - Is authorization checked on every protected endpoint?
24
+ - Can users access resources belonging to other users (IDOR)?
25
+ - Are password reset tokens time-limited and single-use?
26
+ - Is rate limiting applied to authentication endpoints?
27
+
28
+ ### 3. Data Protection
29
+ - Are secrets in environment variables (not code)?
30
+ - Are sensitive fields excluded from API responses and logs?
31
+ - Is data encrypted in transit (HTTPS) and at rest (if required)?
32
+ - Is PII handled according to applicable regulations?
33
+ - Are database backups encrypted?
34
+
35
+ ### 4. Infrastructure
36
+ - Are security headers configured (CSP, HSTS, X-Frame-Options)?
37
+ - Is CORS restricted to specific origins?
38
+ - Are dependencies audited for known vulnerabilities?
39
+ - Are error messages generic (no stack traces or internal details to users)?
40
+ - Is the principle of least privilege applied to service accounts?
41
+
42
+ ### 5. Third-Party Integrations
43
+ - Are API keys and tokens stored securely?
44
+ - Are webhook payloads verified (signature validation)?
45
+ - Are third-party scripts loaded from trusted CDNs with integrity hashes?
46
+ - Are OAuth flows using PKCE and state parameters?
47
+
48
+ ## Severity Classification
49
+
50
+ | Severity | Criteria | Action |
51
+ |----------|----------|--------|
52
+ | **Critical** | Exploitable remotely, leads to data breach or full compromise | Fix immediately, block release |
53
+ | **High** | Exploitable with some conditions, significant data exposure | Fix before release |
54
+ | **Medium** | Limited impact or requires authenticated access to exploit | Fix in current sprint |
55
+ | **Low** | Theoretical risk or defense-in-depth improvement | Schedule for next sprint |
56
+ | **Info** | Best practice recommendation, no current risk | Consider adopting |
57
+
58
+ ## Output Format
59
+
60
+ ```markdown
61
+ ## Security Audit Report
62
+
63
+ ### Summary
64
+ - Critical: [count]
65
+ - High: [count]
66
+ - Medium: [count]
67
+ - Low: [count]
68
+
69
+ ### Findings
70
+
71
+ #### [CRITICAL] [Finding title]
72
+ - **Location:** [file:line]
73
+ - **Description:** [What the vulnerability is]
74
+ - **Impact:** [What an attacker could do]
75
+ - **Proof of concept:** [How to exploit it]
76
+ - **Recommendation:** [Specific fix with code example]
77
+
78
+ #### [HIGH] [Finding title]
79
+ ...
80
+
81
+ ### Positive Observations
82
+ - [Security practices done well]
83
+
84
+ ### Recommendations
85
+ - [Proactive improvements to consider]
86
+ ```
87
+
88
+ ## Rules
89
+
90
+ 1. Focus on exploitable vulnerabilities, not theoretical risks
91
+ 2. Every finding must include a specific, actionable recommendation
92
+ 3. Provide proof of concept or exploitation scenario for Critical/High findings
93
+ 4. Acknowledge good security practices — positive reinforcement matters
94
+ 5. Check the OWASP Top 10 as a minimum baseline
95
+ 6. Review dependencies for known CVEs
96
+ 7. Never suggest disabling security controls as a "fix"
97
+ 8. Do NOT modify files — the auditor's output is the report, not patches. Surface mitigations as recommendations for the author or a follow-up agent.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: test-engineer
3
+ description: QA engineer specialized in test strategy, test writing, and coverage analysis. Use for designing test suites, writing tests for existing code, or evaluating test quality.
4
+ ---
5
+
6
+ # Test Engineer
7
+
8
+ You are an experienced QA Engineer focused on test strategy and quality assurance. Your role is to design test suites, write tests, analyze coverage gaps, and ensure that code changes are properly verified.
9
+
10
+ ## Approach
11
+
12
+ ### 1. Analyze Before Writing
13
+
14
+ Before writing any test:
15
+ - Read the code being tested to understand its behavior
16
+ - Identify the public API / interface (what to test)
17
+ - Identify edge cases and error paths
18
+ - Check existing tests for patterns and conventions
19
+
20
+ ### 2. Test at the Right Level
21
+
22
+ ```
23
+ Pure logic, no I/O → Unit test
24
+ Crosses a boundary → Integration test
25
+ Critical user flow → E2E test
26
+ ```
27
+
28
+ Test at the lowest level that captures the behavior. Don't write E2E tests for things unit tests can cover.
29
+
30
+ ### 3. Follow the Prove-It Pattern for Bugs
31
+
32
+ When asked to write a test for a bug:
33
+ 1. Write a test that demonstrates the bug (must FAIL with current code)
34
+ 2. Confirm the test fails
35
+ 3. Report the test is ready for the fix implementation
36
+
37
+ ### 4. Write Descriptive Tests
38
+
39
+ ```
40
+ describe('[Module/Function name]', () => {
41
+ it('[expected behavior in plain English]', () => {
42
+ // Arrange → Act → Assert
43
+ });
44
+ });
45
+ ```
46
+
47
+ ### 5. Cover These Scenarios
48
+
49
+ For every function or component:
50
+
51
+ | Scenario | Example |
52
+ |----------|---------|
53
+ | Happy path | Valid input produces expected output |
54
+ | Empty input | Empty string, empty array, null, undefined |
55
+ | Boundary values | Min, max, zero, negative |
56
+ | Error paths | Invalid input, network failure, timeout |
57
+ | Concurrency | Rapid repeated calls, out-of-order responses |
58
+
59
+ ## Output Format
60
+
61
+ When analyzing test coverage:
62
+
63
+ ```markdown
64
+ ## Test Coverage Analysis
65
+
66
+ ### Current Coverage
67
+ - [X] tests covering [Y] functions/components
68
+ - Coverage gaps identified: [list]
69
+
70
+ ### Recommended Tests
71
+ 1. **[Test name]** — [What it verifies, why it matters]
72
+ 2. **[Test name]** — [What it verifies, why it matters]
73
+
74
+ ### Priority
75
+ - Critical: [Tests that catch potential data loss or security issues]
76
+ - High: [Tests for core business logic]
77
+ - Medium: [Tests for edge cases and error handling]
78
+ - Low: [Tests for utility functions and formatting]
79
+ ```
80
+
81
+ ## Rules
82
+
83
+ 1. Test behavior, not implementation details
84
+ 2. Each test should verify one concept
85
+ 3. Tests should be independent — no shared mutable state between tests
86
+ 4. Avoid snapshot tests unless reviewing every change to the snapshot
87
+ 5. Mock at system boundaries (database, network), not between internal functions
88
+ 6. Every test name should read like a specification
89
+ 7. A test that never fails is as useless as a test that always fails
package/bin/cli.js ADDED
@@ -0,0 +1,375 @@
1
+ #!/usr/bin/env node
2
+ // agent-skills — thin dispatcher into the LLM-driven guided setup.
3
+ //
4
+ // Three commands:
5
+ // init materialize the package, detect the coding agent, hand off to /setup
6
+ // doctor deterministic preflight scan (broken symlinks, stale persona refs)
7
+ // update refresh the package, then hand off to /setup for the version-diff
8
+ //
9
+ // The CLI itself never decides which skills to install or what to overwrite —
10
+ // that is the job of the guided-workspace-setup skill, run by the user's
11
+ // coding agent. We just put the source files where the agent can find them
12
+ // and print the next-step command.
13
+
14
+ import { readFileSync, existsSync, statSync } from "node:fs";
15
+ import { fileURLToPath } from "node:url";
16
+ import { dirname, join, resolve, relative } from "node:path";
17
+ import { spawnSync } from "node:child_process";
18
+ import { parseArgs } from "node:util";
19
+ import { createInterface } from "node:readline/promises";
20
+ import { stdin, stdout, exit } from "node:process";
21
+
22
+ import { runDoctor } from "./lib/doctor.js";
23
+ import { detectAgent, agentLabel, AGENTS } from "./lib/detect-agent.js";
24
+
25
+ const __dirname = dirname(fileURLToPath(import.meta.url));
26
+ const pkgRoot = resolve(__dirname, "..");
27
+ const pkg = JSON.parse(readFileSync(join(pkgRoot, "package.json"), "utf8"));
28
+
29
+ // ── argv parsing ──────────────────────────────────────────────────────────
30
+
31
+ const argv = process.argv.slice(2);
32
+ const sub = argv[0];
33
+
34
+ if (!sub || sub === "--help" || sub === "-h" || sub === "help") {
35
+ printHelp();
36
+ exit(0);
37
+ }
38
+ if (sub === "--version" || sub === "-v" || sub === "version") {
39
+ console.log(pkg.version);
40
+ exit(0);
41
+ }
42
+
43
+ const parsed = (() => {
44
+ try {
45
+ return parseArgs({
46
+ args: argv.slice(1),
47
+ allowPositionals: true,
48
+ options: {
49
+ agent: { type: "string" },
50
+ method: { type: "string" },
51
+ workspace: { type: "string" },
52
+ yes: { type: "boolean", short: "y" },
53
+ "dry-run": { type: "boolean" },
54
+ launch: { type: "boolean" },
55
+ help: { type: "boolean", short: "h" },
56
+ },
57
+ });
58
+ } catch (err) {
59
+ fail(err.message);
60
+ }
61
+ })();
62
+
63
+ const opts = parsed.values;
64
+ const workspace = resolve(opts.workspace ?? process.cwd());
65
+
66
+ if (opts.help) {
67
+ printHelp(sub);
68
+ exit(0);
69
+ }
70
+
71
+ // ── dispatch ──────────────────────────────────────────────────────────────
72
+
73
+ switch (sub) {
74
+ case "init": await cmdInit(); break;
75
+ case "doctor": await cmdDoctor(); break;
76
+ case "update": await cmdUpdate(); break;
77
+ default: fail(`unknown command: ${sub}\n\nRun "agent-skills --help" for usage.`);
78
+ }
79
+
80
+ // ── commands ──────────────────────────────────────────────────────────────
81
+
82
+ async function cmdInit() {
83
+ await mustBeDirectory(workspace, "workspace");
84
+
85
+ printBanner(`agent-skills v${pkg.version} — guided init`);
86
+ console.log(`Workspace: ${workspace}`);
87
+ console.log(`Source: ${pkgRoot}`);
88
+ console.log();
89
+
90
+ const agent = await chooseAgent(opts.agent);
91
+ console.log(`Coding agent: ${agentLabel(agent)}`);
92
+
93
+ // The CLI doesn't write any skill / persona / command files itself —
94
+ // that is the job of `guided-workspace-setup` running inside the agent.
95
+ // What it CAN do is record the chosen agent + method as a hint the skill
96
+ // will pick up, and print the exact next-step command.
97
+ const method = opts.method ?? "copy";
98
+ if (!["copy", "symlink"].includes(method)) {
99
+ fail(`--method must be "copy" or "symlink" (got "${method}")`);
100
+ }
101
+
102
+ printSection("Next step");
103
+ printHandoff({ agent, method, workspace, source: pkgRoot, version: pkg.version });
104
+
105
+ if (opts.launch) {
106
+ tryLaunch(agent, workspace);
107
+ }
108
+ }
109
+
110
+ async function cmdDoctor() {
111
+ await mustBeDirectory(workspace, "workspace");
112
+
113
+ printBanner(`agent-skills v${pkg.version} — doctor scan`);
114
+ console.log(`Workspace: ${workspace}`);
115
+ console.log();
116
+
117
+ const findings = await runDoctor({ workspace, sourceRoot: pkgRoot });
118
+
119
+ if (findings.length === 0) {
120
+ console.log("✓ No broken symlinks or stale persona references found.");
121
+ exit(0);
122
+ }
123
+
124
+ console.log(`Found ${findings.length} issue(s):\n`);
125
+ console.log(formatFindingsTable(findings));
126
+ console.log();
127
+
128
+ if (opts["dry-run"]) {
129
+ console.log("(--dry-run set: no fixes applied)");
130
+ exit(0);
131
+ }
132
+
133
+ const apply = opts.yes
134
+ ? true
135
+ : await confirm("Apply the suggested fixes now? [y/N] ");
136
+
137
+ if (!apply) {
138
+ console.log("No changes made. Re-run without --dry-run to apply.");
139
+ exit(0);
140
+ }
141
+
142
+ const { repaired, deleted, skipped } = await runDoctor({
143
+ workspace,
144
+ sourceRoot: pkgRoot,
145
+ apply: true,
146
+ });
147
+
148
+ console.log(
149
+ `\n✓ Doctor finished — repaired ${repaired}, deleted ${deleted}, skipped ${skipped}.`,
150
+ );
151
+ console.log(
152
+ "Re-run /setup inside your coding agent if you also want to add or remove artifacts.",
153
+ );
154
+ }
155
+
156
+ async function cmdUpdate() {
157
+ await mustBeDirectory(workspace, "workspace");
158
+
159
+ printBanner(`agent-skills v${pkg.version} — update`);
160
+ console.log(`Workspace: ${workspace}`);
161
+ console.log();
162
+
163
+ // npm itself does the package upgrade. The CLI's job here is to read the
164
+ // workspace's install record, surface the version delta, and tell the user
165
+ // to run /setup so the skill can drive the diff-aware refresh.
166
+ const recordPath = join(workspace, ".ai", "agent-skills-setup.md");
167
+ if (!existsSync(recordPath)) {
168
+ console.log("This workspace has no .ai/agent-skills-setup.md install record.");
169
+ console.log("Run `npx agent-skills init` first, then re-run `update` later.");
170
+ exit(1);
171
+ }
172
+
173
+ const recorded = readRecordedVersion(recordPath);
174
+ const current = pkg.version;
175
+
176
+ if (recorded === current) {
177
+ console.log(`Recorded version (${recorded}) matches the installed package.`);
178
+ console.log("Nothing to do. To upgrade the package itself, run:");
179
+ console.log(" npm install -g agent-skills@latest # global");
180
+ console.log(" npx agent-skills@latest update # one-shot");
181
+ exit(0);
182
+ }
183
+
184
+ console.log(`Recorded in workspace: v${recorded ?? "(pre-versioning)"}`);
185
+ console.log(`Installed package: v${current}`);
186
+ console.log();
187
+ console.log("Run /setup inside your coding agent — the guided-workspace-setup");
188
+ console.log("skill will detect the version delta, show the CHANGELOG between");
189
+ console.log("the two versions, and offer a per-artifact three-way diff before");
190
+ console.log("touching any file.");
191
+ }
192
+
193
+ // ── helpers ───────────────────────────────────────────────────────────────
194
+
195
+ async function chooseAgent(supplied) {
196
+ if (supplied) {
197
+ if (!AGENTS.includes(supplied)) {
198
+ fail(`--agent must be one of: ${AGENTS.join(", ")} (got "${supplied}")`);
199
+ }
200
+ return supplied;
201
+ }
202
+ const detected = detectAgent({ workspace, env: process.env });
203
+ if (detected) return detected;
204
+
205
+ console.log("Could not auto-detect your coding agent.");
206
+ const answer = (await prompt(
207
+ `Which coding agent? [${AGENTS.join("/")}] (claude-code): `,
208
+ )).trim() || "claude-code";
209
+
210
+ if (!AGENTS.includes(answer)) {
211
+ fail(`Unknown agent "${answer}". Allowed: ${AGENTS.join(", ")}`);
212
+ }
213
+ return answer;
214
+ }
215
+
216
+ function printHandoff({ agent, method, workspace, source, version }) {
217
+ const rel = relative(process.cwd(), workspace) || ".";
218
+ const lines = [
219
+ `agent-skills v${version} is ready.`,
220
+ "",
221
+ `Workspace: ${rel}`,
222
+ `Coding agent: ${agentLabel(agent)}`,
223
+ `Install method: ${method}`,
224
+ `Source root: ${source}`,
225
+ "",
226
+ "Open your coding agent in this directory and run:",
227
+ "",
228
+ ` /setup`,
229
+ "",
230
+ "The guided-workspace-setup skill will:",
231
+ " • analyse the workspace",
232
+ " • show grouped install menus with recommendations",
233
+ " • offer project overrides",
234
+ " • confirm everything before writing a single file",
235
+ "",
236
+ "Re-run `npx agent-skills doctor` any time to scan for broken symlinks.",
237
+ ];
238
+ for (const line of lines) console.log(line);
239
+ }
240
+
241
+ function tryLaunch(agent, cwd) {
242
+ const cmd = { "claude-code": "claude", "opencode": "opencode", "pi": "pi" }[agent];
243
+ if (!cmd) return;
244
+ console.log(`\nLaunching: ${cmd} (cwd: ${cwd})`);
245
+ const r = spawnSync(cmd, [], { cwd, stdio: "inherit" });
246
+ if (r.error) {
247
+ console.log(`(could not launch ${cmd}: ${r.error.message})`);
248
+ console.log(`Open ${cmd} manually and run /setup.`);
249
+ }
250
+ }
251
+
252
+ function readRecordedVersion(path) {
253
+ const text = readFileSync(path, "utf8");
254
+ const m = text.match(/^version:\s*([^\s#]+)/m);
255
+ return m ? m[1].trim() : null;
256
+ }
257
+
258
+ function formatFindingsTable(findings) {
259
+ const rows = findings.map((f, i) => [
260
+ String(i + 1),
261
+ f.path,
262
+ f.issue,
263
+ f.fix,
264
+ ]);
265
+ const headers = ["#", "Path", "Issue", "Suggested fix"];
266
+ const widths = headers.map((h, i) =>
267
+ Math.max(h.length, ...rows.map((r) => r[i].length)),
268
+ );
269
+ const pad = (cells) =>
270
+ cells.map((c, i) => c.padEnd(widths[i])).join(" ");
271
+ return [
272
+ pad(headers),
273
+ pad(widths.map((w) => "─".repeat(w))),
274
+ ...rows.map(pad),
275
+ ].join("\n");
276
+ }
277
+
278
+ async function mustBeDirectory(p, label) {
279
+ if (!existsSync(p) || !statSync(p).isDirectory()) {
280
+ fail(`${label} is not a directory: ${p}`);
281
+ }
282
+ }
283
+
284
+ async function prompt(question) {
285
+ const rl = createInterface({ input: stdin, output: stdout });
286
+ try { return await rl.question(question); }
287
+ finally { rl.close(); }
288
+ }
289
+
290
+ async function confirm(question) {
291
+ const ans = (await prompt(question)).trim().toLowerCase();
292
+ return ans === "y" || ans === "yes";
293
+ }
294
+
295
+ function printBanner(text) {
296
+ const bar = "─".repeat(Math.min(text.length, 70));
297
+ console.log(`\n${text}\n${bar}`);
298
+ }
299
+
300
+ function printSection(text) {
301
+ console.log(`\n── ${text} ${"─".repeat(Math.max(0, 60 - text.length))}`);
302
+ }
303
+
304
+ function fail(msg) {
305
+ console.error(`agent-skills: ${msg}`);
306
+ exit(1);
307
+ }
308
+
309
+ function printHelp(sub) {
310
+ if (sub === "init") {
311
+ console.log(`agent-skills init [options]
312
+
313
+ Materialize the package and hand off to the LLM-driven /setup skill.
314
+
315
+ Options:
316
+ --agent <claude-code|opencode|pi> Skip the agent auto-detection
317
+ --method <copy|symlink> Default install method (default: copy)
318
+ --workspace <path> Target workspace (default: cwd)
319
+ --launch Attempt to launch the coding agent after init
320
+ -h, --help Show this help
321
+ `);
322
+ return;
323
+ }
324
+ if (sub === "doctor") {
325
+ console.log(`agent-skills doctor [options]
326
+
327
+ Scan the workspace for broken symlinks and stale persona references.
328
+
329
+ Options:
330
+ --workspace <path> Target workspace (default: cwd)
331
+ --dry-run Show findings, do not apply fixes
332
+ -y, --yes Apply all suggested fixes without prompting
333
+ -h, --help Show this help
334
+ `);
335
+ return;
336
+ }
337
+ if (sub === "update") {
338
+ console.log(`agent-skills update [options]
339
+
340
+ Read the workspace's install record and surface the version delta. The
341
+ actual diff-aware refresh runs inside your coding agent via /setup.
342
+
343
+ Options:
344
+ --workspace <path> Target workspace (default: cwd)
345
+ -h, --help Show this help
346
+
347
+ To upgrade the package itself first:
348
+ npm install -g agent-skills@latest
349
+ npx agent-skills@latest update
350
+ `);
351
+ return;
352
+ }
353
+ console.log(`agent-skills v${pkg.version}
354
+
355
+ Usage:
356
+ npx agent-skills <command> [options]
357
+
358
+ Commands:
359
+ init Materialize the package + hand off to /setup in your agent
360
+ doctor Scan for broken symlinks and stale persona references
361
+ update Surface the version delta + hand off to /setup for the refresh
362
+
363
+ Options:
364
+ -v, --version Print the package version
365
+ -h, --help Print this help (or per-command help)
366
+
367
+ Examples:
368
+ npx agent-skills init
369
+ npx agent-skills init --agent claude-code --method copy
370
+ npx agent-skills doctor --workspace ~/projects/foo
371
+ npx agent-skills update
372
+
373
+ Docs: https://github.com/chankov/agent-skills#readme
374
+ `);
375
+ }
@@ -0,0 +1,37 @@
1
+ // Agent detection — used by `agent-skills init` to pick a sensible default
2
+ // for the coding agent. The user can always override with --agent.
3
+
4
+ import { existsSync } from "node:fs";
5
+ import { join } from "node:path";
6
+
7
+ export const AGENTS = ["claude-code", "opencode", "pi"];
8
+
9
+ const LABELS = {
10
+ "claude-code": "Claude Code",
11
+ "opencode": "OpenCode",
12
+ "pi": "pi",
13
+ };
14
+
15
+ export function agentLabel(agent) {
16
+ return LABELS[agent] ?? agent;
17
+ }
18
+
19
+ // Detection precedence:
20
+ // 1. Explicit env vars from the coding agent runtime
21
+ // 2. Workspace directory hints (.claude/ / .opencode/ / .pi/)
22
+ // 3. Null — let the caller prompt
23
+ export function detectAgent({ workspace, env = process.env } = {}) {
24
+ // 1. Env-based detection. Any agent that injects its own env var wins.
25
+ if (env.CLAUDECODE === "1" || env.CLAUDE_CODE_ENTRYPOINT) return "claude-code";
26
+ if (env.OPENCODE === "1" || env.OPENCODE_VERSION) return "opencode";
27
+ if (env.PI === "1" || env.PI_SESSION_ID) return "pi";
28
+
29
+ // 2. Workspace hints. Only one match → pick it; multiple → don't guess.
30
+ if (!workspace) return null;
31
+ const hits = [];
32
+ if (existsSync(join(workspace, ".claude"))) hits.push("claude-code");
33
+ if (existsSync(join(workspace, ".opencode"))) hits.push("opencode");
34
+ if (existsSync(join(workspace, ".pi"))) hits.push("pi");
35
+
36
+ return hits.length === 1 ? hits[0] : null;
37
+ }