chief-clancy 0.8.22 → 0.9.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.
- package/bin/clancy.js +153 -0
- package/package.json +8 -88
- package/README.md +0 -292
- package/dist/bundle/clancy-afk.js +0 -6
- package/dist/bundle/clancy-once.js +0 -239
- package/dist/installer/file-ops/file-ops.d.ts +0 -32
- package/dist/installer/file-ops/file-ops.d.ts.map +0 -1
- package/dist/installer/file-ops/file-ops.js +0 -58
- package/dist/installer/file-ops/file-ops.js.map +0 -1
- package/dist/installer/hook-installer/hook-installer.d.ts +0 -31
- package/dist/installer/hook-installer/hook-installer.d.ts.map +0 -1
- package/dist/installer/hook-installer/hook-installer.js +0 -137
- package/dist/installer/hook-installer/hook-installer.js.map +0 -1
- package/dist/installer/install.d.ts +0 -3
- package/dist/installer/install.d.ts.map +0 -1
- package/dist/installer/install.js +0 -270
- package/dist/installer/install.js.map +0 -1
- package/dist/installer/manifest/manifest.d.ts +0 -41
- package/dist/installer/manifest/manifest.d.ts.map +0 -1
- package/dist/installer/manifest/manifest.js +0 -97
- package/dist/installer/manifest/manifest.js.map +0 -1
- package/dist/installer/prompts/prompts.d.ts +0 -33
- package/dist/installer/prompts/prompts.d.ts.map +0 -1
- package/dist/installer/prompts/prompts.js +0 -55
- package/dist/installer/prompts/prompts.js.map +0 -1
- package/dist/installer/role-filter/role-filter.d.ts +0 -15
- package/dist/installer/role-filter/role-filter.d.ts.map +0 -1
- package/dist/installer/role-filter/role-filter.js +0 -48
- package/dist/installer/role-filter/role-filter.js.map +0 -1
- package/dist/installer/ui/ui.d.ts +0 -9
- package/dist/installer/ui/ui.d.ts.map +0 -1
- package/dist/installer/ui/ui.js +0 -94
- package/dist/installer/ui/ui.js.map +0 -1
- package/dist/scripts/shared/env-parser/env-parser.d.ts +0 -30
- package/dist/scripts/shared/env-parser/env-parser.d.ts.map +0 -1
- package/dist/scripts/shared/env-parser/env-parser.js +0 -64
- package/dist/scripts/shared/env-parser/env-parser.js.map +0 -1
- package/dist/utils/ansi/ansi.d.ts +0 -55
- package/dist/utils/ansi/ansi.d.ts.map +0 -1
- package/dist/utils/ansi/ansi.js +0 -55
- package/dist/utils/ansi/ansi.js.map +0 -1
- package/hooks/clancy-branch-guard.js +0 -128
- package/hooks/clancy-check-update.js +0 -114
- package/hooks/clancy-context-monitor.js +0 -189
- package/hooks/clancy-credential-guard.js +0 -120
- package/hooks/clancy-drift-detector.js +0 -96
- package/hooks/clancy-notification.js +0 -105
- package/hooks/clancy-post-compact.js +0 -53
- package/hooks/clancy-statusline.js +0 -82
- package/hooks/package.json +0 -3
- package/registry/boards.json +0 -44
- package/src/agents/arch-agent.md +0 -72
- package/src/agents/concerns-agent.md +0 -89
- package/src/agents/design-agent.md +0 -130
- package/src/agents/devils-advocate.md +0 -53
- package/src/agents/quality-agent.md +0 -161
- package/src/agents/tech-agent.md +0 -92
- package/src/agents/verification-gate.md +0 -128
- package/src/roles/implementer/commands/dry-run.md +0 -14
- package/src/roles/implementer/commands/once.md +0 -17
- package/src/roles/implementer/commands/run.md +0 -11
- package/src/roles/implementer/workflows/once.md +0 -146
- package/src/roles/implementer/workflows/run.md +0 -127
- package/src/roles/planner/commands/approve-plan.md +0 -10
- package/src/roles/planner/commands/plan.md +0 -20
- package/src/roles/planner/workflows/approve-plan.md +0 -535
- package/src/roles/planner/workflows/plan.md +0 -536
- package/src/roles/reviewer/commands/logs.md +0 -7
- package/src/roles/reviewer/commands/review.md +0 -9
- package/src/roles/reviewer/commands/status.md +0 -9
- package/src/roles/reviewer/workflows/logs.md +0 -104
- package/src/roles/reviewer/workflows/review.md +0 -186
- package/src/roles/reviewer/workflows/status.md +0 -134
- package/src/roles/setup/commands/doctor.md +0 -7
- package/src/roles/setup/commands/help.md +0 -80
- package/src/roles/setup/commands/init.md +0 -7
- package/src/roles/setup/commands/map-codebase.md +0 -16
- package/src/roles/setup/commands/settings.md +0 -7
- package/src/roles/setup/commands/uninstall.md +0 -5
- package/src/roles/setup/commands/update-docs.md +0 -9
- package/src/roles/setup/commands/update.md +0 -12
- package/src/roles/setup/workflows/doctor.md +0 -124
- package/src/roles/setup/workflows/init.md +0 -1073
- package/src/roles/setup/workflows/map-codebase.md +0 -125
- package/src/roles/setup/workflows/scaffold.md +0 -845
- package/src/roles/setup/workflows/settings.md +0 -944
- package/src/roles/setup/workflows/uninstall.md +0 -161
- package/src/roles/setup/workflows/update-docs.md +0 -92
- package/src/roles/setup/workflows/update.md +0 -277
- package/src/roles/strategist/commands/approve-brief.md +0 -21
- package/src/roles/strategist/commands/brief.md +0 -27
- package/src/roles/strategist/workflows/approve-brief.md +0 -834
- package/src/roles/strategist/workflows/brief.md +0 -890
- package/src/templates/CLAUDE.md +0 -87
|
@@ -1,536 +0,0 @@
|
|
|
1
|
-
# Clancy Plan Workflow
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
Fetch backlog tickets from the board, explore the codebase, and generate structured implementation plans. Plans are posted as comments on the ticket for human review. Does not implement anything — planning only.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Step 1 — Preflight checks
|
|
10
|
-
|
|
11
|
-
1. Check `.clancy/` exists and `.clancy/.env` is present. If not:
|
|
12
|
-
```
|
|
13
|
-
.clancy/ not found. Run /clancy:init to set up Clancy first.
|
|
14
|
-
```
|
|
15
|
-
Stop.
|
|
16
|
-
|
|
17
|
-
2. Source `.clancy/.env` and check board credentials are present.
|
|
18
|
-
|
|
19
|
-
3. Check `CLANCY_ROLES` includes `planner` (or env var is unset, which indicates a global install where all roles are available). If `CLANCY_ROLES` is set but does not include `planner`:
|
|
20
|
-
```
|
|
21
|
-
The Planner role is not enabled. Add "planner" to CLANCY_ROLES in .clancy/.env or run /clancy:settings.
|
|
22
|
-
```
|
|
23
|
-
Stop.
|
|
24
|
-
|
|
25
|
-
4. Check `.clancy/docs/` — if the directory is empty or missing:
|
|
26
|
-
|
|
27
|
-
**AFK mode** (`--afk` flag or `CLANCY_MODE=afk`): continue without prompting (log a warning).
|
|
28
|
-
|
|
29
|
-
**Interactive mode:**
|
|
30
|
-
```
|
|
31
|
-
⚠️ No codebase documentation found in .clancy/docs/
|
|
32
|
-
Plans will be less accurate without codebase context.
|
|
33
|
-
Run /clancy:map-codebase first for better results.
|
|
34
|
-
|
|
35
|
-
Continue anyway? [y/N]
|
|
36
|
-
```
|
|
37
|
-
If the user declines, stop. If they confirm, continue without docs context.
|
|
38
|
-
|
|
39
|
-
5. Branch freshness check — run `git fetch origin` and compare the current HEAD with `origin/$CLANCY_BASE_BRANCH` (defaults to `main`). If the local branch is behind:
|
|
40
|
-
|
|
41
|
-
**AFK mode** (`--afk` flag or `CLANCY_MODE=afk`): auto-pull without prompting. Run `git pull origin $CLANCY_BASE_BRANCH` and continue.
|
|
42
|
-
|
|
43
|
-
**Interactive mode:**
|
|
44
|
-
```
|
|
45
|
-
⚠️ Your local branch is behind origin/{CLANCY_BASE_BRANCH} by {N} commit(s).
|
|
46
|
-
|
|
47
|
-
[1] Pull latest
|
|
48
|
-
[2] Continue anyway
|
|
49
|
-
[3] Abort
|
|
50
|
-
```
|
|
51
|
-
- [1] runs `git pull origin $CLANCY_BASE_BRANCH` and continues
|
|
52
|
-
- [2] continues without pulling
|
|
53
|
-
- [3] stops
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Step 2 — Parse arguments
|
|
58
|
-
|
|
59
|
-
Parse the arguments passed to the command:
|
|
60
|
-
|
|
61
|
-
- **No argument:** plan 1 ticket from the queue
|
|
62
|
-
- **Numeric argument** (e.g. `/clancy:plan 3`): plan up to N tickets from the queue, cap at 10
|
|
63
|
-
- **Specific ticket key:** plan a single ticket by key, with per-platform validation:
|
|
64
|
-
- `#42` — valid for GitHub only. If board is Jira or Linear: `The #N format is for GitHub Issues. Use a ticket key like PROJ-123.` Stop.
|
|
65
|
-
- `PROJ-123` / `ENG-42` (letters-dash-number) — valid for Jira and Linear. If board is GitHub: `Use #N format for GitHub Issues (e.g. #42).` Stop.
|
|
66
|
-
- Bare integer on GitHub (e.g. `/clancy:plan 42` where 42 > 10): ambiguous — ask:
|
|
67
|
-
```
|
|
68
|
-
Did you mean issue #42 or batch mode (42 tickets)?
|
|
69
|
-
[1] Plan issue #42
|
|
70
|
-
[2] Plan 10 tickets (max batch)
|
|
71
|
-
```
|
|
72
|
-
- **`--fresh`:** discard any existing plan and start over from scratch. This is NOT re-plan with feedback — it ignores existing plans entirely.
|
|
73
|
-
- Arguments can appear in any order (e.g. `/clancy:plan --fresh PROJ-123` or `/clancy:plan PROJ-123 --fresh`)
|
|
74
|
-
|
|
75
|
-
If N > 10: `Maximum batch size is 10. Planning 10 tickets.`
|
|
76
|
-
|
|
77
|
-
If N >= 5: display a confirmation (skip in AFK mode — `--afk` flag or `CLANCY_MODE=afk`):
|
|
78
|
-
```
|
|
79
|
-
Planning {N} tickets — each requires codebase exploration. Continue? [Y/n]
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
## Step 3 — Fetch backlog tickets
|
|
85
|
-
|
|
86
|
-
Detect board from `.clancy/.env` and fetch tickets from the **planning queue** (different from the implementation queue used by `/clancy:once`).
|
|
87
|
-
|
|
88
|
-
### Specific ticket key (if provided)
|
|
89
|
-
|
|
90
|
-
If a specific ticket key was parsed in Step 2, fetch that single ticket instead of the queue:
|
|
91
|
-
|
|
92
|
-
#### GitHub — Fetch specific issue
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
RESPONSE=$(curl -s \
|
|
96
|
-
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
|
97
|
-
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
98
|
-
"https://api.github.com/repos/$GITHUB_REPO/issues/$ISSUE_NUMBER")
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Validate the response:
|
|
102
|
-
- If `pull_request` field is present (not null): `#{N} is a PR, not an issue.` Stop.
|
|
103
|
-
- If `state` is `closed`: warn `Issue #${N} is closed. Plan anyway? [y/N]` (in AFK mode: skip this ticket — do not plan closed issues unattended)
|
|
104
|
-
|
|
105
|
-
#### Jira — Fetch specific ticket
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
RESPONSE=$(curl -s \
|
|
109
|
-
-u "$JIRA_USER:$JIRA_API_TOKEN" \
|
|
110
|
-
-H "Accept: application/json" \
|
|
111
|
-
"$JIRA_BASE_URL/rest/api/3/issue/$TICKET_KEY?fields=summary,description,issuelinks,parent,customfield_10014,comment,status,issuetype")
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Validate the response:
|
|
115
|
-
- If `fields.status.statusCategory.key` is `done`: warn `Ticket is done. Plan anyway? [y/N]` (in AFK mode: skip this ticket)
|
|
116
|
-
- If `fields.issuetype.name` is `Epic`: note `This is an epic.` (continue normally)
|
|
117
|
-
|
|
118
|
-
#### Linear — Fetch specific issue
|
|
119
|
-
|
|
120
|
-
```graphql
|
|
121
|
-
query {
|
|
122
|
-
issues(filter: { identifier: { eq: "$IDENTIFIER" } }) {
|
|
123
|
-
nodes {
|
|
124
|
-
id identifier title description
|
|
125
|
-
state { type name }
|
|
126
|
-
parent { identifier title }
|
|
127
|
-
comments { nodes { id body createdAt user { id } } }
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Validate the response:
|
|
134
|
-
- If `nodes` is empty: `Issue {KEY} not found on Linear.` Stop.
|
|
135
|
-
- If `state.type` is `completed`: warn `Issue is completed. Plan anyway? [y/N]` (in AFK mode: skip this ticket)
|
|
136
|
-
- If `state.type` is `canceled`: warn `Issue is canceled. Plan anyway? [y/N]` (in AFK mode: skip this ticket)
|
|
137
|
-
|
|
138
|
-
Then skip to Step 3b with this single ticket.
|
|
139
|
-
|
|
140
|
-
### Queue fetch (no specific key)
|
|
141
|
-
|
|
142
|
-
#### Jira
|
|
143
|
-
|
|
144
|
-
Build the JQL using planning-specific env vars:
|
|
145
|
-
- `CLANCY_PLAN_STATUS` defaults to `Backlog` if not set
|
|
146
|
-
- Sprint clause: include `AND sprint in openSprints()` if `CLANCY_JQL_SPRINT` is set
|
|
147
|
-
- Label clause: include `AND labels = "$CLANCY_LABEL_PLAN"` if `CLANCY_LABEL_PLAN` is set (falls back to `CLANCY_PLAN_LABEL` if `CLANCY_LABEL_PLAN` is not set). If neither is set, include `AND labels = "$CLANCY_LABEL"` if `CLANCY_LABEL` is set.
|
|
148
|
-
|
|
149
|
-
Full JQL: `project=$JIRA_PROJECT_KEY [AND sprint in openSprints()] [AND labels = "$CLANCY_LABEL_PLAN"] AND assignee=currentUser() AND status="$CLANCY_PLAN_STATUS" ORDER BY priority ASC`
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
RESPONSE=$(curl -s \
|
|
153
|
-
-u "$JIRA_USER:$JIRA_API_TOKEN" \
|
|
154
|
-
-X POST \
|
|
155
|
-
-H "Content-Type: application/json" \
|
|
156
|
-
-H "Accept: application/json" \
|
|
157
|
-
"$JIRA_BASE_URL/rest/api/3/search/jql" \
|
|
158
|
-
-d '{"jql": "<jql as above>", "maxResults": <N>, "fields": ["summary", "description", "issuelinks", "parent", "customfield_10014", "comment"]}')
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Note: include the `comment` field so we can check for existing plans and read feedback.
|
|
162
|
-
|
|
163
|
-
#### GitHub Issues
|
|
164
|
-
|
|
165
|
-
First resolve the authenticated username (don't use `@me` — it breaks with fine-grained PATs):
|
|
166
|
-
```bash
|
|
167
|
-
GITHUB_USERNAME=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/user | jq -r '.login')
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
Then fetch issues:
|
|
171
|
-
```bash
|
|
172
|
-
RESPONSE=$(curl -s \
|
|
173
|
-
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
|
174
|
-
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
175
|
-
"https://api.github.com/repos/$GITHUB_REPO/issues?state=open&assignee=$GITHUB_USERNAME&labels=$CLANCY_LABEL_PLAN&per_page=<N>")
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
- `CLANCY_LABEL_PLAN` is the pipeline label for the planning queue (default: `clancy:plan`). Falls back to `CLANCY_PLAN_LABEL` if `CLANCY_LABEL_PLAN` is not set. If neither is set, defaults to `needs-refinement`.
|
|
179
|
-
- Filter out PRs (entries with `pull_request` key)
|
|
180
|
-
- For each issue, fetch comments: `GET /repos/$GITHUB_REPO/issues/{number}/comments`
|
|
181
|
-
|
|
182
|
-
#### Linear
|
|
183
|
-
|
|
184
|
-
Build the filter using `CLANCY_PLAN_STATE_TYPE` (defaults to `backlog` if not set). If `CLANCY_LABEL_PLAN` is set (falls back to `CLANCY_PLAN_LABEL`), add a label filter to the query:
|
|
185
|
-
|
|
186
|
-
```graphql
|
|
187
|
-
query {
|
|
188
|
-
viewer {
|
|
189
|
-
assignedIssues(
|
|
190
|
-
filter: {
|
|
191
|
-
state: { type: { eq: "$CLANCY_PLAN_STATE_TYPE" } }
|
|
192
|
-
team: { id: { eq: "$LINEAR_TEAM_ID" } }
|
|
193
|
-
labels: { name: { eq: "$CLANCY_LABEL_PLAN" } } # Only if CLANCY_LABEL_PLAN is set
|
|
194
|
-
}
|
|
195
|
-
first: $N
|
|
196
|
-
orderBy: priority
|
|
197
|
-
) {
|
|
198
|
-
nodes {
|
|
199
|
-
id identifier title description
|
|
200
|
-
parent { identifier title }
|
|
201
|
-
comments { nodes { id body createdAt user { id } } }
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
If the API call fails (non-200 response or network error):
|
|
209
|
-
```
|
|
210
|
-
❌ Board API error: {HTTP status or error message}
|
|
211
|
-
|
|
212
|
-
Check your credentials in .clancy/.env or run /clancy:doctor to diagnose.
|
|
213
|
-
```
|
|
214
|
-
Stop.
|
|
215
|
-
|
|
216
|
-
If no tickets found:
|
|
217
|
-
```
|
|
218
|
-
🚨 Clancy — Plan
|
|
219
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
220
|
-
|
|
221
|
-
"Nothing to see here." — No backlog tickets to plan.
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
Then display board-specific guidance:
|
|
225
|
-
|
|
226
|
-
- **GitHub:** `For GitHub: planning uses the "$CLANCY_LABEL_PLAN" label (default: clancy:plan, fallback: $CLANCY_PLAN_LABEL or needs-refinement). Apply that label to issues you want planned.`
|
|
227
|
-
- **Jira:** `Check that CLANCY_PLAN_STATUS (currently: "$CLANCY_PLAN_STATUS") matches a status in your Jira project, and that tickets in that status are assigned to you.`
|
|
228
|
-
- **Linear:** `Check that CLANCY_PLAN_STATE_TYPE (currently: "$CLANCY_PLAN_STATE_TYPE") is a valid Linear state type (backlog, unstarted, started, completed, canceled, triage), and that tickets in that state are assigned to you in team $LINEAR_TEAM_ID.`
|
|
229
|
-
|
|
230
|
-
Stop.
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## Step 3b — Check for existing plans
|
|
235
|
-
|
|
236
|
-
For each ticket, scan its comments for the marker `## Clancy Implementation Plan`. Then apply the following logic:
|
|
237
|
-
|
|
238
|
-
| Condition | Behaviour |
|
|
239
|
-
|---|---|
|
|
240
|
-
| Has plan + feedback comments found after the plan | Revise: proceed to Step 3c to read feedback, then generate a revised plan |
|
|
241
|
-
| Has plan + `--fresh` flag | Discard existing plan, proceed to Step 4 (fresh plan from scratch) |
|
|
242
|
-
| Has plan + no feedback + no `--fresh` | Stop for this ticket: `Already planned. Comment on the ticket to provide feedback, then re-run /clancy:plan {KEY} to revise. Or use --fresh to start over.` |
|
|
243
|
-
| No plan found | Proceed to Step 4 |
|
|
244
|
-
|
|
245
|
-
Feedback detection per platform:
|
|
246
|
-
- **GitHub:** comments posted after the plan comment where `user.login != $GITHUB_USERNAME` (the resolved username)
|
|
247
|
-
- **Jira:** comments posted after the plan comment where `author.accountId != plan_comment.author.accountId`
|
|
248
|
-
- **Linear:** all comments posted after the plan comment are treated as feedback (Linear personal keys don't expose viewer ID easily in comment context)
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## Step 3c — Read feedback comments
|
|
253
|
-
|
|
254
|
-
When revising a plan (auto-detected from feedback comments after the existing plan), read all comments posted AFTER the most recent `## Clancy Implementation Plan` comment.
|
|
255
|
-
|
|
256
|
-
Filter out the planner's own comments:
|
|
257
|
-
- **GitHub:** exclude comments where `user.login == $GITHUB_USERNAME` (the resolved username)
|
|
258
|
-
- **Jira:** exclude comments by the same `author.accountId` as the plan comment
|
|
259
|
-
- **Linear:** all post-plan comments are treated as feedback
|
|
260
|
-
|
|
261
|
-
These are presumed to be PO/team feedback. No special syntax needed — they just comment normally on the ticket.
|
|
262
|
-
|
|
263
|
-
Pass this feedback to the plan generation step as additional context.
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
## Step 4 — For each ticket: Generate plan
|
|
268
|
-
|
|
269
|
-
Display the header:
|
|
270
|
-
```
|
|
271
|
-
🚨 Clancy — Plan
|
|
272
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
273
|
-
|
|
274
|
-
"Let me consult my crime files..." — Planning {N} ticket(s).
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
For each ticket, display a progress line when starting:
|
|
278
|
-
```
|
|
279
|
-
[{KEY}] {Title}
|
|
280
|
-
Exploring codebase...
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
And when the plan is posted:
|
|
284
|
-
```
|
|
285
|
-
✅ Plan posted as comment.
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
For multi-ticket runs, this provides visibility into progress. `Ctrl+C` to stop early — completed plans are already posted.
|
|
289
|
-
|
|
290
|
-
### 4a. Quick feasibility scan
|
|
291
|
-
|
|
292
|
-
Before spending time exploring files, scan the ticket title and description for obvious non-codebase signals. Skip immediately if the ticket clearly requires work outside the codebase.
|
|
293
|
-
|
|
294
|
-
**Fail signals (skip immediately):**
|
|
295
|
-
- External platform references: "in Google Tag Manager", "in Salesforce", "in the AWS console", "in HubSpot", "in Jira admin"
|
|
296
|
-
- Human process steps: "get sign-off", "coordinate with", "schedule a meeting", "send an email to customers"
|
|
297
|
-
- Non-code deliverables: "write a runbook", "create a presentation", "update the wiki"
|
|
298
|
-
- Infrastructure ops: "rotate API keys in prod", "scale the fleet", "restart the service"
|
|
299
|
-
|
|
300
|
-
**STACK.md cross-reference:** If `.clancy/docs/STACK.md` exists, read it. If the ticket mentions a technology not listed in STACK.md, flag it as a concern (but do not skip — include a note in the plan's Risks section instead).
|
|
301
|
-
|
|
302
|
-
If infeasible:
|
|
303
|
-
```
|
|
304
|
-
⏭️ [{KEY}] {Title} — not a codebase change. Skipping.
|
|
305
|
-
→ {reason, e.g. "Ticket describes work in Google Tag Manager, not in the codebase."}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
**Post skip comment to board:** Check `CLANCY_SKIP_COMMENTS` env var (default: `true`). If not `false`, post a brief comment on the ticket:
|
|
309
|
-
|
|
310
|
-
> Clancy skipped this ticket: {reason}
|
|
311
|
-
>
|
|
312
|
-
> This ticket appears to require work outside the codebase (e.g. {specific signal}). If this is incorrect, add more context to the ticket description and re-run `/clancy:plan`.
|
|
313
|
-
|
|
314
|
-
Use the same comment API patterns as Step 5 (plan posting). Best-effort — warn on failure, do not stop.
|
|
315
|
-
|
|
316
|
-
**Log SKIPPED entry:** Append to `.clancy/progress.txt`:
|
|
317
|
-
```
|
|
318
|
-
YYYY-MM-DD HH:MM | {KEY} | SKIPPED | {reason}
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
Continue to the next ticket. **Pass signals:** Anything mentioning code, components, features, bugs, UI, API, tests, refactoring, or lacking enough context to determine (benefit of the doubt).
|
|
322
|
-
|
|
323
|
-
### 4b. Check for previous implementation (QA return detection)
|
|
324
|
-
|
|
325
|
-
Check `.clancy/progress.txt` for any previous entry matching this ticket key that ends with `| DONE` (search for `| {KEY} |` on a line ending with `| DONE`). If found, the ticket was previously implemented by Clancy and has returned (likely from QA).
|
|
326
|
-
|
|
327
|
-
If detected:
|
|
328
|
-
- Flag as "Previously implemented — returned from QA"
|
|
329
|
-
- Read QA/review comments from the board (same mechanism as feedback loop in Step 3c)
|
|
330
|
-
- Focus the plan on what likely went wrong and what needs fixing
|
|
331
|
-
|
|
332
|
-
If no progress entry exists: treat as fresh.
|
|
333
|
-
|
|
334
|
-
### 4c. Read codebase context
|
|
335
|
-
|
|
336
|
-
If `.clancy/docs/` exists, read the following docs:
|
|
337
|
-
- `STACK.md`, `ARCHITECTURE.md`, `CONVENTIONS.md`, `TESTING.md`, `DESIGN-SYSTEM.md`, `ACCESSIBILITY.md`, `DEFINITION-OF-DONE.md`
|
|
338
|
-
|
|
339
|
-
These inform the plan's technical approach, affected files, and test plan.
|
|
340
|
-
|
|
341
|
-
### 4d. Figma design context (if applicable)
|
|
342
|
-
|
|
343
|
-
If the ticket description contains a Figma URL and `FIGMA_API_KEY` is configured in `.clancy/.env`, fetch design context using Clancy's existing Figma MCP integration (3 MCP calls: metadata, design context, screenshot). This informs the acceptance criteria and affected components in the plan.
|
|
344
|
-
|
|
345
|
-
If Figma URL is present but `FIGMA_API_KEY` is not configured: note in the plan — "Figma URL present but API key not configured. Run /clancy:settings to add it."
|
|
346
|
-
|
|
347
|
-
### 4e. Explore source files
|
|
348
|
-
|
|
349
|
-
Based on the ticket title AND description, explore the codebase to identify affected files.
|
|
350
|
-
|
|
351
|
-
**For S-sized tickets (simple/obvious scope):** Single-pass exploration — Glob and Read directly.
|
|
352
|
-
|
|
353
|
-
**For M/L-sized tickets (broad scope, multiple subsystems):** Spin up 2-3 parallel Explore subagents:
|
|
354
|
-
- **Agent 1:** Search for files matching ticket keywords, find existing implementations of similar features
|
|
355
|
-
- **Agent 2:** Identify related test files, check test patterns in affected areas
|
|
356
|
-
- **Agent 3:** (if UI ticket) Check component structure, design system usage, accessibility patterns
|
|
357
|
-
|
|
358
|
-
The size is estimated from the ticket title/description before exploration begins (rough heuristic). Subagents return their findings, which are merged into the plan.
|
|
359
|
-
|
|
360
|
-
### 4f. Generate plan
|
|
361
|
-
|
|
362
|
-
Write the plan in this exact template:
|
|
363
|
-
|
|
364
|
-
```markdown
|
|
365
|
-
## Clancy Implementation Plan
|
|
366
|
-
|
|
367
|
-
**Ticket:** [{KEY}] {Title}
|
|
368
|
-
**Planned:** {YYYY-MM-DD}
|
|
369
|
-
|
|
370
|
-
### Summary
|
|
371
|
-
{1-3 sentences: what this ticket asks for, why it matters, gaps filled}
|
|
372
|
-
|
|
373
|
-
### Affected Files
|
|
374
|
-
| File | Change Type | Description |
|
|
375
|
-
|------|-------------|-------------|
|
|
376
|
-
| `src/path/file.ts` | Modify | {What changes and why} |
|
|
377
|
-
| `src/path/new-file.ts` | Create | {What this new file does} |
|
|
378
|
-
| `src/path/file.test.ts` | Modify | {What changes and why} |
|
|
379
|
-
|
|
380
|
-
### Implementation Approach
|
|
381
|
-
{2-4 sentences: implementation strategy, patterns, key decisions}
|
|
382
|
-
|
|
383
|
-
### Test Strategy
|
|
384
|
-
- [ ] {Specific test to write or verify}
|
|
385
|
-
- [ ] {Specific test to write or verify}
|
|
386
|
-
|
|
387
|
-
### Acceptance Criteria
|
|
388
|
-
- [ ] {Specific, testable criterion}
|
|
389
|
-
- [ ] {Specific, testable criterion}
|
|
390
|
-
- [ ] {Specific, testable criterion}
|
|
391
|
-
|
|
392
|
-
### Dependencies
|
|
393
|
-
{Blockers, prerequisites, external deps. "None" if clean.}
|
|
394
|
-
|
|
395
|
-
### Figma Link
|
|
396
|
-
{If a Figma URL was found in the ticket, include it here. Otherwise omit this section entirely.}
|
|
397
|
-
|
|
398
|
-
### Risks / Considerations
|
|
399
|
-
- {Specific risk or consideration and handling}
|
|
400
|
-
- {Specific risk or consideration and handling}
|
|
401
|
-
|
|
402
|
-
### Size Estimate
|
|
403
|
-
**{S / M / L}** — {Brief justification}
|
|
404
|
-
|
|
405
|
-
---
|
|
406
|
-
*Generated by [Clancy](https://github.com/Pushedskydiver/clancy). To request changes: comment on this ticket, then re-run `/clancy:plan` to revise. To start over: `/clancy:plan --fresh`. To approve: `/clancy:approve-plan {KEY}`.*
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
**If re-planning with feedback**, prepend a section before Summary:
|
|
410
|
-
```markdown
|
|
411
|
-
### Changes From Previous Plan
|
|
412
|
-
{What feedback was addressed and how the plan changed}
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
**Quality rules:**
|
|
416
|
-
- Acceptance criteria must be testable ("user can X", "system does Y"), never vague
|
|
417
|
-
- Affected files must be real files found during exploration, not guesses
|
|
418
|
-
- Risks / Considerations must be specific to this ticket, not generic
|
|
419
|
-
- Size: S (< 1 hour, few files), M (1-4 hours, moderate), L (4+ hours, significant)
|
|
420
|
-
- If affected files > 15: add a note "Consider splitting this ticket"
|
|
421
|
-
- If UI ticket without Figma URL: note in plan
|
|
422
|
-
- If ticket mentions tech not in STACK.md: note in Risks / Considerations
|
|
423
|
-
|
|
424
|
-
**Dependency detection:**
|
|
425
|
-
|
|
426
|
-
| Type | Detection | Action |
|
|
427
|
-
|------|-----------|--------|
|
|
428
|
-
| Blocked by another ticket | Jira: issuelinks (type "Blocks"). GitHub: referenced issues. Linear: relations. | List blocking tickets. Note "Complete {KEY} first." |
|
|
429
|
-
| Depends on external API | Mentioned in description or inferred from affected code | If API exists with docs: include integration approach. If API doesn't exist: mark as blocked. |
|
|
430
|
-
| Depends on unfinished design | UI ticket with no Figma URL or design reference | Note "Design dependency — no spec provided. Visual accuracy may vary." |
|
|
431
|
-
| Depends on library upgrade | Ticket mentions upgrading a dependency | Include upgrade as prerequisite step. Note potential breaking changes. |
|
|
432
|
-
| Depends on infra in the repo | DB migrations, docker-compose, CI config | Include in affected files and plan normally. |
|
|
433
|
-
|
|
434
|
-
---
|
|
435
|
-
|
|
436
|
-
## Step 5 — Post plan as comment
|
|
437
|
-
|
|
438
|
-
### Jira — POST comment
|
|
439
|
-
|
|
440
|
-
```bash
|
|
441
|
-
curl -s \
|
|
442
|
-
-u "$JIRA_USER:$JIRA_API_TOKEN" \
|
|
443
|
-
-X POST \
|
|
444
|
-
-H "Content-Type: application/json" \
|
|
445
|
-
-H "Accept: application/json" \
|
|
446
|
-
"$JIRA_BASE_URL/rest/api/3/issue/$TICKET_KEY/comment" \
|
|
447
|
-
-d '<ADF JSON body>'
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
Construct ADF (Atlassian Document Format) JSON for the comment body. Key mappings:
|
|
451
|
-
- `## Heading` → `heading` node (level 2)
|
|
452
|
-
- `### Heading` → `heading` node (level 3)
|
|
453
|
-
- `- bullet` → `bulletList > listItem > paragraph`
|
|
454
|
-
- `- [ ] checkbox` → `taskList > taskItem` (state: "TODO")
|
|
455
|
-
- `| table |` → `table > tableRow > tableCell`
|
|
456
|
-
- `**bold**` → marks: `[{ "type": "strong" }]`
|
|
457
|
-
- `` `code` `` → marks: `[{ "type": "code" }]`
|
|
458
|
-
|
|
459
|
-
If ADF construction is too complex for a particular element, fall back to wrapping that section in a code block (`codeBlock` node).
|
|
460
|
-
|
|
461
|
-
### GitHub — POST comment
|
|
462
|
-
|
|
463
|
-
```bash
|
|
464
|
-
curl -s \
|
|
465
|
-
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
|
466
|
-
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
467
|
-
-X POST \
|
|
468
|
-
"https://api.github.com/repos/$GITHUB_REPO/issues/$ISSUE_NUMBER/comments" \
|
|
469
|
-
-d '{"body": "<markdown plan>"}'
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
GitHub accepts Markdown directly — post the plan as-is.
|
|
473
|
-
|
|
474
|
-
### Linear — commentCreate mutation
|
|
475
|
-
|
|
476
|
-
```bash
|
|
477
|
-
curl -s \
|
|
478
|
-
-X POST \
|
|
479
|
-
-H "Content-Type: application/json" \
|
|
480
|
-
-H "Authorization: $LINEAR_API_KEY" \
|
|
481
|
-
"https://api.linear.app/graphql" \
|
|
482
|
-
-d '{"query": "mutation { commentCreate(input: { issueId: \"$ISSUE_ID\", body: \"<markdown plan>\" }) { success } }"}'
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
Linear accepts Markdown directly.
|
|
486
|
-
|
|
487
|
-
**On failure:** Print the plan to stdout and warn — do not lose the plan. The user can manually paste it.
|
|
488
|
-
|
|
489
|
-
```
|
|
490
|
-
⚠️ Failed to post comment for [{KEY}]. Plan printed above — paste it manually.
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
---
|
|
494
|
-
|
|
495
|
-
## Step 6 — Log
|
|
496
|
-
|
|
497
|
-
For each planned ticket, append to `.clancy/progress.txt` using the appropriate variant:
|
|
498
|
-
|
|
499
|
-
| Outcome | Log entry |
|
|
500
|
-
|---|---|
|
|
501
|
-
| Normal | `YYYY-MM-DD HH:MM \| {KEY} \| PLAN \| {S/M/L}` |
|
|
502
|
-
| Revised (re-plan with feedback) | `YYYY-MM-DD HH:MM \| {KEY} \| REVISED \| {S/M/L}` |
|
|
503
|
-
| Comment post failed | `YYYY-MM-DD HH:MM \| {KEY} \| POST_FAILED \| {reason}` |
|
|
504
|
-
| Skipped (infeasible) | `YYYY-MM-DD HH:MM \| {KEY} \| SKIPPED \| {reason}` |
|
|
505
|
-
|
|
506
|
-
---
|
|
507
|
-
|
|
508
|
-
## Step 7 — Summary
|
|
509
|
-
|
|
510
|
-
After all tickets are processed, display:
|
|
511
|
-
|
|
512
|
-
```
|
|
513
|
-
Planned {N} ticket(s):
|
|
514
|
-
|
|
515
|
-
✅ [{KEY1}] {Title} — M | 6 files | Comment posted
|
|
516
|
-
✅ [{KEY2}] {Title} — S | 2 files | Comment posted
|
|
517
|
-
⏭️ [{KEY3}] {Title} — already planned
|
|
518
|
-
⏭️ [{KEY4}] {Title} — not a codebase change
|
|
519
|
-
|
|
520
|
-
Plans written to your board. After review, run /clancy:approve-plan {KEY} to promote.
|
|
521
|
-
|
|
522
|
-
"Let me dust this for prints..."
|
|
523
|
-
```
|
|
524
|
-
|
|
525
|
-
---
|
|
526
|
-
|
|
527
|
-
## Notes
|
|
528
|
-
|
|
529
|
-
- This command does NOT implement anything — it generates plans only
|
|
530
|
-
- Plans are posted as comments, never overwriting the ticket description (that's `/clancy:approve-plan`)
|
|
531
|
-
- Re-running without `--fresh` auto-detects feedback: if feedback exists, revises; if no feedback, stops with guidance
|
|
532
|
-
- The `--fresh` flag discards the existing plan entirely and generates a new one from scratch
|
|
533
|
-
- The planning queue is separate from the implementation queue — they never compete for the same tickets
|
|
534
|
-
- All board API calls are best-effort — if a comment fails to post, print the plan to stdout as fallback
|
|
535
|
-
- When exploring the codebase, use Glob and Read for small tickets, parallel Explore subagents for larger ones
|
|
536
|
-
- The `## Clancy Implementation Plan` marker in comments is used by both `/clancy:plan` (to detect existing plans) and `/clancy:approve-plan` (to find the plan to promote)
|
|
@@ -1,9 +0,0 @@
|
|
|
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.
|
|
@@ -1,9 +0,0 @@
|
|
|
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:once, 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.
|
|
@@ -1,104 +0,0 @@
|
|
|
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
|
-
🚨 Clancy — Logs
|
|
14
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
15
|
-
|
|
16
|
-
No progress logged yet.
|
|
17
|
-
|
|
18
|
-
"The law is powerless to help you... but not for long." — Run /clancy:once or /clancy:run to get started.
|
|
19
|
-
```
|
|
20
|
-
Stop.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Step 2 — Parse progress.txt
|
|
25
|
-
|
|
26
|
-
Each line has one of these formats:
|
|
27
|
-
- `YYYY-MM-DD HH:MM | TICKET-KEY | Summary | DONE` — completed implementation
|
|
28
|
-
- `YYYY-MM-DD HH:MM | TICKET-KEY | REVIEW | {score}%` — ticket review
|
|
29
|
-
- `YYYY-MM-DD HH:MM | TICKET-KEY | PLAN | {S/M/L}` — plan generated
|
|
30
|
-
- `YYYY-MM-DD HH:MM | TICKET-KEY | REVISED | {S/M/L}` — plan revised after feedback
|
|
31
|
-
- `YYYY-MM-DD HH:MM | TICKET-KEY | APPROVE_PLAN | —` — plan promoted to description
|
|
32
|
-
- `YYYY-MM-DD HH:MM | TICKET-KEY | SKIPPED | {reason}` — ticket skipped
|
|
33
|
-
- `YYYY-MM-DD HH:MM | TICKET-KEY | POST_FAILED | {reason}` — failed to post comment to board
|
|
34
|
-
- `YYYY-MM-DD HH:MM | BRIEF | {slug} | {N} proposed tickets` — brief generated (slug-based format)
|
|
35
|
-
- `YYYY-MM-DD HH:MM | APPROVE_BRIEF | {slug} | {N} tickets created` — brief approved (slug-based format)
|
|
36
|
-
|
|
37
|
-
Parse each line:
|
|
38
|
-
- Date (YYYY-MM-DD)
|
|
39
|
-
- Time (HH:MM)
|
|
40
|
-
- Key or status (BRIEF/APPROVE_BRIEF entries put the status here, standard entries put the ticket key)
|
|
41
|
-
- Detail (status, score, size, reason, or slug for brief entries)
|
|
42
|
-
|
|
43
|
-
Extract:
|
|
44
|
-
- Total DONE tickets
|
|
45
|
-
- First and latest run dates
|
|
46
|
-
- All DONE tickets from the current calendar week (Mon–Sun)
|
|
47
|
-
- Counts for each action type: PLAN, REVISED, APPROVE_PLAN, REVIEW, SKIPPED, POST_FAILED, BRIEF, APPROVE_BRIEF
|
|
48
|
-
- Epic key from ticket key — e.g. PROJ-42 → epic likely PROJ-10 (use parent field if logged, otherwise group by project prefix)
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Step 3 — Display
|
|
53
|
-
|
|
54
|
-
If only 1–3 DONE entries: show a flat list, skip grouping.
|
|
55
|
-
|
|
56
|
-
If 4+ entries, show the full grouped display:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
🚨 Clancy — Logs
|
|
60
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
61
|
-
|
|
62
|
-
Total tickets completed: {count}
|
|
63
|
-
First run: {YYYY-MM-DD}
|
|
64
|
-
Latest run: {YYYY-MM-DD}
|
|
65
|
-
|
|
66
|
-
This week ({Mon date}–{Sun date or today}):
|
|
67
|
-
✅ {TICKET-KEY} {Summary}
|
|
68
|
-
✅ {TICKET-KEY} {Summary}
|
|
69
|
-
...
|
|
70
|
-
|
|
71
|
-
By epic:
|
|
72
|
-
{EPIC-KEY} {Epic name or prefix} {bar} {count} tickets
|
|
73
|
-
{EPIC-KEY} {Epic name or prefix} {bar} {count} tickets
|
|
74
|
-
(other) {bar} {count} tickets
|
|
75
|
-
|
|
76
|
-
Plans generated: {N} (only show if > 0)
|
|
77
|
-
Plans revised: {N} (only show if > 0)
|
|
78
|
-
Plans approved: {N} (only show if > 0)
|
|
79
|
-
Briefs generated: {N} (only show if > 0)
|
|
80
|
-
Briefs approved: {N} (only show if > 0)
|
|
81
|
-
Reviews run: {N} (only show if > 0)
|
|
82
|
-
Tickets skipped: {N} (only show if > 0)
|
|
83
|
-
Post failures: {N} (only show if > 0)
|
|
84
|
-
Full log: .clancy/progress.txt
|
|
85
|
-
|
|
86
|
-
"The law is powerless to help you, but here's what Clancy's done."
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Display rules
|
|
90
|
-
|
|
91
|
-
- Show "this week" at the top — most recent activity is most relevant
|
|
92
|
-
- Cap "this week" at 10 entries. If more: "...and {n} more this week"
|
|
93
|
-
- Progress bars: ASCII, proportional to highest count, width 10 chars, `█` filled, `░` empty
|
|
94
|
-
- Epic grouping: group by epic key in the ticket's parent field (from progress.txt if logged), or by project prefix if not available
|
|
95
|
-
- Tickets without an epic: group under `(other)`
|
|
96
|
-
- 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
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Notes
|
|
101
|
-
|
|
102
|
-
- No external dependencies — all ASCII, all bash-parseable
|
|
103
|
-
- The full log is always available at `.clancy/progress.txt` for raw access
|
|
104
|
-
- `--all` flag to remove the "this week" cap is a v2 addition — do not implement in v1
|