chief-clancy 0.5.5 → 0.5.7
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/README.md +3 -3
- package/dist/bundle/clancy-once.js +38 -32
- package/dist/installer/install.js +1 -1
- package/dist/installer/install.js.map +1 -1
- package/dist/schemas/bitbucket-pr.d.ts +15 -0
- package/dist/schemas/bitbucket-pr.d.ts.map +1 -1
- package/dist/schemas/bitbucket-pr.js +6 -0
- package/dist/schemas/bitbucket-pr.js.map +1 -1
- package/dist/schemas/env.d.ts +8 -0
- package/dist/schemas/env.d.ts.map +1 -1
- package/dist/schemas/env.js +2 -0
- package/dist/schemas/env.js.map +1 -1
- package/dist/schemas/github.d.ts +12 -0
- package/dist/schemas/github.d.ts.map +1 -1
- package/dist/schemas/github.js +2 -0
- package/dist/schemas/github.js.map +1 -1
- package/dist/schemas/gitlab-mr.d.ts +11 -0
- package/dist/schemas/gitlab-mr.d.ts.map +1 -1
- package/dist/schemas/gitlab-mr.js +2 -0
- package/dist/schemas/gitlab-mr.js.map +1 -1
- package/dist/scripts/board/github/github.d.ts +1 -1
- package/dist/scripts/board/github/github.d.ts.map +1 -1
- package/dist/scripts/board/github/github.js +2 -2
- package/dist/scripts/board/github/github.js.map +1 -1
- package/dist/scripts/once/once.d.ts.map +1 -1
- package/dist/scripts/once/once.js +156 -25
- package/dist/scripts/once/once.js.map +1 -1
- package/dist/scripts/shared/git-ops/git-ops.d.ts +11 -0
- package/dist/scripts/shared/git-ops/git-ops.d.ts.map +1 -1
- package/dist/scripts/shared/git-ops/git-ops.js +26 -0
- package/dist/scripts/shared/git-ops/git-ops.js.map +1 -1
- package/dist/scripts/shared/preflight/preflight.d.ts.map +1 -1
- package/dist/scripts/shared/preflight/preflight.js +15 -3
- package/dist/scripts/shared/preflight/preflight.js.map +1 -1
- package/dist/scripts/shared/progress/progress.d.ts +2 -1
- package/dist/scripts/shared/progress/progress.d.ts.map +1 -1
- package/dist/scripts/shared/progress/progress.js +29 -13
- package/dist/scripts/shared/progress/progress.js.map +1 -1
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts +12 -0
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts.map +1 -1
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js +51 -1
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js.map +1 -1
- package/dist/scripts/shared/pull-request/github/github.d.ts +26 -2
- package/dist/scripts/shared/pull-request/github/github.d.ts.map +1 -1
- package/dist/scripts/shared/pull-request/github/github.js +102 -9
- package/dist/scripts/shared/pull-request/github/github.js.map +1 -1
- package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts +30 -2
- package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts.map +1 -1
- package/dist/scripts/shared/pull-request/gitlab/gitlab.js +70 -4
- package/dist/scripts/shared/pull-request/gitlab/gitlab.js.map +1 -1
- package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts.map +1 -1
- package/dist/scripts/shared/pull-request/pr-body/pr-body.js +6 -1
- package/dist/scripts/shared/pull-request/pr-body/pr-body.js.map +1 -1
- package/dist/types/remote.d.ts +2 -0
- package/dist/types/remote.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/roles/planner/commands/approve-plan.md +7 -0
- package/src/roles/planner/commands/plan.md +11 -1
- package/src/roles/planner/workflows/approve-plan.md +478 -0
- package/src/roles/planner/workflows/plan.md +171 -49
- package/src/roles/reviewer/workflows/logs.md +7 -3
- package/src/roles/setup/commands/help.md +3 -2
- package/src/roles/setup/workflows/init.md +53 -2
- package/src/roles/setup/workflows/scaffold.md +23 -0
- package/src/roles/setup/workflows/settings.md +21 -1
- package/src/templates/CLAUDE.md +2 -0
- package/src/roles/planner/commands/approve.md +0 -7
- package/src/roles/planner/workflows/approve.md +0 -237
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
# Clancy Approve Workflow
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
Promote an approved Clancy plan from a ticket comment to the ticket description. The plan is appended below the existing description, never replacing it.
|
|
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
|
-
---
|
|
20
|
-
|
|
21
|
-
## Step 2 — Parse argument
|
|
22
|
-
|
|
23
|
-
The user must provide a ticket key as an argument (e.g. `/clancy:approve PROJ-123`).
|
|
24
|
-
|
|
25
|
-
If no key is provided:
|
|
26
|
-
```
|
|
27
|
-
Usage: /clancy:approve PROJ-123
|
|
28
|
-
```
|
|
29
|
-
Stop.
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Step 3 — Fetch the plan comment
|
|
34
|
-
|
|
35
|
-
Detect board from `.clancy/.env` and fetch comments for the specified ticket.
|
|
36
|
-
|
|
37
|
-
### Jira
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
RESPONSE=$(curl -s \
|
|
41
|
-
-u "$JIRA_USER:$JIRA_API_TOKEN" \
|
|
42
|
-
-H "Accept: application/json" \
|
|
43
|
-
"$JIRA_BASE_URL/rest/api/3/issue/$TICKET_KEY/comment")
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### GitHub
|
|
47
|
-
|
|
48
|
-
First, determine the issue number from the ticket key (strip the `#` prefix if present):
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
RESPONSE=$(curl -s \
|
|
52
|
-
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
|
53
|
-
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
54
|
-
"https://api.github.com/repos/$GITHUB_REPO/issues/$ISSUE_NUMBER/comments")
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Linear
|
|
58
|
-
|
|
59
|
-
```graphql
|
|
60
|
-
query {
|
|
61
|
-
issue(id: "<issue-id>") {
|
|
62
|
-
id identifier title description
|
|
63
|
-
comments { nodes { body createdAt } }
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
For Linear, the user provides the issue identifier (e.g. `ENG-42`). Look up the issue by identifier to get the internal ID and comments:
|
|
69
|
-
|
|
70
|
-
```graphql
|
|
71
|
-
query {
|
|
72
|
-
issueSearch(query: "$IDENTIFIER", first: 5) {
|
|
73
|
-
nodes {
|
|
74
|
-
id identifier title description
|
|
75
|
-
comments { nodes { body createdAt } }
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**Important:** `issueSearch` is a fuzzy text search. After fetching results, verify the returned issue's `identifier` field exactly matches the provided key (case-insensitive). If no exact match is found in the results, report: `❌ Issue {KEY} not found. Check the identifier and try again.`
|
|
82
|
-
|
|
83
|
-
Search the comments for the most recent one containing `## Clancy Implementation Plan`.
|
|
84
|
-
|
|
85
|
-
If no plan comment is found:
|
|
86
|
-
```
|
|
87
|
-
❌ No Clancy plan found for {KEY}. Run /clancy:plan first.
|
|
88
|
-
```
|
|
89
|
-
Stop.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Step 3b — Check for existing plan in description
|
|
94
|
-
|
|
95
|
-
Before confirming, check if the ticket description already contains `## Clancy Implementation Plan`.
|
|
96
|
-
|
|
97
|
-
If it does:
|
|
98
|
-
```
|
|
99
|
-
⚠️ This ticket's description already contains a Clancy plan.
|
|
100
|
-
Continuing will add a duplicate.
|
|
101
|
-
|
|
102
|
-
[1] Continue anyway
|
|
103
|
-
[2] Cancel
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
If the user picks [2], stop: `Cancelled. No changes made.`
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Step 4 — Confirm
|
|
111
|
-
|
|
112
|
-
Display a summary and ask for confirmation:
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
🚨 Clancy — Approve
|
|
116
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
117
|
-
|
|
118
|
-
[{KEY}] {Title}
|
|
119
|
-
Size: {S/M/L} | {N} affected files
|
|
120
|
-
Planned: {date from plan}
|
|
121
|
-
|
|
122
|
-
Promote this plan to the ticket description? [Y/n]
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
If the user declines, stop:
|
|
126
|
-
```
|
|
127
|
-
Cancelled. No changes made.
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
## Step 5 — Update ticket description
|
|
133
|
-
|
|
134
|
-
Append the plan below the existing description with a separator. Never overwrite the original description.
|
|
135
|
-
|
|
136
|
-
The updated description follows this format:
|
|
137
|
-
```
|
|
138
|
-
{existing description}
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
{full plan content}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Jira — PUT issue
|
|
146
|
-
|
|
147
|
-
Fetch the current description first:
|
|
148
|
-
```bash
|
|
149
|
-
CURRENT=$(curl -s \
|
|
150
|
-
-u "$JIRA_USER:$JIRA_API_TOKEN" \
|
|
151
|
-
-H "Accept: application/json" \
|
|
152
|
-
"$JIRA_BASE_URL/rest/api/3/issue/$TICKET_KEY?fields=description")
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Merge the existing ADF description with a `rule` node (horizontal rule) and the plan content as new ADF nodes. Then update:
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
curl -s \
|
|
159
|
-
-u "$JIRA_USER:$JIRA_API_TOKEN" \
|
|
160
|
-
-X PUT \
|
|
161
|
-
-H "Content-Type: application/json" \
|
|
162
|
-
-H "Accept: application/json" \
|
|
163
|
-
"$JIRA_BASE_URL/rest/api/3/issue/$TICKET_KEY" \
|
|
164
|
-
-d '{"fields": {"description": <merged ADF>}}'
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
If ADF construction fails for the plan content, wrap the plan in a `codeBlock` node as fallback.
|
|
168
|
-
|
|
169
|
-
### GitHub — PATCH issue
|
|
170
|
-
|
|
171
|
-
Fetch the current body:
|
|
172
|
-
```bash
|
|
173
|
-
CURRENT=$(curl -s \
|
|
174
|
-
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
|
175
|
-
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
176
|
-
"https://api.github.com/repos/$GITHUB_REPO/issues/$ISSUE_NUMBER")
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Append the plan:
|
|
180
|
-
```bash
|
|
181
|
-
curl -s \
|
|
182
|
-
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
|
183
|
-
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
184
|
-
-X PATCH \
|
|
185
|
-
"https://api.github.com/repos/$GITHUB_REPO/issues/$ISSUE_NUMBER" \
|
|
186
|
-
-d '{"body": "<existing body>\n\n---\n\n<plan>"}'
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Linear — issueUpdate mutation
|
|
190
|
-
|
|
191
|
-
Fetch the current description:
|
|
192
|
-
```graphql
|
|
193
|
-
query { issue(id: "$ISSUE_ID") { description } }
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
Update with appended plan:
|
|
197
|
-
```graphql
|
|
198
|
-
mutation {
|
|
199
|
-
issueUpdate(
|
|
200
|
-
id: "$ISSUE_ID"
|
|
201
|
-
input: { description: "<existing>\n\n---\n\n<plan>" }
|
|
202
|
-
) { success }
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## Step 6 — Confirm and log
|
|
209
|
-
|
|
210
|
-
On success:
|
|
211
|
-
```
|
|
212
|
-
✅ Plan promoted to description for [{KEY}].
|
|
213
|
-
|
|
214
|
-
Move [{KEY}] to your implementation queue (e.g. "To Do") so /clancy:once picks it up.
|
|
215
|
-
|
|
216
|
-
"Book 'em, Lou." — The ticket is ready for /clancy:once.
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
Append to `.clancy/progress.txt`:
|
|
220
|
-
```
|
|
221
|
-
YYYY-MM-DD HH:MM | {KEY} | APPROVE | —
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
On failure:
|
|
225
|
-
```
|
|
226
|
-
❌ Failed to update description for [{KEY}]. Check your board permissions.
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
|
-
## Notes
|
|
232
|
-
|
|
233
|
-
- This command only appends — it never overwrites the existing ticket description
|
|
234
|
-
- If the ticket has multiple plan comments, the most recent one is used
|
|
235
|
-
- The plan content is taken verbatim from the comment — no regeneration
|
|
236
|
-
- Step 3b checks for existing plans in the description to prevent accidental duplication
|
|
237
|
-
- The ticket key is case-insensitive — accept `PROJ-123`, `proj-123`, or `#123` (GitHub)
|