chief-clancy 0.5.0 → 0.5.2

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 CHANGED
@@ -168,7 +168,37 @@ npx chief-clancy
168
168
  | `/clancy:uninstall` | Remove Clancy commands — optionally remove `.clancy/` too |
169
169
  | `/clancy:help` | Command reference |
170
170
 
171
- ¹ Planner is an optional role. Enable with `CLANCY_ROLES=planner` in `.clancy/.env` and re-run the installer.
171
+ ¹ Planner is an optional role see [Roles](#roles) below.
172
+
173
+ ---
174
+
175
+ ## Roles
176
+
177
+ Clancy organises its commands into **roles** — each role handles a different stage of the development workflow.
178
+
179
+ | Role | Purpose | Commands |
180
+ | --- | --- | --- |
181
+ | **Implementer** | Plan → code. Picks up tickets, implements, commits, merges | `/clancy:once`, `/clancy:run`, `/clancy:dry-run` |
182
+ | **Reviewer** | Score ticket readiness and track progress | `/clancy:review`, `/clancy:status`, `/clancy:logs` |
183
+ | **Setup** | Configure and maintain Clancy | `/clancy:init`, `/clancy:settings`, `/clancy:doctor`, etc. |
184
+ | **Planner** *(optional)* | Refine backlog tickets into structured implementation plans | `/clancy:plan`, `/clancy:approve` |
185
+
186
+ **Core roles** (Implementer, Reviewer, Setup) are always installed. **Optional roles** (Planner) are opt-in — add them to `CLANCY_ROLES` in `.clancy/.env` and re-run the installer:
187
+
188
+ ```bash
189
+ # Enable the Planner role
190
+ echo 'CLANCY_ROLES="planner"' >> .clancy/.env
191
+ npx chief-clancy@latest --local # or --global
192
+ ```
193
+
194
+ You can also toggle roles from within Claude Code using `/clancy:settings`.
195
+
196
+ Each role has detailed documentation:
197
+
198
+ - [Implementer](docs/roles/IMPLEMENTER.md) — picks up tickets, implements, commits, merges (AFK loop support)
199
+ - [Reviewer](docs/roles/REVIEWER.md) — scores ticket readiness, tracks progress
200
+ - [Setup & Maintenance](docs/roles/SETUP.md) — init wizard, settings, diagnostics, codebase mapping
201
+ - [Planner](docs/roles/PLANNER.md) — refines backlog tickets into structured implementation plans
172
202
 
173
203
  ---
174
204
 
@@ -198,75 +228,11 @@ Clancy also merges a section into your `CLAUDE.md` (or creates one) that tells C
198
228
 
199
229
  ---
200
230
 
201
- ## Optional enhancements
202
-
203
- Set during `/clancy:init` advanced setup, or by editing `.clancy/.env` directly. Use `/clancy:settings` → "Save as defaults" to save non-credential settings to `~/.clancy/defaults.json` — new projects created with `/clancy:init` will inherit them automatically.
204
-
205
- ### Figma MCP
206
-
207
- ```
208
- FIGMA_API_KEY=your-key
209
- ```
210
-
211
- When a ticket description contains a Figma URL, Clancy fetches design specs automatically:
212
-
213
- 1. Figma MCP: `get_metadata` → `get_design_context` → `get_screenshot` (3 calls)
214
- 2. Figma REST API image export (fallback)
215
- 3. Ticket image attachment (fallback)
216
-
217
- ### Playwright visual checks
218
-
219
- ```
220
- PLAYWRIGHT_ENABLED=true
221
- PLAYWRIGHT_DEV_COMMAND="yarn dev"
222
- PLAYWRIGHT_DEV_PORT=5173
223
- PLAYWRIGHT_STORYBOOK_COMMAND="yarn storybook" # if applicable
224
- PLAYWRIGHT_STORYBOOK_PORT=6006 # if applicable
225
- PLAYWRIGHT_STARTUP_WAIT=15
226
- ```
227
-
228
- After implementing a UI ticket, Clancy starts the dev server or Storybook, screenshots, assesses visually, checks the console, and fixes anything wrong before committing.
229
-
230
- ### Status transitions
231
-
232
- ```
233
- CLANCY_STATUS_IN_PROGRESS="In Progress"
234
- CLANCY_STATUS_DONE="Done"
235
- ```
236
-
237
- Clancy automatically moves tickets through your board when it picks up and completes them. Set these to the exact column name shown in your Jira or Linear board. Best-effort — a failed transition never stops the run. Configurable via `/clancy:settings`.
238
-
239
- ### Notifications
240
-
241
- ```
242
- CLANCY_NOTIFY_WEBHOOK=https://hooks.slack.com/services/your/webhook/url
243
- ```
244
-
245
- Posts to Slack or Teams when a ticket completes or Clancy hits an error. URL is auto-detected.
246
-
247
- ---
248
-
249
- ## How the loop works
231
+ ## Configuration
250
232
 
251
- ```
252
- clancy-afk.js
253
- └─ while i < MAX_ITERATIONS:
254
- node clancy-once.js
255
- 1. Preflight checks (credentials, git state, board reachability)
256
- 2. Fetch next ticket from board (maxResults=1)
257
- 3. git checkout $EPIC_BRANCH
258
- 4. git checkout -b feature/{ticket-key}
259
- 5. Read .clancy/docs/* (especially GIT.md)
260
- 6. echo "$PROMPT" | claude --dangerously-skip-permissions
261
- 7. git checkout $EPIC_BRANCH
262
- 8. git merge --squash feature/{ticket-key}
263
- 9. git commit -m "feat(TICKET): summary"
264
- 10. git branch -D feature/{ticket-key}
265
- 11. Append to .clancy/progress.txt
266
- if "No tickets found": break
267
- ```
233
+ Clancy supports optional enhancements — Figma design specs, Playwright visual checks, status transitions, and Slack/Teams notifications. All are configured via `.clancy/.env` or `/clancy:settings`.
268
234
 
269
- Clancy reads `GIT.md` before every run and follows whatever conventions are documented there. The defaults above apply on greenfield projects or when GIT.md is silent.
235
+ See [Configuration guide](docs/guides/CONFIGURATION.md) for full details and all environment variables.
270
236
 
271
237
  ---
272
238
 
@@ -288,80 +254,9 @@ Clancy is what happens when you take that idea seriously for team development. S
288
254
 
289
255
  ## Security
290
256
 
291
- ### Permissions model
292
-
293
- Clancy runs Claude with `--dangerously-skip-permissions`, which suppresses all permission prompts so it can work unattended. This means Claude has full read/write access to your file system and can execute shell commands without asking.
294
-
295
- **Only run Clancy on codebases you own and trust.** Review the scripts in `.clancy/` before your first run if you want to see exactly what executes.
296
-
297
- **Alternative — granular permissions:** if you run Claude Code without `--dangerously-skip-permissions` by default, you can pre-approve only the commands Clancy needs. Add this to `.claude/settings.json` in your project (or `~/.claude/settings.json` globally):
298
-
299
- ```json
300
- {
301
- "permissions": {
302
- "allow": [
303
- "Bash(git:*)",
304
- "Bash(bash:*)",
305
- "Bash(node:*)",
306
- "Bash(npm:*)",
307
- "Bash(mkdir:*)",
308
- "Bash(cat:*)",
309
- "Bash(cp:*)",
310
- "Bash(echo:*)",
311
- "Bash(ls:*)",
312
- "Bash(grep:*)",
313
- "Bash(wc:*)",
314
- "Bash(sort:*)",
315
- "Bash(tr:*)",
316
- "Bash(head:*)",
317
- "Bash(tail:*)",
318
- "Bash(lsof:*)",
319
- "Bash(command:*)"
320
- ]
321
- }
322
- }
323
- ```
324
-
325
- ### Protect your credentials from Claude
326
-
327
- Your board tokens and API keys live in `.clancy/.env`. Although Claude doesn't need to read this file during a run (the JS shim loads it before invoking Claude), adding it to Claude Code's deny list is good defence-in-depth. Add it to `.claude/settings.json` in your project, or `~/.claude/settings.json` globally:
328
-
329
- ```json
330
- {
331
- "permissions": {
332
- "deny": [
333
- "Read(.clancy/.env)",
334
- "Read(.env)",
335
- "Read(.env.*)",
336
- "Read(**/*.pem)",
337
- "Read(**/*.key)"
338
- ]
339
- }
340
- }
341
- ```
342
-
343
- This prevents Claude from reading these files regardless of what commands run. Clancy automatically adds `.clancy/.env` to `.gitignore` during init, but the deny list is an additional layer.
344
-
345
- ### Credential guard
346
-
347
- Clancy installs a `PreToolUse` hook (`clancy-credential-guard.js`) that scans every Write, Edit, and MultiEdit operation for credential patterns — API keys, tokens, passwords, private keys, and connection strings. If a match is found, the operation is blocked with a message telling Claude to move the credential to `.clancy/.env` instead. Files that are expected to contain credentials (`.clancy/.env`, `.env.example`, etc.) are exempt.
348
-
349
- This is best-effort — it won't catch every possible credential format, but it prevents the most common accidental leaks.
257
+ Clancy runs Claude with `--dangerously-skip-permissions` for unattended operation. It includes a credential guard hook, recommended permission deny lists, and token scope guidance.
350
258
 
351
- ### Token scopes
352
-
353
- Use the minimum permissions each integration requires:
354
-
355
- | Integration | Recommended scope |
356
- |---|---|
357
- | GitHub PAT | `repo` — read/write issues and contents for your repo only |
358
- | Jira API token | Standard user — no admin rights needed |
359
- | Linear API key | Personal API key — read/write to your assigned issues |
360
- | Figma API key | Read-only access is sufficient |
361
-
362
- ### Webhook URLs
363
-
364
- If you configure Slack or Teams notifications, treat the webhook URL as a secret — anyone who has it can post to your channel. Keep `.clancy/.env` gitignored (Clancy does this automatically during init) and never share the URL.
259
+ See [Security guide](docs/guides/SECURITY.md) for full details — permissions model, credential protection, token scopes, and webhook security.
365
260
 
366
261
  ---
367
262
 
@@ -369,70 +264,7 @@ If you configure Slack or Teams notifications, treat the webhook URL as a secret
369
264
 
370
265
  **Start here:** run `/clancy:doctor` — it tests every integration and tells you exactly what's broken and how to fix it.
371
266
 
372
- ---
373
-
374
- **Commands not found after install?**
375
-
376
- Restart Claude Code to reload commands, then verify the files exist:
377
-
378
- ```bash
379
- ls ~/.claude/commands/clancy/ # global install
380
- ls .claude/commands/clancy/ # local install
381
- ```
382
-
383
- If missing, re-run `npx chief-clancy`.
384
-
385
- ---
386
-
387
- **Board connection fails?**
388
-
389
- Run `/clancy:doctor` to test your credentials. If it reports a failure, open `.clancy/.env` and check your tokens — they're the most common cause. You can also run `/clancy:settings` → Switch board to re-enter credentials without re-running full init.
390
-
391
- ---
392
-
393
- **No tickets showing up?**
394
-
395
- Run `/clancy:status` to see what Clancy would pick up. If the queue is empty:
396
-
397
- - Check that tickets are assigned to you on the board
398
- - For Jira: verify the status filter in `/clancy:settings` matches your board's status name exactly (e.g. `To Do` vs `TODO`)
399
- - For Linear: Clancy filters by `state.type: unstarted` — ensure your backlog state maps to this type
400
-
401
- ---
402
-
403
- **`.clancy/clancy-once.js` not found?**
404
-
405
- Re-run `/clancy:init` — it will detect the existing setup and offer to re-scaffold without asking for credentials again.
406
-
407
- ---
408
-
409
- **Playwright port already in use?**
410
-
411
- ```bash
412
- lsof -ti:5173 | xargs kill -9 # replace 5173 with your PLAYWRIGHT_DEV_PORT
413
- ```
414
-
415
- ---
416
-
417
- **Updating Clancy?**
418
-
419
- ```bash
420
- /clancy:update
421
- ```
422
-
423
- Or directly: `npx chief-clancy@latest`
424
-
425
- The update workflow shows what's changed (changelog diff) and asks for confirmation before overwriting. If you've customised any command or workflow files, they're automatically backed up to `.claude/clancy/local-patches/` before the update — check there to reapply your changes afterwards.
426
-
427
- ---
428
-
429
- **Uninstalling?**
430
-
431
- ```
432
- /clancy:uninstall
433
- ```
434
-
435
- Removes slash commands from your chosen location. Cleans up the `<!-- clancy:start -->` / `<!-- clancy:end -->` block from `CLAUDE.md` (or deletes it entirely if Clancy created it) and removes the `.clancy/.env` entry from `.gitignore`. Optionally removes `.clancy/` (credentials and docs).
267
+ See [Troubleshooting guide](docs/guides/TROUBLESHOOTING.md) for common issues and solutions.
436
268
 
437
269
  ---
438
270
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chief-clancy",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Autonomous, board-driven development for Claude Code — scaffolds docs, integrates Kanban boards, runs tickets in a loop.",
5
5
  "keywords": [
6
6
  "claude",
@@ -22,9 +22,9 @@ Before asking any questions, silently check:
22
22
  - Is this an existing project? Check for `package.json`, `.git`, `src/`, `app/`, `lib/`
23
23
  - Is a board already configured? Check `.clancy/.env` for `JIRA_BASE_URL`, `GITHUB_TOKEN`, `LINEAR_API_KEY`
24
24
  - Does `CLAUDE.md` already exist? Flag for merge — never overwrite
25
- - Does `.clancy/` already exist? Warn and offer re-init or abort
25
+ - Does `.clancy/.env` already exist? This means init has been completed before — warn and offer re-init or abort. Note: `.clancy/` alone may exist from the installer (runtime scripts) without init having run.
26
26
 
27
- If `.clancy/` exists, output:
27
+ If `.clancy/.env` exists, output:
28
28
 
29
29
  It looks like Clancy is already set up in this project.
30
30
 
@@ -239,6 +239,82 @@ If enter is pressed with no value: skip — omit the label clause entirely (Clan
239
239
 
240
240
  ---
241
241
 
242
+ ### Q3d (Jira and Linear only): Status transitions
243
+
244
+ Output:
245
+
246
+ **GitHub:** Skip this step entirely — GitHub Issues use `open`/`closed`, not status columns. Clancy closes issues automatically on completion.
247
+
248
+ **Jira:** Output:
249
+
250
+ ```
251
+ When Clancy picks up a ticket, it can transition it on your Jira board.
252
+ Jira uses transition action names (e.g. "In Progress", "Start Progress").
253
+ These usually match the column name, but check your Jira workflow if transitions fail.
254
+
255
+ What transition should Clancy use when it starts working on a ticket?
256
+
257
+ [1] In Progress (most common)
258
+ [2] Enter a different value
259
+ [3] Skip — don't transition on pickup (ticket stays in its current column)
260
+ ```
261
+
262
+ If [1]: store `CLANCY_STATUS_IN_PROGRESS="In Progress"` in `.clancy/.env`.
263
+ If [2]: prompt for the value, store as `CLANCY_STATUS_IN_PROGRESS` in `.clancy/.env`. Wrap in double quotes.
264
+ If [3] or the user says "skip"/"none": skip — no `CLANCY_STATUS_IN_PROGRESS` line written.
265
+
266
+ Then ask:
267
+
268
+ ```
269
+ What transition should Clancy use after implementation is complete?
270
+
271
+ [1] Done
272
+ [2] Ready for Review
273
+ [3] Enter a different value
274
+ [4] Skip — don't transition on completion (ticket stays in its current column)
275
+ ```
276
+
277
+ If [1]: store `CLANCY_STATUS_DONE="Done"` in `.clancy/.env`.
278
+ If [2]: store `CLANCY_STATUS_DONE="Ready for Review"` in `.clancy/.env`.
279
+ If [3]: prompt for the value, store as `CLANCY_STATUS_DONE` in `.clancy/.env`. Wrap in double quotes.
280
+ If [4] or the user says "skip"/"none": skip — no `CLANCY_STATUS_DONE` line written.
281
+
282
+ **Linear:** Output:
283
+
284
+ ```
285
+ When Clancy picks up a ticket, it can move it to a workflow state on your board.
286
+
287
+ What state should Clancy move a ticket to when it starts working on it?
288
+
289
+ [1] In Progress (most common)
290
+ [2] Enter a different value
291
+ [3] Skip — don't transition on pickup (ticket stays in its current state)
292
+ ```
293
+
294
+ If [1]: store `CLANCY_STATUS_IN_PROGRESS="In Progress"` in `.clancy/.env`.
295
+ If [2]: prompt for the value, store as `CLANCY_STATUS_IN_PROGRESS` in `.clancy/.env`. Wrap in double quotes.
296
+ If [3] or the user says "skip"/"none": skip — no `CLANCY_STATUS_IN_PROGRESS` line written.
297
+
298
+ Then ask:
299
+
300
+ ```
301
+ What state should Clancy move a ticket to after implementation is complete?
302
+
303
+ [1] Done
304
+ [2] Ready for Review
305
+ [3] Enter a different value
306
+ [4] Skip — don't transition on completion (ticket stays in its current state)
307
+ ```
308
+
309
+ If [1]: store `CLANCY_STATUS_DONE="Done"` in `.clancy/.env`.
310
+ If [2]: store `CLANCY_STATUS_DONE="Ready for Review"` in `.clancy/.env`.
311
+ If [3]: prompt for the value, store as `CLANCY_STATUS_DONE` in `.clancy/.env`. Wrap in double quotes.
312
+ If [4] or the user says "skip"/"none": skip — no `CLANCY_STATUS_DONE` line written.
313
+
314
+ You can always configure these later via `/clancy:settings`.
315
+
316
+ ---
317
+
242
318
  ### Q4: Base branch (auto-detect)
243
319
 
244
320
  Silently detect the base branch — do not ask unless detection fails:
@@ -322,6 +398,28 @@ Note: as more roles are added in future versions, they appear as additional numb
322
398
 
323
399
  ---
324
400
 
401
+ ## Step 4d (Jira only, if Planner role selected): Planning queue status
402
+
403
+ Only ask this if the user selected Planner in Step 4c above (or if re-running init and `CLANCY_ROLES` already includes `planner`).
404
+
405
+ If the planner role is not enabled, skip this step entirely.
406
+
407
+ Output:
408
+
409
+ ```
410
+ The Planner role picks tickets from a separate queue for planning.
411
+
412
+ Which Jira status should Clancy pick planning tickets from?
413
+
414
+ [1] Backlog (default)
415
+ [2] Enter a different value
416
+ ```
417
+
418
+ If [1]: store `CLANCY_PLAN_STATUS="Backlog"` in `.clancy/.env`.
419
+ If [2]: prompt for the value, store as `CLANCY_PLAN_STATUS` in `.clancy/.env`. Wrap in double quotes.
420
+
421
+ ---
422
+
325
423
  ## Step 5 — Optional enhancements
326
424
 
327
425
  Output:
@@ -335,6 +335,7 @@ JIRA_USER=your-email@example.com
335
335
  JIRA_API_TOKEN=your-api-token-from-id.atlassian.com
336
336
  JIRA_PROJECT_KEY=PROJ
337
337
 
338
+ # ─── Implementation Queue ─────────────────────────────────────────────────────
338
339
  # Status name for "ready to be picked up" (default: To Do)
339
340
  # Must be quoted if the status name contains spaces (e.g. "Selected for Development")
340
341
  CLANCY_JQL_STATUS="To Do"
@@ -377,10 +378,17 @@ MAX_ITERATIONS=5
377
378
 
378
379
  # ─── Optional: Status transitions ────────────────────────────────────────────
379
380
  # Move tickets automatically when Clancy picks up or completes them.
380
- # Set to the exact status name shown in your Jira board column header.
381
+ # Set to the Jira transition name (the action label, not the column header).
382
+ # In many workflows these match, but check your Jira workflow if transitions fail.
383
+ # "Done" can be any transition to a post-implementation status.
381
384
  # CLANCY_STATUS_IN_PROGRESS="In Progress"
382
385
  # CLANCY_STATUS_DONE="Done"
383
386
 
387
+ # ─── Optional: Planner queue ─────────────────────────────────────────────────
388
+ # Status for backlog tickets that /clancy:plan fetches from (default: Backlog)
389
+ # Only used if Planner role is enabled via CLANCY_ROLES
390
+ # CLANCY_PLAN_STATUS="Backlog"
391
+
384
392
  # ─── Optional: Notifications ──────────────────────────────────────────────────
385
393
  # Webhook URL for Slack or Teams notifications on ticket completion
386
394
  # CLANCY_NOTIFY_WEBHOOK=https://hooks.slack.com/services/your/webhook/url
@@ -397,10 +405,14 @@ MAX_ITERATIONS=5
397
405
  GITHUB_TOKEN=ghp_your-personal-access-token
398
406
  GITHUB_REPO=owner/repo-name
399
407
 
400
- # Optional: only pick up issues with this label (in addition to 'clancy').
401
- # Useful for mixed backlogs where not every issue is suitable for autonomous implementation.
408
+ # Recommended: only pick up issues with this label.
409
+ # Without this, Clancy picks up all open issues assigned to you.
402
410
  # Create the label in GitHub first, then add it to any issue you want Clancy to pick up.
403
- # CLANCY_LABEL=clancy
411
+ # CLANCY_LABEL="clancy"
412
+
413
+ # ─── Planner Queue (optional — requires CLANCY_ROLES to include "planner") ───
414
+ # Label for backlog issues that /clancy:plan fetches from (default: needs-refinement)
415
+ # CLANCY_PLAN_LABEL="needs-refinement"
404
416
 
405
417
  # ─── Git ──────────────────────────────────────────────────────────────────────
406
418
  # Base integration branch. Clancy branches from here when an issue has no milestone.
@@ -479,7 +491,8 @@ MAX_ITERATIONS=20
479
491
 
480
492
  # ─── Optional: Status transitions ────────────────────────────────────────────
481
493
  # Move issues automatically when Clancy picks up or completes them.
482
- # Set to the exact workflow state name shown in your Linear board column header.
494
+ # Set to the exact workflow state name shown in your Linear team settings.
495
+ # "Done" can be any post-implementation state (e.g. "Ready for Review", "In Review").
483
496
  # CLANCY_STATUS_IN_PROGRESS="In Progress"
484
497
  # CLANCY_STATUS_DONE="Done"
485
498