@chief-clancy/terminal 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/hooks/clancy-branch-guard.js +1 -0
- package/dist/hooks/clancy-check-update.js +2 -0
- package/dist/hooks/clancy-context-monitor.js +9 -0
- package/dist/hooks/clancy-credential-guard.js +2 -0
- package/dist/hooks/clancy-drift-detector.js +1 -0
- package/dist/hooks/clancy-notification.js +1 -0
- package/dist/hooks/clancy-post-compact.js +2 -0
- package/dist/hooks/clancy-statusline.js +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/file-ops/file-ops.d.ts +35 -0
- package/dist/installer/file-ops/file-ops.d.ts.map +1 -0
- package/dist/installer/file-ops/file-ops.js +95 -0
- package/dist/installer/file-ops/file-ops.js.map +1 -0
- package/dist/installer/file-ops/index.d.ts +2 -0
- package/dist/installer/file-ops/index.d.ts.map +1 -0
- package/dist/installer/file-ops/index.js +2 -0
- package/dist/installer/file-ops/index.js.map +1 -0
- package/dist/installer/hook-installer/hook-installer.d.ts +22 -0
- package/dist/installer/hook-installer/hook-installer.d.ts.map +1 -0
- package/dist/installer/hook-installer/hook-installer.js +213 -0
- package/dist/installer/hook-installer/hook-installer.js.map +1 -0
- package/dist/installer/hook-installer/index.d.ts +2 -0
- package/dist/installer/hook-installer/index.d.ts.map +1 -0
- package/dist/installer/hook-installer/index.js +2 -0
- package/dist/installer/hook-installer/index.js.map +1 -0
- package/dist/installer/install/index.d.ts +3 -0
- package/dist/installer/install/index.d.ts.map +1 -0
- package/dist/installer/install/index.js +2 -0
- package/dist/installer/install/index.js.map +1 -0
- package/dist/installer/install/install.d.ts +124 -0
- package/dist/installer/install/install.d.ts.map +1 -0
- package/dist/installer/install/install.js +255 -0
- package/dist/installer/install/install.js.map +1 -0
- package/dist/installer/manifest/index.d.ts +2 -0
- package/dist/installer/manifest/index.d.ts.map +1 -0
- package/dist/installer/manifest/index.js +2 -0
- package/dist/installer/manifest/index.js.map +1 -0
- package/dist/installer/manifest/manifest.d.ts +46 -0
- package/dist/installer/manifest/manifest.d.ts.map +1 -0
- package/dist/installer/manifest/manifest.js +180 -0
- package/dist/installer/manifest/manifest.js.map +1 -0
- package/dist/installer/prompts/index.d.ts +2 -0
- package/dist/installer/prompts/index.d.ts.map +1 -0
- package/dist/installer/prompts/index.js +2 -0
- package/dist/installer/prompts/index.js.map +1 -0
- package/dist/installer/prompts/prompts.d.ts +34 -0
- package/dist/installer/prompts/prompts.d.ts.map +1 -0
- package/dist/installer/prompts/prompts.js +28 -0
- package/dist/installer/prompts/prompts.js.map +1 -0
- package/dist/installer/role-filter/index.d.ts +2 -0
- package/dist/installer/role-filter/index.d.ts.map +1 -0
- package/dist/installer/role-filter/index.js +2 -0
- package/dist/installer/role-filter/index.js.map +1 -0
- package/dist/installer/role-filter/role-filter.d.ts +33 -0
- package/dist/installer/role-filter/role-filter.d.ts.map +1 -0
- package/dist/installer/role-filter/role-filter.js +91 -0
- package/dist/installer/role-filter/role-filter.js.map +1 -0
- package/dist/installer/shared/fs-errors/fs-errors.d.ts +3 -0
- package/dist/installer/shared/fs-errors/fs-errors.d.ts.map +1 -0
- package/dist/installer/shared/fs-errors/fs-errors.js +7 -0
- package/dist/installer/shared/fs-errors/fs-errors.js.map +1 -0
- package/dist/installer/shared/fs-errors/index.d.ts +2 -0
- package/dist/installer/shared/fs-errors/index.d.ts.map +1 -0
- package/dist/installer/shared/fs-errors/index.js +2 -0
- package/dist/installer/shared/fs-errors/index.js.map +1 -0
- package/dist/installer/shared/fs-guards/fs-guards.d.ts +3 -0
- package/dist/installer/shared/fs-guards/fs-guards.d.ts.map +1 -0
- package/dist/installer/shared/fs-guards/fs-guards.js +18 -0
- package/dist/installer/shared/fs-guards/fs-guards.js.map +1 -0
- package/dist/installer/shared/fs-guards/index.d.ts +2 -0
- package/dist/installer/shared/fs-guards/index.d.ts.map +1 -0
- package/dist/installer/shared/fs-guards/index.js +2 -0
- package/dist/installer/shared/fs-guards/index.js.map +1 -0
- package/dist/installer/shared/type-guards/index.d.ts +2 -0
- package/dist/installer/shared/type-guards/index.d.ts.map +1 -0
- package/dist/installer/shared/type-guards/index.js +2 -0
- package/dist/installer/shared/type-guards/index.js.map +1 -0
- package/dist/installer/shared/type-guards/type-guards.d.ts +8 -0
- package/dist/installer/shared/type-guards/type-guards.d.ts.map +1 -0
- package/dist/installer/shared/type-guards/type-guards.js +10 -0
- package/dist/installer/shared/type-guards/type-guards.js.map +1 -0
- package/dist/installer/ui/index.d.ts +2 -0
- package/dist/installer/ui/index.d.ts.map +1 -0
- package/dist/installer/ui/index.js +2 -0
- package/dist/installer/ui/index.js.map +1 -0
- package/dist/installer/ui/ui.d.ts +23 -0
- package/dist/installer/ui/ui.d.ts.map +1 -0
- package/dist/installer/ui/ui.js +121 -0
- package/dist/installer/ui/ui.js.map +1 -0
- package/dist/runner/autopilot/autopilot.d.ts +71 -0
- package/dist/runner/autopilot/autopilot.d.ts.map +1 -0
- package/dist/runner/autopilot/autopilot.js +206 -0
- package/dist/runner/autopilot/autopilot.js.map +1 -0
- package/dist/runner/autopilot/index.d.ts +2 -0
- package/dist/runner/autopilot/index.d.ts.map +1 -0
- package/dist/runner/autopilot/index.js +2 -0
- package/dist/runner/autopilot/index.js.map +1 -0
- package/dist/runner/cli-bridge/cli-bridge.d.ts +34 -0
- package/dist/runner/cli-bridge/cli-bridge.d.ts.map +1 -0
- package/dist/runner/cli-bridge/cli-bridge.js +53 -0
- package/dist/runner/cli-bridge/cli-bridge.js.map +1 -0
- package/dist/runner/cli-bridge/index.d.ts +2 -0
- package/dist/runner/cli-bridge/index.d.ts.map +1 -0
- package/dist/runner/cli-bridge/index.js +2 -0
- package/dist/runner/cli-bridge/index.js.map +1 -0
- package/dist/runner/dep-factory/deliver-phase.d.ts +24 -0
- package/dist/runner/dep-factory/deliver-phase.d.ts.map +1 -0
- package/dist/runner/dep-factory/deliver-phase.js +57 -0
- package/dist/runner/dep-factory/deliver-phase.js.map +1 -0
- package/dist/runner/dep-factory/dep-factory.d.ts +38 -0
- package/dist/runner/dep-factory/dep-factory.d.ts.map +1 -0
- package/dist/runner/dep-factory/dep-factory.js +193 -0
- package/dist/runner/dep-factory/dep-factory.js.map +1 -0
- package/dist/runner/dep-factory/index.d.ts +2 -0
- package/dist/runner/dep-factory/index.d.ts.map +1 -0
- package/dist/runner/dep-factory/index.js +2 -0
- package/dist/runner/dep-factory/index.js.map +1 -0
- package/dist/runner/dep-factory/invoke-phase.d.ts +20 -0
- package/dist/runner/dep-factory/invoke-phase.d.ts.map +1 -0
- package/dist/runner/dep-factory/invoke-phase.js +45 -0
- package/dist/runner/dep-factory/invoke-phase.js.map +1 -0
- package/dist/runner/implement/implement.d.ts +38 -0
- package/dist/runner/implement/implement.d.ts.map +1 -0
- package/dist/runner/implement/implement.js +61 -0
- package/dist/runner/implement/implement.js.map +1 -0
- package/dist/runner/implement/index.d.ts +2 -0
- package/dist/runner/implement/index.d.ts.map +1 -0
- package/dist/runner/implement/index.js +2 -0
- package/dist/runner/implement/index.js.map +1 -0
- package/dist/runner/notify/index.d.ts +2 -0
- package/dist/runner/notify/index.d.ts.map +1 -0
- package/dist/runner/notify/index.js +2 -0
- package/dist/runner/notify/index.js.map +1 -0
- package/dist/runner/notify/notify.d.ts +49 -0
- package/dist/runner/notify/notify.d.ts.map +1 -0
- package/dist/runner/notify/notify.js +90 -0
- package/dist/runner/notify/notify.js.map +1 -0
- package/dist/runner/prompt-builder/index.d.ts +2 -0
- package/dist/runner/prompt-builder/index.d.ts.map +1 -0
- package/dist/runner/prompt-builder/index.js +2 -0
- package/dist/runner/prompt-builder/index.js.map +1 -0
- package/dist/runner/prompt-builder/prompt-builder.d.ts +53 -0
- package/dist/runner/prompt-builder/prompt-builder.d.ts.map +1 -0
- package/dist/runner/prompt-builder/prompt-builder.js +122 -0
- package/dist/runner/prompt-builder/prompt-builder.js.map +1 -0
- package/dist/runner/session-report/index.d.ts +2 -0
- package/dist/runner/session-report/index.d.ts.map +1 -0
- package/dist/runner/session-report/index.js +2 -0
- package/dist/runner/session-report/index.js.map +1 -0
- package/dist/runner/session-report/session-report.d.ts +81 -0
- package/dist/runner/session-report/session-report.d.ts.map +1 -0
- package/dist/runner/session-report/session-report.js +227 -0
- package/dist/runner/session-report/session-report.js.map +1 -0
- package/dist/runner/shared/types.d.ts +30 -0
- package/dist/runner/shared/types.d.ts.map +1 -0
- package/dist/runner/shared/types.js +2 -0
- package/dist/runner/shared/types.js.map +1 -0
- package/dist/shared/ansi/ansi.d.ts +59 -0
- package/dist/shared/ansi/ansi.d.ts.map +1 -0
- package/dist/shared/ansi/ansi.js +59 -0
- package/dist/shared/ansi/ansi.js.map +1 -0
- package/dist/shared/ansi/index.d.ts +2 -0
- package/dist/shared/ansi/index.d.ts.map +1 -0
- package/dist/shared/ansi/index.js +2 -0
- package/dist/shared/ansi/index.js.map +1 -0
- package/package.json +52 -0
- package/src/agents/agents.test.ts +57 -0
- package/src/agents/arch-agent.md +80 -0
- package/src/agents/concerns-agent.md +96 -0
- package/src/agents/design-agent.md +146 -0
- package/src/agents/devils-advocate.md +54 -0
- package/src/agents/quality-agent.md +178 -0
- package/src/agents/tech-agent.md +101 -0
- package/src/agents/verification-gate.md +128 -0
- package/src/roles/implementer/commands/autopilot.md +11 -0
- package/src/roles/implementer/commands/dry-run.md +15 -0
- package/src/roles/implementer/commands/implement.md +19 -0
- package/src/roles/implementer/workflows/autopilot.md +136 -0
- package/src/roles/implementer/workflows/implement.md +161 -0
- package/src/roles/planner/commands/approve-plan.md +11 -0
- package/src/roles/planner/commands/plan.md +22 -0
- package/src/roles/planner/workflows/approve-plan.md +970 -0
- package/src/roles/planner/workflows/plan.md +868 -0
- package/src/roles/reviewer/commands/logs.md +7 -0
- package/src/roles/reviewer/commands/review.md +9 -0
- package/src/roles/reviewer/commands/status.md +9 -0
- package/src/roles/reviewer/workflows/logs.md +109 -0
- package/src/roles/reviewer/workflows/review.md +197 -0
- package/src/roles/reviewer/workflows/status.md +142 -0
- package/src/roles/roles.test.ts +87 -0
- package/src/roles/setup/commands/doctor.md +7 -0
- package/src/roles/setup/commands/help.md +80 -0
- package/src/roles/setup/commands/init.md +7 -0
- package/src/roles/setup/commands/map-codebase.md +17 -0
- package/src/roles/setup/commands/settings.md +7 -0
- package/src/roles/setup/commands/uninstall.md +5 -0
- package/src/roles/setup/commands/update-docs.md +9 -0
- package/src/roles/setup/commands/update.md +13 -0
- package/src/roles/setup/workflows/doctor.md +131 -0
- package/src/roles/setup/workflows/init.md +1096 -0
- package/src/roles/setup/workflows/map-codebase.md +130 -0
- package/src/roles/setup/workflows/scaffold.md +872 -0
- package/src/roles/setup/workflows/settings.md +958 -0
- package/src/roles/setup/workflows/uninstall.md +170 -0
- package/src/roles/setup/workflows/update-docs.md +95 -0
- package/src/roles/setup/workflows/update.md +287 -0
- package/src/roles/strategist/commands/approve-brief.md +23 -0
- package/src/roles/strategist/commands/brief.md +29 -0
- package/src/roles/strategist/workflows/approve-brief.md +1540 -0
- package/src/roles/strategist/workflows/brief.md +1330 -0
- package/src/templates/CLAUDE.md +101 -0
- package/src/templates/templates.test.ts +53 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Quality Agent
|
|
2
|
+
|
|
3
|
+
You are the quality agent for Clancy's `map-codebase` command. Your job is to write four docs:
|
|
4
|
+
|
|
5
|
+
- `.clancy/docs/CONVENTIONS.md`
|
|
6
|
+
- `.clancy/docs/TESTING.md`
|
|
7
|
+
- `.clancy/docs/GIT.md`
|
|
8
|
+
- `.clancy/docs/DEFINITION-OF-DONE.md`
|
|
9
|
+
|
|
10
|
+
## Instructions
|
|
11
|
+
|
|
12
|
+
1. Use Glob and Grep extensively before writing anything. Read actual code — never guess.
|
|
13
|
+
2. Use real file paths in your output.
|
|
14
|
+
3. Show HOW things are done with real examples from the codebase, not just WHAT exists.
|
|
15
|
+
4. Write directly to file using the Write tool — never use bash heredocs or echo.
|
|
16
|
+
5. Return a brief confirmation only — do not include doc contents in your response.
|
|
17
|
+
6. If a section has no applicable content, write: `<!-- Not applicable to this project -->`
|
|
18
|
+
|
|
19
|
+
## What to look for
|
|
20
|
+
|
|
21
|
+
### CONVENTIONS.md
|
|
22
|
+
|
|
23
|
+
Read:
|
|
24
|
+
|
|
25
|
+
- `.eslintrc.*`, `eslint.config.*` — linting rules
|
|
26
|
+
- `.prettierrc.*`, `prettier.config.*` — formatting
|
|
27
|
+
- `tsconfig.json` — TypeScript strictness
|
|
28
|
+
- `stylelint.config.*` — CSS conventions
|
|
29
|
+
- Existing source files — extract real patterns
|
|
30
|
+
|
|
31
|
+
Document:
|
|
32
|
+
|
|
33
|
+
**Code Style** — Tabs vs spaces, quote style, semicolons, line length. Show the config.
|
|
34
|
+
|
|
35
|
+
**Naming Conventions** — How are things named in this codebase? Extract real examples:
|
|
36
|
+
|
|
37
|
+
- Components: PascalCase? (`UserProfile.tsx`)
|
|
38
|
+
- Hooks: `use` prefix? (`useUserProfile.ts`)
|
|
39
|
+
- Utils: camelCase? (`formatDate.ts`)
|
|
40
|
+
- Constants: SCREAMING_SNAKE? (`MAX_RETRY_COUNT`)
|
|
41
|
+
- Types/interfaces: `T`/`I` prefix, or plain? (`UserProfile` vs `IUserProfile`)
|
|
42
|
+
- CSS classes: BEM? utility-first? camelCase modules?
|
|
43
|
+
|
|
44
|
+
**File Organisation** — Show the patterns with real file paths:
|
|
45
|
+
|
|
46
|
+
- Where do components live?
|
|
47
|
+
- Co-located tests or separate test directories?
|
|
48
|
+
- Feature-based or layer-based structure?
|
|
49
|
+
- Barrel files (`index.ts`) — used or avoided?
|
|
50
|
+
|
|
51
|
+
**Component Patterns** — For UI components, extract the prevailing pattern:
|
|
52
|
+
|
|
53
|
+
- Props interface naming
|
|
54
|
+
- Default exports vs named exports
|
|
55
|
+
- Composition patterns
|
|
56
|
+
- Real example from the codebase
|
|
57
|
+
|
|
58
|
+
**Error Handling** — How are errors handled?
|
|
59
|
+
|
|
60
|
+
- Try/catch patterns
|
|
61
|
+
- Error boundaries
|
|
62
|
+
- API error conventions
|
|
63
|
+
- Real example
|
|
64
|
+
|
|
65
|
+
**Logging** — What logging is used and how?
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### TESTING.md
|
|
70
|
+
|
|
71
|
+
Read:
|
|
72
|
+
|
|
73
|
+
- `jest.config.*`, `vitest.config.*`, `playwright.config.*`
|
|
74
|
+
- Test files (`*.test.ts`, `*.spec.ts`, `*.test.tsx`)
|
|
75
|
+
- `package.json` test scripts
|
|
76
|
+
|
|
77
|
+
Document:
|
|
78
|
+
|
|
79
|
+
**Test Runner** — Jest, Vitest, Playwright, Cypress — versions and config file path.
|
|
80
|
+
|
|
81
|
+
**Test Structure** — Where do tests live? Co-located or `__tests__/`? File naming pattern.
|
|
82
|
+
|
|
83
|
+
**Unit Tests** — What's typically unit tested? Real example from the codebase (show describe/it block).
|
|
84
|
+
|
|
85
|
+
**Integration Tests** — If present, what do they test? How do they differ from unit tests?
|
|
86
|
+
|
|
87
|
+
**E2E Tests** — Tool and location. What flows are covered?
|
|
88
|
+
|
|
89
|
+
**Coverage Expectations** — Is there a coverage threshold? Read from jest/vitest config. If not configured, note it.
|
|
90
|
+
|
|
91
|
+
**Test Utilities** — Custom render functions, factories, fixtures — show real examples.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### GIT.md
|
|
96
|
+
|
|
97
|
+
Read:
|
|
98
|
+
|
|
99
|
+
- `git log --oneline -20` (run via bash if available, or note it can't be checked)
|
|
100
|
+
- `.gitmessage` if present
|
|
101
|
+
- `CONTRIBUTING.md` if present
|
|
102
|
+
- Branch names in recent commits
|
|
103
|
+
|
|
104
|
+
**IMPORTANT:** This file is the single source of truth for Clancy's git behaviour. Be precise. Clancy reads this before every run.
|
|
105
|
+
|
|
106
|
+
Document:
|
|
107
|
+
|
|
108
|
+
**Branch Naming** — The actual pattern used in this repo. Examples:
|
|
109
|
+
|
|
110
|
+
- `feat/PROJ-123-short-description`
|
|
111
|
+
- `feature/issue-42`
|
|
112
|
+
- `fix/login-bug`
|
|
113
|
+
|
|
114
|
+
**Commit Format** — The actual format with a real example from the log:
|
|
115
|
+
|
|
116
|
+
- Conventional commits? (`feat(auth): add password reset`)
|
|
117
|
+
- Jira-key prefix? (`PROJ-123: Add password reset`)
|
|
118
|
+
- Plain summary?
|
|
119
|
+
|
|
120
|
+
**Merge Strategy** — Squash merge, merge commits, rebase? Read from branch protection rules if available.
|
|
121
|
+
|
|
122
|
+
**Pull Request Process** — Is there one? What does a typical PR look like?
|
|
123
|
+
|
|
124
|
+
**Versioning** — Semver? CalVer? Manual? Changelog automated?
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### DEFINITION-OF-DONE.md
|
|
129
|
+
|
|
130
|
+
Based on conventions, tests, and codebase patterns found above, write a practical checklist.
|
|
131
|
+
|
|
132
|
+
This is what Clancy checks before marking a ticket complete. Make it specific to this codebase.
|
|
133
|
+
|
|
134
|
+
Example structure:
|
|
135
|
+
|
|
136
|
+
```markdown
|
|
137
|
+
## Code Quality
|
|
138
|
+
|
|
139
|
+
- [ ] Passes `{lint command}` with no errors
|
|
140
|
+
- [ ] Passes `{typecheck command}` with no errors
|
|
141
|
+
- [ ] No `any` types added without justification
|
|
142
|
+
|
|
143
|
+
## Testing
|
|
144
|
+
|
|
145
|
+
- [ ] Unit tests written for new logic
|
|
146
|
+
- [ ] Tests pass (`{test command}`)
|
|
147
|
+
- [ ] Coverage not reduced below {threshold}%
|
|
148
|
+
|
|
149
|
+
## Design
|
|
150
|
+
|
|
151
|
+
- [ ] Matches Figma spec (if UI ticket)
|
|
152
|
+
- [ ] Uses design tokens — no hardcoded colours or spacing values
|
|
153
|
+
- [ ] Responsive at mobile, tablet, desktop breakpoints
|
|
154
|
+
|
|
155
|
+
## Accessibility
|
|
156
|
+
|
|
157
|
+
- [ ] Keyboard navigable
|
|
158
|
+
- [ ] Screen reader tested or ARIA attributes correct
|
|
159
|
+
- [ ] Colour contrast passes WCAG AA
|
|
160
|
+
|
|
161
|
+
## Review
|
|
162
|
+
|
|
163
|
+
- [ ] Self-reviewed diff before commit
|
|
164
|
+
- [ ] Commit message follows GIT.md conventions
|
|
165
|
+
- [ ] No debug code left in (console.log, TODO without ticket)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Replace `{lint command}` etc. with the actual commands from `package.json` scripts.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Output format
|
|
173
|
+
|
|
174
|
+
Write all four docs, then respond with:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
quality agent complete — CONVENTIONS.md ({N} lines), TESTING.md ({N} lines), GIT.md ({N} lines), DEFINITION-OF-DONE.md ({N} lines)
|
|
178
|
+
```
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Tech Agent
|
|
2
|
+
|
|
3
|
+
You are the tech agent for Clancy's `map-codebase` command. Your job is to write two docs:
|
|
4
|
+
|
|
5
|
+
- `.clancy/docs/STACK.md`
|
|
6
|
+
- `.clancy/docs/INTEGRATIONS.md`
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
1. Use Glob and Grep extensively before writing anything. Understand the actual codebase — never guess.
|
|
11
|
+
2. Use real file paths in your output (`src/utils/api.ts` not "the API utility").
|
|
12
|
+
3. Show HOW things are done with real code examples, not just WHAT exists.
|
|
13
|
+
4. Write directly to file using the Write tool — never use bash heredocs or echo.
|
|
14
|
+
5. Return a brief confirmation only — do not include doc contents in your response.
|
|
15
|
+
6. If a section has no applicable content, write: `<!-- Not applicable to this project -->`
|
|
16
|
+
|
|
17
|
+
## What to look for
|
|
18
|
+
|
|
19
|
+
### For STACK.md
|
|
20
|
+
|
|
21
|
+
Start by reading:
|
|
22
|
+
|
|
23
|
+
- `package.json` — runtime, dependencies, scripts
|
|
24
|
+
- Lock files (`yarn.lock`, `package-lock.json`, `bun.lockb`) — confirm actual versions
|
|
25
|
+
- `tsconfig.json` — TypeScript config if present
|
|
26
|
+
- `vite.config.*`, `next.config.*`, `nuxt.config.*`, `astro.config.*` — build/framework config
|
|
27
|
+
- `.nvmrc`, `.node-version`, `.tool-versions` — runtime version pins
|
|
28
|
+
- `Dockerfile`, `docker-compose.yml` — containerisation
|
|
29
|
+
|
|
30
|
+
Then write STACK.md covering:
|
|
31
|
+
|
|
32
|
+
**Runtime** — Node version, Bun, Deno, etc. Quote the pinned version if found.
|
|
33
|
+
|
|
34
|
+
**Package Manager** — npm / yarn / pnpm / bun. Note which lockfile is present.
|
|
35
|
+
|
|
36
|
+
**Frameworks** — Primary framework (React, Vue, Next.js, etc.) + version. Note SSR/SSG/SPA.
|
|
37
|
+
|
|
38
|
+
**Key Libraries** — The 10–15 most important libraries. Group by purpose: UI, state, forms, data fetching, animation, etc.
|
|
39
|
+
|
|
40
|
+
**Build Tools** — Vite, Webpack, Turbopack, esbuild, Rollup — config file path + key settings.
|
|
41
|
+
|
|
42
|
+
**Dev Servers** — This section is mandatory. Document:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
## Dev Servers
|
|
46
|
+
|
|
47
|
+
| Server | Command | Port | Config file |
|
|
48
|
+
| ---------- | --------- | ------ | ------------------ |
|
|
49
|
+
| Dev server | {command} | {port} | {config file path} |
|
|
50
|
+
| Storybook | {command} | {port} | {config file path} |
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Read the actual config files for port numbers — never guess. If Storybook is not present, omit that row.
|
|
54
|
+
|
|
55
|
+
Also document:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
## Route structure
|
|
59
|
+
|
|
60
|
+
{list key routes with file paths}
|
|
61
|
+
/dashboard → src/pages/Dashboard.tsx
|
|
62
|
+
|
|
63
|
+
## Storybook stories location
|
|
64
|
+
|
|
65
|
+
{glob pattern for story files, e.g. src/components/**/*.stories.tsx}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Environment** — Note which env vars are used (read `.env.example` or `env.d.ts` if present). Do not include actual secret values.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### For INTEGRATIONS.md
|
|
73
|
+
|
|
74
|
+
Look for:
|
|
75
|
+
|
|
76
|
+
- API client calls (`fetch`, `axios`, `ky`, GraphQL clients)
|
|
77
|
+
- Auth libraries (NextAuth, Clerk, Auth0, Supabase Auth)
|
|
78
|
+
- Database clients (Prisma, Drizzle, Supabase, Firebase)
|
|
79
|
+
- Payment providers (Stripe, Paddle)
|
|
80
|
+
- Analytics (PostHog, Mixpanel, Segment, GA)
|
|
81
|
+
- Email (Resend, SendGrid, Postmark)
|
|
82
|
+
- Storage (S3, Cloudflare R2, Supabase Storage)
|
|
83
|
+
- Feature flags (LaunchDarkly, Growthbook, Statsig)
|
|
84
|
+
- Monitoring (Sentry, Datadog, LogRocket)
|
|
85
|
+
|
|
86
|
+
For each integration, document:
|
|
87
|
+
|
|
88
|
+
- What it is
|
|
89
|
+
- How it's initialised (real code snippet from the codebase)
|
|
90
|
+
- Which env vars it needs
|
|
91
|
+
- Where the client is instantiated (file path)
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Output format
|
|
96
|
+
|
|
97
|
+
Write the docs, then respond with:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
tech agent complete — STACK.md ({N} lines), INTEGRATIONS.md ({N} lines)
|
|
101
|
+
```
|
|
@@ -0,0 +1,128 @@
|
|
|
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 `2` (current attempt + 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.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# /clancy:autopilot
|
|
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:autopilot — uses MAX_ITERATIONS from .clancy/.env (default 5)
|
|
7
|
+
/clancy:autopilot 20 — overrides MAX_ITERATIONS to 20 for this session only
|
|
8
|
+
|
|
9
|
+
@.claude/clancy/workflows/autopilot.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.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# /clancy:dry-run
|
|
2
|
+
|
|
3
|
+
Preview which ticket Clancy would pick up next — no changes made.
|
|
4
|
+
|
|
5
|
+
Shows:
|
|
6
|
+
|
|
7
|
+
- The ticket that would be picked up (key, summary, epic)
|
|
8
|
+
- The target branch and feature branch that would be created
|
|
9
|
+
- Full preflight checks — catches config issues early
|
|
10
|
+
|
|
11
|
+
Nothing is written, no git operations run, Claude is not invoked.
|
|
12
|
+
|
|
13
|
+
@.claude/clancy/workflows/implement.md
|
|
14
|
+
|
|
15
|
+
Run the implement workflow with `--dry-run` as documented above. Treat this invocation as if the user passed `--dry-run`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# /clancy:implement
|
|
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
|
+
|
|
7
|
+
- Your first run — watch Clancy work before going AFK
|
|
8
|
+
- Testing after changing .clancy/docs/ or CLAUDE.md
|
|
9
|
+
- Debugging a specific ticket
|
|
10
|
+
- When you only have time for one ticket
|
|
11
|
+
|
|
12
|
+
Pass `--dry-run` to preview what Clancy would do without making any changes:
|
|
13
|
+
|
|
14
|
+
- Shows the ticket, epic, target branch, and feature branch
|
|
15
|
+
- Exits before any git operations or Claude invocation
|
|
16
|
+
|
|
17
|
+
@.claude/clancy/workflows/implement.md
|
|
18
|
+
|
|
19
|
+
Run one ticket as documented in the workflow above.
|
|
@@ -0,0 +1,136 @@
|
|
|
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 Autopilot 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:autopilot` or `/clancy:autopilot 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 — Autopilot
|
|
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:implement 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
|
+
```
|
|
56
|
+
.clancy/ not found. Run /clancy:init first to set up Clancy.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Stop.
|
|
60
|
+
|
|
61
|
+
2. Check `.clancy/.env` exists. If not:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
.clancy/.env not found. Run /clancy:init first.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Stop.
|
|
68
|
+
|
|
69
|
+
3. Source `.clancy/.env` and check that board credentials are present.
|
|
70
|
+
|
|
71
|
+
**Jira:** `JIRA_BASE_URL`, `JIRA_USER`, `JIRA_API_TOKEN`, `JIRA_PROJECT_KEY`
|
|
72
|
+
**GitHub:** `GITHUB_TOKEN`, `GITHUB_REPO`
|
|
73
|
+
**Linear:** `LINEAR_API_KEY`, `LINEAR_TEAM_ID`
|
|
74
|
+
|
|
75
|
+
If any required var is missing:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Missing credentials in .clancy/.env: <var name>
|
|
79
|
+
Run /clancy:init to reconfigure, or edit .clancy/.env directly.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Stop.
|
|
83
|
+
|
|
84
|
+
4. Check `.clancy/clancy-autopilot.js` exists. If not:
|
|
85
|
+
```
|
|
86
|
+
.clancy/clancy-autopilot.js not found. Run /clancy:init to scaffold scripts.
|
|
87
|
+
```
|
|
88
|
+
Stop.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Step 3 — Start
|
|
93
|
+
|
|
94
|
+
Display (only if the high-iteration warning was not already shown):
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
🚨 Clancy — Autopilot
|
|
98
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
99
|
+
|
|
100
|
+
"All right, let's do this." — Processing up to {N} ticket(s). Ctrl+C to stop early.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Step 4 — Run
|
|
106
|
+
|
|
107
|
+
Execute:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
MAX_ITERATIONS={N} node .clancy/clancy-autopilot.js
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Stream output directly — do not buffer or summarise.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Step 5 — Finish
|
|
118
|
+
|
|
119
|
+
When the script exits, echo the final summary line from the output.
|
|
120
|
+
|
|
121
|
+
If `clancy-autopilot.js` exits with a non-zero status:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
❌ Clancy stopped with an error. Check the output above.
|
|
125
|
+
|
|
126
|
+
"Looks like we've got ourselves a 23-19." — Run /clancy:implement for more detail on the next ticket.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Notes
|
|
132
|
+
|
|
133
|
+
- The `N` argument is session-only. It never modifies `.clancy/.env`.
|
|
134
|
+
- If the user wants to permanently change their default, they edit `.clancy/.env` directly or re-run `/clancy:init` advanced setup.
|
|
135
|
+
- Do not attempt to run scripts from `src/templates/` — only run scripts in `.clancy/`.
|
|
136
|
+
- The runtime scripts in `.clancy/` are self-contained bundles — no npm package dependency needed at runtime.
|