@chief-clancy/terminal 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 (217) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/dist/hooks/clancy-branch-guard.js +1 -0
  4. package/dist/hooks/clancy-check-update.js +2 -0
  5. package/dist/hooks/clancy-context-monitor.js +9 -0
  6. package/dist/hooks/clancy-credential-guard.js +2 -0
  7. package/dist/hooks/clancy-drift-detector.js +1 -0
  8. package/dist/hooks/clancy-notification.js +1 -0
  9. package/dist/hooks/clancy-post-compact.js +2 -0
  10. package/dist/hooks/clancy-statusline.js +1 -0
  11. package/dist/index.d.ts +24 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +23 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/installer/file-ops/file-ops.d.ts +35 -0
  16. package/dist/installer/file-ops/file-ops.d.ts.map +1 -0
  17. package/dist/installer/file-ops/file-ops.js +95 -0
  18. package/dist/installer/file-ops/file-ops.js.map +1 -0
  19. package/dist/installer/file-ops/index.d.ts +2 -0
  20. package/dist/installer/file-ops/index.d.ts.map +1 -0
  21. package/dist/installer/file-ops/index.js +2 -0
  22. package/dist/installer/file-ops/index.js.map +1 -0
  23. package/dist/installer/hook-installer/hook-installer.d.ts +22 -0
  24. package/dist/installer/hook-installer/hook-installer.d.ts.map +1 -0
  25. package/dist/installer/hook-installer/hook-installer.js +213 -0
  26. package/dist/installer/hook-installer/hook-installer.js.map +1 -0
  27. package/dist/installer/hook-installer/index.d.ts +2 -0
  28. package/dist/installer/hook-installer/index.d.ts.map +1 -0
  29. package/dist/installer/hook-installer/index.js +2 -0
  30. package/dist/installer/hook-installer/index.js.map +1 -0
  31. package/dist/installer/install/index.d.ts +3 -0
  32. package/dist/installer/install/index.d.ts.map +1 -0
  33. package/dist/installer/install/index.js +2 -0
  34. package/dist/installer/install/index.js.map +1 -0
  35. package/dist/installer/install/install.d.ts +124 -0
  36. package/dist/installer/install/install.d.ts.map +1 -0
  37. package/dist/installer/install/install.js +255 -0
  38. package/dist/installer/install/install.js.map +1 -0
  39. package/dist/installer/manifest/index.d.ts +2 -0
  40. package/dist/installer/manifest/index.d.ts.map +1 -0
  41. package/dist/installer/manifest/index.js +2 -0
  42. package/dist/installer/manifest/index.js.map +1 -0
  43. package/dist/installer/manifest/manifest.d.ts +46 -0
  44. package/dist/installer/manifest/manifest.d.ts.map +1 -0
  45. package/dist/installer/manifest/manifest.js +180 -0
  46. package/dist/installer/manifest/manifest.js.map +1 -0
  47. package/dist/installer/prompts/index.d.ts +2 -0
  48. package/dist/installer/prompts/index.d.ts.map +1 -0
  49. package/dist/installer/prompts/index.js +2 -0
  50. package/dist/installer/prompts/index.js.map +1 -0
  51. package/dist/installer/prompts/prompts.d.ts +34 -0
  52. package/dist/installer/prompts/prompts.d.ts.map +1 -0
  53. package/dist/installer/prompts/prompts.js +28 -0
  54. package/dist/installer/prompts/prompts.js.map +1 -0
  55. package/dist/installer/role-filter/index.d.ts +2 -0
  56. package/dist/installer/role-filter/index.d.ts.map +1 -0
  57. package/dist/installer/role-filter/index.js +2 -0
  58. package/dist/installer/role-filter/index.js.map +1 -0
  59. package/dist/installer/role-filter/role-filter.d.ts +33 -0
  60. package/dist/installer/role-filter/role-filter.d.ts.map +1 -0
  61. package/dist/installer/role-filter/role-filter.js +91 -0
  62. package/dist/installer/role-filter/role-filter.js.map +1 -0
  63. package/dist/installer/shared/fs-errors/fs-errors.d.ts +3 -0
  64. package/dist/installer/shared/fs-errors/fs-errors.d.ts.map +1 -0
  65. package/dist/installer/shared/fs-errors/fs-errors.js +7 -0
  66. package/dist/installer/shared/fs-errors/fs-errors.js.map +1 -0
  67. package/dist/installer/shared/fs-errors/index.d.ts +2 -0
  68. package/dist/installer/shared/fs-errors/index.d.ts.map +1 -0
  69. package/dist/installer/shared/fs-errors/index.js +2 -0
  70. package/dist/installer/shared/fs-errors/index.js.map +1 -0
  71. package/dist/installer/shared/fs-guards/fs-guards.d.ts +3 -0
  72. package/dist/installer/shared/fs-guards/fs-guards.d.ts.map +1 -0
  73. package/dist/installer/shared/fs-guards/fs-guards.js +18 -0
  74. package/dist/installer/shared/fs-guards/fs-guards.js.map +1 -0
  75. package/dist/installer/shared/fs-guards/index.d.ts +2 -0
  76. package/dist/installer/shared/fs-guards/index.d.ts.map +1 -0
  77. package/dist/installer/shared/fs-guards/index.js +2 -0
  78. package/dist/installer/shared/fs-guards/index.js.map +1 -0
  79. package/dist/installer/shared/type-guards/index.d.ts +2 -0
  80. package/dist/installer/shared/type-guards/index.d.ts.map +1 -0
  81. package/dist/installer/shared/type-guards/index.js +2 -0
  82. package/dist/installer/shared/type-guards/index.js.map +1 -0
  83. package/dist/installer/shared/type-guards/type-guards.d.ts +8 -0
  84. package/dist/installer/shared/type-guards/type-guards.d.ts.map +1 -0
  85. package/dist/installer/shared/type-guards/type-guards.js +10 -0
  86. package/dist/installer/shared/type-guards/type-guards.js.map +1 -0
  87. package/dist/installer/ui/index.d.ts +2 -0
  88. package/dist/installer/ui/index.d.ts.map +1 -0
  89. package/dist/installer/ui/index.js +2 -0
  90. package/dist/installer/ui/index.js.map +1 -0
  91. package/dist/installer/ui/ui.d.ts +23 -0
  92. package/dist/installer/ui/ui.d.ts.map +1 -0
  93. package/dist/installer/ui/ui.js +121 -0
  94. package/dist/installer/ui/ui.js.map +1 -0
  95. package/dist/runner/autopilot/autopilot.d.ts +71 -0
  96. package/dist/runner/autopilot/autopilot.d.ts.map +1 -0
  97. package/dist/runner/autopilot/autopilot.js +206 -0
  98. package/dist/runner/autopilot/autopilot.js.map +1 -0
  99. package/dist/runner/autopilot/index.d.ts +2 -0
  100. package/dist/runner/autopilot/index.d.ts.map +1 -0
  101. package/dist/runner/autopilot/index.js +2 -0
  102. package/dist/runner/autopilot/index.js.map +1 -0
  103. package/dist/runner/cli-bridge/cli-bridge.d.ts +34 -0
  104. package/dist/runner/cli-bridge/cli-bridge.d.ts.map +1 -0
  105. package/dist/runner/cli-bridge/cli-bridge.js +53 -0
  106. package/dist/runner/cli-bridge/cli-bridge.js.map +1 -0
  107. package/dist/runner/cli-bridge/index.d.ts +2 -0
  108. package/dist/runner/cli-bridge/index.d.ts.map +1 -0
  109. package/dist/runner/cli-bridge/index.js +2 -0
  110. package/dist/runner/cli-bridge/index.js.map +1 -0
  111. package/dist/runner/dep-factory/deliver-phase.d.ts +24 -0
  112. package/dist/runner/dep-factory/deliver-phase.d.ts.map +1 -0
  113. package/dist/runner/dep-factory/deliver-phase.js +57 -0
  114. package/dist/runner/dep-factory/deliver-phase.js.map +1 -0
  115. package/dist/runner/dep-factory/dep-factory.d.ts +38 -0
  116. package/dist/runner/dep-factory/dep-factory.d.ts.map +1 -0
  117. package/dist/runner/dep-factory/dep-factory.js +193 -0
  118. package/dist/runner/dep-factory/dep-factory.js.map +1 -0
  119. package/dist/runner/dep-factory/index.d.ts +2 -0
  120. package/dist/runner/dep-factory/index.d.ts.map +1 -0
  121. package/dist/runner/dep-factory/index.js +2 -0
  122. package/dist/runner/dep-factory/index.js.map +1 -0
  123. package/dist/runner/dep-factory/invoke-phase.d.ts +20 -0
  124. package/dist/runner/dep-factory/invoke-phase.d.ts.map +1 -0
  125. package/dist/runner/dep-factory/invoke-phase.js +45 -0
  126. package/dist/runner/dep-factory/invoke-phase.js.map +1 -0
  127. package/dist/runner/implement/implement.d.ts +38 -0
  128. package/dist/runner/implement/implement.d.ts.map +1 -0
  129. package/dist/runner/implement/implement.js +61 -0
  130. package/dist/runner/implement/implement.js.map +1 -0
  131. package/dist/runner/implement/index.d.ts +2 -0
  132. package/dist/runner/implement/index.d.ts.map +1 -0
  133. package/dist/runner/implement/index.js +2 -0
  134. package/dist/runner/implement/index.js.map +1 -0
  135. package/dist/runner/notify/index.d.ts +2 -0
  136. package/dist/runner/notify/index.d.ts.map +1 -0
  137. package/dist/runner/notify/index.js +2 -0
  138. package/dist/runner/notify/index.js.map +1 -0
  139. package/dist/runner/notify/notify.d.ts +49 -0
  140. package/dist/runner/notify/notify.d.ts.map +1 -0
  141. package/dist/runner/notify/notify.js +90 -0
  142. package/dist/runner/notify/notify.js.map +1 -0
  143. package/dist/runner/prompt-builder/index.d.ts +2 -0
  144. package/dist/runner/prompt-builder/index.d.ts.map +1 -0
  145. package/dist/runner/prompt-builder/index.js +2 -0
  146. package/dist/runner/prompt-builder/index.js.map +1 -0
  147. package/dist/runner/prompt-builder/prompt-builder.d.ts +53 -0
  148. package/dist/runner/prompt-builder/prompt-builder.d.ts.map +1 -0
  149. package/dist/runner/prompt-builder/prompt-builder.js +122 -0
  150. package/dist/runner/prompt-builder/prompt-builder.js.map +1 -0
  151. package/dist/runner/session-report/index.d.ts +2 -0
  152. package/dist/runner/session-report/index.d.ts.map +1 -0
  153. package/dist/runner/session-report/index.js +2 -0
  154. package/dist/runner/session-report/index.js.map +1 -0
  155. package/dist/runner/session-report/session-report.d.ts +81 -0
  156. package/dist/runner/session-report/session-report.d.ts.map +1 -0
  157. package/dist/runner/session-report/session-report.js +227 -0
  158. package/dist/runner/session-report/session-report.js.map +1 -0
  159. package/dist/runner/shared/types.d.ts +30 -0
  160. package/dist/runner/shared/types.d.ts.map +1 -0
  161. package/dist/runner/shared/types.js +2 -0
  162. package/dist/runner/shared/types.js.map +1 -0
  163. package/dist/shared/ansi/ansi.d.ts +59 -0
  164. package/dist/shared/ansi/ansi.d.ts.map +1 -0
  165. package/dist/shared/ansi/ansi.js +59 -0
  166. package/dist/shared/ansi/ansi.js.map +1 -0
  167. package/dist/shared/ansi/index.d.ts +2 -0
  168. package/dist/shared/ansi/index.d.ts.map +1 -0
  169. package/dist/shared/ansi/index.js +2 -0
  170. package/dist/shared/ansi/index.js.map +1 -0
  171. package/package.json +52 -0
  172. package/src/agents/agents.test.ts +57 -0
  173. package/src/agents/arch-agent.md +80 -0
  174. package/src/agents/concerns-agent.md +96 -0
  175. package/src/agents/design-agent.md +146 -0
  176. package/src/agents/devils-advocate.md +54 -0
  177. package/src/agents/quality-agent.md +178 -0
  178. package/src/agents/tech-agent.md +101 -0
  179. package/src/agents/verification-gate.md +128 -0
  180. package/src/roles/implementer/commands/autopilot.md +11 -0
  181. package/src/roles/implementer/commands/dry-run.md +15 -0
  182. package/src/roles/implementer/commands/implement.md +19 -0
  183. package/src/roles/implementer/workflows/autopilot.md +136 -0
  184. package/src/roles/implementer/workflows/implement.md +161 -0
  185. package/src/roles/planner/commands/approve-plan.md +11 -0
  186. package/src/roles/planner/commands/plan.md +22 -0
  187. package/src/roles/planner/workflows/approve-plan.md +970 -0
  188. package/src/roles/planner/workflows/plan.md +868 -0
  189. package/src/roles/reviewer/commands/logs.md +7 -0
  190. package/src/roles/reviewer/commands/review.md +9 -0
  191. package/src/roles/reviewer/commands/status.md +9 -0
  192. package/src/roles/reviewer/workflows/logs.md +109 -0
  193. package/src/roles/reviewer/workflows/review.md +197 -0
  194. package/src/roles/reviewer/workflows/status.md +142 -0
  195. package/src/roles/roles.test.ts +87 -0
  196. package/src/roles/setup/commands/doctor.md +7 -0
  197. package/src/roles/setup/commands/help.md +80 -0
  198. package/src/roles/setup/commands/init.md +7 -0
  199. package/src/roles/setup/commands/map-codebase.md +17 -0
  200. package/src/roles/setup/commands/settings.md +7 -0
  201. package/src/roles/setup/commands/uninstall.md +5 -0
  202. package/src/roles/setup/commands/update-docs.md +9 -0
  203. package/src/roles/setup/commands/update.md +13 -0
  204. package/src/roles/setup/workflows/doctor.md +131 -0
  205. package/src/roles/setup/workflows/init.md +1096 -0
  206. package/src/roles/setup/workflows/map-codebase.md +130 -0
  207. package/src/roles/setup/workflows/scaffold.md +872 -0
  208. package/src/roles/setup/workflows/settings.md +958 -0
  209. package/src/roles/setup/workflows/uninstall.md +170 -0
  210. package/src/roles/setup/workflows/update-docs.md +95 -0
  211. package/src/roles/setup/workflows/update.md +287 -0
  212. package/src/roles/strategist/commands/approve-brief.md +23 -0
  213. package/src/roles/strategist/commands/brief.md +29 -0
  214. package/src/roles/strategist/workflows/approve-brief.md +1540 -0
  215. package/src/roles/strategist/workflows/brief.md +1330 -0
  216. package/src/templates/CLAUDE.md +101 -0
  217. package/src/templates/templates.test.ts +53 -0
@@ -0,0 +1,170 @@
1
+ # Clancy Uninstall Workflow
2
+
3
+ ## Overview
4
+
5
+ Remove Clancy's slash commands from the local project, globally, or both. Optionally remove the `.clancy/` project folder (which includes `.clancy/.env`). Clean up CLAUDE.md, .gitignore, and .prettierignore changes made during init.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Detect install locations
10
+
11
+ Check both locations silently. Each install has two parts — commands and workflows:
12
+
13
+ - **Project-local commands:** `.claude/commands/clancy/`
14
+ - **Project-local workflows:** `.claude/clancy/`
15
+ - **Global commands:** `~/.claude/commands/clancy/`
16
+ - **Global workflows:** `~/.claude/clancy/`
17
+
18
+ | Scenario | Action |
19
+ | --------------------- | ------------------------------------------------------------------------------------------------ |
20
+ | Found in both | Ask: "Remove from project, globally, or both?" → `[1] Project only` `[2] Global only` `[3] Both` |
21
+ | Found in project only | Proceed with project removal |
22
+ | Found globally only | Proceed with global removal |
23
+ | Found in neither | Print "Clancy commands not found. Nothing to remove." and stop |
24
+
25
+ ---
26
+
27
+ ## Step 2 — Confirm before removing commands
28
+
29
+ Show exactly this message, filling in the detected location:
30
+
31
+ ```
32
+ 🚨 Clancy — Uninstall
33
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
34
+
35
+ This will remove Clancy's slash commands from [location].
36
+ Your .clancy/ folder will not be touched.
37
+ Continue? (yes / no)
38
+ ```
39
+
40
+ - `no` → print "Nothing removed." and stop
41
+ - `yes` → proceed to remove commands, workflows, hooks, and settings entries (Steps 2a–2c)
42
+
43
+ If "Both" was chosen in Step 1: confirm once for both, remove everything for both locations.
44
+
45
+ ### Step 2a — Remove command and workflow directories
46
+
47
+ Delete both the commands directory and the workflows directory for the chosen location(s):
48
+
49
+ - Project-local: `.claude/commands/clancy/` and `.claude/clancy/`
50
+ - Global: `~/.claude/commands/clancy/` and `~/.claude/clancy/`
51
+
52
+ Print: `✅ Clancy commands removed from [location].`
53
+
54
+ ### Step 2b — Remove hooks
55
+
56
+ For each location being removed, delete these hook files if they exist:
57
+
58
+ - Project-local: `.claude/hooks/clancy-branch-guard.js`, `.claude/hooks/clancy-check-update.js`, `.claude/hooks/clancy-context-monitor.js`, `.claude/hooks/clancy-credential-guard.js`, `.claude/hooks/clancy-drift-detector.js`, `.claude/hooks/clancy-notification.js`, `.claude/hooks/clancy-post-compact.js`, `.claude/hooks/clancy-statusline.js`
59
+ - Global: `~/.claude/hooks/clancy-branch-guard.js`, `~/.claude/hooks/clancy-check-update.js`, `~/.claude/hooks/clancy-context-monitor.js`, `~/.claude/hooks/clancy-credential-guard.js`, `~/.claude/hooks/clancy-drift-detector.js`, `~/.claude/hooks/clancy-notification.js`, `~/.claude/hooks/clancy-post-compact.js`, `~/.claude/hooks/clancy-statusline.js`
60
+
61
+ Also remove the hooks `package.json` if it exists (`.claude/hooks/package.json` or `~/.claude/hooks/package.json`) — this was written by the installer for CJS compatibility.
62
+
63
+ Then remove the Clancy hook registrations from the corresponding `settings.json` (`.claude/settings.json` for local, `~/.claude/settings.json` for global):
64
+
65
+ - Remove any entry in `hooks.SessionStart` whose `command` contains `clancy-check-update`
66
+ - Remove any entry in `hooks.PreToolUse` whose `command` contains `clancy-credential-guard`
67
+ - Remove any entry in `hooks.PreToolUse` whose `command` contains `clancy-branch-guard`
68
+ - Remove any entry in `hooks.PostToolUse` whose `command` contains `clancy-context-monitor`
69
+ - Remove any entry in `hooks.PostToolUse` whose `command` contains `clancy-drift-detector`
70
+ - Remove any entry in `hooks.PostCompact` whose `command` contains `clancy-post-compact`
71
+ - Remove any entry in `hooks.Notification` whose `command` contains `clancy-notification`
72
+ - Remove the `statusLine` key if its `command` value contains `clancy-statusline`
73
+ - If removing an entry leaves any `hooks.*` array empty, remove the key entirely
74
+
75
+ Also remove the update check cache if it exists: `~/.claude/cache/clancy-update-check.json`
76
+
77
+ If `settings.json` does not exist or cannot be parsed, skip silently — do not create or overwrite it.
78
+
79
+ ---
80
+
81
+ ## Step 3 — Clean up CLAUDE.md
82
+
83
+ Check whether `CLAUDE.md` exists in the current project directory.
84
+
85
+ If it does, check for Clancy markers (`<!-- clancy:start -->` and `<!-- clancy:end -->`):
86
+
87
+ **If markers found:**
88
+
89
+ Read the full file content. Determine whether Clancy created the file or appended to an existing one:
90
+
91
+ - **Clancy created it** (the file contains only whitespace outside the markers — no meaningful content before `<!-- clancy:start -->` or after `<!-- clancy:end -->`): delete the entire file.
92
+ - **Clancy appended to an existing file** (there is meaningful content outside the markers): remove everything from `<!-- clancy:start -->` through `<!-- clancy:end -->` (inclusive), plus any blank lines immediately before the start marker that were added as spacing. Write the cleaned file back.
93
+
94
+ Print `✅ CLAUDE.md cleaned up.` (or `✅ CLAUDE.md removed.` if deleted).
95
+
96
+ **If no markers found:** skip — Clancy didn't modify this file.
97
+
98
+ **If CLAUDE.md does not exist:** skip.
99
+
100
+ ---
101
+
102
+ ## Step 4 — Clean up .gitignore
103
+
104
+ Check whether `.gitignore` exists in the current project directory.
105
+
106
+ If it does, check whether it contains the Clancy entries (`# Clancy credentials` and/or `.clancy/.env`):
107
+
108
+ **If found:** remove the `# Clancy credentials` comment line and the `.clancy/.env` line. Also remove any blank line immediately before or after the removed block to avoid leaving double blank lines. Write the cleaned file back.
109
+
110
+ If the file is now empty (or contains only whitespace) after removal, delete it entirely — Clancy created it during init.
111
+
112
+ Print `✅ .gitignore cleaned up.` (or `✅ .gitignore removed.` if deleted).
113
+
114
+ **If not found:** skip — Clancy didn't modify this file.
115
+
116
+ **If .gitignore does not exist:** skip.
117
+
118
+ ---
119
+
120
+ ## Step 5 — Clean up .prettierignore
121
+
122
+ Check whether `.prettierignore` exists in the current project directory.
123
+
124
+ If it does, check whether it contains Clancy entries (`# Clancy generated files` and/or `.clancy/` and/or `.claude/commands/clancy/`):
125
+
126
+ **If found:** remove the `# Clancy generated files` comment line, the `.clancy/` line, and the `.claude/commands/clancy/` line. Also remove any blank line immediately before or after the removed block to avoid leaving double blank lines. Write the cleaned file back.
127
+
128
+ If the file is now empty (or contains only whitespace) after removal, delete it entirely — Clancy added those entries during init.
129
+
130
+ Print `✅ .prettierignore cleaned up.` (or `✅ .prettierignore removed.` if deleted).
131
+
132
+ **If not found:** skip — Clancy didn't modify this file.
133
+
134
+ **If .prettierignore does not exist:** skip.
135
+
136
+ ---
137
+
138
+ ## Step 6 — Offer to remove .clancy/ (if present)
139
+
140
+ Check whether `.clancy/` exists in the current project directory.
141
+
142
+ If it does, ask separately:
143
+
144
+ ```
145
+ .clancy/ contains your codebase docs, progress log, and credentials (.env).
146
+ Remove it too? This cannot be undone. (yes / no)
147
+ ```
148
+
149
+ - `no` → print "✅ .clancy/ kept — your docs and progress log are safe."
150
+ - `yes` → delete `.clancy/` and print "✅ .clancy/ removed."
151
+
152
+ If `.clancy/` does not exist, skip this step entirely.
153
+
154
+ ---
155
+
156
+ ## Step 7 — Final message
157
+
158
+ ```
159
+ ✅ Clancy uninstalled.
160
+
161
+ "You have the right to remain silent... goodbye, Clancy." — To reinstall: npx chief-clancy
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Hard constraints
167
+
168
+ - **Never touch any `.env` at the project root** — Clancy's credentials live in `.clancy/.env` and are only removed as part of `.clancy/` in Step 6
169
+ - Steps 1–2 (commands removal), Steps 3–5 (CLAUDE.md, .gitignore, and .prettierignore cleanup), and Step 6 (`.clancy/` removal) are always asked separately — never bundle them into one confirmation
170
+ - If the user says no to commands removal in Step 2, skip all remaining steps and stop
@@ -0,0 +1,95 @@
1
+ # Clancy Update-Docs Workflow
2
+
3
+ ## Overview
4
+
5
+ Incrementally refresh `.clancy/docs/` by re-running only the agents covering areas that have changed. Faster than a full `map-codebase` when changes are targeted.
6
+
7
+ ---
8
+
9
+ ## Step 0 — Preflight
10
+
11
+ Check `.clancy/` exists and `.clancy/.env` is present.
12
+
13
+ If either is missing:
14
+
15
+ ```
16
+ .clancy/ not found. Run /clancy:init to set up Clancy first.
17
+ ```
18
+
19
+ Stop.
20
+
21
+ ---
22
+
23
+ ## Step 1 — Determine what changed
24
+
25
+ Ask: "What changed since your last codebase scan? (or press Enter to auto-detect via git diff)"
26
+
27
+ If the user describes changes, parse their description to identify affected areas.
28
+
29
+ If Enter is pressed, run:
30
+
31
+ ```bash
32
+ git diff --name-only HEAD~10 HEAD 2>/dev/null || git diff --name-only
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Step 2 — Map changes to agents
38
+
39
+ | Changed files / areas | Re-run agent |
40
+ | ----------------------------------------------------- | ------------ |
41
+ | `package.json`, `*.lock`, deps, build config, env | tech |
42
+ | `src/` structure, API routes, data models, services | arch |
43
+ | test files, lint config, `.eslintrc`, `jest.config.*` | quality |
44
+ | CSS, tokens, Figma, component library, a11y | design |
45
+ | Security, performance, infra, known issues | concerns |
46
+
47
+ Multiple agents may need to re-run — run them in parallel.
48
+
49
+ If `PLAYWRIGHT_ENABLED=true` and the tech agent is re-running: verify `PLAYWRIGHT.md` ports/commands still match what `STACK.md` now says. Update `PLAYWRIGHT.md` if they differ.
50
+
51
+ ---
52
+
53
+ ## Step 3 — Confirm before running
54
+
55
+ ```
56
+ 🚨 Clancy — Update Docs
57
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
58
+
59
+ Based on your changes, I'll re-run:
60
+ - {agent list}
61
+
62
+ This will update:
63
+ - {file list}
64
+
65
+ Continue? [Y/n]:
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Step 4 — Re-run selected agents in parallel
71
+
72
+ Same as map-codebase Step 3, but only for the selected agents.
73
+
74
+ ---
75
+
76
+ ## Step 5 — Verify and commit
77
+
78
+ Verify each updated file is non-empty.
79
+
80
+ ```bash
81
+ git add .clancy/docs/
82
+ git commit -m "docs(clancy): update-docs — refresh .clancy/docs/"
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Step 6 — Final message
88
+
89
+ ```
90
+ ✅ Docs updated — {N} files refreshed.
91
+
92
+ Updated: {file list}
93
+
94
+ "Case files updated." — Run /clancy:implement or /clancy:autopilot when ready.
95
+ ```
@@ -0,0 +1,287 @@
1
+ # Clancy Update Workflow
2
+
3
+ ## Overview
4
+
5
+ Check for Clancy updates via npm, display changelog for versions between installed and latest, obtain user confirmation, and execute clean installation.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Detect installed version
10
+
11
+ Determine whether Clancy is installed locally or globally by checking both locations:
12
+
13
+ ```bash
14
+ LOCAL_VERSION_FILE="./.claude/commands/clancy/VERSION"
15
+ GLOBAL_VERSION_FILE="$HOME/.claude/commands/clancy/VERSION"
16
+
17
+ if [ -f "$LOCAL_VERSION_FILE" ] && grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+' "$LOCAL_VERSION_FILE"; then
18
+ INSTALLED=$(cat "$LOCAL_VERSION_FILE")
19
+ INSTALL_TYPE="LOCAL"
20
+ elif [ -f "$GLOBAL_VERSION_FILE" ] && grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+' "$GLOBAL_VERSION_FILE"; then
21
+ INSTALLED=$(cat "$GLOBAL_VERSION_FILE")
22
+ INSTALL_TYPE="GLOBAL"
23
+ else
24
+ INSTALLED="unknown"
25
+ INSTALL_TYPE="UNKNOWN"
26
+ fi
27
+
28
+ echo "$INSTALLED"
29
+ echo "$INSTALL_TYPE"
30
+ ```
31
+
32
+ Parse output:
33
+
34
+ - First line = installed version (or "unknown")
35
+ - Second line = install type (LOCAL, GLOBAL, or UNKNOWN)
36
+
37
+ **If version is unknown:**
38
+
39
+ ```
40
+ ## Clancy Update
41
+
42
+ **Installed version:** Unknown
43
+
44
+ Your installation doesn't include version tracking.
45
+
46
+ Running fresh install...
47
+ ```
48
+
49
+ Proceed to Step 4 (treat as version 0.0.0 for comparison).
50
+
51
+ ---
52
+
53
+ ## Step 2 — Check latest version
54
+
55
+ Check npm for the latest published version:
56
+
57
+ ```bash
58
+ npm view chief-clancy version 2>/dev/null
59
+ ```
60
+
61
+ **If npm check fails:**
62
+
63
+ ```
64
+ Couldn't check for updates (offline or npm unavailable).
65
+
66
+ To update manually: `npx chief-clancy@latest`
67
+ ```
68
+
69
+ Exit.
70
+
71
+ ---
72
+
73
+ ## Step 3 — Compare versions and confirm
74
+
75
+ Compare installed vs latest:
76
+
77
+ **If installed == latest:**
78
+
79
+ ```
80
+ 🚨 Clancy — Update
81
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
+
83
+ **Installed:** X.Y.Z
84
+ **Latest:** X.Y.Z
85
+
86
+ ✅ You're already on the latest version. "Nothing to see here, folks."
87
+ ```
88
+
89
+ Exit.
90
+
91
+ **If update available**, fetch the changelog from GitHub and show what's new BEFORE updating:
92
+
93
+ ```bash
94
+ curl -s https://raw.githubusercontent.com/Pushedskydiver/chief-clancy/main/CHANGELOG.md
95
+ ```
96
+
97
+ The CHANGELOG uses `## [X.Y.Z]` headings. Extract all content from the `## [{latest}]` heading down to (but not including) the `## [{installed}]` heading.
98
+
99
+ If the changelog fetch fails (network error, non-200), skip the "What's New" section and show: `Could not fetch changelog. View changes at github.com/Pushedskydiver/chief-clancy/blob/main/CHANGELOG.md`
100
+
101
+ Display:
102
+
103
+ ```
104
+ 🚨 Clancy — Update
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+
107
+ **Installed:** {installed}
108
+ **Latest:** {latest}
109
+
110
+ ### What's New
111
+ ────────────────────────────────────────────────────────────
112
+
113
+ {relevant CHANGELOG entries between installed and latest}
114
+
115
+ ────────────────────────────────────────────────────────────
116
+
117
+ ⚠️ **Note:** The update performs a clean install of Clancy command folders:
118
+ - `.claude/commands/clancy/` will be replaced
119
+ - `.claude/clancy/workflows/` will be replaced
120
+
121
+ If you've modified any Clancy files directly, they'll be automatically backed up
122
+ to `.claude/clancy/local-patches/` before overwriting.
123
+
124
+ Your project files are preserved:
125
+ - `.clancy/docs/`, `.clancy/.env`, `.clancy/progress.txt` ✅
126
+ - `CLAUDE.md` ✅
127
+ - Custom commands not in `commands/clancy/` ✅
128
+ - Custom hooks ✅
129
+
130
+ Note: `.clancy/clancy-implement.js` and `.clancy/clancy-autopilot.js` **will be replaced** with
131
+ the latest bundled versions. The rest of `.clancy/` is untouched.
132
+ ```
133
+
134
+ **AFK mode check:** If `--afk` flag is passed OR `CLANCY_MODE=afk` in `.clancy/.env`, **skip the confirmation and proceed automatically.** Do not prompt — auto-approve the update.
135
+
136
+ **Interactive mode:** Ask the user: **"Proceed with update?"** with options:
137
+
138
+ - "Yes, update now"
139
+ - "No, cancel"
140
+
141
+ **If user cancels:** Exit.
142
+
143
+ ---
144
+
145
+ ## Step 4 — Run the update
146
+
147
+ Run the installer using the detected install type from Step 1. Pass `--global` or `--local` so the installer runs non-interactively (no prompts):
148
+
149
+ - If `INSTALL_TYPE` is `LOCAL`: `npx -y chief-clancy@latest --local`
150
+ - If `INSTALL_TYPE` is `GLOBAL`: `npx -y chief-clancy@latest --global`
151
+ - If `INSTALL_TYPE` is `UNKNOWN`: `npx -y chief-clancy@latest` (falls back to interactive mode)
152
+
153
+ ```bash
154
+ # Example for local install:
155
+ npx -y chief-clancy@latest --local
156
+
157
+ # Example for global install:
158
+ npx -y chief-clancy@latest --global
159
+ ```
160
+
161
+ The `--global`/`--local` flags skip the interactive install-type prompt and auto-accept the overwrite confirmation.
162
+
163
+ This touches:
164
+
165
+ - `.claude/commands/clancy/` — slash commands (replaced)
166
+ - `.claude/clancy/workflows/` — workflow files (replaced)
167
+ - `.clancy/clancy-implement.js` and `.clancy/clancy-autopilot.js` — bundled runtime scripts (replaced)
168
+
169
+ It never modifies:
170
+
171
+ - `.clancy/docs/` — codebase documentation
172
+ - `.clancy/progress.txt` — progress log
173
+ - `CLAUDE.md`
174
+
175
+ It may **append** to:
176
+
177
+ - `.clancy/.env` — adds missing env var defaults (see Step 4a)
178
+
179
+ ---
180
+
181
+ ## Step 4a — Backfill missing env var defaults
182
+
183
+ After the installer finishes, read `.clancy/.env` and check for missing pipeline label variables. These were introduced in v0.7.4 and won't exist in `.env` files from earlier installs.
184
+
185
+ **Check for and append if missing:**
186
+
187
+ ```
188
+ # Pipeline labels (added in v0.7.4)
189
+ CLANCY_LABEL_BRIEF=clancy:brief
190
+ CLANCY_LABEL_PLAN=clancy:plan
191
+ CLANCY_LABEL_BUILD=clancy:build
192
+ ```
193
+
194
+ For each variable:
195
+
196
+ 1. Read `.clancy/.env` content
197
+ 2. If the variable name does NOT appear anywhere in the file (not even commented out), append it with its default value
198
+ 3. If the variable already exists (even with a different value), leave it untouched
199
+
200
+ Add a blank line and a `# Pipeline labels (added in v0.7.4)` comment header before the new variables, but only if at least one variable was added.
201
+
202
+ **Display what was added (if any):**
203
+
204
+ ```
205
+ 📋 Added missing env var defaults to .clancy/.env:
206
+ CLANCY_LABEL_BRIEF=clancy:brief
207
+ CLANCY_LABEL_PLAN=clancy:plan
208
+ CLANCY_LABEL_BUILD=clancy:build
209
+
210
+ Customise these via /clancy:settings → L1/L2/L3
211
+ ```
212
+
213
+ If nothing was added, display nothing.
214
+
215
+ ---
216
+
217
+ ## Step 5 — Check for local patches
218
+
219
+ After the update completes, check if the installer backed up any locally modified files:
220
+
221
+ Check for `.claude/clancy/local-patches/backup-meta.json` (local install) or `~/.claude/clancy/local-patches/backup-meta.json` (global install).
222
+
223
+ **If patches were found:**
224
+
225
+ ```
226
+ Local patches were backed up before the update.
227
+ Your modified files are in .claude/clancy/local-patches/
228
+
229
+ To review what changed:
230
+ Compare each file in local-patches/ against its counterpart in
231
+ .claude/commands/clancy/ or .claude/clancy/workflows/ and manually
232
+ reapply any customisations you want to keep.
233
+
234
+ Backed up files:
235
+ {list from backup-meta.json}
236
+ ```
237
+
238
+ **If no patches:** Continue normally (no message needed).
239
+
240
+ ---
241
+
242
+ ## Step 6 — Clear update cache and confirm
243
+
244
+ Clear the update check cache so the statusline indicator disappears:
245
+
246
+ ```bash
247
+ rm -f "$HOME/.claude/cache/clancy-update-check.json"
248
+ rm -f "./.claude/cache/clancy-update-check.json"
249
+ ```
250
+
251
+ Display completion message:
252
+
253
+ ```
254
+ ╔═══════════════════════════════════════════════════════════╗
255
+ ║ ✅ Clancy Updated: v{old} → v{new} ║
256
+ ╚═══════════════════════════════════════════════════════════╝
257
+
258
+ "New badge, same Chief." — Start a new Claude Code session to pick up the updated commands.
259
+
260
+ View full changelog: github.com/Pushedskydiver/chief-clancy/blob/main/CHANGELOG.md
261
+ ```
262
+
263
+ ### New role hints
264
+
265
+ After the completion message, check `.clancy/.env` for `CLANCY_ROLES` and display hints for any optional roles that are available but not enabled:
266
+
267
+ - If `CLANCY_ROLES` does not include `planner`:
268
+ ```
269
+ 💡 Planner role available — refine vague tickets into structured plans.
270
+ Run /clancy:settings to enable it.
271
+ ```
272
+ - If `CLANCY_ROLES` does not include `strategist`:
273
+ ```
274
+ 💡 Strategist role available — generate briefs, grill requirements, create tickets.
275
+ Run /clancy:settings to enable it.
276
+ ```
277
+ - If `CLANCY_ROLES` is not set at all (env var missing), show both hints.
278
+ - If all optional roles are already enabled, show nothing.
279
+
280
+ ---
281
+
282
+ ## Notes
283
+
284
+ - If the user installed globally, the update applies globally
285
+ - If the user installed locally, the update applies locally
286
+ - After updating, restart Claude Code for new commands to take effect
287
+ - New role hints are shown post-update so existing users discover features added in newer versions
@@ -0,0 +1,23 @@
1
+ # /clancy:approve-brief
2
+
3
+ Convert an approved brief into real tickets on the board. Creates child tickets under the parent, links dependencies, and posts a tracking summary.
4
+
5
+ Accepts optional arguments:
6
+
7
+ - **By slug:** `/clancy:approve-brief auth-rework` — approve a specific brief
8
+ - **By index:** `/clancy:approve-brief 2` — approve the 2nd unapproved brief
9
+ - **By ticket:** `/clancy:approve-brief PROJ-123` — approve brief sourced from this ticket
10
+ - **Set parent:** `--epic PROJ-50` — override or set the parent epic
11
+ - **Preview:** `--dry-run` — show what would be created without making API calls
12
+ - **Skip confirmation:** `--afk` — auto-confirm without prompting (for automation)
13
+
14
+ Examples:
15
+
16
+ - `/clancy:approve-brief` — auto-select (if only 1 unapproved brief)
17
+ - `/clancy:approve-brief auth-rework` — approve by slug
18
+ - `/clancy:approve-brief --dry-run` — preview ticket creation
19
+ - `/clancy:approve-brief --epic PROJ-50` — set parent and approve
20
+
21
+ @.claude/clancy/workflows/approve-brief.md
22
+
23
+ Follow the approve-brief workflow above. Parse the decomposition, create tickets on the board, link dependencies, and post a tracking comment.
@@ -0,0 +1,29 @@
1
+ # /clancy:brief
2
+
3
+ Generate a strategic brief for a feature idea. Researches the codebase, grills you (or itself) on requirements, and produces a decomposition into actionable tickets.
4
+
5
+ Accepts optional arguments:
6
+
7
+ - **Board ticket:** `/clancy:brief PROJ-123`, `/clancy:brief #42`, `/clancy:brief ENG-42` — brief from a board ticket
8
+ - **Inline text:** `/clancy:brief "Add dark mode"` — brief from a description
9
+ - **From file:** `/clancy:brief --from docs/rfc.md` — brief from a local file
10
+ - **Batch mode:** `/clancy:brief 3` — brief up to 3 tickets from the queue
11
+ - **Fresh start:** `--fresh` — discard existing brief and start over
12
+ - **Force web research:** `--research` — include web research in analysis
13
+ - **AFK mode:** `--afk` — use AI-grill instead of human grill
14
+ - **Epic hint:** `--epic PROJ-50 "Add dark mode"` — set parent for approve step
15
+ - **List briefs:** `--list` — show inventory of existing briefs
16
+
17
+ Examples:
18
+
19
+ - `/clancy:brief` — interactive mode (prompt for idea)
20
+ - `/clancy:brief PROJ-200` — brief a Jira ticket
21
+ - `/clancy:brief #42` — brief a GitHub issue
22
+ - `/clancy:brief ENG-42` — brief a Linear issue
23
+ - `/clancy:brief "Add dark mode support"` — brief from inline text
24
+ - `/clancy:brief --afk PROJ-200` — brief with AI-grill (no human questions)
25
+ - `/clancy:brief --list` — show all briefs
26
+
27
+ @.claude/clancy/workflows/brief.md
28
+
29
+ Follow the brief workflow above. Research the codebase, conduct the grill phase, generate the brief, and save it locally. Do not create tickets — briefing only.