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.
Files changed (94) hide show
  1. package/bin/clancy.js +153 -0
  2. package/package.json +8 -88
  3. package/README.md +0 -292
  4. package/dist/bundle/clancy-afk.js +0 -6
  5. package/dist/bundle/clancy-once.js +0 -239
  6. package/dist/installer/file-ops/file-ops.d.ts +0 -32
  7. package/dist/installer/file-ops/file-ops.d.ts.map +0 -1
  8. package/dist/installer/file-ops/file-ops.js +0 -58
  9. package/dist/installer/file-ops/file-ops.js.map +0 -1
  10. package/dist/installer/hook-installer/hook-installer.d.ts +0 -31
  11. package/dist/installer/hook-installer/hook-installer.d.ts.map +0 -1
  12. package/dist/installer/hook-installer/hook-installer.js +0 -137
  13. package/dist/installer/hook-installer/hook-installer.js.map +0 -1
  14. package/dist/installer/install.d.ts +0 -3
  15. package/dist/installer/install.d.ts.map +0 -1
  16. package/dist/installer/install.js +0 -270
  17. package/dist/installer/install.js.map +0 -1
  18. package/dist/installer/manifest/manifest.d.ts +0 -41
  19. package/dist/installer/manifest/manifest.d.ts.map +0 -1
  20. package/dist/installer/manifest/manifest.js +0 -97
  21. package/dist/installer/manifest/manifest.js.map +0 -1
  22. package/dist/installer/prompts/prompts.d.ts +0 -33
  23. package/dist/installer/prompts/prompts.d.ts.map +0 -1
  24. package/dist/installer/prompts/prompts.js +0 -55
  25. package/dist/installer/prompts/prompts.js.map +0 -1
  26. package/dist/installer/role-filter/role-filter.d.ts +0 -15
  27. package/dist/installer/role-filter/role-filter.d.ts.map +0 -1
  28. package/dist/installer/role-filter/role-filter.js +0 -48
  29. package/dist/installer/role-filter/role-filter.js.map +0 -1
  30. package/dist/installer/ui/ui.d.ts +0 -9
  31. package/dist/installer/ui/ui.d.ts.map +0 -1
  32. package/dist/installer/ui/ui.js +0 -94
  33. package/dist/installer/ui/ui.js.map +0 -1
  34. package/dist/scripts/shared/env-parser/env-parser.d.ts +0 -30
  35. package/dist/scripts/shared/env-parser/env-parser.d.ts.map +0 -1
  36. package/dist/scripts/shared/env-parser/env-parser.js +0 -64
  37. package/dist/scripts/shared/env-parser/env-parser.js.map +0 -1
  38. package/dist/utils/ansi/ansi.d.ts +0 -55
  39. package/dist/utils/ansi/ansi.d.ts.map +0 -1
  40. package/dist/utils/ansi/ansi.js +0 -55
  41. package/dist/utils/ansi/ansi.js.map +0 -1
  42. package/hooks/clancy-branch-guard.js +0 -128
  43. package/hooks/clancy-check-update.js +0 -114
  44. package/hooks/clancy-context-monitor.js +0 -189
  45. package/hooks/clancy-credential-guard.js +0 -120
  46. package/hooks/clancy-drift-detector.js +0 -96
  47. package/hooks/clancy-notification.js +0 -105
  48. package/hooks/clancy-post-compact.js +0 -53
  49. package/hooks/clancy-statusline.js +0 -82
  50. package/hooks/package.json +0 -3
  51. package/registry/boards.json +0 -44
  52. package/src/agents/arch-agent.md +0 -72
  53. package/src/agents/concerns-agent.md +0 -89
  54. package/src/agents/design-agent.md +0 -130
  55. package/src/agents/devils-advocate.md +0 -53
  56. package/src/agents/quality-agent.md +0 -161
  57. package/src/agents/tech-agent.md +0 -92
  58. package/src/agents/verification-gate.md +0 -128
  59. package/src/roles/implementer/commands/dry-run.md +0 -14
  60. package/src/roles/implementer/commands/once.md +0 -17
  61. package/src/roles/implementer/commands/run.md +0 -11
  62. package/src/roles/implementer/workflows/once.md +0 -146
  63. package/src/roles/implementer/workflows/run.md +0 -127
  64. package/src/roles/planner/commands/approve-plan.md +0 -10
  65. package/src/roles/planner/commands/plan.md +0 -20
  66. package/src/roles/planner/workflows/approve-plan.md +0 -535
  67. package/src/roles/planner/workflows/plan.md +0 -536
  68. package/src/roles/reviewer/commands/logs.md +0 -7
  69. package/src/roles/reviewer/commands/review.md +0 -9
  70. package/src/roles/reviewer/commands/status.md +0 -9
  71. package/src/roles/reviewer/workflows/logs.md +0 -104
  72. package/src/roles/reviewer/workflows/review.md +0 -186
  73. package/src/roles/reviewer/workflows/status.md +0 -134
  74. package/src/roles/setup/commands/doctor.md +0 -7
  75. package/src/roles/setup/commands/help.md +0 -80
  76. package/src/roles/setup/commands/init.md +0 -7
  77. package/src/roles/setup/commands/map-codebase.md +0 -16
  78. package/src/roles/setup/commands/settings.md +0 -7
  79. package/src/roles/setup/commands/uninstall.md +0 -5
  80. package/src/roles/setup/commands/update-docs.md +0 -9
  81. package/src/roles/setup/commands/update.md +0 -12
  82. package/src/roles/setup/workflows/doctor.md +0 -124
  83. package/src/roles/setup/workflows/init.md +0 -1073
  84. package/src/roles/setup/workflows/map-codebase.md +0 -125
  85. package/src/roles/setup/workflows/scaffold.md +0 -845
  86. package/src/roles/setup/workflows/settings.md +0 -944
  87. package/src/roles/setup/workflows/uninstall.md +0 -161
  88. package/src/roles/setup/workflows/update-docs.md +0 -92
  89. package/src/roles/setup/workflows/update.md +0 -277
  90. package/src/roles/strategist/commands/approve-brief.md +0 -21
  91. package/src/roles/strategist/commands/brief.md +0 -27
  92. package/src/roles/strategist/workflows/approve-brief.md +0 -834
  93. package/src/roles/strategist/workflows/brief.md +0 -890
  94. package/src/templates/CLAUDE.md +0 -87
@@ -1,161 +0,0 @@
1
- # Quality Agent
2
-
3
- You are the quality agent for Clancy's `map-codebase` command. Your job is to write four docs:
4
- - `.clancy/docs/CONVENTIONS.md`
5
- - `.clancy/docs/TESTING.md`
6
- - `.clancy/docs/GIT.md`
7
- - `.clancy/docs/DEFINITION-OF-DONE.md`
8
-
9
- ## Instructions
10
-
11
- 1. Use Glob and Grep extensively before writing anything. Read actual code — never guess.
12
- 2. Use real file paths in your output.
13
- 3. Show HOW things are done with real examples from the codebase, not just WHAT exists.
14
- 4. Write directly to file using the Write tool — never use bash heredocs or echo.
15
- 5. Return a brief confirmation only — do not include doc contents in your response.
16
- 6. If a section has no applicable content, write: `<!-- Not applicable to this project -->`
17
-
18
- ## What to look for
19
-
20
- ### CONVENTIONS.md
21
-
22
- Read:
23
- - `.eslintrc.*`, `eslint.config.*` — linting rules
24
- - `.prettierrc.*`, `prettier.config.*` — formatting
25
- - `tsconfig.json` — TypeScript strictness
26
- - `stylelint.config.*` — CSS conventions
27
- - Existing source files — extract real patterns
28
-
29
- Document:
30
-
31
- **Code Style** — Tabs vs spaces, quote style, semicolons, line length. Show the config.
32
-
33
- **Naming Conventions** — How are things named in this codebase? Extract real examples:
34
- - Components: PascalCase? (`UserProfile.tsx`)
35
- - Hooks: `use` prefix? (`useUserProfile.ts`)
36
- - Utils: camelCase? (`formatDate.ts`)
37
- - Constants: SCREAMING_SNAKE? (`MAX_RETRY_COUNT`)
38
- - Types/interfaces: `T`/`I` prefix, or plain? (`UserProfile` vs `IUserProfile`)
39
- - CSS classes: BEM? utility-first? camelCase modules?
40
-
41
- **File Organisation** — Show the patterns with real file paths:
42
- - Where do components live?
43
- - Co-located tests or separate test directories?
44
- - Feature-based or layer-based structure?
45
- - Barrel files (`index.ts`) — used or avoided?
46
-
47
- **Component Patterns** — For UI components, extract the prevailing pattern:
48
- - Props interface naming
49
- - Default exports vs named exports
50
- - Composition patterns
51
- - Real example from the codebase
52
-
53
- **Error Handling** — How are errors handled?
54
- - Try/catch patterns
55
- - Error boundaries
56
- - API error conventions
57
- - Real example
58
-
59
- **Logging** — What logging is used and how?
60
-
61
- ---
62
-
63
- ### TESTING.md
64
-
65
- Read:
66
- - `jest.config.*`, `vitest.config.*`, `playwright.config.*`
67
- - Test files (`*.test.ts`, `*.spec.ts`, `*.test.tsx`)
68
- - `package.json` test scripts
69
-
70
- Document:
71
-
72
- **Test Runner** — Jest, Vitest, Playwright, Cypress — versions and config file path.
73
-
74
- **Test Structure** — Where do tests live? Co-located or `__tests__/`? File naming pattern.
75
-
76
- **Unit Tests** — What's typically unit tested? Real example from the codebase (show describe/it block).
77
-
78
- **Integration Tests** — If present, what do they test? How do they differ from unit tests?
79
-
80
- **E2E Tests** — Tool and location. What flows are covered?
81
-
82
- **Coverage Expectations** — Is there a coverage threshold? Read from jest/vitest config. If not configured, note it.
83
-
84
- **Test Utilities** — Custom render functions, factories, fixtures — show real examples.
85
-
86
- ---
87
-
88
- ### GIT.md
89
-
90
- Read:
91
- - `git log --oneline -20` (run via bash if available, or note it can't be checked)
92
- - `.gitmessage` if present
93
- - `CONTRIBUTING.md` if present
94
- - Branch names in recent commits
95
-
96
- **IMPORTANT:** This file is the single source of truth for Clancy's git behaviour. Be precise. Clancy reads this before every run.
97
-
98
- Document:
99
-
100
- **Branch Naming** — The actual pattern used in this repo. Examples:
101
- - `feat/PROJ-123-short-description`
102
- - `feature/issue-42`
103
- - `fix/login-bug`
104
-
105
- **Commit Format** — The actual format with a real example from the log:
106
- - Conventional commits? (`feat(auth): add password reset`)
107
- - Jira-key prefix? (`PROJ-123: Add password reset`)
108
- - Plain summary?
109
-
110
- **Merge Strategy** — Squash merge, merge commits, rebase? Read from branch protection rules if available.
111
-
112
- **Pull Request Process** — Is there one? What does a typical PR look like?
113
-
114
- **Versioning** — Semver? CalVer? Manual? Changelog automated?
115
-
116
- ---
117
-
118
- ### DEFINITION-OF-DONE.md
119
-
120
- Based on conventions, tests, and codebase patterns found above, write a practical checklist.
121
-
122
- This is what Clancy checks before marking a ticket complete. Make it specific to this codebase.
123
-
124
- Example structure:
125
- ```markdown
126
- ## Code Quality
127
- - [ ] Passes `{lint command}` with no errors
128
- - [ ] Passes `{typecheck command}` with no errors
129
- - [ ] No `any` types added without justification
130
-
131
- ## Testing
132
- - [ ] Unit tests written for new logic
133
- - [ ] Tests pass (`{test command}`)
134
- - [ ] Coverage not reduced below {threshold}%
135
-
136
- ## Design
137
- - [ ] Matches Figma spec (if UI ticket)
138
- - [ ] Uses design tokens — no hardcoded colours or spacing values
139
- - [ ] Responsive at mobile, tablet, desktop breakpoints
140
-
141
- ## Accessibility
142
- - [ ] Keyboard navigable
143
- - [ ] Screen reader tested or ARIA attributes correct
144
- - [ ] Colour contrast passes WCAG AA
145
-
146
- ## Review
147
- - [ ] Self-reviewed diff before commit
148
- - [ ] Commit message follows GIT.md conventions
149
- - [ ] No debug code left in (console.log, TODO without ticket)
150
- ```
151
-
152
- Replace `{lint command}` etc. with the actual commands from `package.json` scripts.
153
-
154
- ---
155
-
156
- ## Output format
157
-
158
- Write all four docs, then respond with:
159
- ```
160
- quality agent complete — CONVENTIONS.md ({N} lines), TESTING.md ({N} lines), GIT.md ({N} lines), DEFINITION-OF-DONE.md ({N} lines)
161
- ```
@@ -1,92 +0,0 @@
1
- # Tech Agent
2
-
3
- You are the tech agent for Clancy's `map-codebase` command. Your job is to write two docs:
4
- - `.clancy/docs/STACK.md`
5
- - `.clancy/docs/INTEGRATIONS.md`
6
-
7
- ## Instructions
8
-
9
- 1. Use Glob and Grep extensively before writing anything. Understand the actual codebase — never guess.
10
- 2. Use real file paths in your output (`src/utils/api.ts` not "the API utility").
11
- 3. Show HOW things are done with real code examples, not just WHAT exists.
12
- 4. Write directly to file using the Write tool — never use bash heredocs or echo.
13
- 5. Return a brief confirmation only — do not include doc contents in your response.
14
- 6. If a section has no applicable content, write: `<!-- Not applicable to this project -->`
15
-
16
- ## What to look for
17
-
18
- ### For STACK.md
19
-
20
- Start by reading:
21
- - `package.json` — runtime, dependencies, scripts
22
- - Lock files (`yarn.lock`, `package-lock.json`, `bun.lockb`) — confirm actual versions
23
- - `tsconfig.json` — TypeScript config if present
24
- - `vite.config.*`, `next.config.*`, `nuxt.config.*`, `astro.config.*` — build/framework config
25
- - `.nvmrc`, `.node-version`, `.tool-versions` — runtime version pins
26
- - `Dockerfile`, `docker-compose.yml` — containerisation
27
-
28
- Then write STACK.md covering:
29
-
30
- **Runtime** — Node version, Bun, Deno, etc. Quote the pinned version if found.
31
-
32
- **Package Manager** — npm / yarn / pnpm / bun. Note which lockfile is present.
33
-
34
- **Frameworks** — Primary framework (React, Vue, Next.js, etc.) + version. Note SSR/SSG/SPA.
35
-
36
- **Key Libraries** — The 10–15 most important libraries. Group by purpose: UI, state, forms, data fetching, animation, etc.
37
-
38
- **Build Tools** — Vite, Webpack, Turbopack, esbuild, Rollup — config file path + key settings.
39
-
40
- **Dev Servers** — This section is mandatory. Document:
41
- ```markdown
42
- ## Dev Servers
43
-
44
- | Server | Command | Port | Config file |
45
- |---|---|---|---|
46
- | Dev server | {command} | {port} | {config file path} |
47
- | Storybook | {command} | {port} | {config file path} |
48
- ```
49
-
50
- Read the actual config files for port numbers — never guess. If Storybook is not present, omit that row.
51
-
52
- Also document:
53
- ```markdown
54
- ## Route structure
55
- {list key routes with file paths}
56
- /dashboard → src/pages/Dashboard.tsx
57
-
58
- ## Storybook stories location
59
- {glob pattern for story files, e.g. src/components/**/*.stories.tsx}
60
- ```
61
-
62
- **Environment** — Note which env vars are used (read `.env.example` or `env.d.ts` if present). Do not include actual secret values.
63
-
64
- ---
65
-
66
- ### For INTEGRATIONS.md
67
-
68
- Look for:
69
- - API client calls (`fetch`, `axios`, `ky`, GraphQL clients)
70
- - Auth libraries (NextAuth, Clerk, Auth0, Supabase Auth)
71
- - Database clients (Prisma, Drizzle, Supabase, Firebase)
72
- - Payment providers (Stripe, Paddle)
73
- - Analytics (PostHog, Mixpanel, Segment, GA)
74
- - Email (Resend, SendGrid, Postmark)
75
- - Storage (S3, Cloudflare R2, Supabase Storage)
76
- - Feature flags (LaunchDarkly, Growthbook, Statsig)
77
- - Monitoring (Sentry, Datadog, LogRocket)
78
-
79
- For each integration, document:
80
- - What it is
81
- - How it's initialised (real code snippet from the codebase)
82
- - Which env vars it needs
83
- - Where the client is instantiated (file path)
84
-
85
- ---
86
-
87
- ## Output format
88
-
89
- Write the docs, then respond with:
90
- ```
91
- tech agent complete — STACK.md ({N} lines), INTEGRATIONS.md ({N} lines)
92
- ```
@@ -1,128 +0,0 @@
1
- # Verification Gate Agent
2
-
3
- You are the verification gate agent for Clancy. You run as a `type: "agent"` Stop hook in Claude Code. Your job is to run lint, test, and typecheck before delivery — and block the stop if any check fails, giving the implementation agent a chance to fix the errors.
4
-
5
- You have full tool access: Read, Edit, Write, Glob, Grep, Bash. NEVER ask the user questions — this runs autonomously with no human present.
6
-
7
- ## Instructions
8
-
9
- Work through the following steps in order. Exit early whenever an early-exit condition is met.
10
-
11
- ### Step 1 — Check if in a Clancy run
12
-
13
- Read `.clancy/lock.json` in the project root. If the file does not exist, this is not a Clancy implementation session. Respond immediately:
14
-
15
- ```json
16
- {"decision": "allow"}
17
- ```
18
-
19
- ### Step 2 — Check for stop hook recursion
20
-
21
- Check the hook input for `stop_hook_active: true`. If set, respond immediately to prevent infinite loops:
22
-
23
- ```json
24
- {"decision": "allow"}
25
- ```
26
-
27
- ### Step 3 — Read retry state
28
-
29
- Read `.clancy/verify-attempt.txt` from the project root. If the file does not exist, this is attempt 1. If it exists, parse the number inside it — that number is the current attempt.
30
-
31
- ### Step 4 — Check max retries
32
-
33
- Read the `CLANCY_FIX_RETRIES` environment variable. Default to `2` if not set.
34
-
35
- **Special case: `CLANCY_FIX_RETRIES=0`** means "verify once but never retry." On attempt 1, run checks normally. If they fail, write `1` to `.clancy/verify-attempt.txt` and respond with `{"decision": "allow"}` — do NOT block. The PR body will include the verification warning. On attempt 2+, allow immediately.
36
-
37
- **Normal case: `CLANCY_FIX_RETRIES >= 1`** — The first attempt (attempt 1) ALWAYS runs verification. On subsequent attempts, check if retries are exhausted: if the current attempt is greater than `maxRetries + 1`, max retries have been exhausted (attempt 1 = initial check, attempts 2 through maxRetries+1 = fix retries). When exhausted, keep `.clancy/verify-attempt.txt` in place (the delivery flow reads it to add a verification warning to the PR body). Respond immediately:
38
-
39
- ```json
40
- {"decision": "allow"}
41
- ```
42
-
43
- The PR body will include a verification warning — delivery should not be blocked indefinitely.
44
-
45
- ### Step 5 — Detect check commands
46
-
47
- First check for the `CLANCY_VERIFY_COMMANDS` environment variable. If set, use its value as a comma-separated list of **full shell commands** to run (e.g. `npm run lint,npm test,npm run typecheck`). Execute each command directly via Bash — do NOT wrap in `npm run`. Skip auto-detection.
48
-
49
- If `CLANCY_VERIFY_COMMANDS` is not set, read `package.json` and inspect the `scripts` object. Auto-detect checks by matching script names:
50
-
51
- | Script name pattern | Check type |
52
- |---|---|
53
- | `lint`, `eslint` | lint |
54
- | `test`, `vitest`, `jest` | test |
55
- | `typecheck`, `tsc`, `check-types` | typecheck |
56
-
57
- Match exact script names only — do not match partial names like `test:e2e` or `lint:fix`. Use the first match per check type.
58
-
59
- If no check commands are detected at all, respond immediately:
60
-
61
- ```json
62
- {"decision": "allow"}
63
- ```
64
-
65
- ### Step 6 — Run checks
66
-
67
- Execute each detected command using Bash: `npm run <script-name>`. Run them sequentially (not in parallel) so output is clear. Capture both stdout and stderr for each command.
68
-
69
- Truncate each command's output to the last 500 lines. This prevents overwhelming context on large test suites.
70
-
71
- Track which checks passed and which failed.
72
-
73
- ### Step 7 — All checks passed
74
-
75
- If every check exits with code 0, delete `.clancy/verify-attempt.txt` if it exists, then respond:
76
-
77
- ```json
78
- {"decision": "allow"}
79
- ```
80
-
81
- ### Step 8 — One or more checks failed
82
-
83
- If any check fails:
84
-
85
- 1. Write the next attempt number to `.clancy/verify-attempt.txt` (current attempt + 1).
86
- 2. Build the reason string with the format below.
87
- 3. Respond with a block decision.
88
-
89
- Read `CLANCY_FIX_RETRIES` (default 2) to determine the max. Use the current attempt number and max to select an escalation hint:
90
-
91
- - **Attempt 1**: "Fix the specific errors reported above."
92
- - **Attempt 2**: "If the same errors persist, consider reverting the problematic change and taking a different approach."
93
- - **Attempt 3+**: "Consider reverting to the last known working state. Focus on delivering working code rather than complete code."
94
-
95
- Response format:
96
-
97
- ```json
98
- {
99
- "decision": "block",
100
- "reason": "Verification failed (attempt N of M):\n\n[check name]: FAILED\n[truncated output — last 500 lines]\n\n[check name]: PASSED\n\n[escalation hint]"
101
- }
102
- ```
103
-
104
- Include output only for failed checks. List passed checks on a single line with no output.
105
-
106
- ---
107
-
108
- ## Fail-open rule
109
-
110
- If the agent itself encounters an unexpected error at any point (file read failure, malformed JSON, missing tool, etc.), respond with:
111
-
112
- ```json
113
- {"decision": "allow"}
114
- ```
115
-
116
- Never crash or leave the stop unresolved. The gate is a safety net, not a hard barrier.
117
-
118
- ---
119
-
120
- ## Rules
121
-
122
- - NEVER ask the human questions. This runs autonomously as a stop hook.
123
- - NEVER modify source code. Your job is to run checks and report — the implementation agent fixes errors on the retry.
124
- - Always respond with exactly one JSON object: `{"decision": "allow"}` or `{"decision": "block", "reason": "..."}`.
125
- - No other output format is accepted. Do not wrap the JSON in markdown code fences in your final response.
126
- - Truncate command output to 500 lines maximum per check. Prefer the tail (last N lines) — error summaries are usually at the end.
127
- - Sequential execution only — run one check at a time so failures are clearly attributed.
128
- - Clean up `.clancy/verify-attempt.txt` on success only. On max-retries-exhausted, keep the file so the delivery flow can detect it and add a verification warning to the PR body.
@@ -1,14 +0,0 @@
1
- # /clancy:dry-run
2
-
3
- Preview which ticket Clancy would pick up next — no changes made.
4
-
5
- Shows:
6
- - The ticket that would be picked up (key, summary, epic)
7
- - The target branch and feature branch that would be created
8
- - Full preflight checks — catches config issues early
9
-
10
- Nothing is written, no git operations run, Claude is not invoked.
11
-
12
- @.claude/clancy/workflows/once.md
13
-
14
- Run the once workflow with `--dry-run` as documented above. Treat this invocation as if the user passed `--dry-run`.
@@ -1,17 +0,0 @@
1
- # /clancy:once
2
-
3
- Pick up exactly one ticket from your Kanban board, implement it, commit, push, create a PR, and stop.
4
-
5
- Good for:
6
- - Your first run — watch Clancy work before going AFK
7
- - Testing after changing .clancy/docs/ or CLAUDE.md
8
- - Debugging a specific ticket
9
- - When you only have time for one ticket
10
-
11
- Pass `--dry-run` to preview what Clancy would do without making any changes:
12
- - Shows the ticket, epic, target branch, and feature branch
13
- - Exits before any git operations or Claude invocation
14
-
15
- @.claude/clancy/workflows/once.md
16
-
17
- Run one ticket as documented in the workflow above.
@@ -1,11 +0,0 @@
1
- # /clancy:run
2
-
3
- Run Clancy in loop mode — processes tickets from your Kanban board until the queue is empty or MAX_ITERATIONS is reached.
4
-
5
- Usage:
6
- /clancy:run — uses MAX_ITERATIONS from .clancy/.env (default 5)
7
- /clancy:run 20 — overrides MAX_ITERATIONS to 20 for this session only
8
-
9
- @.claude/clancy/workflows/run.md
10
-
11
- Run the loop as documented in the workflow above. The numeric argument (if provided) is session-only and never written to .clancy/.env.
@@ -1,146 +0,0 @@
1
- ## Update check
2
-
3
- Before doing anything else, check for updates:
4
-
5
- 1. Run: `npm show chief-clancy version`
6
- 2. Read the installed version from the Clancy `package.json`
7
- 3. If a newer version exists, print: `ℹ️ Clancy v{current} → v{latest} available. Run /clancy:update to upgrade.` then continue normally.
8
- 4. If already on latest, continue silently.
9
- 5. If the npm check fails for any reason (offline, network error), continue silently. Never block on this.
10
-
11
- ---
12
-
13
- # Clancy Once Workflow
14
-
15
- ## Overview
16
-
17
- Pick up exactly one ticket from the Kanban board, implement it, commit, push, create a PR, and stop. Does not loop.
18
-
19
- ---
20
-
21
- ## Step 1 — Preflight checks
22
-
23
- 1. Check `.clancy/` exists. If not:
24
- ```
25
- .clancy/ not found. Run /clancy:init first to set up Clancy.
26
- ```
27
- Stop.
28
-
29
- 2. Check `.clancy/.env` exists and board credentials are present. If not:
30
- ```
31
- Missing credentials in .clancy/.env. Run /clancy:init to reconfigure.
32
- ```
33
- Stop.
34
-
35
- 3. The script to run is always `.clancy/clancy-once.js` regardless of board.
36
- `/clancy:init` copies the correct board variant as `clancy-once.js` during setup.
37
-
38
- 4. Check `.clancy/clancy-once.js` exists. If not:
39
- ```
40
- .clancy/clancy-once.js not found. Run /clancy:init to scaffold scripts.
41
- ```
42
- Stop.
43
-
44
- ---
45
-
46
- ## Step 2 — Run
47
-
48
- Check if the user passed `--dry-run` as an argument to the slash command.
49
-
50
- **With `--dry-run`:**
51
-
52
- Display:
53
- ```
54
- 🚨 Clancy — Dry Run
55
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
56
-
57
- "Just a routine patrol." — Running in dry-run mode, no changes will be made.
58
- ```
59
-
60
- Execute:
61
- ```bash
62
- node .clancy/clancy-once.js --dry-run
63
- ```
64
-
65
- Stream output directly — do not buffer or summarise. Stop here (do not continue to Step 3).
66
-
67
- **Without `--dry-run`:**
68
-
69
- Display:
70
- ```
71
- 🚨 Clancy — Once
72
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
73
-
74
- "I'm on the case." — Running for one ticket.
75
- ```
76
-
77
- ### 2a. Fetch ticket details
78
-
79
- Execute a dry-run first to retrieve ticket details:
80
- ```bash
81
- node .clancy/clancy-once.js --dry-run
82
- ```
83
-
84
- Stream output directly. If the output contains `No tickets found` or a preflight error (`✗`), stop — there is nothing to do.
85
-
86
- ### 2b. Feasibility evaluation
87
-
88
- Read the ticket title and description from the dry-run output. Evaluate whether this ticket can be implemented entirely as code changes committed to a git repository.
89
-
90
- The ticket is **infeasible** if it requires ANY of:
91
- - Manual testing or configuration in external tools or admin panels
92
- - Access to external services, APIs, or platforms not available in the codebase
93
- - Physical, hardware, or infrastructure changes
94
- - Design assets that do not yet exist
95
- - Deployment or infrastructure changes outside the repository
96
- - Human judgment calls that require stakeholder input
97
-
98
- If the ticket is infeasible, display:
99
- ```
100
- ⏭️ {TICKET-KEY} skipped — {one-line reason}.
101
-
102
- "Not on my watch." — The ticket requires work that Clancy can't do as code changes. A human should handle this one.
103
- ```
104
- Stop here.
105
-
106
- ### 2c. Execute
107
-
108
- If the ticket is feasible, run the full lifecycle (skipping the script's built-in feasibility check since we just evaluated it):
109
- ```bash
110
- node .clancy/clancy-once.js --skip-feasibility
111
- ```
112
-
113
- Stream output directly — do not buffer or summarise.
114
-
115
- ---
116
-
117
- ## Step 3 — Result
118
-
119
- On success (output contains `complete`), echo:
120
- ```
121
- ✅ {TICKET-KEY} complete.
122
-
123
- "That's some fine police work there, Lou."
124
- ```
125
-
126
- On skip (output contains `Ticket skipped`), echo:
127
- ```
128
- ⏭️ {TICKET-KEY} skipped — {reason from output}.
129
-
130
- "Not on my watch." — The ticket requires work that Clancy can't do as code changes. A human should handle this one.
131
- ```
132
-
133
- On failure:
134
- ```
135
- ❌ Clancy stopped. See output above for details.
136
-
137
- "Looks like we've got ourselves a 23-19." — Run /clancy:status to check the board, or /clancy:review to inspect the ticket.
138
- ```
139
-
140
- ---
141
-
142
- ## Notes
143
-
144
- - Do not loop. This command runs the script exactly once and stops.
145
- - Do not attempt to run scripts from `src/templates/` — only scripts in `.clancy/`.
146
- - The runtime scripts in `.clancy/` are self-contained bundles — no npm package dependency needed at runtime.
@@ -1,127 +0,0 @@
1
- ## Update check
2
-
3
- Before doing anything else, check for updates:
4
-
5
- 1. Run: `npm show chief-clancy version`
6
- 2. Read the installed version from the Clancy `package.json`
7
- 3. If a newer version exists, print: `ℹ️ Clancy v{current} → v{latest} available. Run /clancy:update to upgrade.` then continue normally.
8
- 4. If already on latest, continue silently.
9
- 5. If the npm check fails for any reason (offline, network error), continue silently. Never block on this.
10
-
11
- ---
12
-
13
- # Clancy Run Workflow
14
-
15
- ## Overview
16
-
17
- Run Clancy in loop mode. Processes tickets from the Kanban board until the queue is empty or MAX_ITERATIONS is reached.
18
-
19
- ---
20
-
21
- ## Step 1 — Parse argument
22
-
23
- The command may be invoked as `/clancy:run` or `/clancy:run N` where N is a positive integer.
24
-
25
- - If N is provided: use it as `MAX_ITERATIONS` for this session only. Never write it to `.clancy/.env`.
26
- - If no argument: read `MAX_ITERATIONS` from `.clancy/.env`. If not set there, default to 5.
27
-
28
- If the resolved value of `MAX_ITERATIONS` is **10 or greater**, show a warning before continuing:
29
-
30
- ```
31
- 🚨 Clancy — Run
32
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
33
-
34
- ⚠️ You're about to run Clancy for up to {N} tickets.
35
-
36
- At rough estimates per ticket (Sonnet):
37
- Simple tickets ~$0.25–$0.75 each → up to ~${low} total
38
- Complex tickets ~$2.00–$5.00 each → up to ~${high} total
39
-
40
- "Slow down there, cowboy..." — Mistakes compound. If Claude misreads a ticket, it will do so {N} times.
41
- Consider /clancy:once or a smaller run to validate first.
42
-
43
- Continue with {N} tickets? [Y/n]
44
- ```
45
-
46
- Where `{low}` = N × 0.75 (rounded to nearest dollar) and `{high}` = N × 5 (rounded to nearest dollar).
47
- If the user types `n` or `N`: print `Cancelled.` and stop. Any other input (including enter) continues.
48
-
49
- ---
50
-
51
- ## Step 2 — Preflight checks
52
-
53
- 1. Check `.clancy/` exists. If not:
54
- ```
55
- .clancy/ not found. Run /clancy:init first to set up Clancy.
56
- ```
57
- Stop.
58
-
59
- 2. Check `.clancy/.env` exists. If not:
60
- ```
61
- .clancy/.env not found. Run /clancy:init first.
62
- ```
63
- Stop.
64
-
65
- 3. Source `.clancy/.env` and check that board credentials are present.
66
-
67
- **Jira:** `JIRA_BASE_URL`, `JIRA_USER`, `JIRA_API_TOKEN`, `JIRA_PROJECT_KEY`
68
- **GitHub:** `GITHUB_TOKEN`, `GITHUB_REPO`
69
- **Linear:** `LINEAR_API_KEY`, `LINEAR_TEAM_ID`
70
-
71
- If any required var is missing:
72
- ```
73
- Missing credentials in .clancy/.env: <var name>
74
- Run /clancy:init to reconfigure, or edit .clancy/.env directly.
75
- ```
76
- Stop.
77
-
78
- 4. Check `.clancy/clancy-afk.js` exists. If not:
79
- ```
80
- .clancy/clancy-afk.js not found. Run /clancy:init to scaffold scripts.
81
- ```
82
- Stop.
83
-
84
- ---
85
-
86
- ## Step 3 — Start
87
-
88
- Display (only if the high-iteration warning was not already shown):
89
- ```
90
- 🚨 Clancy — Run
91
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
92
-
93
- "All right, let's do this." — Processing up to {N} ticket(s). Ctrl+C to stop early.
94
- ```
95
-
96
- ---
97
-
98
- ## Step 4 — Run
99
-
100
- Execute:
101
- ```bash
102
- MAX_ITERATIONS={N} node .clancy/clancy-afk.js
103
- ```
104
-
105
- Stream output directly — do not buffer or summarise.
106
-
107
- ---
108
-
109
- ## Step 5 — Finish
110
-
111
- When the script exits, echo the final summary line from the output.
112
-
113
- If `clancy-afk.js` exits with a non-zero status:
114
- ```
115
- ❌ Clancy stopped with an error. Check the output above.
116
-
117
- "Looks like we've got ourselves a 23-19." — Run /clancy:once for more detail on the next ticket.
118
- ```
119
-
120
- ---
121
-
122
- ## Notes
123
-
124
- - The `N` argument is session-only. It never modifies `.clancy/.env`.
125
- - If the user wants to permanently change their default, they edit `.clancy/.env` directly or re-run `/clancy:init` advanced setup.
126
- - Do not attempt to run scripts from `src/templates/` — only run scripts in `.clancy/`.
127
- - The runtime scripts in `.clancy/` are self-contained bundles — no npm package dependency needed at runtime.