@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,7 @@
1
+ # /clancy:logs
2
+
3
+ Format and display .clancy/progress.txt — tickets completed, dates, epics, and progress bars by epic.
4
+
5
+ @.claude/clancy/workflows/logs.md
6
+
7
+ Display the progress log as documented in the workflow above.
@@ -0,0 +1,9 @@
1
+ # /clancy:review
2
+
3
+ Fetch the next ticket from the board and score it — returns a confidence score (0–100%) and actionable recommendations before you run.
4
+
5
+ Does not implement anything. Read-only from Clancy's perspective, though it invokes Claude for analysis.
6
+
7
+ @.claude/clancy/workflows/review.md
8
+
9
+ Score the ticket as documented in the workflow above, including the full 7-criterion rubric and confidence bands.
@@ -0,0 +1,9 @@
1
+ # /clancy:status
2
+
3
+ Show the next tickets Clancy would pick up — read-only board check, no side effects.
4
+
5
+ Fetches up to 3 tickets from the queue using the same query as /clancy:implement, so what you see here is exactly what Clancy would run next.
6
+
7
+ @.claude/clancy/workflows/status.md
8
+
9
+ Show status as documented in the workflow above. Strictly read-only — no git operations, no file writes, no ticket claiming.
@@ -0,0 +1,109 @@
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
+ ```
14
+ 🚨 Clancy — Logs
15
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
+
17
+ No progress logged yet.
18
+
19
+ "The law is powerless to help you... but not for long." — Run /clancy:implement or /clancy:autopilot to get started.
20
+ ```
21
+
22
+ Stop.
23
+
24
+ ---
25
+
26
+ ## Step 2 — Parse progress.txt
27
+
28
+ Each line has one of these formats:
29
+
30
+ - `YYYY-MM-DD HH:MM | TICKET-KEY | Summary | DONE` — completed implementation
31
+ - `YYYY-MM-DD HH:MM | TICKET-KEY | REVIEW | {score}%` — ticket review
32
+ - `YYYY-MM-DD HH:MM | TICKET-KEY | PLAN | {S/M/L}` — plan generated
33
+ - `YYYY-MM-DD HH:MM | TICKET-KEY | REVISED | {S/M/L}` — plan revised after feedback
34
+ - `YYYY-MM-DD HH:MM | TICKET-KEY | APPROVE_PLAN | —` — plan promoted to description
35
+ - `YYYY-MM-DD HH:MM | TICKET-KEY | SKIPPED | {reason}` — ticket skipped
36
+ - `YYYY-MM-DD HH:MM | TICKET-KEY | POST_FAILED | {reason}` — failed to post comment to board
37
+ - `YYYY-MM-DD HH:MM | BRIEF | {slug} | {N} proposed tickets` — brief generated (slug-based format)
38
+ - `YYYY-MM-DD HH:MM | APPROVE_BRIEF | {slug} | {N} tickets created` — brief approved (slug-based format)
39
+
40
+ Parse each line:
41
+
42
+ - Date (YYYY-MM-DD)
43
+ - Time (HH:MM)
44
+ - Key or status (BRIEF/APPROVE_BRIEF entries put the status here, standard entries put the ticket key)
45
+ - Detail (status, score, size, reason, or slug for brief entries)
46
+
47
+ Extract:
48
+
49
+ - Total DONE tickets
50
+ - First and latest run dates
51
+ - All DONE tickets from the current calendar week (Mon–Sun)
52
+ - Counts for each action type: PLAN, REVISED, APPROVE_PLAN, REVIEW, SKIPPED, POST_FAILED, BRIEF, APPROVE_BRIEF
53
+ - Epic key from ticket key — e.g. PROJ-42 → epic likely PROJ-10 (use parent field if logged, otherwise group by project prefix)
54
+
55
+ ---
56
+
57
+ ## Step 3 — Display
58
+
59
+ If only 1–3 DONE entries: show a flat list, skip grouping.
60
+
61
+ If 4+ entries, show the full grouped display:
62
+
63
+ ```
64
+ 🚨 Clancy — Logs
65
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
66
+
67
+ Total tickets completed: {count}
68
+ First run: {YYYY-MM-DD}
69
+ Latest run: {YYYY-MM-DD}
70
+
71
+ This week ({Mon date}–{Sun date or today}):
72
+ ✅ {TICKET-KEY} {Summary}
73
+ ✅ {TICKET-KEY} {Summary}
74
+ ...
75
+
76
+ By epic:
77
+ {EPIC-KEY} {Epic name or prefix} {bar} {count} tickets
78
+ {EPIC-KEY} {Epic name or prefix} {bar} {count} tickets
79
+ (other) {bar} {count} tickets
80
+
81
+ Plans generated: {N} (only show if > 0)
82
+ Plans revised: {N} (only show if > 0)
83
+ Plans approved: {N} (only show if > 0)
84
+ Briefs generated: {N} (only show if > 0)
85
+ Briefs approved: {N} (only show if > 0)
86
+ Reviews run: {N} (only show if > 0)
87
+ Tickets skipped: {N} (only show if > 0)
88
+ Post failures: {N} (only show if > 0)
89
+ Full log: .clancy/progress.txt
90
+
91
+ "The law is powerless to help you, but here's what Clancy's done."
92
+ ```
93
+
94
+ ### Display rules
95
+
96
+ - Show "this week" at the top — most recent activity is most relevant
97
+ - Cap "this week" at 10 entries. If more: "...and {n} more this week"
98
+ - Progress bars: ASCII, proportional to highest count, width 10 chars, `█` filled, `░` empty
99
+ - Epic grouping: group by epic key in the ticket's parent field (from progress.txt if logged), or by project prefix if not available
100
+ - Tickets without an epic: group under `(other)`
101
+ - REVIEW, PLAN, REVISED, APPROVE_PLAN, BRIEF, APPROVE_BRIEF, SKIPPED, and POST_FAILED lines: shown separately at the end as counts — not included in ticket count
102
+
103
+ ---
104
+
105
+ ## Notes
106
+
107
+ - No external dependencies — all ASCII, all bash-parseable
108
+ - The full log is always available at `.clancy/progress.txt` for raw access
109
+ - `--all` flag to remove the "this week" cap is a v2 addition — do not implement in v1
@@ -0,0 +1,197 @@
1
+ # Clancy Review Workflow
2
+
3
+ ## Overview
4
+
5
+ Fetch the next ticket from the board and score how well-specified it is. Returns a confidence score (0–100%) and actionable recommendations. Does not implement anything.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Preflight checks
10
+
11
+ 1. Check `.clancy/` exists and `.clancy/.env` is present. If not:
12
+
13
+ ```
14
+ .clancy/ not found. Run /clancy:init to set up Clancy first.
15
+ ```
16
+
17
+ Stop.
18
+
19
+ 2. Source `.clancy/.env` and check board credentials are present (same vars checked by `/clancy:status`).
20
+
21
+ ---
22
+
23
+ ## Step 2 — Fetch next ticket
24
+
25
+ Detect board from `.clancy/.env` and fetch with `maxResults=1`. The query must match the once-runner exactly — what review shows is what run would pick up.
26
+
27
+ **Jira:** Build JQL using the same clauses as the once-runner:
28
+
29
+ - Sprint clause: include `AND sprint in openSprints()` if `CLANCY_JQL_SPRINT` is set
30
+ - Label clause: include `AND labels = "$CLANCY_LABEL_BUILD"` if `CLANCY_LABEL_BUILD` is set (falls back to `CLANCY_LABEL`)
31
+ - `CLANCY_JQL_STATUS` defaults to `To Do` if not set
32
+
33
+ Full JQL: `project=$JIRA_PROJECT_KEY [AND sprint in openSprints()] [AND labels = "$CLANCY_LABEL_BUILD"] AND assignee=currentUser() AND status="$CLANCY_JQL_STATUS" ORDER BY priority ASC`
34
+
35
+ Use the POST `/rest/api/3/search/jql` endpoint (the old GET `/rest/api/3/search` was removed Aug 2025):
36
+
37
+ ```bash
38
+ RESPONSE=$(curl -s \
39
+ -u "$JIRA_USER:$JIRA_API_TOKEN" \
40
+ -X POST \
41
+ -H "Content-Type: application/json" \
42
+ -H "Accept: application/json" \
43
+ "$JIRA_BASE_URL/rest/api/3/search/jql" \
44
+ -d '{"jql": "<jql as above>", "maxResults": 1, "fields": ["summary", "description", "issuelinks", "parent", "customfield_10014"]}')
45
+ ```
46
+
47
+ **GitHub Issues:** First resolve the authenticated username (don't use `@me` — it breaks with fine-grained PATs):
48
+ `GITHUB_USERNAME=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/user | jq -r '.login')`
49
+ Then: `GET /repos/$GITHUB_REPO/issues?state=open&assignee=$GITHUB_USERNAME&labels=$CLANCY_LABEL_BUILD&per_page=1` — filter out PRs (entries with `pull_request` key). Use `CLANCY_LABEL_BUILD` from `.clancy/.env` (falls back to `CLANCY_LABEL`, defaults to `clancy`).
50
+
51
+ **Linear:** GraphQL `viewer.assignedIssues` with `filter: { state: { type: { eq: "unstarted" } }, team: { id: { eq: "$LINEAR_TEAM_ID" } }[, labels: { name: { eq: "$CLANCY_LABEL_BUILD" } }] }` (label clause only if `CLANCY_LABEL_BUILD` is set, falls back to `CLANCY_LABEL`), `first: 1`, `orderBy: priority`
52
+
53
+ Fetch full ticket content: summary, description (full text), acceptance criteria (if present), epic/parent info, blockers/issue links.
54
+
55
+ If no tickets found:
56
+
57
+ ```
58
+ 🚨 Clancy — Review
59
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
60
+
61
+ No tickets in the queue. Nothing to review.
62
+
63
+ "Quiet. Too quiet." — Check your board or run /clancy:status.
64
+ ```
65
+
66
+ Stop.
67
+
68
+ ---
69
+
70
+ ## Step 3 — Score against 7 criteria
71
+
72
+ Score each criterion as pass / warn / fail using the rubric below. Compute weighted confidence score.
73
+
74
+ ### Scoring rubric
75
+
76
+ | # | Criterion | Weight | Pass | Warn | Fail |
77
+ | --- | --------------------------- | ------ | -------------------------- | ------------------------------------- | ------------------------------------------------------- |
78
+ | 1 | Summary clarity | 10% | Specific, scopeable | Vague but workable | Too broad or meaningless |
79
+ | 2 | Description quality | 15% | Explains what + why | What only, no why | Missing or one-liner |
80
+ | 3 | Acceptance criteria | 25% | Concrete + testable | Present but vague | Missing entirely |
81
+ | 4 | Figma URL (UI tickets only) | 15% | URL present in description | — | UI ticket, no Figma URL |
82
+ | 5 | Scope realism | 15% | Single focused deliverable | Multiple deliverables or borderline | Too large, "and also" tasks, or spans unrelated systems |
83
+ | 6 | Dependencies stated | 5% | Blockers explicit | — | No mention of dependencies |
84
+ | 7 | Clancy executability | 15% | Purely codebase work | Mostly codebase, minor external touch | Requires work outside the codebase |
85
+
86
+ **Criterion 7 — Clancy executability:** Score as Fail if the ticket primarily requires any of the following — Clancy cannot do these from within the codebase:
87
+
88
+ - **External system admin:** "in Google Analytics", "in Salesforce", "in HubSpot", "in the AWS console", "in Jira admin", "in the app store dashboard"
89
+ - **Human process steps:** "get sign-off from", "send an email to customers", "coordinate with", "schedule a meeting", "announce to users"
90
+ - **Production ops (non-repo):** "deploy to production", "rotate the API keys in prod", "scale the fleet", "restart the service" — unless the ticket is purely about CI/CD config files that live in the repo
91
+ - **Non-code deliverables:** "write a runbook", "update the wiki", "create a presentation", "document in Confluence"
92
+
93
+ Score as Warn if the ticket is mostly codebase work but has an incidental external touch (e.g. "add a new event to the existing analytics tracking" — the code change is in the repo, even if the event appears in a dashboard).
94
+
95
+ **Tech stack coherence (part of criterion 7):** If `.clancy/docs/STACK.md` exists, read it and check the ticket against the documented stack. If the ticket mentions a technology or platform not in the documented stack that appears to be an external service (not a new dependency to install), score criterion 7 as Warn and note the mismatch explicitly.
96
+
97
+ **Figma criterion:** Only applies if the ticket description mentions UI, components, screens, design, or visual elements. Backend/API/config tickets skip criterion 4 and redistribute its 15% weight proportionally across the remaining criteria.
98
+
99
+ **Figma URL quality checks:**
100
+
101
+ - URL present but points to file root (no `node-id`) → warn: recommend scoping to specific frame
102
+ - `FIGMA_API_KEY` not configured but UI ticket has Figma URL → warn: link will be ignored at runtime
103
+
104
+ **Scope realism — additional Fail signals:**
105
+
106
+ - Ticket contains multiple distinct deliverables ("and also", "additionally", "while you're at it", "as well as")
107
+ - Ticket implies setting up new infrastructure from scratch where none exists in the repo (new database, new service, new deployment pipeline)
108
+ - Ticket references 4+ unrelated subsystems that would each require deep separate context
109
+
110
+ **Score calculation:**
111
+
112
+ - Pass = full weight
113
+ - Warn = half weight
114
+ - Fail = zero weight
115
+ - Sum all weighted scores → overall percentage
116
+
117
+ **Hard gate — executability override:** If criterion 7 scores Fail, cap the verdict at "Needs work" regardless of the calculated score. A ticket that requires work outside the codebase cannot be run reliably no matter how well it is specified.
118
+
119
+ ---
120
+
121
+ ## Step 4 — Generate recommendations
122
+
123
+ For each warn or fail criterion, generate a specific, actionable recommendation — specific to this ticket, not generic advice.
124
+
125
+ Good: "Add a Figma URL to the ticket description — this ticket mentions updating the profile header component"
126
+ Bad: "Ensure design specs are provided"
127
+
128
+ ---
129
+
130
+ ## Step 5 — Display output
131
+
132
+ ```
133
+ 🚨 Clancy — Review
134
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
135
+
136
+ [{TICKET-KEY}] {Summary}
137
+
138
+ Confidence: {score}% — {badge} {band label}
139
+
140
+ {for each criterion:}
141
+ ✅ {criterion name} — {pass reason}
142
+ ⚠️ {criterion name} — {warn reason}
143
+ → {specific recommendation}
144
+ ❌ {criterion name} — {fail reason}
145
+ → {specific recommendation}
146
+
147
+ {verdict line}
148
+
149
+ {sign-off quote}
150
+ ```
151
+
152
+ ### Confidence bands
153
+
154
+ | Score | Badge | Label | Verdict action |
155
+ | ------- | ----- | ----------------------- | ------------------------------------------------------------------------------- |
156
+ | 85–100% | 🟢 | Ready | "Run with confidence." |
157
+ | 65–84% | 🟡 | Good to go with caveats | "Review the warnings above, then run /clancy:implement." |
158
+ | 40–64% | 🟠 | Needs work | "Address the ❌ items in the ticket, then re-run /clancy:review." |
159
+ | 0–39% | 🔴 | Not ready | "This ticket needs significant rework before Clancy can implement it reliably." |
160
+
161
+ **Executability override:** If criterion 7 (Clancy executability) scores Fail, ignore the calculated band and show:
162
+
163
+ ```
164
+ 🔴 Verdict: Not ready for Clancy
165
+ This ticket requires work outside the codebase — Clancy can only implement code changes.
166
+ Update the ticket to focus on the codebase side, or remove it from the queue.
167
+
168
+ "This is Papa Bear. Put out an APB for a better ticket spec."
169
+ ```
170
+
171
+ ### Sign-off quotes per band
172
+
173
+ Append a Wiggum-themed quote after the verdict to add personality. Never suggest bypassing the review on low-confidence tickets:
174
+
175
+ - **🟢 Ready:** `"Bake 'em away, toys." — Run /clancy:implement to pick it up.`
176
+ - **🟡 Good to go:** `"I'd rather let Herman go. I don't think we've got enough to nail him." — Fix the warnings, then run /clancy:implement.`
177
+ - **🟠 Needs work:** `"Uh, no. You got the wrong number. This is 9-1... 2." — Update the ticket, then re-run /clancy:review.`
178
+ - **🔴 Not ready:** `"This is Papa Bear. Put out an APB for a better ticket spec." — Rework the ticket first.`
179
+
180
+ ---
181
+
182
+ ## Step 6 — Log the review
183
+
184
+ Append to `.clancy/progress.txt`:
185
+
186
+ ```
187
+ YYYY-MM-DD HH:MM | {TICKET-KEY} | REVIEW | {score}%
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Notes
193
+
194
+ - Recommendations are specific to this ticket — never generic
195
+ - The verdict always suggests a next step — never leaves the user without a clear action
196
+ - Re-running `/clancy:review` multiple times is safe — the score may improve as the ticket is updated
197
+ - Do not implement anything — Claude is invoked for analysis only
@@ -0,0 +1,142 @@
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 the once-runner:
27
+
28
+ - Sprint clause: include `AND sprint in openSprints()` if `CLANCY_JQL_SPRINT` is set
29
+ - Label clause: include `AND labels = "$CLANCY_LABEL_BUILD"` if `CLANCY_LABEL_BUILD` is set (falls back to `CLANCY_LABEL`)
30
+ - `CLANCY_JQL_STATUS` defaults to `To Do` if not set
31
+
32
+ Full JQL (with both optional clauses shown):
33
+ `project=$JIRA_PROJECT_KEY [AND sprint in openSprints()] [AND labels = "$CLANCY_LABEL_BUILD"] AND assignee=currentUser() AND status="$CLANCY_JQL_STATUS" ORDER BY priority ASC`
34
+
35
+ ```bash
36
+ RESPONSE=$(curl -s \
37
+ -u "$JIRA_USER:$JIRA_API_TOKEN" \
38
+ -X POST \
39
+ -H "Content-Type: application/json" \
40
+ -H "Accept: application/json" \
41
+ "$JIRA_BASE_URL/rest/api/3/search/jql" \
42
+ -d '{"jql": "<jql as above>", "maxResults": 3, "fields": ["summary", "parent", "customfield_10014", "status"]}')
43
+ ```
44
+
45
+ **GitHub Issues:**
46
+ First resolve the authenticated username (don't use `@me` — it breaks with fine-grained PATs):
47
+
48
+ ```bash
49
+ GITHUB_USERNAME=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/user | jq -r '.login')
50
+ ```
51
+
52
+ Then fetch issues:
53
+
54
+ ```bash
55
+ RESPONSE=$(curl -s \
56
+ -H "Authorization: Bearer $GITHUB_TOKEN" \
57
+ -H "X-GitHub-Api-Version: 2022-11-28" \
58
+ "https://api.github.com/repos/$GITHUB_REPO/issues?state=open&assignee=$GITHUB_USERNAME&labels=$CLANCY_LABEL_BUILD&per_page=3")
59
+ # Filter out PRs (entries with pull_request key)
60
+ ```
61
+
62
+ **Linear:**
63
+
64
+ Build the filter — `CLANCY_LABEL_BUILD` is optional (falls back to `CLANCY_LABEL`):
65
+
66
+ - Base filter: `state: { type: { eq: "unstarted" } }, team: { id: { eq: "$LINEAR_TEAM_ID" } }`
67
+ - If `CLANCY_LABEL_BUILD` is set (or `CLANCY_LABEL` fallback): add `labels: { name: { eq: "$CLANCY_LABEL_BUILD" } }` to the filter
68
+
69
+ ```graphql
70
+ query {
71
+ viewer {
72
+ assignedIssues(
73
+ filter: { state: { type: { eq: "unstarted" } }, team: { id: { eq: "$LINEAR_TEAM_ID" } } [, labels: { name: { eq: "$CLANCY_LABEL_BUILD" } }] }
74
+ first: 3
75
+ orderBy: priority
76
+ ) {
77
+ nodes { id identifier title parent { identifier title } }
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Step 3 — Display
86
+
87
+ If tickets found, display:
88
+
89
+ ```
90
+ 🚨 Clancy — Status
91
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
92
+
93
+ Next up:
94
+
95
+ 1. [{TICKET-KEY}] {Summary}
96
+ Epic: {epic key} — {epic title}
97
+ Status: {status}
98
+
99
+ 2. [{TICKET-KEY}] {Summary}
100
+ Epic: {epic key} — {epic title}
101
+ Status: {status}
102
+
103
+ 3. [{TICKET-KEY}] {Summary}
104
+ Epic: {epic key} — {epic title}
105
+ Status: {status}
106
+
107
+ "Let me check the dispatch..." — Run /clancy:implement to pick up #1, or /clancy:autopilot to process the queue.
108
+ ```
109
+
110
+ If no tickets found:
111
+
112
+ ```
113
+ 🚨 Clancy — Status
114
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
115
+
116
+ No tickets found in the current queue.
117
+
118
+ "Quiet. Too quiet." — Check your board or run /clancy:init to verify your config.
119
+ ```
120
+
121
+ If API call fails, show the error clearly:
122
+
123
+ ```
124
+ 🚨 Clancy — Status
125
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
126
+
127
+ ❌ Board API error: {error message}
128
+
129
+ Tips:
130
+ - Check your credentials in .clancy/.env
131
+ - For Jira: ensure you have VPN access if required
132
+ - Run /clancy:init to reconfigure
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Notes
138
+
139
+ - Show up to 3 tickets. If only 1 or 2 are available, show those.
140
+ - Omit "Epic:" line if no epic/parent data is present for that ticket.
141
+ - This command is strictly read-only. No git ops, no file writes, no Claude invocation for analysis.
142
+ - The query used here must be identical to the one used by the once-runner — what status shows is exactly what run would pick up.
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Structural tests for role markdown files.
3
+ *
4
+ * Verifies the roles directory contains the expected roles and subdirectories
5
+ * that the installer's role-filter module depends on.
6
+ */
7
+ import { readdirSync, readFileSync } from 'node:fs';
8
+ import { join } from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+
11
+ import { describe, expect, it } from 'vitest';
12
+
13
+ const ROLES_DIR = fileURLToPath(new URL('.', import.meta.url));
14
+
15
+ const CORE_ROLES = ['implementer', 'reviewer', 'setup'];
16
+ const OPTIONAL_ROLES = ['planner', 'strategist'];
17
+ const ALL_ROLES = [...CORE_ROLES, ...OPTIONAL_ROLES].sort();
18
+
19
+ const SUBDIRS = ['commands', 'workflows'];
20
+
21
+ describe('roles directory structure', () => {
22
+ it('contains exactly the expected roles', () => {
23
+ const roles = readdirSync(ROLES_DIR, { withFileTypes: true })
24
+ .filter((d) => d.isDirectory())
25
+ .map((d) => d.name)
26
+ .sort();
27
+
28
+ expect(roles).toEqual(ALL_ROLES);
29
+ });
30
+
31
+ ALL_ROLES.forEach((role) => {
32
+ describe(role, () => {
33
+ SUBDIRS.forEach((subdir) => {
34
+ it(`has a ${subdir}/ subdirectory with .md files`, () => {
35
+ const dir = join(ROLES_DIR, role, subdir);
36
+ const files = readdirSync(dir).filter((f) => f.endsWith('.md'));
37
+
38
+ expect(files.length).toBeGreaterThan(0);
39
+ });
40
+ });
41
+ });
42
+ });
43
+
44
+ SUBDIRS.forEach((subdir) => {
45
+ it(`has no duplicate filenames across roles in ${subdir}/`, () => {
46
+ const seen = new Map<string, string>();
47
+ const duplicates: string[] = [];
48
+
49
+ ALL_ROLES.forEach((role) => {
50
+ const dir = join(ROLES_DIR, role, subdir);
51
+ const files = readdirSync(dir).filter((f) => f.endsWith('.md'));
52
+
53
+ files.forEach((file) => {
54
+ const existing = seen.get(file);
55
+
56
+ if (existing) {
57
+ duplicates.push(`${file} in both ${existing} and ${role}`);
58
+ } else {
59
+ seen.set(file, role);
60
+ }
61
+ });
62
+ });
63
+
64
+ expect(duplicates).toEqual([]);
65
+ });
66
+ });
67
+
68
+ it('all command files start with a heading', () => {
69
+ const issues: string[] = [];
70
+
71
+ ALL_ROLES.forEach((role) => {
72
+ const cmdDir = join(ROLES_DIR, role, 'commands');
73
+ const files = readdirSync(cmdDir).filter((f) => f.endsWith('.md'));
74
+
75
+ files.forEach((file) => {
76
+ const content = readFileSync(join(cmdDir, file), 'utf8');
77
+ const firstLine = content.split('\n')[0]?.trim() ?? '';
78
+
79
+ if (!firstLine.startsWith('#')) {
80
+ issues.push(`${role}/commands/${file}`);
81
+ }
82
+ });
83
+ });
84
+
85
+ expect(issues).toEqual([]);
86
+ });
87
+ });
@@ -0,0 +1,7 @@
1
+ # /clancy:doctor
2
+
3
+ Diagnose your Clancy setup — test every configured integration and report what's working, what's broken, and how to fix it.
4
+
5
+ @.claude/clancy/workflows/doctor.md
6
+
7
+ Run the doctor workflow as documented above.
@@ -0,0 +1,80 @@
1
+ # /clancy:help
2
+
3
+ List all Clancy commands with descriptions.
4
+
5
+ Display the following:
6
+
7
+ ---
8
+
9
+ ## Clancy — autonomous, board-driven development for Claude Code
10
+
11
+ Named after Chief Clancy Wiggum (Ralph's dad, The Simpsons). Built on the Ralph technique
12
+ coined by Geoffrey Huntley (ghuntley.com/ralph/). Clancy extends that foundation with board
13
+ integration (6 boards), structured codebase docs, and a git workflow built for team development.
14
+
15
+ **Supported boards:** Jira, GitHub Issues, Linear, Shortcut, Notion, Azure DevOps
16
+
17
+ ### Planner _(optional — enable via `CLANCY_ROLES=planner` in `.clancy/.env`)_
18
+
19
+ | Command | Description |
20
+ | ----------------------- | ----------------------------------------------------------- |
21
+ | `/clancy:plan` | Refine backlog tickets into structured implementation plans |
22
+ | `/clancy:plan 3` | Plan up to 3 tickets in batch mode |
23
+ | `/clancy:plan PROJ-123` | Plan a specific ticket by key (also `#42`, `ENG-42`) |
24
+ | `/clancy:plan --fresh` | Discard any existing plan and start from scratch |
25
+ | `/clancy:approve-plan` | Promote an approved plan to the ticket description |
26
+
27
+ ### Strategist _(optional — enable via `CLANCY_ROLES=strategist` in `.clancy/.env`)_
28
+
29
+ | Command | Description |
30
+ | ----------------------- | ------------------------------------------------------------- |
31
+ | `/clancy:brief` | Generate a strategic brief (research + grill + decomposition) |
32
+ | `/clancy:approve-brief` | Convert a brief into tickets on the board |
33
+
34
+ ### Implementer
35
+
36
+ | Command | Description |
37
+ | ---------------------- | --------------------------------------------------------------- |
38
+ | `/clancy:implement` | Pick up one ticket and stop — good for first runs and debugging |
39
+ | `/clancy:autopilot` | Run in loop mode until queue is empty or MAX_ITERATIONS hit |
40
+ | `/clancy:autopilot 20` | Same, but override MAX_ITERATIONS to 20 for this session |
41
+ | `/clancy:dry-run` | Preview next ticket without making any changes |
42
+
43
+ ### Reviewer
44
+
45
+ | Command | Description |
46
+ | ---------------- | ---------------------------------------------------------- |
47
+ | `/clancy:review` | Score next ticket (0–100%) with actionable recommendations |
48
+ | `/clancy:status` | Show next tickets without running — read-only board check |
49
+ | `/clancy:logs` | Format and display .clancy/progress.txt |
50
+
51
+ ### Setup & Maintenance
52
+
53
+ | Command | Description |
54
+ | ---------------------- | ------------------------------------------------------------------------------ |
55
+ | `/clancy:init` | Wizard — choose board, collect config, scaffold everything, offer map-codebase |
56
+ | `/clancy:settings` | View and change configuration — model, iterations, board, and more |
57
+ | `/clancy:doctor` | Diagnose your setup — test every integration and report what's broken |
58
+ | `/clancy:map-codebase` | Full 5-agent parallel codebase scan, writes all 10 docs |
59
+ | `/clancy:update-docs` | Incremental refresh — re-runs agents for changed areas only |
60
+ | `/clancy:update` | Update Clancy to latest version via npx |
61
+ | `/clancy:uninstall` | Remove Clancy commands — optionally remove `.clancy/` too |
62
+ | `/clancy:help` | This screen |
63
+
64
+ ### How it works
65
+
66
+ 1. Run `/clancy:init` to connect your Kanban board and scaffold .clancy/
67
+ 2. Run `/clancy:map-codebase` to generate codebase docs (or say yes during init)
68
+ 3. Run `/clancy:dry-run` to preview the first ticket, then `/clancy:implement` to run it — then go AFK with `/clancy:autopilot`
69
+
70
+ Clancy picks one ticket per loop, fresh context every iteration. No context rot.
71
+
72
+ ### Links
73
+
74
+ - GitHub: github.com/Pushedskydiver/chief-clancy
75
+ - Issues: github.com/Pushedskydiver/chief-clancy/issues
76
+ - Lineage: ghuntley.com/ralph/
77
+
78
+ ---
79
+
80
+ Show this output exactly. Do not add, remove, or reformat any content.
@@ -0,0 +1,7 @@
1
+ # /clancy:init
2
+
3
+ Set up Clancy in your project — choose your Kanban board, collect config, scaffold scripts and docs, and optionally scan your codebase.
4
+
5
+ @.claude/clancy/workflows/init.md
6
+
7
+ Run the full init wizard as documented in the workflow above. Follow every step exactly.