@chankov/agent-skills 0.2.0 → 0.3.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 (178) hide show
  1. package/.claude/commands/{doctor.md → doctor-agent-skills.md} +1 -1
  2. package/.pi/extensions/agent-skills-update-check/README.md +4 -4
  3. package/.pi/prompts/{doctor.md → doctor-agent-skills.md} +1 -1
  4. package/.versions/0.2.0/.claude/commands/{doctor.md → doctor-agent-skills.md} +1 -1
  5. package/.versions/0.2.0/.pi/extensions/agent-skills-update-check/README.md +4 -4
  6. package/.versions/0.2.0/.pi/prompts/{doctor.md → doctor-agent-skills.md} +1 -1
  7. package/.versions/0.2.0/skills/guided-workspace-setup/SKILL.md +40 -2
  8. package/.versions/0.3.0/.claude/commands/build.md +18 -0
  9. package/.versions/0.3.0/.claude/commands/code-simplify.md +22 -0
  10. package/.versions/0.3.0/.claude/commands/design-agent.md +14 -0
  11. package/.versions/0.3.0/.claude/commands/doctor-agent-skills.md +13 -0
  12. package/.versions/0.3.0/.claude/commands/plan.md +16 -0
  13. package/.versions/0.3.0/.claude/commands/prime.md +22 -0
  14. package/.versions/0.3.0/.claude/commands/review.md +16 -0
  15. package/.versions/0.3.0/.claude/commands/setup-agent-skills.md +19 -0
  16. package/.versions/0.3.0/.claude/commands/ship.md +17 -0
  17. package/.versions/0.3.0/.claude/commands/spec.md +15 -0
  18. package/.versions/0.3.0/.claude/commands/test.md +19 -0
  19. package/.versions/0.3.0/.opencode/commands/as-build.md +17 -0
  20. package/.versions/0.3.0/.opencode/commands/as-code-simplify.md +16 -0
  21. package/.versions/0.3.0/.opencode/commands/as-design-agent.md +15 -0
  22. package/.versions/0.3.0/.opencode/commands/as-doctor-agent-skills.md +11 -0
  23. package/.versions/0.3.0/.opencode/commands/as-plan.md +16 -0
  24. package/.versions/0.3.0/.opencode/commands/as-prime.md +22 -0
  25. package/.versions/0.3.0/.opencode/commands/as-review.md +15 -0
  26. package/.versions/0.3.0/.opencode/commands/as-setup-agent-skills.md +11 -0
  27. package/.versions/0.3.0/.opencode/commands/as-ship.md +16 -0
  28. package/.versions/0.3.0/.opencode/commands/as-spec.md +16 -0
  29. package/.versions/0.3.0/.opencode/commands/as-test.md +21 -0
  30. package/.versions/0.3.0/.pi/agents/agent-chain.yaml +49 -0
  31. package/.versions/0.3.0/.pi/agents/bowser.md +19 -0
  32. package/.versions/0.3.0/.pi/agents/pi-pi/agent-expert.md +98 -0
  33. package/.versions/0.3.0/.pi/agents/pi-pi/cli-expert.md +41 -0
  34. package/.versions/0.3.0/.pi/agents/pi-pi/config-expert.md +63 -0
  35. package/.versions/0.3.0/.pi/agents/pi-pi/ext-expert.md +43 -0
  36. package/.versions/0.3.0/.pi/agents/pi-pi/keybinding-expert.md +134 -0
  37. package/.versions/0.3.0/.pi/agents/pi-pi/pi-orchestrator.md +57 -0
  38. package/.versions/0.3.0/.pi/agents/pi-pi/prompt-expert.md +70 -0
  39. package/.versions/0.3.0/.pi/agents/pi-pi/skill-expert.md +42 -0
  40. package/.versions/0.3.0/.pi/agents/pi-pi/theme-expert.md +40 -0
  41. package/.versions/0.3.0/.pi/agents/pi-pi/tui-expert.md +85 -0
  42. package/.versions/0.3.0/.pi/agents/teams.yaml +31 -0
  43. package/.versions/0.3.0/.pi/damage-control-rules.yaml +278 -0
  44. package/.versions/0.3.0/.pi/extensions/agent-skills-update-check/README.md +58 -0
  45. package/.versions/0.3.0/.pi/extensions/agent-skills-update-check/index.ts +161 -0
  46. package/.versions/0.3.0/.pi/extensions/agent-skills-update-check/package.json +6 -0
  47. package/.versions/0.3.0/.pi/extensions/chrome-devtools-mcp/README.md +39 -0
  48. package/.versions/0.3.0/.pi/extensions/chrome-devtools-mcp/index.ts +61 -0
  49. package/.versions/0.3.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  50. package/.versions/0.3.0/.pi/extensions/compact-and-continue/README.md +42 -0
  51. package/.versions/0.3.0/.pi/extensions/compact-and-continue/index.ts +120 -0
  52. package/.versions/0.3.0/.pi/extensions/compact-and-continue/package.json +6 -0
  53. package/.versions/0.3.0/.pi/extensions/mcp-bridge/README.md +46 -0
  54. package/.versions/0.3.0/.pi/extensions/mcp-bridge/index.ts +206 -0
  55. package/.versions/0.3.0/.pi/extensions/mcp-bridge/package.json +6 -0
  56. package/.versions/0.3.0/.pi/extensions/package-lock.json +1143 -0
  57. package/.versions/0.3.0/.pi/extensions/package.json +9 -0
  58. package/.versions/0.3.0/.pi/harnesses/agent-chain/README.md +37 -0
  59. package/.versions/0.3.0/.pi/harnesses/agent-chain/index.ts +795 -0
  60. package/.versions/0.3.0/.pi/harnesses/agent-chain/package.json +6 -0
  61. package/.versions/0.3.0/.pi/harnesses/agent-team/README.md +38 -0
  62. package/.versions/0.3.0/.pi/harnesses/agent-team/index.ts +732 -0
  63. package/.versions/0.3.0/.pi/harnesses/agent-team/package.json +6 -0
  64. package/.versions/0.3.0/.pi/harnesses/coms/README.md +36 -0
  65. package/.versions/0.3.0/.pi/harnesses/coms/index.ts +1595 -0
  66. package/.versions/0.3.0/.pi/harnesses/coms/package.json +6 -0
  67. package/.versions/0.3.0/.pi/harnesses/coms-net/README.md +46 -0
  68. package/.versions/0.3.0/.pi/harnesses/coms-net/index.ts +1637 -0
  69. package/.versions/0.3.0/.pi/harnesses/coms-net/package.json +6 -0
  70. package/.versions/0.3.0/.pi/harnesses/damage-control/README.md +38 -0
  71. package/.versions/0.3.0/.pi/harnesses/damage-control/index.ts +207 -0
  72. package/.versions/0.3.0/.pi/harnesses/damage-control/package.json +6 -0
  73. package/.versions/0.3.0/.pi/harnesses/damage-control-continue/README.md +37 -0
  74. package/.versions/0.3.0/.pi/harnesses/damage-control-continue/index.ts +234 -0
  75. package/.versions/0.3.0/.pi/harnesses/damage-control-continue/package.json +6 -0
  76. package/.versions/0.3.0/.pi/harnesses/minimal/README.md +27 -0
  77. package/.versions/0.3.0/.pi/harnesses/minimal/index.ts +32 -0
  78. package/.versions/0.3.0/.pi/harnesses/minimal/package.json +6 -0
  79. package/.versions/0.3.0/.pi/harnesses/package-lock.json +35 -0
  80. package/.versions/0.3.0/.pi/harnesses/package.json +9 -0
  81. package/.versions/0.3.0/.pi/harnesses/pi-pi/README.md +39 -0
  82. package/.versions/0.3.0/.pi/harnesses/pi-pi/index.ts +631 -0
  83. package/.versions/0.3.0/.pi/harnesses/pi-pi/package.json +6 -0
  84. package/.versions/0.3.0/.pi/harnesses/purpose-gate/README.md +27 -0
  85. package/.versions/0.3.0/.pi/harnesses/purpose-gate/index.ts +82 -0
  86. package/.versions/0.3.0/.pi/harnesses/purpose-gate/package.json +6 -0
  87. package/.versions/0.3.0/.pi/harnesses/session-replay/README.md +28 -0
  88. package/.versions/0.3.0/.pi/harnesses/session-replay/index.ts +214 -0
  89. package/.versions/0.3.0/.pi/harnesses/session-replay/package.json +6 -0
  90. package/.versions/0.3.0/.pi/harnesses/subagent-widget/README.md +36 -0
  91. package/.versions/0.3.0/.pi/harnesses/subagent-widget/index.ts +479 -0
  92. package/.versions/0.3.0/.pi/harnesses/subagent-widget/package.json +6 -0
  93. package/.versions/0.3.0/.pi/harnesses/system-select/README.md +39 -0
  94. package/.versions/0.3.0/.pi/harnesses/system-select/index.ts +165 -0
  95. package/.versions/0.3.0/.pi/harnesses/system-select/package.json +6 -0
  96. package/.versions/0.3.0/.pi/harnesses/tilldone/README.md +35 -0
  97. package/.versions/0.3.0/.pi/harnesses/tilldone/index.ts +724 -0
  98. package/.versions/0.3.0/.pi/harnesses/tilldone/package.json +6 -0
  99. package/.versions/0.3.0/.pi/harnesses/tool-counter/README.md +31 -0
  100. package/.versions/0.3.0/.pi/harnesses/tool-counter/index.ts +100 -0
  101. package/.versions/0.3.0/.pi/harnesses/tool-counter/package.json +6 -0
  102. package/.versions/0.3.0/.pi/harnesses/tool-counter-widget/README.md +27 -0
  103. package/.versions/0.3.0/.pi/harnesses/tool-counter-widget/index.ts +66 -0
  104. package/.versions/0.3.0/.pi/harnesses/tool-counter-widget/package.json +6 -0
  105. package/.versions/0.3.0/.pi/prompts/build.md +24 -0
  106. package/.versions/0.3.0/.pi/prompts/code-simplify.md +22 -0
  107. package/.versions/0.3.0/.pi/prompts/doctor-agent-skills.md +13 -0
  108. package/.versions/0.3.0/.pi/prompts/plan.md +16 -0
  109. package/.versions/0.3.0/.pi/prompts/review.md +16 -0
  110. package/.versions/0.3.0/.pi/prompts/setup-agent-skills.md +19 -0
  111. package/.versions/0.3.0/.pi/prompts/ship.md +17 -0
  112. package/.versions/0.3.0/.pi/prompts/spec.md +15 -0
  113. package/.versions/0.3.0/.pi/prompts/test.md +19 -0
  114. package/.versions/0.3.0/.pi/skills/bowser/SKILL.md +114 -0
  115. package/.versions/0.3.0/.version +1 -0
  116. package/.versions/0.3.0/agents/builder.md +6 -0
  117. package/.versions/0.3.0/agents/code-reviewer.md +93 -0
  118. package/.versions/0.3.0/agents/documenter.md +6 -0
  119. package/.versions/0.3.0/agents/plan-reviewer.md +22 -0
  120. package/.versions/0.3.0/agents/planner.md +6 -0
  121. package/.versions/0.3.0/agents/scout.md +6 -0
  122. package/.versions/0.3.0/agents/security-auditor.md +97 -0
  123. package/.versions/0.3.0/agents/test-engineer.md +89 -0
  124. package/.versions/0.3.0/hooks/SIMPLIFY-IGNORE.md +90 -0
  125. package/.versions/0.3.0/hooks/hooks.json +14 -0
  126. package/.versions/0.3.0/hooks/session-start.sh +74 -0
  127. package/.versions/0.3.0/hooks/simplify-ignore-test.sh +247 -0
  128. package/.versions/0.3.0/hooks/simplify-ignore.sh +302 -0
  129. package/.versions/0.3.0/references/accessibility-checklist.md +159 -0
  130. package/.versions/0.3.0/references/performance-checklist.md +121 -0
  131. package/.versions/0.3.0/references/prompting-patterns.md +380 -0
  132. package/.versions/0.3.0/references/security-checklist.md +134 -0
  133. package/.versions/0.3.0/references/testing-patterns.md +236 -0
  134. package/.versions/0.3.0/skills/api-and-interface-design/SKILL.md +294 -0
  135. package/.versions/0.3.0/skills/browser-testing-with-devtools/SKILL.md +335 -0
  136. package/.versions/0.3.0/skills/ci-cd-and-automation/SKILL.md +390 -0
  137. package/.versions/0.3.0/skills/code-review-and-quality/SKILL.md +347 -0
  138. package/.versions/0.3.0/skills/code-simplification/SKILL.md +331 -0
  139. package/.versions/0.3.0/skills/context-engineering/SKILL.md +291 -0
  140. package/.versions/0.3.0/skills/debugging-and-error-recovery/SKILL.md +300 -0
  141. package/.versions/0.3.0/skills/deprecation-and-migration/SKILL.md +206 -0
  142. package/.versions/0.3.0/skills/designing-agents/SKILL.md +394 -0
  143. package/.versions/0.3.0/skills/designing-agents/pi-harness-authoring.md +213 -0
  144. package/.versions/0.3.0/skills/documentation-and-adrs/SKILL.md +278 -0
  145. package/.versions/0.3.0/skills/frontend-ui-engineering/SKILL.md +322 -0
  146. package/.versions/0.3.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
  147. package/.versions/0.3.0/skills/guided-workspace-setup/SKILL.md +331 -0
  148. package/.versions/0.3.0/skills/idea-refine/SKILL.md +178 -0
  149. package/.versions/0.3.0/skills/idea-refine/examples.md +238 -0
  150. package/.versions/0.3.0/skills/idea-refine/frameworks.md +99 -0
  151. package/.versions/0.3.0/skills/idea-refine/refinement-criteria.md +113 -0
  152. package/.versions/0.3.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
  153. package/.versions/0.3.0/skills/incremental-implementation/SKILL.md +279 -0
  154. package/.versions/0.3.0/skills/performance-optimization/SKILL.md +350 -0
  155. package/.versions/0.3.0/skills/planning-and-task-breakdown/SKILL.md +237 -0
  156. package/.versions/0.3.0/skills/security-and-hardening/SKILL.md +349 -0
  157. package/.versions/0.3.0/skills/shipping-and-launch/SKILL.md +309 -0
  158. package/.versions/0.3.0/skills/source-driven-development/SKILL.md +194 -0
  159. package/.versions/0.3.0/skills/spec-driven-development/SKILL.md +237 -0
  160. package/.versions/0.3.0/skills/test-driven-development/SKILL.md +379 -0
  161. package/.versions/0.3.0/skills/using-agent-skills/SKILL.md +176 -0
  162. package/CHANGELOG.md +72 -0
  163. package/README.md +5 -5
  164. package/bin/cli.js +100 -24
  165. package/bin/lib/bootstrap.js +254 -0
  166. package/bin/lib/doctor.js +1 -1
  167. package/docs/getting-started.md +2 -2
  168. package/docs/npm-install.md +34 -11
  169. package/package.json +1 -1
  170. package/skills/guided-workspace-setup/SKILL.md +40 -2
  171. /package/.claude/commands/{setup.md → setup-agent-skills.md} +0 -0
  172. /package/.opencode/commands/{as-doctor.md → as-doctor-agent-skills.md} +0 -0
  173. /package/.opencode/commands/{as-setup.md → as-setup-agent-skills.md} +0 -0
  174. /package/.pi/prompts/{setup.md → setup-agent-skills.md} +0 -0
  175. /package/.versions/0.2.0/.claude/commands/{setup.md → setup-agent-skills.md} +0 -0
  176. /package/.versions/0.2.0/.opencode/commands/{as-doctor.md → as-doctor-agent-skills.md} +0 -0
  177. /package/.versions/0.2.0/.opencode/commands/{as-setup.md → as-setup-agent-skills.md} +0 -0
  178. /package/.versions/0.2.0/.pi/prompts/{setup.md → setup-agent-skills.md} +0 -0
@@ -0,0 +1,254 @@
1
+ // bootstrap.js — drop the minimum installer artifacts a coding agent needs
2
+ // to recognize `/setup-agent-skills` and `/doctor-agent-skills`.
3
+ //
4
+ // The CLI's `init` calls this before the handoff message. Without it, a
5
+ // fresh workspace has no `.claude/commands/setup-agent-skills.md`, `.pi/prompts/setup-agent-skills.md`,
6
+ // etc., so the agent has no idea what `/setup-agent-skills` is and the whole hand-off
7
+ // breaks silently.
8
+ //
9
+ // What we bootstrap (per agent):
10
+ // - The `setup` slash command (so the user can invoke it)
11
+ // - The `doctor` slash command (same)
12
+ // - The `guided-workspace-setup` skill body (the slash command says
13
+ // "load this skill" — the skill must be present somewhere the agent
14
+ // auto-discovers)
15
+ //
16
+ // What we do NOT bootstrap:
17
+ // - Any of the user-facing skills (spec-driven-development,
18
+ // test-driven-development, …). Those are picked by the user inside
19
+ // /setup-agent-skills, by design. The CLI never decides the workspace's catalogue
20
+ // for the user.
21
+ //
22
+ // Method:
23
+ // `copy` — safe default; works for npx caches that may be cleaned
24
+ // `symlink` — leaner; only safe when the source root is stable
25
+ // (global install / git clone). Warning printed if the
26
+ // source path looks like an npx cache.
27
+
28
+ import { existsSync, mkdirSync, copyFileSync, symlinkSync, unlinkSync, lstatSync, rmSync, readdirSync, rmdirSync } from "node:fs";
29
+ import { dirname, join, relative } from "node:path";
30
+
31
+ // (agent → list of {kind, src, dest}) — kind is just for the report.
32
+ //
33
+ // All installer slash commands are namespaced with `-agent-skills` so they
34
+ // don't collide with workspace-defined or other-tool slash commands. The
35
+ // short names (setup, doctor, as-setup, as-doctor) were used in 0.2.0 and
36
+ // earlier — cleanupLegacyNames() removes those if found.
37
+ function plan({ agent, sourceRoot, workspace }) {
38
+ const skillSrc = join(sourceRoot, "skills", "guided-workspace-setup", "SKILL.md");
39
+
40
+ switch (agent) {
41
+ case "claude-code":
42
+ return [
43
+ { kind: "command", src: join(sourceRoot, ".claude/commands/setup-agent-skills.md"),
44
+ dest: join(workspace, ".claude/commands/setup-agent-skills.md") },
45
+ { kind: "command", src: join(sourceRoot, ".claude/commands/doctor-agent-skills.md"),
46
+ dest: join(workspace, ".claude/commands/doctor-agent-skills.md") },
47
+ { kind: "skill", src: skillSrc,
48
+ dest: join(workspace, ".claude/skills/guided-workspace-setup/SKILL.md") },
49
+ ];
50
+
51
+ case "pi":
52
+ return [
53
+ { kind: "prompt", src: join(sourceRoot, ".pi/prompts/setup-agent-skills.md"),
54
+ dest: join(workspace, ".pi/prompts/setup-agent-skills.md") },
55
+ { kind: "prompt", src: join(sourceRoot, ".pi/prompts/doctor-agent-skills.md"),
56
+ dest: join(workspace, ".pi/prompts/doctor-agent-skills.md") },
57
+ // pi auto-discovers skills from .pi/skills/ and .agents/skills/ —
58
+ // we use .pi/skills/ to avoid polluting a shared .agents/ dir if
59
+ // the user has other tools there.
60
+ { kind: "skill", src: skillSrc,
61
+ dest: join(workspace, ".pi/skills/guided-workspace-setup/SKILL.md") },
62
+ ];
63
+
64
+ case "opencode":
65
+ // OpenCode discovers skills + commands from ~/.config/opencode/ (global)
66
+ // and references AGENTS.md. A project-local bootstrap is awkward — we
67
+ // drop the command file into .opencode/commands/ (which OpenCode does
68
+ // load from the project) and the skill alongside it, then flag the
69
+ // AGENTS.md gap for the user.
70
+ return [
71
+ { kind: "command", src: join(sourceRoot, ".opencode/commands/as-setup-agent-skills.md"),
72
+ dest: join(workspace, ".opencode/commands/as-setup-agent-skills.md") },
73
+ { kind: "command", src: join(sourceRoot, ".opencode/commands/as-doctor-agent-skills.md"),
74
+ dest: join(workspace, ".opencode/commands/as-doctor-agent-skills.md") },
75
+ { kind: "skill", src: skillSrc,
76
+ dest: join(workspace, ".opencode/skills/guided-workspace-setup/SKILL.md") },
77
+ ];
78
+
79
+ default:
80
+ throw new Error(`bootstrap: unknown agent "${agent}"`);
81
+ }
82
+ }
83
+
84
+ // Files that were the bootstrap targets in 0.2.0 and earlier (pre-rename).
85
+ // Removed during bootstrap so a workspace upgraded from 0.2.0 doesn't end
86
+ // up with both the old and new slash commands.
87
+ function legacyPaths({ agent, workspace }) {
88
+ switch (agent) {
89
+ case "claude-code":
90
+ return [
91
+ join(workspace, ".claude/commands/setup.md"),
92
+ join(workspace, ".claude/commands/doctor.md"),
93
+ ];
94
+ case "pi":
95
+ return [
96
+ join(workspace, ".pi/prompts/setup.md"),
97
+ join(workspace, ".pi/prompts/doctor.md"),
98
+ ];
99
+ case "opencode":
100
+ return [
101
+ join(workspace, ".opencode/commands/as-setup.md"),
102
+ join(workspace, ".opencode/commands/as-doctor.md"),
103
+ ];
104
+ default:
105
+ return [];
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Run the bootstrap.
111
+ *
112
+ * @param {object} opts
113
+ * @param {string} opts.agent claude-code | opencode | pi
114
+ * @param {string} opts.sourceRoot Absolute path to the installed package
115
+ * @param {string} opts.workspace Absolute path to the target workspace
116
+ * @param {"copy"|"symlink"} opts.method
117
+ * @param {boolean} [opts.dryRun]
118
+ * @returns {{written:Array, skipped:Array, warnings:Array}}
119
+ */
120
+ export function bootstrap({ agent, sourceRoot, workspace, method, dryRun = false }) {
121
+ const items = plan({ agent, sourceRoot, workspace });
122
+ const written = [], skipped = [], removed = [], warnings = [];
123
+
124
+ // Warn if the user asked for symlink against an unstable source.
125
+ if (method === "symlink" && /\/\.npm\/_npx\//.test(sourceRoot)) {
126
+ warnings.push(
127
+ "--method symlink against an npx cache path: links will break when " +
128
+ "the cache is cleaned. Consider --method copy or install globally " +
129
+ "with `npm install -g @chankov/agent-skills`.",
130
+ );
131
+ }
132
+
133
+ // Clean up pre-0.3.0 file names if present — they were renamed to
134
+ // *-agent-skills so they don't collide with other slash commands.
135
+ for (const oldPath of legacyPaths({ agent, workspace })) {
136
+ if (!existsSync(oldPath) && !isSymlink(oldPath)) continue;
137
+ if (dryRun) {
138
+ removed.push(oldPath);
139
+ continue;
140
+ }
141
+ try {
142
+ unlinkSync(oldPath);
143
+ removed.push(oldPath);
144
+ } catch (err) {
145
+ warnings.push(`could not remove legacy file ${relative(workspace, oldPath)}: ${err.message}`);
146
+ }
147
+ }
148
+
149
+ for (const item of items) {
150
+ if (!existsSync(item.src)) {
151
+ warnings.push(`missing source: ${relative(sourceRoot, item.src)} (skipping ${item.kind})`);
152
+ continue;
153
+ }
154
+
155
+ if (dryRun) {
156
+ written.push({ ...item, method });
157
+ continue;
158
+ }
159
+
160
+ try {
161
+ mkdirSync(dirname(item.dest), { recursive: true });
162
+
163
+ // Always replace — the bootstrap is installer scaffolding, not user
164
+ // data. If we left it stale, an upgraded package would still hand off
165
+ // to the old /setup-agent-skills command. Step 6 of guided-workspace-setup explicitly
166
+ // never offers these files in the install menu, so we are the only
167
+ // mechanism that refreshes them.
168
+ if (existsSync(item.dest) || isSymlink(item.dest)) {
169
+ unlinkSync(item.dest);
170
+ }
171
+
172
+ if (method === "symlink") {
173
+ symlinkSync(item.src, item.dest);
174
+ } else {
175
+ // copyFileSync handles plain files; for the SKILL.md case the source
176
+ // may have sibling support files in some skills — but
177
+ // guided-workspace-setup is a single-file skill, so copyFileSync is
178
+ // fine. Switch to cpSync if that ever changes.
179
+ copyFileSync(item.src, item.dest);
180
+ }
181
+ written.push({ ...item, method });
182
+ } catch (err) {
183
+ skipped.push({ ...item, error: err.message });
184
+ }
185
+ }
186
+
187
+ return { written, skipped, removed, warnings };
188
+ }
189
+
190
+ /**
191
+ * Remove every bootstrap artifact this module knows how to write. Called
192
+ * by guided-workspace-setup at the end of Step 10 unless the user chose
193
+ * to keep the installer commands. After cleanup, the only way back to
194
+ * /setup-agent-skills is to re-run `npx @chankov/agent-skills init`.
195
+ *
196
+ * The same `agent` value must be supplied that was used at bootstrap time —
197
+ * we don't have a tracking file, so we delete based on the plan map.
198
+ *
199
+ * @param {object} opts
200
+ * @param {string} opts.agent
201
+ * @param {string} opts.workspace
202
+ * @param {boolean} [opts.dryRun]
203
+ * @returns {{removed:string[], kept:string[], warnings:string[]}}
204
+ */
205
+ export function cleanupInstaller({ agent, workspace, dryRun = false }) {
206
+ const planned = plan({ agent, sourceRoot: workspace, workspace });
207
+ const removed = [], kept = [], warnings = [];
208
+
209
+ for (const item of planned) {
210
+ if (!existsSync(item.dest) && !isSymlink(item.dest)) {
211
+ kept.push(item.dest); // already gone — count it as a no-op, not an error
212
+ continue;
213
+ }
214
+ if (dryRun) {
215
+ removed.push(item.dest);
216
+ continue;
217
+ }
218
+ try {
219
+ const lst = lstatSync(item.dest);
220
+ if (lst.isDirectory() && !lst.isSymbolicLink()) {
221
+ rmSync(item.dest, { recursive: true });
222
+ } else {
223
+ unlinkSync(item.dest);
224
+ }
225
+ removed.push(item.dest);
226
+
227
+ // If we removed the only file in a parent directory we created
228
+ // (.claude/skills/guided-workspace-setup/), prune the directory too.
229
+ pruneEmptyDirsUpTo(dirname(item.dest), workspace);
230
+ } catch (err) {
231
+ warnings.push(`could not remove ${relative(workspace, item.dest)}: ${err.message}`);
232
+ }
233
+ }
234
+
235
+ return { removed, kept, warnings };
236
+ }
237
+
238
+ function pruneEmptyDirsUpTo(dir, workspace) {
239
+ // Walk upward removing empty parent dirs until we hit a non-empty one or
240
+ // the workspace root. Never delete the workspace itself.
241
+ try {
242
+ while (dir !== workspace && dir.startsWith(workspace)) {
243
+ const entries = readdirSync(dir);
244
+ if (entries.length > 0) return;
245
+ rmdirSync(dir);
246
+ dir = dirname(dir);
247
+ }
248
+ } catch { /* prune is best-effort */ }
249
+ }
250
+
251
+ function isSymlink(path) {
252
+ try { return lstatSync(path).isSymbolicLink(); }
253
+ catch { return false; }
254
+ }
package/bin/lib/doctor.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Doctor scan — deterministic preflight extracted from
2
2
  // guided-workspace-setup Step 5. Both `agent-skills doctor` (CLI) and the
3
- // `/doctor` slash command call into this so behaviour cannot drift.
3
+ // `/doctor-agent-skills` slash command call into this so behaviour cannot drift.
4
4
  //
5
5
  // Two classes of findings:
6
6
  // 1. Broken symlinks — links whose source has been moved, renamed, or deleted
@@ -14,7 +14,7 @@ Each skill is a Markdown file (`SKILL.md`) that describes a specific engineering
14
14
  |---|---|---|
15
15
  | **Most users** — you want to use the skills in your projects | `npx @chankov/agent-skills init` | One command; semver updates; cross-platform; no source dir to babysit. See [docs/npm-install.md](npm-install.md). |
16
16
  | **Claude Code users** — you live in Claude Code and want plugin-managed updates | `/plugin marketplace add chankov/agent-skills` | Best UX inside Claude Code; marketplace handles the lifecycle. |
17
- | **Skill authors / contributors** — you want to edit the skills and have changes flow into every connected workspace | `git clone` + `symlink` mode in `/setup` | Edit-in-place; every connected workspace sees the change instantly. |
17
+ | **Skill authors / contributors** — you want to edit the skills and have changes flow into every connected workspace | `git clone` + `symlink` mode in `/setup-agent-skills` | Edit-in-place; every connected workspace sees the change instantly. |
18
18
 
19
19
  All three converge on the same `guided-workspace-setup` skill — they only differ in how the source files reach your workspace. None is being deprecated.
20
20
 
@@ -124,7 +124,7 @@ The `.claude/commands/` directory contains slash commands for Claude Code:
124
124
 
125
125
  | Command | Skill Invoked |
126
126
  |---------|---------------|
127
- | `/setup` | guided-workspace-setup |
127
+ | `/setup-agent-skills` | guided-workspace-setup |
128
128
  | `/spec` | spec-driven-development |
129
129
  | `/plan` | planning-and-task-breakdown |
130
130
  | `/build` | incremental-implementation + test-driven-development |
@@ -31,18 +31,41 @@ So:
31
31
  # In the workspace you want to configure:
32
32
  npx @chankov/agent-skills init
33
33
  # Then open your coding agent in this directory and run:
34
- # /setup
34
+ # /setup-agent-skills
35
35
  ```
36
36
 
37
37
  That's it. `npx` fetches the package, the CLI detects your coding agent and
38
- prints the next-step command, and `/setup` runs the full guided install
38
+ prints the next-step command, and `/setup-agent-skills` runs the full guided install
39
39
  inside your agent.
40
40
 
41
41
  ## Commands
42
42
 
43
43
  ### `npx @chankov/agent-skills init`
44
44
 
45
- Materializes the package and hands off to `/setup`.
45
+ Materializes the package, **bootstraps the installer artifacts** into the
46
+ workspace (so the agent has a `/setup-agent-skills` and `/doctor-agent-skills` command to invoke),
47
+ and hands off to `/setup-agent-skills`.
48
+
49
+ What `init` writes per agent:
50
+
51
+ | Agent | Files written to the workspace |
52
+ |---|---|
53
+ | `claude-code` | `.claude/commands/setup-agent-skills.md`, `.claude/commands/doctor-agent-skills.md`, `.claude/skills/guided-workspace-setup/SKILL.md` |
54
+ | `pi` | `.pi/prompts/setup-agent-skills.md`, `.pi/prompts/doctor-agent-skills.md`, `.pi/skills/guided-workspace-setup/SKILL.md` |
55
+ | `opencode` | `.opencode/commands/as-setup-agent-skills.md`, `.opencode/commands/as-doctor-agent-skills.md`, `.opencode/skills/guided-workspace-setup/SKILL.md` |
56
+
57
+ These are **just the plumbing** — the slash commands, plus the skill they
58
+ invoke. The actual catalogue (spec-driven-development, code-reviewer,
59
+ test-engineer, pi extensions, …) is picked by you inside `/setup-agent-skills`. Re-run
60
+ `init` to refresh the plumbing after a package upgrade; bootstrap files
61
+ are always overwritten because they're scaffolding, not user data.
62
+
63
+ After `/setup-agent-skills` finishes its install pass, **the bootstrap files
64
+ are removed by default** so they don't clutter your agent's slash-command
65
+ list. Re-run `npx @chankov/agent-skills init` whenever you want
66
+ `/setup-agent-skills` back. To keep them in place across runs, reply `keep`
67
+ to the Step 9 confirmation prompt — the skill will record
68
+ `keep-installer: true` in `.ai/agent-skills-setup.md`.
46
69
 
47
70
  | Flag | Default | Purpose |
48
71
  |------|---------|---------|
@@ -60,7 +83,7 @@ npx @chankov/agent-skills init --workspace ~/projects/foo --method symlink
60
83
 
61
84
  Deterministic preflight scan — walks every install-target directory, lists
62
85
  broken symlinks and stale persona references, and offers fixes. Same scan
63
- that `/doctor` runs inside the agent.
86
+ that `/doctor-agent-skills` runs inside the agent.
64
87
 
65
88
  | Flag | Default | Purpose |
66
89
  |------|---------|---------|
@@ -78,13 +101,13 @@ npx @chankov/agent-skills doctor -y
78
101
  Reads the workspace's `.ai/agent-skills-setup.md`, compares the recorded
79
102
  package version against the installed package version, and prints the next
80
103
  step. The actual diff-aware refresh runs inside the coding agent via
81
- `/setup`.
104
+ `/setup-agent-skills`.
82
105
 
83
106
  ```bash
84
107
  # Upgrade the package itself first, then check the delta:
85
108
  npm install -g @chankov/agent-skills@latest
86
109
  npx agent-skills update --workspace .
87
- # Then open your agent and run /setup to review per-artifact diffs.
110
+ # Then open your agent and run /setup-agent-skills to review per-artifact diffs.
88
111
  ```
89
112
 
90
113
  ## Versioning
@@ -137,7 +160,7 @@ npm is the recommended path for most users. The other two stay supported:
137
160
  - **[Claude Code plugin marketplace](../README.md#quick-start)** — best UX
138
161
  inside Claude Code. Same skills, marketplace-managed updates.
139
162
  - **Git clone + symlinks** — best for skill authors and contributors. Clone
140
- the repo, run `/setup` from there, choose `symlink` in Step 8. Updates
163
+ the repo, run `/setup-agent-skills` from there, choose `symlink` in Step 8. Updates
141
164
  flow through `git pull`. Symlinks need Developer Mode on Windows.
142
165
 
143
166
  All three paths converge on the same `guided-workspace-setup` skill — the
@@ -153,7 +176,7 @@ npx --yes @chankov/agent-skills@latest init --agent claude-code --method copy --
153
176
  ```
154
177
 
155
178
  `doctor` accepts `--yes` for non-interactive repair. Note that the
156
- LLM-driven `/setup` flow is not CI-runnable by design — confirmation gates
179
+ LLM-driven `/setup-agent-skills` flow is not CI-runnable by design — confirmation gates
157
180
  exist precisely so a human approves every write.
158
181
 
159
182
  ## Receiving update notifications
@@ -182,15 +205,15 @@ If the cache is stale, a detached background process refreshes it for the
182
205
 
183
206
  ### 2. Claude Code session-start hook
184
207
 
185
- When `hooks/session-start.sh` is installed (offered in Group 18 of `/setup`),
208
+ When `hooks/session-start.sh` is installed (offered in Group 18 of `/setup-agent-skills`),
186
209
  every new Claude Code session runs the check with a 3-second wall-clock cap.
187
210
  If an upgrade is available, the banner is injected into the session context
188
211
  so Claude can mention it on its first turn — e.g. *"Note: agent-skills 0.2.0
189
- is available; want me to apply it via `/setup`?"*
212
+ is available; want me to apply it via `/setup-agent-skills`?"*
190
213
 
191
214
  ### 3. pi extension (`agent-skills-update-check`)
192
215
 
193
- When installed (offered in Group 10 of `/setup`), the extension fires on the
216
+ When installed (offered in Group 10 of `/setup-agent-skills`), the extension fires on the
194
217
  first `agent_start` event of each pi session and emits a `ctx.ui.notify`
195
218
  message in the pi UI if a newer version is published. Reads the same cache
196
219
  as the CLI — no double-fetching.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chankov/agent-skills",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Production-grade engineering skills for AI coding agents. Ships skills, agent personas, slash commands, and pi extensions, with a thin CLI that hands off to the LLM-driven guided setup.",
5
5
  "keywords": [
6
6
  "ai",
@@ -108,7 +108,7 @@ Present findings in a single table:
108
108
 
109
109
  Then ask, multi-select: which fixes to apply now. Apply only the picked ones; record skipped items so the install menu can surface them again. Append a `## doctor-runs` line to `.ai/agent-skills-setup.md` with the date, agent, phase (`preflight`), and `repaired` / `deleted` / `skipped` counts.
110
110
 
111
- The doctor scan is also exposed standalone as `/doctor` — running it outside a setup pass is this same scan-and-repair flow without the rest of the install menu.
111
+ The doctor scan is also exposed standalone as `/doctor-agent-skills` — running it outside a setup pass is this same scan-and-repair flow without the rest of the install menu.
112
112
 
113
113
  ### 6. Present the install menu
114
114
 
@@ -207,6 +207,8 @@ Ask `copy` or `symlink` for this run.
207
207
 
208
208
  Present the full set as one summary table — artifacts to add, update, and remove; their resolved target paths; the chosen install method; and the changes to both `.ai/` files. When the version delta from Step 4 is non-empty, lead the summary with a one-line "Changes since `v<recorded>` → `v<current>`" block sourced from `CHANGELOG.md` (only the entries between the two versions, not the full file). Ask the user to confirm, and write nothing until they do.
209
209
 
210
+ **Installer cleanup line.** The summary always ends with one line stating that the installer slash commands (`/setup-agent-skills`, `/doctor-agent-skills` — or `/as-*-agent-skills` for OpenCode — plus the `guided-workspace-setup` skill body) will be removed after apply, so they do not pollute the user's slash-command list. Add the verbatim suffix: *"Reply `keep` to leave them in place; re-run `npx @chankov/agent-skills init` later if removed."* If the user replies `keep`, record `keep-installer: true` in `## workspace-summary` and skip Step 10b. Otherwise the default is to remove them.
211
+
210
212
  ### 10. Apply the setup
211
213
 
212
214
  Apply the changes: create directories, add or update selected artifacts, and remove deselected ones — **bound by the removal-scope rule from Step 6**. Before deleting any target, verify both conditions: (a) the name is in the agent-skills inventory and (b) the item is either listed in `## install-status` or is a symlink resolving into the source repo. If either check fails, skip the deletion silently and log the path under a "Skipped — not owned by agent-skills" line in the final report.
@@ -217,10 +219,36 @@ For settings files (`.claude/settings.json` and equivalents), edit only the agen
217
219
 
218
220
  Then write both `.ai/` files: the agreed override sections from Step 7 into `.ai/agent-skills-overrides.md`, and the install record — artifacts, target paths, method, **package version**, date — into `.ai/agent-skills-setup.md`. The `version:` line in `## workspace-summary` is set to the package version from Step 2; this is what the next re-run will compare against to compute the version delta.
219
221
 
222
+ ### 10b. Remove the installer artifacts (unless the user said `keep`)
223
+
224
+ After Step 10 has written the catalogue + the `.ai/` files, the installer files dropped by `npx @chankov/agent-skills init` — the `setup-agent-skills` / `doctor-agent-skills` slash commands and the `guided-workspace-setup` skill body itself — are no longer needed in the workspace. They were bootstrap plumbing, not part of the user's permanent install. Leaving them in place pollutes the agent's slash-command list and confuses re-runs (which should always go through `init`, not a stale local copy).
225
+
226
+ Default behaviour:
227
+
228
+ - **`keep-installer: true` in `## workspace-summary`** → skip this step. The files stay.
229
+ - **Otherwise** → run the cleanup. Delete every file the bootstrap wrote for the chosen agent:
230
+
231
+ | Agent | Files removed |
232
+ |---|---|
233
+ | `claude-code` | `.claude/commands/setup-agent-skills.md`, `.claude/commands/doctor-agent-skills.md`, `.claude/skills/guided-workspace-setup/SKILL.md` |
234
+ | `pi` | `.pi/prompts/setup-agent-skills.md`, `.pi/prompts/doctor-agent-skills.md`, `.pi/skills/guided-workspace-setup/SKILL.md` |
235
+ | `opencode` | `.opencode/commands/as-setup-agent-skills.md`, `.opencode/commands/as-doctor-agent-skills.md`, `.opencode/skills/guided-workspace-setup/SKILL.md` |
236
+
237
+ After deleting, prune any directories that were created solely for these files (e.g. `.claude/skills/guided-workspace-setup/`) — never prune a directory that contains other files.
238
+
239
+ Note: the skill body file you are removing here is the same file the agent is *currently executing*. Filesystem removal does not interrupt the in-memory copy — finish this step, then Step 11, then return as normal.
240
+
241
+ If `cleanupInstaller` is available via the CLI (`npx @chankov/agent-skills cleanup-installer --agent <agent> --workspace <path>`), invoking it is equivalent to the manual deletions above; either path is acceptable. Failures (permission denied, file already gone) are logged but do not abort the apply.
242
+
220
243
  ### 11. Verify and report
221
244
 
222
245
  Re-scan the install-target directories one more time and confirm: every selected artifact exists at its target path, every deselected one is gone, and zero broken symlinks remain. Also re-read `.ai/agent-skills-setup.md` and verify the `version:` line matches the package version from Step 2 — a mismatch here means the apply pass did not stamp the new version, and must be corrected before the next re-run computes the wrong delta. If the post-apply scan surfaces any new breakage, treat it as a doctor finding and offer the same repair options as Step 5, then append a second `## doctor-runs` line with `phase: postflight`. List what changed, point the user at `.ai/agent-skills-overrides.md` and `.ai/agent-skills-setup.md`, and suggest loading `using-agent-skills` first in their next session.
223
246
 
247
+ Close the report with one line explaining the installer-cleanup outcome:
248
+
249
+ - If Step 10b ran: *"Installer slash commands removed from your workspace. Re-run `npx @chankov/agent-skills init` if you need `/setup-agent-skills` back."*
250
+ - If Step 10b was skipped (`keep-installer: true`): *"Installer slash commands kept in place per your choice. `/setup-agent-skills` and `/doctor-agent-skills` remain available."*
251
+
224
252
  ## Common Rationalizations
225
253
 
226
254
  | Rationalization | Reality |
@@ -237,10 +265,13 @@ Re-scan the install-target directories one more time and confirm: every selected
237
265
  | "I'll record the full install detail in the overrides file too — one place is simpler." | Other skills load the overrides file on every run. Install detail belongs only in `agent-skills-setup.md`; padding the overrides file taxes every later session. |
238
266
  | "There's an unfamiliar skill in `.claude/skills/` — the user must have forgotten to uncheck it, I'll remove it." | The removal scope rule exists exactly to prevent this. If the name is not in the agent-skills inventory or not in `## install-status`, it is user-owned; leave it alone and log it as skipped. |
239
267
  | "The user wants a clean workspace — I'll prune custom hooks and unrelated MCP entries from `settings.json` too." | Setting-file edits are limited to agent-skills' own hook registrations. Touching anything else silently deletes work that does not belong to this skill. |
240
- | "`/setup` and `/doctor` are useful — I'll install them into the workspace so the user can re-run them locally." | They are installer commands; they ship with the source agent-skills repo and act on workspaces from there. Installing them into a target duplicates the install surface and gives the target a path to manipulate itself. |
268
+ | "`/setup-agent-skills` and `/doctor-agent-skills` are useful — I'll re-install them at the end of apply so the user can re-run them locally." | They are installer commands that the CLI bootstraps and the skill itself cleans up in Step 10b by default. Keeping them is opt-in via `keep` in Step 9. Re-installing them silently undoes the cleanup the user implicitly chose. |
241
269
  | "The recorded version differs from the current — I'll just refresh everything to the new source without showing the diff." | Conflicting upgrades (user-modified copy + source changed upstream) require the three-way diff to be shown in Step 6, with the row pre-unchecked. Refreshing silently overwrites work the user did between versions. |
242
270
  | "The `.versions/<recorded>/` snapshot is missing — I'll pretend the installed copy matches the recorded source and refresh anyway." | A missing snapshot means we cannot compute the three-way diff. The skill must fall back to "treat installed copy as canonical" and surface the missing snapshot in the row's status so the user can decide — never pretend a diff exists. |
243
271
  | "The workspace has no `version:` line — I'll silently stamp the current version and move on." | A pre-versioning workspace must be flagged in Step 4 and the user prompted: stamp the current version (assume copies match) or wipe and reinstall. Silent stamping hides a real decision. |
272
+ | "The user didn't say anything about the installer cleanup line — I'll leave the installer files in place to be safe." | The default is to remove. Step 9's confirmation line explicitly states the cleanup will happen unless the user replies `keep`. Silence is consent for the default, not opt-out from it. |
273
+ | "I'll add `setup-agent-skills` and `doctor-agent-skills` to the install menu so the user can pick whether to keep them." | They are still installer-only and excluded from the menu. The keep-vs-remove choice is the single Step 9 line, not a menu group — adding them to the menu re-opens the pollution we just fixed. |
274
+ | "The skill is currently executing; deleting its own file in Step 10b will crash mid-run." | The agent loads the skill into memory at the start of execution. Removing the file on disk does not unload the in-memory copy — Steps 10b and 11 complete normally before control returns. |
244
275
 
245
276
  ## Red Flags
246
277
 
@@ -265,6 +296,10 @@ Re-scan the install-target directories one more time and confirm: every selected
265
296
  - A `conflicting upgrade` row pre-checked, or the three-way diff omitted for it.
266
297
  - A pre-versioning workspace stamped with the current version without prompting the user first.
267
298
  - The post-apply `version:` line not matching the package version from Step 2.
299
+ - Step 9 summary missing the installer-cleanup line, or the line stated `keep` as the default.
300
+ - Installer files (`setup-agent-skills`, `doctor-agent-skills`, the `guided-workspace-setup` skill body) left in place without a recorded `keep-installer: true`.
301
+ - `setup-agent-skills` or `doctor-agent-skills` shown as install-menu rows.
302
+ - Step 11 report omitting the one-line installer-cleanup outcome.
268
303
 
269
304
  ## Verification
270
305
 
@@ -287,6 +322,9 @@ After completing the workflow, confirm:
287
322
  - [ ] When the version delta was non-empty, Step 9's summary led with the "Changes since v<recorded> → v<current>" block sourced from `CHANGELOG.md`.
288
323
  - [ ] Every `conflicting upgrade` row was rendered with its three-way diff in Step 6 and was not pre-checked.
289
324
  - [ ] A pre-versioning workspace was flagged in Step 4 and the user was prompted to stamp or wipe — not silently stamped.
325
+ - [ ] Step 9 summary ended with the installer-cleanup line: states remove-by-default and offers `keep` as the opt-out.
326
+ - [ ] Step 10b ran (or was explicitly skipped because `keep-installer: true`); the installer files are absent from the workspace unless the user opted to keep them.
327
+ - [ ] Step 11 report includes the one-line installer-cleanup outcome.
290
328
  - [ ] No broken symlinks remain in any of the scanned install-target directories.
291
329
  - [ ] No YAML config references a removed persona name.
292
330
  - [ ] No secrets were written to either `.ai/` file.
File without changes