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,423 @@
1
+ # Clancy Init Workflow
2
+
3
+ ## Overview
4
+
5
+ Full wizard for setting up Clancy in a project. Follow every step exactly. Do not skip steps or reorder them.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Detect project state
10
+
11
+ Before asking any questions, silently check:
12
+
13
+ - Is this an existing project? Check for `package.json`, `.git`, `src/`, `app/`, `lib/`
14
+ - Is a board already configured? Check `.clancy/.env` for `JIRA_BASE_URL`, `GITHUB_TOKEN`, `LINEAR_API_KEY`
15
+ - Does `CLAUDE.md` already exist? Flag for merge — never overwrite
16
+ - Does `.clancy/` already exist? Warn and offer re-init or abort
17
+
18
+ If `.clancy/` exists, output:
19
+
20
+ It looks like Clancy is already set up in this project.
21
+
22
+ [1] Re-run init (update config, re-scaffold)
23
+ [2] Abort (keep existing setup)
24
+
25
+ ---
26
+
27
+ ## Step 1b — Prerequisite check
28
+
29
+ Before proceeding, silently run `command -v` for each required binary:
30
+
31
+ | Binary | Install hint |
32
+ |---|---|
33
+ | `jq` | `brew install jq` / `apt install jq` |
34
+ | `curl` | pre-installed on macOS and most Linux |
35
+ | `git` | `brew install git` / `apt install git` |
36
+
37
+ If all are present: continue silently.
38
+
39
+ If any are missing, output:
40
+
41
+ ```
42
+ ⚠ Missing prerequisites:
43
+
44
+ ✗ jq — brew install jq (or apt install jq on Linux)
45
+
46
+ Clancy's shell scripts require these binaries to run. Install them, then re-run /clancy:init.
47
+ ```
48
+
49
+ List only the missing ones. Then stop — do not proceed with setup until prerequisites are satisfied.
50
+
51
+ ---
52
+
53
+ ## Step 2 — Welcome message
54
+
55
+ Output:
56
+
57
+ Clancy pulls tickets from your Kanban board, implements them, commits, and squash-merges — one ticket per run, fresh context every time.
58
+
59
+ Let's get you set up.
60
+
61
+ ---
62
+
63
+ ## Step 3 — Questions (board-dependent)
64
+
65
+ ### Q1: Board selection
66
+
67
+ Output:
68
+
69
+ Which Kanban board are you using?
70
+
71
+ [1] Jira
72
+ [2] GitHub Issues
73
+ [3] Linear
74
+ [4] My board isn't listed
75
+
76
+ If the user selects [4], output the dead-end message and stop:
77
+
78
+ Clancy currently supports Jira, GitHub Issues, and Linear out of the box.
79
+
80
+ Your board isn't supported yet — but you can add it:
81
+ · Open an issue: github.com/Pushedskydiver/clancy/issues
82
+ · Contribute one: see CONTRIBUTING.md — adding a board is just a script template + a boards.json entry
83
+
84
+ In the meantime, you can still use Clancy manually:
85
+ · Run /clancy:map-codebase to scan and document your codebase
86
+ · Use the clancy-once.sh template from the GitHub repo as a starting point
87
+ · Implement your board's API fetch, store credentials in .clancy/.env
88
+ · Point clancy-afk.sh at your custom script via CLANCY_ONCE_SCRIPT in .clancy/.env
89
+
90
+ Do not scaffold anything after this message. Stop completely.
91
+
92
+ ---
93
+
94
+ ### Q2: Board-specific config
95
+
96
+ Ask each question individually and wait for an answer before moving to the next.
97
+
98
+ **Jira** — ask in this order:
99
+
100
+ 1. `What's your Jira base URL? (e.g. https://your-org.atlassian.net)`
101
+ 2. `What's your Jira project key? (e.g. PROJ)`
102
+ 3. `What email address do you use to log in to Atlassian?`
103
+ 4. `Paste your Jira API token: (create one at id.atlassian.com/manage-profile/security/api-tokens)`
104
+
105
+ **GitHub Issues** — ask in this order:
106
+
107
+ 1. `What's your GitHub repo? (owner/name, e.g. acme/my-app)`
108
+ 2. `Paste your GitHub personal access token: (needs repo scope)`
109
+
110
+ After collecting GitHub credentials, show:
111
+ ```
112
+ Important: Clancy only picks up GitHub Issues that have the "clancy" label applied.
113
+ Add this label to any issue you want Clancy to work on.
114
+ ```
115
+
116
+ **Linear** — ask in this order:
117
+
118
+ 1. `Paste your Linear API key: (create one at linear.app/settings/api)`
119
+ 2. `What's your Linear team ID? (find it at linear.app/settings/teams — click your team, copy the ID from the URL)`
120
+ 3. `What label should Clancy filter by? Create a "clancy" label in your Linear team and apply it to issues you want Clancy to implement. [clancy]`
121
+
122
+ If a label is entered: store as `CLANCY_LABEL` in `.clancy/.env`. Always wrap the value in double quotes (e.g. `CLANCY_LABEL="clancy"`).
123
+ If enter is pressed with no value: skip — omit the label clause entirely (Clancy will pick up all unstarted assigned issues).
124
+
125
+ ---
126
+
127
+ ### Q3 (Jira only): Status name
128
+
129
+ Output:
130
+
131
+ Which Jira status should Clancy pick tickets from?
132
+ Common values: To Do, Selected for Development, Ready, Open
133
+
134
+ [1] To Do (default)
135
+ [2] Enter a different value
136
+
137
+ Store as `CLANCY_JQL_STATUS` in `.clancy/.env`. Always wrap the value in double quotes — status names often contain spaces (e.g. `CLANCY_JQL_STATUS="Selected for Development"`) and unquoted values with spaces cause bash parse errors when the file is sourced.
138
+
139
+ ---
140
+
141
+ ### Q3b (Jira only): Sprints
142
+
143
+ Output: `Does your Jira project use sprints? (Requires Jira Software — not available on all plans) [y/N]:`
144
+
145
+ If yes: add `CLANCY_JQL_SPRINT=true` to `.clancy/.env`.
146
+ If no: omit the sprint clause from JQL entirely.
147
+
148
+ ---
149
+
150
+ ### Q3c (Jira only): Label filter
151
+
152
+ Output: `What label should Clancy filter by? Create a "clancy" label in your Jira project and apply it to tickets you want Clancy to implement. [clancy]`
153
+
154
+ If a label is entered: store as `CLANCY_LABEL` in `.clancy/.env`. Always wrap the value in double quotes (e.g. `CLANCY_LABEL="clancy"`).
155
+ If enter is pressed with no value: skip — omit the label clause entirely (Clancy will pick up all assigned tickets in the queue).
156
+
157
+ ---
158
+
159
+ ### Q4: Base branch (auto-detect)
160
+
161
+ Silently detect the base branch — do not ask unless detection fails:
162
+
163
+ 1. Run `git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null` and strip the `refs/remotes/origin/` prefix
164
+ 2. If that fails, check whether `main`, `master`, or `develop` exist as local branches (in that order)
165
+ 3. If still unresolved, default to `main`
166
+
167
+ Only if detection produces an unexpected result (e.g. something other than main/master/develop), confirm with the user:
168
+
169
+ Detected base branch: `{branch}` — is this correct? [Y/n]
170
+
171
+ Store the detected (or confirmed) value as `CLANCY_BASE_BRANCH` in `.clancy/.env`.
172
+
173
+ ---
174
+
175
+ ## Step 4 — Scaffold
176
+
177
+ Create `.clancy/` directory and the following:
178
+
179
+ 1. Copy the correct `clancy-once.sh` variant for the chosen board to `.clancy/clancy-once.sh`
180
+ 2. Copy `clancy-afk.sh` to `.clancy/clancy-afk.sh`
181
+ 3. Make both scripts executable: `chmod +x .clancy/*.sh`
182
+ 4. Create `.clancy/docs/` with 10 empty template files (UPPERCASE.md with section headings only):
183
+ - STACK.md, INTEGRATIONS.md, ARCHITECTURE.md, CONVENTIONS.md, TESTING.md
184
+ - GIT.md, DESIGN-SYSTEM.md, ACCESSIBILITY.md, DEFINITION-OF-DONE.md, CONCERNS.md
185
+ 5. Copy the correct `.env.example` variant to `.clancy/.env.example`
186
+ 6. Write collected credentials to `.clancy/.env` (if the user provided them)
187
+ 7. Handle `CLAUDE.md` — follow the merge logic in scaffold.md exactly:
188
+ - If no CLAUDE.md: write the full template as `CLAUDE.md`
189
+ - If CLAUDE.md exists without `<!-- clancy:start -->`: append the Clancy section to the end
190
+ - If CLAUDE.md exists with `<!-- clancy:start -->`: replace only the content between the markers
191
+ - Never overwrite the entire file
192
+ 8. Check `.gitignore` — if `.clancy/.env` is not listed, append it
193
+
194
+ ---
195
+
196
+ ## Step 4b — Commit scaffold
197
+
198
+ After scaffolding, commit everything created (excluding `.clancy/.env` which contains credentials):
199
+
200
+ ```bash
201
+ git add .clancy/clancy-once.sh .clancy/clancy-afk.sh .clancy/.env.example .clancy/docs/ CLAUDE.md .gitignore
202
+ git commit -m "chore(clancy): initialise — scaffold scripts, docs templates, and config"
203
+ ```
204
+
205
+ If `CLAUDE.md` was not modified (it already existed and was not changed), omit it from the `git add`. If `.gitignore` was not modified, omit it too. Only stage files that actually changed.
206
+
207
+ ---
208
+
209
+ ## Step 5 — Optional enhancements
210
+
211
+ Output:
212
+
213
+ ```
214
+ Clancy is set up. A few optional enhancements are available:
215
+
216
+ 1. Figma MCP — fetch design specs when tickets include a Figma URL
217
+ 2. Playwright — screenshot and verify UI after implementing tickets
218
+ 3. Notifications — post to Slack or Teams when a ticket completes or errors
219
+ 4. Max iterations — set how many tickets /clancy:run processes per session
220
+
221
+ Each takes about 2 minutes to configure, or skip any for now.
222
+ You can always add them later by editing .clancy/.env.
223
+
224
+ Set up optional enhancements? [y/N]
225
+ ```
226
+
227
+ If no: skip to Step 6.
228
+
229
+ If yes, walk through each in order. After each enhancement (whether configured or skipped), ask before starting the next one: `Set up [enhancement name]? [y/N]`
230
+
231
+ ### Enhancement 1: Figma MCP
232
+
233
+ Output: `Fetch design context from Figma when tickets include a Figma URL. Set up Figma MCP? [y/N]`
234
+
235
+ If no: skip to Enhancement 2.
236
+
237
+ If yes: `Paste your Figma API key: (create one at figma.com/settings → Personal access tokens)`
238
+
239
+ If a key is entered:
240
+ 1. Verify the key by calling `GET https://api.figma.com/v1/me` with `X-Figma-Token: {key}`
241
+ 2. On success, show:
242
+ ```
243
+ ✓ Figma connected: {email}
244
+
245
+ Note: Figma's API does not expose plan information.
246
+ Clancy uses 3 MCP calls per ticket (metadata, design context, screenshot).
247
+ Check your plan at figma.com/settings to confirm you have enough MCP calls for your usage.
248
+ Pro plans: 200 calls/day (~66 tickets). Starter: 6 calls/month (not suitable for AFK use).
249
+
250
+ Figma MCP enabled.
251
+ ```
252
+
253
+ If `GET /v1/me` fails (non-200), show:
254
+ ```
255
+ ✗ Couldn't verify Figma API key (HTTP {status}).
256
+ Double-check it at figma.com/settings → Personal access tokens.
257
+
258
+ [1] Try a different key
259
+ [2] Skip Figma for now
260
+ ```
261
+ Never silently continue with an unverified key. If the user picks [1], re-prompt for the key and repeat the verification. If [2], skip to Enhancement 2.
262
+
263
+ Write `FIGMA_API_KEY` to `.clancy/.env`. Add usage note to CLAUDE.md Clancy section.
264
+
265
+ ---
266
+
267
+ ### Enhancement 2: Playwright visual checks
268
+
269
+ If Figma was configured in Enhancement 1, output:
270
+ `Screenshot and verify UI after implementing tickets — and compare against the Figma design when one was fetched. Set up Playwright visual checks? [y/N]`
271
+
272
+ Otherwise output:
273
+ `Screenshot and verify UI after implementing tickets. Set up Playwright visual checks? [y/N]`
274
+
275
+ If no: skip to Enhancement 3.
276
+
277
+ If yes, continue:
278
+
279
+ **Step 1: Storybook detection**
280
+
281
+ Check `package.json` for `@storybook/` dependencies and `.storybook/` directory.
282
+ If detected: "This project appears to use Storybook. Is that right? [Y/n]"
283
+
284
+ **Step 2: (If Storybook confirmed) Storybook content**
285
+ ```
286
+ What does your project keep in Storybook?
287
+ [a] Individual components only (atoms, molecules, organisms)
288
+ [b] Components and some pages
289
+ [c] Everything — all UI is previewed in Storybook
290
+ [d] Let me describe it
291
+ ```
292
+
293
+ **Step 3: (If Storybook confirmed) Dev server scope**
294
+ ```
295
+ What UI work requires the full dev server instead of Storybook?
296
+ [a] Full pages and routes
297
+ [b] Nothing — everything is in Storybook
298
+ [c] Let me describe it
299
+ ```
300
+
301
+ **Step 4: Dev server command**
302
+ Auto-detect from `package.json` scripts (priority: `dev`, `start`, `serve`).
303
+ ```
304
+ What command starts your dev server?
305
+ Detected: {value}
306
+
307
+ [1] Yes, use this
308
+ [2] Enter a different command
309
+ ```
310
+
311
+ **Step 5: Dev server port**
312
+ Auto-detect from `vite.config.*`, `next.config.*`, or common defaults (5173, 3000, 8080).
313
+ ```
314
+ What port does your dev server run on?
315
+ Detected: {value}
316
+
317
+ [1] Yes, use this
318
+ [2] Enter a different port
319
+ ```
320
+
321
+ **Step 6: (If Storybook confirmed) Storybook command**
322
+ Auto-detect from `package.json` scripts (`storybook`, `storybook:dev`).
323
+ ```
324
+ What command starts Storybook?
325
+ Detected: {value}
326
+
327
+ [1] Yes, use this
328
+ [2] Enter a different command
329
+ ```
330
+
331
+ **Step 7: (If Storybook confirmed) Storybook port**
332
+ Auto-detect from `.storybook/main.js|ts` or default to 6006.
333
+ ```
334
+ What port does Storybook run on?
335
+ Detected: {value}
336
+
337
+ [1] Yes, use this
338
+ [2] Enter a different port
339
+ ```
340
+
341
+ **Step 8: Startup wait**
342
+ ```
343
+ How many seconds should Clancy wait for a server to be ready?
344
+
345
+ [1] 15 seconds (default)
346
+ [2] Enter a different value
347
+ ```
348
+
349
+ Write to `.clancy/.env`. Wrap command values in double quotes — they often contain spaces:
350
+ ```
351
+ PLAYWRIGHT_ENABLED=true
352
+ PLAYWRIGHT_DEV_COMMAND="<value>"
353
+ PLAYWRIGHT_DEV_PORT=<value>
354
+ PLAYWRIGHT_STORYBOOK_COMMAND="<value>" # only if Storybook confirmed
355
+ PLAYWRIGHT_STORYBOOK_PORT=<value> # only if Storybook confirmed
356
+ PLAYWRIGHT_STARTUP_WAIT=<value>
357
+ ```
358
+
359
+ Create `.clancy/docs/PLAYWRIGHT.md` — see PLAYWRIGHT.md template in scaffold.md.
360
+
361
+ ---
362
+
363
+ ### Enhancement 3: Slack / Teams notifications
364
+
365
+ Output: `Post to a channel when a ticket completes or Clancy hits an error. Set up notifications? [y/N]`
366
+
367
+ If no: skip to Enhancement 4.
368
+
369
+ If yes: `Paste your Slack or Teams webhook URL:`
370
+
371
+ Auto-detect platform from URL:
372
+ - `https://hooks.slack.com/` → Slack → sends `{"text": "..."}` payload
373
+ - `https://prod-*.logic.azure.com/` or `https://*.webhook.office.com/` → Teams → sends Adaptive Card
374
+
375
+ If Teams URL entered, show:
376
+ ```
377
+ Ensure you've set up the "Post to a channel when a webhook request is received"
378
+ workflow via Teams → channel → ... → Workflows. The URL must come from that
379
+ workflow's trigger, not from the old Office 365 Connectors setup (retired April 2026).
380
+ ```
381
+
382
+ Write `CLANCY_NOTIFY_WEBHOOK=<url>` to `.clancy/.env`.
383
+
384
+ ---
385
+
386
+ ### Enhancement 4: Max iterations
387
+
388
+ Output:
389
+
390
+ ```
391
+ How many tickets should /clancy:run process before stopping? [5]
392
+ (You can override this per-session with /clancy:run 20)
393
+ ```
394
+
395
+ Write `MAX_ITERATIONS=<value>` to `.clancy/.env`.
396
+
397
+ ---
398
+
399
+ ## Step 6 — Offer map-codebase
400
+
401
+ Output:
402
+
403
+ One last step — Clancy can scan your codebase now and populate `.clancy/docs/` with structured context it reads before every ticket. This takes about 2 minutes.
404
+
405
+ Scan codebase now? [Y/n]
406
+
407
+ If yes: run the map-codebase workflow.
408
+ If no: output "Run /clancy:map-codebase when you're ready." then continue to final output.
409
+
410
+ ---
411
+
412
+ ## Final output
413
+
414
+ Output:
415
+
416
+ Clancy is ready.
417
+
418
+ - Scripts: `.clancy/clancy-once.sh`, `.clancy/clancy-afk.sh`
419
+ - Docs: `.clancy/docs/` (10 files)
420
+ - Config: `.clancy/.env`
421
+ - CLAUDE.md: updated
422
+
423
+ Run `/clancy:once` to pick up your first ticket, or `/clancy:run` to process the full queue.
@@ -0,0 +1,82 @@
1
+ # Clancy Logs Workflow
2
+
3
+ ## Overview
4
+
5
+ Read `.clancy/progress.txt` and present a formatted summary.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Check file exists
10
+
11
+ If `.clancy/progress.txt` does not exist:
12
+ ```
13
+ No progress logged yet. Run /clancy:once or /clancy:run to get started.
14
+ ```
15
+ Stop.
16
+
17
+ ---
18
+
19
+ ## Step 2 — Parse progress.txt
20
+
21
+ Each line format: `YYYY-MM-DD HH:MM | TICKET-KEY | Summary | DONE`
22
+ Review lines format: `YYYY-MM-DD HH:MM | TICKET-KEY | REVIEW | {score}%`
23
+
24
+ Parse each line:
25
+ - Date (YYYY-MM-DD)
26
+ - Time (HH:MM)
27
+ - Ticket key (e.g. PROJ-42)
28
+ - Summary or "REVIEW"
29
+ - Status ("DONE" or score)
30
+
31
+ Extract:
32
+ - Total DONE tickets
33
+ - First and latest run dates
34
+ - All DONE tickets from the current calendar week (Mon–Sun)
35
+ - Epic key from ticket key — e.g. PROJ-42 → epic likely PROJ-10 (use parent field if logged, otherwise group by project prefix)
36
+
37
+ ---
38
+
39
+ ## Step 3 — Display
40
+
41
+ If only 1–3 DONE entries: show a flat list, skip grouping.
42
+
43
+ If 4+ entries, show the full grouped display:
44
+
45
+ ```
46
+ Clancy Progress Log
47
+ ───────────────────────────────────────
48
+ Total tickets completed: {count}
49
+ First run: {YYYY-MM-DD}
50
+ Latest run: {YYYY-MM-DD}
51
+
52
+ This week ({Mon date}–{Sun date or today}):
53
+ ✓ {TICKET-KEY} {Summary}
54
+ ✓ {TICKET-KEY} {Summary}
55
+ ...
56
+
57
+ By epic:
58
+ {EPIC-KEY} {Epic name or prefix} {bar} {count} tickets
59
+ {EPIC-KEY} {Epic name or prefix} {bar} {count} tickets
60
+ (other) {bar} {count} tickets
61
+
62
+ Full log: .clancy/progress.txt
63
+
64
+ Reviews run: {N}
65
+ ```
66
+
67
+ ### Display rules
68
+
69
+ - Show "this week" at the top — most recent activity is most relevant
70
+ - Cap "this week" at 10 entries. If more: "...and {n} more this week"
71
+ - Progress bars: ASCII, proportional to highest count, width 10 chars, `█` filled, `░` empty
72
+ - Epic grouping: group by epic key in the ticket's parent field (from progress.txt if logged), or by project prefix if not available
73
+ - Tickets without an epic: group under `(other)`
74
+ - REVIEW lines: shown separately at the end as "Reviews run: N" — not included in ticket count
75
+
76
+ ---
77
+
78
+ ## Notes
79
+
80
+ - No external dependencies — all ASCII, all bash-parseable
81
+ - The full log is always available at `.clancy/progress.txt` for raw access
82
+ - `--all` flag to remove the "this week" cap is a v2 addition — do not implement in v1
@@ -0,0 +1,124 @@
1
+ # Clancy Map-Codebase Workflow
2
+
3
+ ## Overview
4
+
5
+ Scan the codebase with 5 parallel specialist agents, each writing their assigned docs to `.clancy/docs/`. All 5 agents run simultaneously.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Check existing docs
10
+
11
+ If `.clancy/docs/` already has non-empty files:
12
+ ```
13
+ .clancy/docs/ already has content.
14
+
15
+ [1] Refresh all — re-run all 5 agents
16
+ [2] Update changed — detect what changed and re-run relevant agents
17
+ [3] Skip — keep existing docs
18
+ ```
19
+
20
+ If no content exists, proceed directly to Step 2.
21
+
22
+ ---
23
+
24
+ ## Step 2 — Create docs directory
25
+
26
+ Create `.clancy/docs/` if it doesn't exist.
27
+
28
+ ---
29
+
30
+ ## Step 3 — Spawn all 5 agents simultaneously
31
+
32
+ Launch all agents in parallel. Do not wait for one before starting the next.
33
+
34
+ Each agent is defined in `src/agents/`. Pass the agent the full path to the docs directory and the project root.
35
+
36
+ | Agent | Prompt file | Docs written |
37
+ |---|---|---|
38
+ | tech | `src/agents/tech-agent.md` | `STACK.md`, `INTEGRATIONS.md` |
39
+ | arch | `src/agents/arch-agent.md` | `ARCHITECTURE.md` |
40
+ | quality | `src/agents/quality-agent.md` | `CONVENTIONS.md`, `TESTING.md`, `GIT.md`, `DEFINITION-OF-DONE.md` |
41
+ | design | `src/agents/design-agent.md` | `DESIGN-SYSTEM.md`, `ACCESSIBILITY.md` |
42
+ | concerns | `src/agents/concerns-agent.md` | `CONCERNS.md` |
43
+
44
+ Tell the user agents are running:
45
+ ```
46
+ Scanning codebase with 5 parallel agents...
47
+ tech → STACK.md, INTEGRATIONS.md
48
+ arch → ARCHITECTURE.md
49
+ quality → CONVENTIONS.md, TESTING.md, GIT.md, DEFINITION-OF-DONE.md
50
+ design → DESIGN-SYSTEM.md, ACCESSIBILITY.md
51
+ concerns → CONCERNS.md
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Step 4 — Collect confirmations
57
+
58
+ Each agent returns a brief confirmation when done. Display as they complete:
59
+ ```
60
+ ✓ tech agent complete
61
+ ✓ arch agent complete
62
+ ✓ quality agent complete
63
+ ✓ design agent complete
64
+ ✓ concerns agent complete
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Step 5 — Verify
70
+
71
+ Check that all 10 files exist and are non-empty:
72
+ - `.clancy/docs/STACK.md`
73
+ - `.clancy/docs/INTEGRATIONS.md`
74
+ - `.clancy/docs/ARCHITECTURE.md`
75
+ - `.clancy/docs/CONVENTIONS.md`
76
+ - `.clancy/docs/TESTING.md`
77
+ - `.clancy/docs/GIT.md`
78
+ - `.clancy/docs/DEFINITION-OF-DONE.md`
79
+ - `.clancy/docs/DESIGN-SYSTEM.md`
80
+ - `.clancy/docs/ACCESSIBILITY.md`
81
+ - `.clancy/docs/CONCERNS.md`
82
+
83
+ If any file is missing or empty, report which agent failed and suggest re-running:
84
+ ```
85
+ Warning: {filename} is missing or empty. The {agent} agent may have failed.
86
+ Run /clancy:update-docs to re-run only that agent.
87
+ ```
88
+
89
+ Also check: if `PLAYWRIGHT_ENABLED=true` in `.clancy/.env`, verify `.clancy/docs/PLAYWRIGHT.md` exists. If not, create it from the template (see scaffold.md).
90
+
91
+ ---
92
+
93
+ ## Step 6 — Commit
94
+
95
+ ```bash
96
+ git add .clancy/docs/
97
+ git commit -m "docs(clancy): map codebase — generate .clancy/docs/"
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Step 7 — Final message
103
+
104
+ ```
105
+ Codebase mapped. Clancy is ready.
106
+
107
+ Docs written to .clancy/docs/ (10 files)
108
+
109
+ Run /clancy:once to pick up your first ticket.
110
+ Run /clancy:run to process the full queue.
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Agent instructions (apply to all 5 agents)
116
+
117
+ When writing agent prompts, embed these instructions:
118
+
119
+ - Use actual file paths (`src/components/Button.tsx` not "the Button component")
120
+ - Show HOW things are done with real code examples, not just WHAT exists
121
+ - Use Glob and Grep liberally before writing — understand the codebase, don't guess
122
+ - Write directly to file using the Write tool — never use bash heredocs
123
+ - Return a brief confirmation only — do not include doc contents in the response
124
+ - If a section has no content (e.g. no design system exists), write: `<!-- Not applicable to this project -->`
@@ -0,0 +1,80 @@
1
+ ## Update check
2
+
3
+ Before doing anything else, check for updates:
4
+
5
+ 1. Run: `npm show chief-clancy version`
6
+ 2. Read the installed version from the Clancy `package.json`
7
+ 3. If a newer version exists, print: `ℹ Clancy v{current} → v{latest} available. Run /clancy:update to upgrade.` then continue normally.
8
+ 4. If already on latest, continue silently.
9
+ 5. If the npm check fails for any reason (offline, network error), continue silently. Never block on this.
10
+
11
+ ---
12
+
13
+ # Clancy Once Workflow
14
+
15
+ ## Overview
16
+
17
+ Pick up exactly one ticket from the Kanban board, implement it, commit, squash-merge, and stop. Does not loop.
18
+
19
+ ---
20
+
21
+ ## Step 1 — Preflight checks
22
+
23
+ 1. Check `.clancy/` exists. If not:
24
+ ```
25
+ .clancy/ not found. Run /clancy:init first to set up Clancy.
26
+ ```
27
+ Stop.
28
+
29
+ 2. Check `.clancy/.env` exists and board credentials are present. If not:
30
+ ```
31
+ Missing credentials in .clancy/.env. Run /clancy:init to reconfigure.
32
+ ```
33
+ Stop.
34
+
35
+ 3. The script to run is always `.clancy/clancy-once.sh` regardless of board.
36
+ `/clancy:init` copies the correct board variant as `clancy-once.sh` during setup.
37
+
38
+ 4. Check `.clancy/clancy-once.sh` exists. If not:
39
+ ```
40
+ .clancy/clancy-once.sh not found. Run /clancy:init to scaffold scripts.
41
+ ```
42
+ Stop.
43
+
44
+ ---
45
+
46
+ ## Step 2 — Run
47
+
48
+ Display:
49
+ ```
50
+ Running Clancy for one ticket.
51
+ ```
52
+
53
+ Execute:
54
+ ```bash
55
+ bash .clancy/clancy-once.sh
56
+ ```
57
+
58
+ Stream output directly — do not buffer or summarise.
59
+
60
+ ---
61
+
62
+ ## Step 3 — Result
63
+
64
+ On success, echo the result line from the script output:
65
+ ```
66
+ ✓ {TICKET-KEY} complete.
67
+ ```
68
+
69
+ On failure:
70
+ ```
71
+ Clancy stopped. See output above for details.
72
+ Run /clancy:status to check the board, or /clancy:review to inspect the ticket.
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Notes
78
+
79
+ - Do not loop. This command runs the script exactly once and stops.
80
+ - Do not attempt to run scripts from `src/templates/` — only scripts in `.clancy/`.