chief-clancy 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 (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +426 -0
  3. package/bin/install.js +169 -0
  4. package/package.json +42 -0
  5. package/registry/boards.json +47 -0
  6. package/src/agents/arch-agent.md +72 -0
  7. package/src/agents/concerns-agent.md +89 -0
  8. package/src/agents/design-agent.md +130 -0
  9. package/src/agents/quality-agent.md +161 -0
  10. package/src/agents/tech-agent.md +92 -0
  11. package/src/commands/doctor.md +7 -0
  12. package/src/commands/help.md +50 -0
  13. package/src/commands/init.md +7 -0
  14. package/src/commands/logs.md +7 -0
  15. package/src/commands/map-codebase.md +16 -0
  16. package/src/commands/once.md +13 -0
  17. package/src/commands/review.md +9 -0
  18. package/src/commands/run.md +11 -0
  19. package/src/commands/settings.md +7 -0
  20. package/src/commands/status.md +9 -0
  21. package/src/commands/uninstall.md +5 -0
  22. package/src/commands/update-docs.md +9 -0
  23. package/src/commands/update.md +9 -0
  24. package/src/templates/.env.example.github +43 -0
  25. package/src/templates/.env.example.jira +53 -0
  26. package/src/templates/.env.example.linear +43 -0
  27. package/src/templates/CLAUDE.md +69 -0
  28. package/src/templates/scripts/clancy-afk.sh +111 -0
  29. package/src/templates/scripts/clancy-once-github.sh +225 -0
  30. package/src/templates/scripts/clancy-once-linear.sh +252 -0
  31. package/src/templates/scripts/clancy-once.sh +259 -0
  32. package/src/workflows/doctor.md +115 -0
  33. package/src/workflows/init.md +423 -0
  34. package/src/workflows/logs.md +82 -0
  35. package/src/workflows/map-codebase.md +124 -0
  36. package/src/workflows/once.md +80 -0
  37. package/src/workflows/review.md +165 -0
  38. package/src/workflows/run.md +119 -0
  39. package/src/workflows/scaffold.md +289 -0
  40. package/src/workflows/settings.md +344 -0
  41. package/src/workflows/status.md +120 -0
  42. package/src/workflows/uninstall.md +75 -0
  43. package/src/workflows/update-docs.md +89 -0
  44. package/src/workflows/update.md +67 -0
@@ -0,0 +1,344 @@
1
+ # Clancy Settings Workflow
2
+
3
+ ## Overview
4
+
5
+ View and change Clancy configuration. Reads `.clancy/.env`, shows current values, and lets the user update any setting interactively. Loops until the user exits. Never modifies anything other than `.clancy/.env`.
6
+
7
+ ---
8
+
9
+ ## Step 1 — 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 2 — Read current config
24
+
25
+ Source `.clancy/.env` silently. Detect which board is configured:
26
+ - `JIRA_BASE_URL` set → Jira
27
+ - `GITHUB_TOKEN` set → GitHub Issues
28
+ - `LINEAR_API_KEY` set → Linear
29
+
30
+ ---
31
+
32
+ ## Step 3 — Display settings menu
33
+
34
+ Show all current values. Board-specific settings only appear when that board is configured.
35
+
36
+ ```
37
+ Clancy settings — .clancy/.env
38
+
39
+ General
40
+ [1] Max iterations {MAX_ITERATIONS:-5} tickets per /clancy:run session
41
+ [2] Claude model {CLANCY_MODEL:-default} model used for each ticket session
42
+ [3] Base branch {CLANCY_BASE_BRANCH:-main}
43
+
44
+ {If Jira:}
45
+ Jira
46
+ [4] Status filter {CLANCY_JQL_STATUS:-To Do}
47
+ [5] Sprint filter {on if CLANCY_JQL_SPRINT set, else off}
48
+ [6] Label filter {CLANCY_LABEL if set, else off — only pick up tickets with this label}
49
+
50
+ {If Linear:}
51
+ Linear
52
+ [4] Label filter {CLANCY_LABEL if set, else off — only pick up issues with this label}
53
+
54
+ Optional enhancements
55
+ [{N}] Figma MCP {enabled if FIGMA_API_KEY set, else not set}
56
+ [{N}] Playwright {enabled if PLAYWRIGHT_ENABLED=true, else off}
57
+ [{N}] Notifications {configured if CLANCY_NOTIFY_WEBHOOK set, else not set}
58
+
59
+ [{N}] Switch board currently: {Jira / GitHub Issues / Linear}
60
+ [{N}] Exit
61
+
62
+ Which setting would you like to change?
63
+ ```
64
+
65
+ Number each option sequentially. Show only the board-specific section that matches the configured board. If Jira: show [4] status, [5] sprint, [6] label. If Linear: show [4] label. If GitHub: no board-specific options.
66
+
67
+ ---
68
+
69
+ ## Step 4 — Handle each selection
70
+
71
+ After the user picks a number, handle it as below. After saving, print `✓ Saved.` and loop back to Step 3 to show the updated menu.
72
+
73
+ ---
74
+
75
+ ### [1] Max iterations
76
+
77
+ ```
78
+ Max iterations — current: {value}
79
+ How many tickets should /clancy:run process per session?
80
+
81
+ [1] 5 (default)
82
+ [2] Enter a different number
83
+ ```
84
+
85
+ Write `MAX_ITERATIONS=<value>` to `.clancy/.env`.
86
+
87
+ ---
88
+
89
+ ### [2] Claude model
90
+
91
+ ```
92
+ Claude model — current: {value or "default"}
93
+
94
+ [1] Default (Claude picks the best available model)
95
+ [2] claude-opus-4-6 — most capable, slower
96
+ [3] claude-sonnet-4-6 — balanced (recommended)
97
+ [4] claude-haiku-4-5 — fastest, lightest
98
+ [5] Enter a custom model ID
99
+ [6] Clear (revert to default)
100
+ ```
101
+
102
+ If the user picks [1] or [6]: remove `CLANCY_MODEL` from `.clancy/.env` (or leave it commented out).
103
+ Otherwise: write `CLANCY_MODEL=<value>` to `.clancy/.env`.
104
+
105
+ ---
106
+
107
+ ### [3] Base branch
108
+
109
+ ```
110
+ Base branch — current: {value}
111
+ Branch Clancy uses as the integration target when a ticket has no parent epic.
112
+
113
+ Enter new value (or press enter to keep current):
114
+ ```
115
+
116
+ Write `CLANCY_BASE_BRANCH=<value>` to `.clancy/.env`.
117
+
118
+ ---
119
+
120
+ ### [4] Jira status filter (Jira only)
121
+
122
+ ```
123
+ Jira status filter — current: {value}
124
+ Which status name should Clancy pick tickets from?
125
+ Common values: To Do, Selected for Development, Ready, Open
126
+
127
+ [1] To Do (default)
128
+ [2] Enter a different value
129
+ ```
130
+
131
+ Write `CLANCY_JQL_STATUS=<value>` to `.clancy/.env`.
132
+
133
+ ---
134
+
135
+ ### [5] Jira sprint filter (Jira only)
136
+
137
+ ```
138
+ Jira sprint filter — current: {on / off}
139
+ Filter tickets to the active sprint? (Requires Jira Software)
140
+
141
+ [1] On
142
+ [2] Off (default)
143
+ ```
144
+
145
+ If on: write `CLANCY_JQL_SPRINT=true` to `.clancy/.env`.
146
+ If off: remove `CLANCY_JQL_SPRINT` from `.clancy/.env` (or comment it out).
147
+
148
+ ---
149
+
150
+ ### [6] Jira label filter (Jira only)
151
+
152
+ ```
153
+ Jira label filter — current: {label name or "off"}
154
+ Only pick up tickets with this label. Useful for mixed backlogs
155
+ where some tickets are not suitable for autonomous implementation.
156
+
157
+ [1] Set label name
158
+ [2] Off (pick up all assigned tickets regardless of label)
159
+ [3] Cancel
160
+ ```
161
+
162
+ If [1]: prompt `What label should Clancy filter by? (must already exist in Jira)` then write `CLANCY_LABEL=<value>` to `.clancy/.env`.
163
+ If [2]: remove `CLANCY_LABEL` from `.clancy/.env`.
164
+
165
+ ---
166
+
167
+ ### [4] Linear label filter (Linear only)
168
+
169
+ ```
170
+ Linear label filter — current: {label name or "off"}
171
+ Only pick up issues with this label. Useful for mixed backlogs
172
+ where some issues are not suitable for autonomous implementation.
173
+
174
+ [1] Set label name
175
+ [2] Off (pick up all unstarted assigned issues regardless of label)
176
+ [3] Cancel
177
+ ```
178
+
179
+ If [1]: prompt `What label should Clancy filter by? (must already exist in your Linear team)` then write `CLANCY_LABEL=<value>` to `.clancy/.env`.
180
+ If [2]: remove `CLANCY_LABEL` from `.clancy/.env`.
181
+
182
+ ---
183
+
184
+ ### Figma MCP
185
+
186
+ ```
187
+ Figma MCP — current: {enabled / not set}
188
+
189
+ [1] Set API key
190
+ [2] Disable (remove key)
191
+ [3] Cancel
192
+ ```
193
+
194
+ If [1]: prompt `Paste your Figma API key: (create one at figma.com/settings → Personal access tokens)` then verify with the Figma `whoami` API before saving. If verification fails, tell the user and offer retry or skip — never save an unverified key.
195
+ If [2]: remove `FIGMA_API_KEY` from `.clancy/.env`.
196
+
197
+ ---
198
+
199
+ ### Playwright
200
+
201
+ ```
202
+ Playwright visual checks — current: {enabled / off}
203
+
204
+ [1] Enable
205
+ [2] Disable
206
+ [3] Cancel
207
+ ```
208
+
209
+ If [1] Enable selected and `PLAYWRIGHT_ENABLED` is already `true`: show `Playwright is already enabled. [1] Reconfigure [2] Cancel`. If Reconfigure, walk through the setup questions again. If Cancel, loop back.
210
+ If [1] Enable selected and `PLAYWRIGHT_DEV_COMMAND` is not set: walk through the Playwright setup questions from the init workflow (dev server command, port, Storybook detection, startup wait).
211
+ If [1] Enable selected and `PLAYWRIGHT_DEV_COMMAND` is already set: just set `PLAYWRIGHT_ENABLED=true`.
212
+ If [2] Disable: set `PLAYWRIGHT_ENABLED=false` in `.clancy/.env`.
213
+
214
+ ---
215
+
216
+ ### Notifications
217
+
218
+ ```
219
+ Notifications — current: {configured / not set}
220
+
221
+ [1] Set webhook URL
222
+ [2] Disable (remove webhook)
223
+ [3] Cancel
224
+ ```
225
+
226
+ If [1]: prompt `Paste your Slack or Teams webhook URL:` then write `CLANCY_NOTIFY_WEBHOOK=<url>` to `.clancy/.env`.
227
+ If [2]: remove `CLANCY_NOTIFY_WEBHOOK` from `.clancy/.env`.
228
+
229
+ ---
230
+
231
+ ### Switch board
232
+
233
+ Show which board is currently active, then offer the other two:
234
+
235
+ ```
236
+ Switch board — currently: {Jira / GitHub Issues / Linear}
237
+
238
+ [1] {board A}
239
+ [2] {board B}
240
+ [3] Cancel
241
+ ```
242
+
243
+ Only show the two boards that are not currently active. If the user picks Cancel, loop back to the menu without changing anything.
244
+
245
+ **Step 1: Collect new credentials**
246
+
247
+ Ask each credential question individually and wait for an answer, exactly as in the init workflow Q2:
248
+
249
+ Jira — ask in this order:
250
+ 1. `What's your Jira base URL? (e.g. https://your-org.atlassian.net)`
251
+ 2. `What's your Jira project key? (e.g. PROJ)`
252
+ 3. `What email address do you use to log in to Atlassian?`
253
+ 4. `Paste your Jira API token: (create one at id.atlassian.com/manage-profile/security/api-tokens)`
254
+
255
+ GitHub Issues — ask in this order:
256
+ 1. `What's your GitHub repo? (owner/name, e.g. acme/my-app)`
257
+ 2. `Paste your GitHub personal access token: (needs repo scope)`
258
+
259
+ After collecting GitHub credentials, remind the user:
260
+ ```
261
+ Important: Clancy only picks up GitHub Issues that have the "clancy" label applied.
262
+ Add this label to any issue you want Clancy to work on.
263
+ ```
264
+
265
+ Linear — ask in this order:
266
+ 1. `Paste your Linear API key: (create one at linear.app/settings/api)`
267
+ 2. `What's your Linear team ID? (find it at linear.app/settings/teams — click your team, copy the ID from the URL)`
268
+
269
+ **Step 2: Verify credentials**
270
+
271
+ Verify the new credentials before making any changes — same checks as the init preflight and doctor workflow. Show the result:
272
+
273
+ ```
274
+ Verifying...
275
+ ✓ Connected — {board-specific confirmation, e.g. "PROJ reachable" / "acme/my-app found" / "Linear authenticated"}
276
+ ```
277
+
278
+ If verification fails, tell the user clearly and offer:
279
+
280
+ ```
281
+ Could not connect. Check your credentials and try again.
282
+
283
+ [1] Try again
284
+ [2] Cancel
285
+ ```
286
+
287
+ Never modify any files if verification fails.
288
+
289
+ **Step 3: Confirm the switch**
290
+
291
+ Once verified, show a single confirmation before making changes:
292
+
293
+ ```
294
+ Ready to switch from {old board} to {new board}.
295
+ Your other settings (model, iterations, branch, enhancements) will be kept.
296
+
297
+ Confirm? [Y/n]
298
+ ```
299
+
300
+ If no: print `Cancelled. No changes made.` and loop back to the menu.
301
+
302
+ **Step 4: Apply the switch**
303
+
304
+ 1. Remove all vars belonging to the old board from `.clancy/.env`:
305
+ - Jira: `JIRA_BASE_URL`, `JIRA_USER`, `JIRA_API_TOKEN`, `JIRA_PROJECT_KEY`, `CLANCY_JQL_STATUS`, `CLANCY_JQL_SPRINT`
306
+ - GitHub: `GITHUB_TOKEN`, `GITHUB_REPO`
307
+ - Linear: `LINEAR_API_KEY`, `LINEAR_TEAM_ID`
308
+ 2. Write the new board credentials to `.clancy/.env`
309
+ 3. If switching to Jira: also ask the status filter question (same as init Q3) and write `CLANCY_JQL_STATUS` to `.clancy/.env`
310
+ 4. Write the correct `clancy-once.sh` variant for the new board to `.clancy/clancy-once.sh` — same script content as init Step 4 uses (Jira → `clancy-once.sh`, GitHub → `clancy-once-github.sh`, Linear → `clancy-once-linear.sh`). Make it executable: `chmod +x .clancy/clancy-once.sh`
311
+
312
+ Print:
313
+
314
+ ```
315
+ ✓ Switched to {new board}.
316
+ ```
317
+
318
+ Then loop back to the main settings menu.
319
+
320
+ ---
321
+
322
+ ### Exit
323
+
324
+ Print nothing extra. Stop.
325
+
326
+ ---
327
+
328
+ ## Step 5 — Writing values to .clancy/.env
329
+
330
+ When updating a value:
331
+
332
+ - If the key already exists in `.clancy/.env`: replace its line in place
333
+ - If the key does not exist: append it to the end of the file
334
+ - If removing a key: delete its line from the file
335
+ - Never touch any other lines in the file
336
+
337
+ ---
338
+
339
+ ## Notes
340
+
341
+ - All changes are written to `.clancy/.env` immediately after confirmation
342
+ - Switching boards verifies credentials before making any changes — nothing is written if verification fails
343
+ - `/clancy:init` remains available for a full re-setup (re-scaffolds scripts and docs)
344
+ - This command never restarts any servers or triggers any ticket processing
@@ -0,0 +1,120 @@
1
+ # Clancy Status Workflow
2
+
3
+ ## Overview
4
+
5
+ Read-only board check. Fetches the next 3 tickets Clancy would pick up and displays them. No side effects whatsoever — no git operations, no file writes, no ticket claiming.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Preflight checks
10
+
11
+ 1. Check `.clancy/` exists and `.clancy/.env` is present.
12
+ 2. Source `.clancy/.env` and check board credentials are present.
13
+ 3. On any missing config, show a specific error and stop:
14
+ ```
15
+ Missing config. Run /clancy:init to set up Clancy.
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Step 2 — Detect board and fetch tickets
21
+
22
+ Detect board from `.clancy/.env`:
23
+
24
+ **Jira:**
25
+
26
+ Build the JQL string first using the same clauses as `clancy-once.sh`:
27
+ - Sprint clause: include `AND sprint in openSprints()` if `CLANCY_JQL_SPRINT` is set
28
+ - Label clause: include `AND labels = "$CLANCY_LABEL"` if `CLANCY_LABEL` is set
29
+ - `CLANCY_JQL_STATUS` defaults to `To Do` if not set
30
+
31
+ Full JQL (with both optional clauses shown):
32
+ `project=$JIRA_PROJECT_KEY [AND sprint in openSprints()] [AND labels = "$CLANCY_LABEL"] AND assignee=currentUser() AND status="$CLANCY_JQL_STATUS" ORDER BY priority ASC`
33
+
34
+ ```bash
35
+ RESPONSE=$(curl -s \
36
+ -u "$JIRA_USER:$JIRA_API_TOKEN" \
37
+ -X POST \
38
+ -H "Content-Type: application/json" \
39
+ -H "Accept: application/json" \
40
+ "$JIRA_BASE_URL/rest/api/3/search/jql" \
41
+ -d '{"jql": "<jql as above>", "maxResults": 3, "fields": ["summary", "parent", "customfield_10014", "status"]}')
42
+ ```
43
+
44
+ **GitHub Issues:**
45
+ ```bash
46
+ RESPONSE=$(curl -s \
47
+ -H "Authorization: Bearer $GITHUB_TOKEN" \
48
+ -H "X-GitHub-Api-Version: 2022-11-28" \
49
+ "https://api.github.com/repos/$GITHUB_REPO/issues?state=open&assignee=@me&labels=clancy&per_page=3")
50
+ # Filter out PRs (entries with pull_request key)
51
+ ```
52
+
53
+ **Linear:**
54
+
55
+ Build the filter — `CLANCY_LABEL` is optional:
56
+ - Base filter: `state: { type: { eq: "unstarted" } }, team: { id: { eq: "$LINEAR_TEAM_ID" } }`
57
+ - If `CLANCY_LABEL` is set: add `labels: { name: { eq: "$CLANCY_LABEL" } }` to the filter
58
+
59
+ ```graphql
60
+ query {
61
+ viewer {
62
+ assignedIssues(
63
+ filter: { state: { type: { eq: "unstarted" } }, team: { id: { eq: "$LINEAR_TEAM_ID" } } [, labels: { name: { eq: "$CLANCY_LABEL" } }] }
64
+ first: 3
65
+ orderBy: priority
66
+ ) {
67
+ nodes { id identifier title parent { identifier title } }
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Step 3 — Display
76
+
77
+ If tickets found, display:
78
+ ```
79
+ Next up for Clancy:
80
+
81
+ 1. [{TICKET-KEY}] {Summary}
82
+ Epic: {epic key} — {epic title}
83
+ Status: {status}
84
+
85
+ 2. [{TICKET-KEY}] {Summary}
86
+ Epic: {epic key} — {epic title}
87
+ Status: {status}
88
+
89
+ 3. [{TICKET-KEY}] {Summary}
90
+ Epic: {epic key} — {epic title}
91
+ Status: {status}
92
+
93
+ Run /clancy:once to pick up the first ticket.
94
+ Run /clancy:run to process all tickets in the queue.
95
+ ```
96
+
97
+ If no tickets found:
98
+ ```
99
+ No tickets found in the current queue. Check your board or run /clancy:init
100
+ to verify your configuration.
101
+ ```
102
+
103
+ If API call fails, show the error clearly:
104
+ ```
105
+ Board API error: {error message}
106
+
107
+ Tips:
108
+ - Check your credentials in .clancy/.env
109
+ - For Jira: ensure you have VPN access if required
110
+ - Run /clancy:init to reconfigure
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Notes
116
+
117
+ - Show up to 3 tickets. If only 1 or 2 are available, show those.
118
+ - Omit "Epic:" line if no epic/parent data is present for that ticket.
119
+ - This command is strictly read-only. No git ops, no file writes, no Claude invocation for analysis.
120
+ - The query used here must be identical to the one used by `clancy-once.sh` — what status shows is exactly what run would pick up.
@@ -0,0 +1,75 @@
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`). Never touch `CLAUDE.md` under any circumstances.
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
+ This will remove Clancy's slash commands from [location].
33
+ Your .clancy/ folder will not be touched.
34
+ Continue? (yes / no)
35
+ ```
36
+
37
+ - `no` → print "Nothing removed." and stop
38
+ - `yes` → delete both the commands directory and the workflows directory for the chosen location(s), print "✓ Clancy removed from [location]."
39
+
40
+ If "Both" was chosen in Step 1: confirm once for both, remove all four directories, print two confirmation lines.
41
+
42
+ ---
43
+
44
+ ## Step 3 — Offer to remove .clancy/ (if present)
45
+
46
+ Check whether `.clancy/` exists in the current project directory.
47
+
48
+ If it does, ask separately:
49
+
50
+ ```
51
+ .clancy/ contains your codebase docs, progress log, and credentials (.env).
52
+ Remove it too? This cannot be undone. (yes / no)
53
+ ```
54
+
55
+ - `no` → print "✓ .clancy/ kept — your docs and progress log are safe."
56
+ - `yes` → delete `.clancy/` and print "✓ .clancy/ removed."
57
+
58
+ If `.clancy/` does not exist, skip this step entirely.
59
+
60
+ ---
61
+
62
+ ## Step 4 — Final message
63
+
64
+ ```
65
+ Clancy uninstalled. To reinstall: npx chief-clancy
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Hard constraints
71
+
72
+ - **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 3
73
+ - **Never touch `CLAUDE.md`** — under any circumstances, in any scenario
74
+ - Steps 1–2 (commands removal) and Step 3 (`.clancy/` removal) are always asked separately — never bundle them into one confirmation
75
+ - If the user says no to commands removal in Step 2, skip Step 3 entirely and stop
@@ -0,0 +1,89 @@
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
+ .clancy/ not found. Run /clancy:init to set up Clancy first.
16
+ ```
17
+ Stop.
18
+
19
+ ---
20
+
21
+ ## Step 1 — Determine what changed
22
+
23
+ Ask: "What changed since your last codebase scan? (or press Enter to auto-detect via git diff)"
24
+
25
+ If the user describes changes, parse their description to identify affected areas.
26
+
27
+ If Enter is pressed, run:
28
+ ```bash
29
+ git diff --name-only HEAD~10 HEAD 2>/dev/null || git diff --name-only
30
+ ```
31
+
32
+ ---
33
+
34
+ ## Step 2 — Map changes to agents
35
+
36
+ | Changed files / areas | Re-run agent |
37
+ |---|---|
38
+ | `package.json`, `*.lock`, deps, build config, env | tech |
39
+ | `src/` structure, API routes, data models, services | arch |
40
+ | test files, lint config, `.eslintrc`, `jest.config.*` | quality |
41
+ | CSS, tokens, Figma, component library, a11y | design |
42
+ | Security, performance, infra, known issues | concerns |
43
+
44
+ Multiple agents may need to re-run — run them in parallel.
45
+
46
+ 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.
47
+
48
+ ---
49
+
50
+ ## Step 3 — Confirm before running
51
+
52
+ ```
53
+ Based on your changes, I'll re-run:
54
+ - {agent list}
55
+
56
+ This will update:
57
+ - {file list}
58
+
59
+ Continue? [Y/n]:
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Step 4 — Re-run selected agents in parallel
65
+
66
+ Same as map-codebase Step 3, but only for the selected agents.
67
+
68
+ ---
69
+
70
+ ## Step 5 — Verify and commit
71
+
72
+ Verify each updated file is non-empty.
73
+
74
+ ```bash
75
+ git add .clancy/docs/
76
+ git commit -m "docs(clancy): update-docs — refresh .clancy/docs/"
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Step 6 — Final message
82
+
83
+ ```
84
+ Docs updated.
85
+
86
+ Updated: {file list}
87
+
88
+ Run /clancy:once or /clancy:run when ready.
89
+ ```
@@ -0,0 +1,67 @@
1
+ # Clancy Update Workflow
2
+
3
+ ## Overview
4
+
5
+ Update Clancy itself to the latest version via npx.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Check current version
10
+
11
+ Read current version from the installed package (check `~/.claude/commands/clancy/` or `./.claude/commands/clancy/` for a `VERSION` file, or from npm).
12
+
13
+ ```bash
14
+ npm view chief-clancy version 2>/dev/null || echo "unknown"
15
+ ```
16
+
17
+ ---
18
+
19
+ ## Step 2 — Run the updater
20
+
21
+ ```
22
+ Updating Clancy...
23
+ ```
24
+
25
+ Run:
26
+ ```bash
27
+ npx chief-clancy@latest
28
+ ```
29
+
30
+ This re-runs the installer, which copies the latest command files into the correct `.claude/commands/clancy/` directory (global or local, matching the existing install location).
31
+
32
+ The update only touches `.claude/commands/clancy/` (slash commands and workflows). It never modifies:
33
+ - `.clancy/clancy-once.sh` or `.clancy/clancy-afk.sh` — shell scripts are not updated
34
+ - `.clancy/docs/` codebase documentation
35
+ - `.clancy/progress.txt` progress log
36
+ - `.clancy/.env` credentials
37
+ - `CLAUDE.md`
38
+
39
+ **To update the shell scripts** (`.clancy/clancy-once.sh`, `.clancy/clancy-afk.sh`), re-run `/clancy:init` — it will detect the existing setup and re-scaffold the scripts without asking for credentials again.
40
+
41
+ ---
42
+
43
+ ## Step 3 — Show changelog diff
44
+
45
+ After update, fetch and display the CHANGELOG section for any versions between old and new:
46
+
47
+ ```
48
+ Updated Clancy from v{old} to v{new}.
49
+
50
+ What's new:
51
+ {relevant CHANGELOG entries}
52
+
53
+ View full changelog: github.com/Pushedskydiver/clancy/blob/main/CHANGELOG.md
54
+ ```
55
+
56
+ If version is already latest:
57
+ ```
58
+ Clancy is already up to date (v{version}).
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Notes
64
+
65
+ - If the user installed globally, the update applies globally
66
+ - If the user installed locally, the update applies locally
67
+ - After updating, the new commands take effect immediately in Claude Code