@juho0719/cckit 0.1.1
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/assets/agents/architect.md +211 -0
- package/assets/agents/build-error-resolver.md +114 -0
- package/assets/agents/ccwin-code-reviewer.md +224 -0
- package/assets/agents/database-reviewer.md +91 -0
- package/assets/agents/doc-updater.md +107 -0
- package/assets/agents/e2e-runner.md +107 -0
- package/assets/agents/planner.md +212 -0
- package/assets/agents/python-reviewer.md +98 -0
- package/assets/agents/refactor-cleaner.md +85 -0
- package/assets/agents/security-reviewer.md +108 -0
- package/assets/agents/superpower-code-reviewer.md +48 -0
- package/assets/agents/tdd-guide.md +80 -0
- package/assets/commands/build-fix.md +62 -0
- package/assets/commands/checkpoint.md +74 -0
- package/assets/commands/code-review.md +40 -0
- package/assets/commands/e2e.md +362 -0
- package/assets/commands/eval.md +120 -0
- package/assets/commands/orchestrate.md +172 -0
- package/assets/commands/plan.md +113 -0
- package/assets/commands/python-review.md +297 -0
- package/assets/commands/refactor-clean.md +80 -0
- package/assets/commands/sessions.md +305 -0
- package/assets/commands/tdd.md +326 -0
- package/assets/commands/test-coverage.md +69 -0
- package/assets/commands/update-codemaps.md +72 -0
- package/assets/commands/update-docs.md +84 -0
- package/assets/commands/verify.md +59 -0
- package/assets/hooks/post-edit-format.js +49 -0
- package/assets/hooks/post-edit-typecheck.js +96 -0
- package/assets/mcps/mcp-servers.json +92 -0
- package/assets/rules/common/agents.md +49 -0
- package/assets/rules/common/coding-style.md +48 -0
- package/assets/rules/common/git-workflow.md +45 -0
- package/assets/rules/common/hooks.md +30 -0
- package/assets/rules/common/patterns.md +31 -0
- package/assets/rules/common/performance.md +55 -0
- package/assets/rules/common/security.md +29 -0
- package/assets/rules/common/testing.md +29 -0
- package/assets/rules/python/coding-style.md +42 -0
- package/assets/rules/python/hooks.md +19 -0
- package/assets/rules/python/patterns.md +39 -0
- package/assets/rules/python/security.md +30 -0
- package/assets/rules/python/testing.md +38 -0
- package/assets/rules/typescript/coding-style.md +18 -0
- package/assets/rules/typescript/hooks.md +19 -0
- package/assets/rules/typescript/patterns.md +39 -0
- package/assets/rules/typescript/security.md +30 -0
- package/assets/rules/typescript/testing.md +38 -0
- package/assets/skills/api-design/SKILL.md +522 -0
- package/assets/skills/backend-patterns/SKILL.md +597 -0
- package/assets/skills/brainstorming/SKILL.md +96 -0
- package/assets/skills/coding-standards/SKILL.md +529 -0
- package/assets/skills/database-migrations/SKILL.md +334 -0
- package/assets/skills/deployment-patterns/SKILL.md +426 -0
- package/assets/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/assets/skills/docker-patterns/SKILL.md +363 -0
- package/assets/skills/e2e-testing/SKILL.md +325 -0
- package/assets/skills/eval-harness/SKILL.md +235 -0
- package/assets/skills/executing-plans/SKILL.md +84 -0
- package/assets/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/assets/skills/frontend-patterns/SKILL.md +641 -0
- package/assets/skills/iterative-retrieval/SKILL.md +210 -0
- package/assets/skills/postgres-patterns/SKILL.md +145 -0
- package/assets/skills/python-patterns/SKILL.md +749 -0
- package/assets/skills/python-testing/SKILL.md +815 -0
- package/assets/skills/receiving-code-review/SKILL.md +213 -0
- package/assets/skills/requesting-code-review/SKILL.md +105 -0
- package/assets/skills/requesting-code-review/code-reviewer-template.md +146 -0
- package/assets/skills/subagent-driven-development/SKILL.md +242 -0
- package/assets/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/assets/skills/subagent-driven-development/implementer-prompt.md +78 -0
- package/assets/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/assets/skills/systematic-debugging/CREATION-LOG.md +114 -0
- package/assets/skills/systematic-debugging/SKILL.md +296 -0
- package/assets/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/assets/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/assets/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/assets/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/assets/skills/systematic-debugging/scripts/find-polluter.sh +63 -0
- package/assets/skills/systematic-debugging/test-academic.md +14 -0
- package/assets/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/assets/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/assets/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/assets/skills/tdd-workflow/SKILL.md +409 -0
- package/assets/skills/test-driven-development/SKILL.md +371 -0
- package/assets/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/assets/skills/using-git-worktrees/SKILL.md +218 -0
- package/assets/skills/verification-before-completion/SKILL.md +139 -0
- package/assets/skills/verification-loop/SKILL.md +125 -0
- package/assets/skills/writing-plans/SKILL.md +116 -0
- package/dist/agents-AEKT67A6.js +9 -0
- package/dist/chunk-3GUKEMND.js +28 -0
- package/dist/chunk-3UNN3IBE.js +54 -0
- package/dist/chunk-3Y26YU4R.js +27 -0
- package/dist/chunk-5XOKKPAA.js +21 -0
- package/dist/chunk-6B46AIFM.js +136 -0
- package/dist/chunk-EYY2IZ7N.js +27 -0
- package/dist/chunk-K25UZZVG.js +17 -0
- package/dist/chunk-KEENFBLL.js +24 -0
- package/dist/chunk-RMUKD7CW.js +44 -0
- package/dist/chunk-W63UKEIT.js +50 -0
- package/dist/cli-VZRGF733.js +238 -0
- package/dist/commands-P5LILVZ5.js +9 -0
- package/dist/hooks-IIG2XK4I.js +9 -0
- package/dist/index.js +131 -0
- package/dist/mcps-67Q7TBGW.js +6 -0
- package/dist/paths-FT6KBIRD.js +10 -0
- package/dist/registry-EGXWYWWK.js +17 -0
- package/dist/rules-2CPBVNNJ.js +7 -0
- package/dist/skills-ULMW3UCM.js +8 -0
- package/package.json +36 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-git-worktrees
|
|
3
|
+
description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using Git Worktrees
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Systematic directory selection + safety verification = reliable isolation.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
|
|
15
|
+
|
|
16
|
+
## Directory Selection Process
|
|
17
|
+
|
|
18
|
+
Follow this priority order:
|
|
19
|
+
|
|
20
|
+
### 1. Check Existing Directories
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Check in priority order
|
|
24
|
+
ls -d .worktrees 2>/dev/null # Preferred (hidden)
|
|
25
|
+
ls -d worktrees 2>/dev/null # Alternative
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**If found:** Use that directory. If both exist, `.worktrees` wins.
|
|
29
|
+
|
|
30
|
+
### 2. Check CLAUDE.md
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**If preference specified:** Use it without asking.
|
|
37
|
+
|
|
38
|
+
### 3. Ask User
|
|
39
|
+
|
|
40
|
+
If no directory exists and no CLAUDE.md preference:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
No worktree directory found. Where should I create worktrees?
|
|
44
|
+
|
|
45
|
+
1. .worktrees/ (project-local, hidden)
|
|
46
|
+
2. ~/.config/worktrees/<project-name>/ (global location)
|
|
47
|
+
|
|
48
|
+
Which would you prefer?
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Safety Verification
|
|
52
|
+
|
|
53
|
+
### For Project-Local Directories (.worktrees or worktrees)
|
|
54
|
+
|
|
55
|
+
**MUST verify directory is ignored before creating worktree:**
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Check if directory is ignored (respects local, global, and system gitignore)
|
|
59
|
+
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**If NOT ignored:**
|
|
63
|
+
|
|
64
|
+
Per Jesse's rule "Fix broken things immediately":
|
|
65
|
+
1. Add appropriate line to .gitignore
|
|
66
|
+
2. Commit the change
|
|
67
|
+
3. Proceed with worktree creation
|
|
68
|
+
|
|
69
|
+
**Why critical:** Prevents accidentally committing worktree contents to repository.
|
|
70
|
+
|
|
71
|
+
### For Global Directory (~/.config/worktrees)
|
|
72
|
+
|
|
73
|
+
No .gitignore verification needed - outside project entirely.
|
|
74
|
+
|
|
75
|
+
## Creation Steps
|
|
76
|
+
|
|
77
|
+
### 1. Detect Project Name
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
project=$(basename "$(git rev-parse --show-toplevel)")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 2. Create Worktree
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Determine full path
|
|
87
|
+
case $LOCATION in
|
|
88
|
+
.worktrees|worktrees)
|
|
89
|
+
path="$LOCATION/$BRANCH_NAME"
|
|
90
|
+
;;
|
|
91
|
+
~/.config/worktrees/*)
|
|
92
|
+
path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME"
|
|
93
|
+
;;
|
|
94
|
+
esac
|
|
95
|
+
|
|
96
|
+
# Create worktree with new branch
|
|
97
|
+
git worktree add "$path" -b "$BRANCH_NAME"
|
|
98
|
+
cd "$path"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 3. Run Project Setup
|
|
102
|
+
|
|
103
|
+
Auto-detect and run appropriate setup:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Node.js
|
|
107
|
+
if [ -f package.json ]; then npm install; fi
|
|
108
|
+
|
|
109
|
+
# Rust
|
|
110
|
+
if [ -f Cargo.toml ]; then cargo build; fi
|
|
111
|
+
|
|
112
|
+
# Python
|
|
113
|
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
114
|
+
if [ -f pyproject.toml ]; then poetry install; fi
|
|
115
|
+
|
|
116
|
+
# Go
|
|
117
|
+
if [ -f go.mod ]; then go mod download; fi
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 4. Verify Clean Baseline
|
|
121
|
+
|
|
122
|
+
Run tests to ensure worktree starts clean:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Examples - use project-appropriate command
|
|
126
|
+
npm test
|
|
127
|
+
cargo test
|
|
128
|
+
pytest
|
|
129
|
+
go test ./...
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**If tests fail:** Report failures, ask whether to proceed or investigate.
|
|
133
|
+
|
|
134
|
+
**If tests pass:** Report ready.
|
|
135
|
+
|
|
136
|
+
### 5. Report Location
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
Worktree ready at <full-path>
|
|
140
|
+
Tests passing (<N> tests, 0 failures)
|
|
141
|
+
Ready to implement <feature-name>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Quick Reference
|
|
145
|
+
|
|
146
|
+
| Situation | Action |
|
|
147
|
+
|-----------|--------|
|
|
148
|
+
| `.worktrees/` exists | Use it (verify ignored) |
|
|
149
|
+
| `worktrees/` exists | Use it (verify ignored) |
|
|
150
|
+
| Both exist | Use `.worktrees/` |
|
|
151
|
+
| Neither exists | Check CLAUDE.md → Ask user |
|
|
152
|
+
| Directory not ignored | Add to .gitignore + commit |
|
|
153
|
+
| Tests fail during baseline | Report failures + ask |
|
|
154
|
+
| No package.json/Cargo.toml | Skip dependency install |
|
|
155
|
+
|
|
156
|
+
## Common Mistakes
|
|
157
|
+
|
|
158
|
+
### Skipping ignore verification
|
|
159
|
+
|
|
160
|
+
- **Problem:** Worktree contents get tracked, pollute git status
|
|
161
|
+
- **Fix:** Always use `git check-ignore` before creating project-local worktree
|
|
162
|
+
|
|
163
|
+
### Assuming directory location
|
|
164
|
+
|
|
165
|
+
- **Problem:** Creates inconsistency, violates project conventions
|
|
166
|
+
- **Fix:** Follow priority: existing > CLAUDE.md > ask
|
|
167
|
+
|
|
168
|
+
### Proceeding with failing tests
|
|
169
|
+
|
|
170
|
+
- **Problem:** Can't distinguish new bugs from pre-existing issues
|
|
171
|
+
- **Fix:** Report failures, get explicit permission to proceed
|
|
172
|
+
|
|
173
|
+
### Hardcoding setup commands
|
|
174
|
+
|
|
175
|
+
- **Problem:** Breaks on projects using different tools
|
|
176
|
+
- **Fix:** Auto-detect from project files (package.json, etc.)
|
|
177
|
+
|
|
178
|
+
## Example Workflow
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
You: I'm using the using-git-worktrees skill to set up an isolated workspace.
|
|
182
|
+
|
|
183
|
+
[Check .worktrees/ - exists]
|
|
184
|
+
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
|
|
185
|
+
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
|
|
186
|
+
[Run npm install]
|
|
187
|
+
[Run npm test - 47 passing]
|
|
188
|
+
|
|
189
|
+
Worktree ready at /Users/jesse/myproject/.worktrees/auth
|
|
190
|
+
Tests passing (47 tests, 0 failures)
|
|
191
|
+
Ready to implement auth feature
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Red Flags
|
|
195
|
+
|
|
196
|
+
**Never:**
|
|
197
|
+
- Create worktree without verifying it's ignored (project-local)
|
|
198
|
+
- Skip baseline test verification
|
|
199
|
+
- Proceed with failing tests without asking
|
|
200
|
+
- Assume directory location when ambiguous
|
|
201
|
+
- Skip CLAUDE.md check
|
|
202
|
+
|
|
203
|
+
**Always:**
|
|
204
|
+
- Follow directory priority: existing > CLAUDE.md > ask
|
|
205
|
+
- Verify directory is ignored for project-local
|
|
206
|
+
- Auto-detect and run project setup
|
|
207
|
+
- Verify clean test baseline
|
|
208
|
+
|
|
209
|
+
## Integration
|
|
210
|
+
|
|
211
|
+
**Called by:**
|
|
212
|
+
- **brainstorming** (Phase 4) - REQUIRED when design is approved and implementation follows
|
|
213
|
+
- **subagent-driven-development** - REQUIRED before executing any tasks
|
|
214
|
+
- **executing-plans** - REQUIRED before executing any tasks
|
|
215
|
+
- Any skill needing isolated workspace
|
|
216
|
+
|
|
217
|
+
**Pairs with:**
|
|
218
|
+
- **finishing-a-development-branch** - REQUIRED for cleanup after work complete
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-before-completion
|
|
3
|
+
description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verification Before Completion
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Claiming work is complete without verification is dishonesty, not efficiency.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Evidence before claims, always.
|
|
13
|
+
|
|
14
|
+
**Violating the letter of this rule is violating the spirit of this rule.**
|
|
15
|
+
|
|
16
|
+
## The Iron Law
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If you haven't run the verification command in this message, you cannot claim it passes.
|
|
23
|
+
|
|
24
|
+
## The Gate Function
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
BEFORE claiming any status or expressing satisfaction:
|
|
28
|
+
|
|
29
|
+
1. IDENTIFY: What command proves this claim?
|
|
30
|
+
2. RUN: Execute the FULL command (fresh, complete)
|
|
31
|
+
3. READ: Full output, check exit code, count failures
|
|
32
|
+
4. VERIFY: Does output confirm the claim?
|
|
33
|
+
- If NO: State actual status with evidence
|
|
34
|
+
- If YES: State claim WITH evidence
|
|
35
|
+
5. ONLY THEN: Make the claim
|
|
36
|
+
|
|
37
|
+
Skip any step = lying, not verifying
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Common Failures
|
|
41
|
+
|
|
42
|
+
| Claim | Requires | Not Sufficient |
|
|
43
|
+
|-------|----------|----------------|
|
|
44
|
+
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
|
|
45
|
+
| Linter clean | Linter output: 0 errors | Partial check, extrapolation |
|
|
46
|
+
| Build succeeds | Build command: exit 0 | Linter passing, logs look good |
|
|
47
|
+
| Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
|
|
48
|
+
| Regression test works | Red-green cycle verified | Test passes once |
|
|
49
|
+
| Agent completed | VCS diff shows changes | Agent reports "success" |
|
|
50
|
+
| Requirements met | Line-by-line checklist | Tests passing |
|
|
51
|
+
|
|
52
|
+
## Red Flags - STOP
|
|
53
|
+
|
|
54
|
+
- Using "should", "probably", "seems to"
|
|
55
|
+
- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
|
|
56
|
+
- About to commit/push/PR without verification
|
|
57
|
+
- Trusting agent success reports
|
|
58
|
+
- Relying on partial verification
|
|
59
|
+
- Thinking "just this once"
|
|
60
|
+
- Tired and wanting work over
|
|
61
|
+
- **ANY wording implying success without having run verification**
|
|
62
|
+
|
|
63
|
+
## Rationalization Prevention
|
|
64
|
+
|
|
65
|
+
| Excuse | Reality |
|
|
66
|
+
|--------|---------|
|
|
67
|
+
| "Should work now" | RUN the verification |
|
|
68
|
+
| "I'm confident" | Confidence ≠ evidence |
|
|
69
|
+
| "Just this once" | No exceptions |
|
|
70
|
+
| "Linter passed" | Linter ≠ compiler |
|
|
71
|
+
| "Agent said success" | Verify independently |
|
|
72
|
+
| "I'm tired" | Exhaustion ≠ excuse |
|
|
73
|
+
| "Partial check is enough" | Partial proves nothing |
|
|
74
|
+
| "Different words so rule doesn't apply" | Spirit over letter |
|
|
75
|
+
|
|
76
|
+
## Key Patterns
|
|
77
|
+
|
|
78
|
+
**Tests:**
|
|
79
|
+
```
|
|
80
|
+
✅ [Run test command] [See: 34/34 pass] "All tests pass"
|
|
81
|
+
❌ "Should pass now" / "Looks correct"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Regression tests (TDD Red-Green):**
|
|
85
|
+
```
|
|
86
|
+
✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
|
|
87
|
+
❌ "I've written a regression test" (without red-green verification)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Build:**
|
|
91
|
+
```
|
|
92
|
+
✅ [Run build] [See: exit 0] "Build passes"
|
|
93
|
+
❌ "Linter passed" (linter doesn't check compilation)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Requirements:**
|
|
97
|
+
```
|
|
98
|
+
✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
|
|
99
|
+
❌ "Tests pass, phase complete"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Agent delegation:**
|
|
103
|
+
```
|
|
104
|
+
✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
|
|
105
|
+
❌ Trust agent report
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Why This Matters
|
|
109
|
+
|
|
110
|
+
From 24 failure memories:
|
|
111
|
+
- your human partner said "I don't believe you" - trust broken
|
|
112
|
+
- Undefined functions shipped - would crash
|
|
113
|
+
- Missing requirements shipped - incomplete features
|
|
114
|
+
- Time wasted on false completion → redirect → rework
|
|
115
|
+
- Violates: "Honesty is a core value. If you lie, you'll be replaced."
|
|
116
|
+
|
|
117
|
+
## When To Apply
|
|
118
|
+
|
|
119
|
+
**ALWAYS before:**
|
|
120
|
+
- ANY variation of success/completion claims
|
|
121
|
+
- ANY expression of satisfaction
|
|
122
|
+
- ANY positive statement about work state
|
|
123
|
+
- Committing, PR creation, task completion
|
|
124
|
+
- Moving to next task
|
|
125
|
+
- Delegating to agents
|
|
126
|
+
|
|
127
|
+
**Rule applies to:**
|
|
128
|
+
- Exact phrases
|
|
129
|
+
- Paraphrases and synonyms
|
|
130
|
+
- Implications of success
|
|
131
|
+
- ANY communication suggesting completion/correctness
|
|
132
|
+
|
|
133
|
+
## The Bottom Line
|
|
134
|
+
|
|
135
|
+
**No shortcuts for verification.**
|
|
136
|
+
|
|
137
|
+
Run the command. Read the output. THEN claim the result.
|
|
138
|
+
|
|
139
|
+
This is non-negotiable.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-loop
|
|
3
|
+
description: "A comprehensive verification system for Claude Code sessions."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verification Loop Skill
|
|
7
|
+
|
|
8
|
+
A comprehensive verification system for Claude Code sessions.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
Invoke this skill:
|
|
13
|
+
- After completing a feature or significant code change
|
|
14
|
+
- Before creating a PR
|
|
15
|
+
- When you want to ensure quality gates pass
|
|
16
|
+
- After refactoring
|
|
17
|
+
|
|
18
|
+
## Verification Phases
|
|
19
|
+
|
|
20
|
+
### Phase 1: Build Verification
|
|
21
|
+
```bash
|
|
22
|
+
# Check if project builds
|
|
23
|
+
npm run build 2>&1 | tail -20
|
|
24
|
+
# OR
|
|
25
|
+
pnpm build 2>&1 | tail -20
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If build fails, STOP and fix before continuing.
|
|
29
|
+
|
|
30
|
+
### Phase 2: Type Check
|
|
31
|
+
```bash
|
|
32
|
+
# TypeScript projects
|
|
33
|
+
npx tsc --noEmit 2>&1 | head -30
|
|
34
|
+
|
|
35
|
+
# Python projects
|
|
36
|
+
pyright . 2>&1 | head -30
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Report all type errors. Fix critical ones before continuing.
|
|
40
|
+
|
|
41
|
+
### Phase 3: Lint Check
|
|
42
|
+
```bash
|
|
43
|
+
# JavaScript/TypeScript
|
|
44
|
+
npm run lint 2>&1 | head -30
|
|
45
|
+
|
|
46
|
+
# Python
|
|
47
|
+
ruff check . 2>&1 | head -30
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Phase 4: Test Suite
|
|
51
|
+
```bash
|
|
52
|
+
# Run tests with coverage
|
|
53
|
+
npm run test -- --coverage 2>&1 | tail -50
|
|
54
|
+
|
|
55
|
+
# Check coverage threshold
|
|
56
|
+
# Target: 80% minimum
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Report:
|
|
60
|
+
- Total tests: X
|
|
61
|
+
- Passed: X
|
|
62
|
+
- Failed: X
|
|
63
|
+
- Coverage: X%
|
|
64
|
+
|
|
65
|
+
### Phase 5: Security Scan
|
|
66
|
+
```bash
|
|
67
|
+
# Check for secrets
|
|
68
|
+
grep -rn "sk-" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
|
|
69
|
+
grep -rn "api_key" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
|
|
70
|
+
|
|
71
|
+
# Check for console.log
|
|
72
|
+
grep -rn "console.log" --include="*.ts" --include="*.tsx" src/ 2>/dev/null | head -10
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Phase 6: Diff Review
|
|
76
|
+
```bash
|
|
77
|
+
# Show what changed
|
|
78
|
+
git diff --stat
|
|
79
|
+
git diff HEAD~1 --name-only
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Review each changed file for:
|
|
83
|
+
- Unintended changes
|
|
84
|
+
- Missing error handling
|
|
85
|
+
- Potential edge cases
|
|
86
|
+
|
|
87
|
+
## Output Format
|
|
88
|
+
|
|
89
|
+
After running all phases, produce a verification report:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
VERIFICATION REPORT
|
|
93
|
+
==================
|
|
94
|
+
|
|
95
|
+
Build: [PASS/FAIL]
|
|
96
|
+
Types: [PASS/FAIL] (X errors)
|
|
97
|
+
Lint: [PASS/FAIL] (X warnings)
|
|
98
|
+
Tests: [PASS/FAIL] (X/Y passed, Z% coverage)
|
|
99
|
+
Security: [PASS/FAIL] (X issues)
|
|
100
|
+
Diff: [X files changed]
|
|
101
|
+
|
|
102
|
+
Overall: [READY/NOT READY] for PR
|
|
103
|
+
|
|
104
|
+
Issues to Fix:
|
|
105
|
+
1. ...
|
|
106
|
+
2. ...
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Continuous Mode
|
|
110
|
+
|
|
111
|
+
For long sessions, run verification every 15 minutes or after major changes:
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
Set a mental checkpoint:
|
|
115
|
+
- After completing each function
|
|
116
|
+
- After finishing a component
|
|
117
|
+
- Before moving to next task
|
|
118
|
+
|
|
119
|
+
Run: /verify
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Integration with Hooks
|
|
123
|
+
|
|
124
|
+
This skill complements PostToolUse hooks but provides deeper verification.
|
|
125
|
+
Hooks catch issues immediately; this skill provides comprehensive review.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-plans
|
|
3
|
+
description: Use when you have a spec or requirements for a multi-step task, before touching code
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Plans
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
11
|
+
|
|
12
|
+
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
|
|
15
|
+
|
|
16
|
+
**Context:** This should be run in a dedicated worktree (created by brainstorming skill).
|
|
17
|
+
|
|
18
|
+
**Save plans to:** `docs/plans/YYYY-MM-DD-<feature-name>.md`
|
|
19
|
+
|
|
20
|
+
## Bite-Sized Task Granularity
|
|
21
|
+
|
|
22
|
+
**Each step is one action (2-5 minutes):**
|
|
23
|
+
- "Write the failing test" - step
|
|
24
|
+
- "Run it to make sure it fails" - step
|
|
25
|
+
- "Implement the minimal code to make the test pass" - step
|
|
26
|
+
- "Run the tests and make sure they pass" - step
|
|
27
|
+
- "Commit" - step
|
|
28
|
+
|
|
29
|
+
## Plan Document Header
|
|
30
|
+
|
|
31
|
+
**Every plan MUST start with this header:**
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
# [Feature Name] Implementation Plan
|
|
35
|
+
|
|
36
|
+
> **For Claude:** REQUIRED SUB-SKILL: Use `executing-plans` to implement this plan task-by-task.
|
|
37
|
+
|
|
38
|
+
**Goal:** [One sentence describing what this builds]
|
|
39
|
+
|
|
40
|
+
**Architecture:** [2-3 sentences about approach]
|
|
41
|
+
|
|
42
|
+
**Tech Stack:** [Key technologies/libraries]
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Task Structure
|
|
48
|
+
|
|
49
|
+
````markdown
|
|
50
|
+
### Task N: [Component Name]
|
|
51
|
+
|
|
52
|
+
**Files:**
|
|
53
|
+
- Create: `exact/path/to/file.py`
|
|
54
|
+
- Modify: `exact/path/to/existing.py:123-145`
|
|
55
|
+
- Test: `tests/exact/path/to/test.py`
|
|
56
|
+
|
|
57
|
+
**Step 1: Write the failing test**
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
def test_specific_behavior():
|
|
61
|
+
result = function(input)
|
|
62
|
+
assert result == expected
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Step 2: Run test to verify it fails**
|
|
66
|
+
|
|
67
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
68
|
+
Expected: FAIL with "function not defined"
|
|
69
|
+
|
|
70
|
+
**Step 3: Write minimal implementation**
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
def function(input):
|
|
74
|
+
return expected
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Step 4: Run test to verify it passes**
|
|
78
|
+
|
|
79
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
80
|
+
Expected: PASS
|
|
81
|
+
|
|
82
|
+
**Step 5: Commit**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git add tests/path/test.py src/path/file.py
|
|
86
|
+
git commit -m "feat: add specific feature"
|
|
87
|
+
```
|
|
88
|
+
````
|
|
89
|
+
|
|
90
|
+
## Remember
|
|
91
|
+
- Exact file paths always
|
|
92
|
+
- Complete code in plan (not "add validation")
|
|
93
|
+
- Exact commands with expected output
|
|
94
|
+
- Reference relevant skills with @ syntax
|
|
95
|
+
- DRY, YAGNI, TDD, frequent commits
|
|
96
|
+
|
|
97
|
+
## Execution Handoff
|
|
98
|
+
|
|
99
|
+
After saving the plan, offer execution choice:
|
|
100
|
+
|
|
101
|
+
**"Plan complete and saved to `docs/plans/<filename>.md`. Two execution options:**
|
|
102
|
+
|
|
103
|
+
**1. Subagent-Driven (this session)** - I dispatch fresh subagent per task, review between tasks, fast iteration
|
|
104
|
+
|
|
105
|
+
**2. Parallel Session (separate)** - Open new session with executing-plans, batch execution with checkpoints
|
|
106
|
+
|
|
107
|
+
**Which approach?"**
|
|
108
|
+
|
|
109
|
+
**If Subagent-Driven chosen:**
|
|
110
|
+
- **REQUIRED SUB-SKILL:** Use `subagent-driven-development`
|
|
111
|
+
- Stay in this session
|
|
112
|
+
- Fresh subagent per task + code review
|
|
113
|
+
|
|
114
|
+
**If Parallel Session chosen:**
|
|
115
|
+
- Guide them to open new session in worktree
|
|
116
|
+
- **REQUIRED SUB-SKILL:** New session uses superpowers:executing-plans
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/utils/file.ts
|
|
2
|
+
import { mkdir, copyFile, readdir } from "fs/promises";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
async function ensureDir(dirPath) {
|
|
5
|
+
await mkdir(dirPath, { recursive: true });
|
|
6
|
+
}
|
|
7
|
+
async function copyFileUtil(src, dest) {
|
|
8
|
+
await copyFile(src, dest);
|
|
9
|
+
}
|
|
10
|
+
async function copyDir(src, dest) {
|
|
11
|
+
await ensureDir(dest);
|
|
12
|
+
const entries = await readdir(src, { withFileTypes: true });
|
|
13
|
+
for (const entry of entries) {
|
|
14
|
+
const srcPath = join(src, entry.name);
|
|
15
|
+
const destPath = join(dest, entry.name);
|
|
16
|
+
if (entry.isDirectory()) {
|
|
17
|
+
await copyDir(srcPath, destPath);
|
|
18
|
+
} else {
|
|
19
|
+
await copyFileUtil(srcPath, destPath);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
ensureDir,
|
|
26
|
+
copyFileUtil,
|
|
27
|
+
copyDir
|
|
28
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
backupIfExists
|
|
3
|
+
} from "./chunk-K25UZZVG.js";
|
|
4
|
+
import {
|
|
5
|
+
copyFileUtil,
|
|
6
|
+
ensureDir
|
|
7
|
+
} from "./chunk-3GUKEMND.js";
|
|
8
|
+
import {
|
|
9
|
+
getAssetsDir
|
|
10
|
+
} from "./chunk-5XOKKPAA.js";
|
|
11
|
+
|
|
12
|
+
// src/installers/hooks.ts
|
|
13
|
+
import { join } from "path";
|
|
14
|
+
import { readFile, writeFile, access } from "fs/promises";
|
|
15
|
+
import { constants } from "fs";
|
|
16
|
+
async function mergeHookSettings(settingsPath, hookType, matcher, command) {
|
|
17
|
+
let settings = {};
|
|
18
|
+
try {
|
|
19
|
+
await access(settingsPath, constants.F_OK);
|
|
20
|
+
const content = await readFile(settingsPath, "utf-8");
|
|
21
|
+
settings = JSON.parse(content);
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
if (!settings.hooks) settings.hooks = {};
|
|
25
|
+
if (!settings.hooks[hookType]) settings.hooks[hookType] = [];
|
|
26
|
+
const hookTypeArr = settings.hooks[hookType];
|
|
27
|
+
let matcherEntry = hookTypeArr.find((e) => e.matcher === matcher);
|
|
28
|
+
if (!matcherEntry) {
|
|
29
|
+
matcherEntry = { matcher, hooks: [] };
|
|
30
|
+
hookTypeArr.push(matcherEntry);
|
|
31
|
+
}
|
|
32
|
+
const alreadyExists = matcherEntry.hooks.some((h) => h.command === command);
|
|
33
|
+
if (!alreadyExists) {
|
|
34
|
+
matcherEntry.hooks.push({ type: "command", command });
|
|
35
|
+
}
|
|
36
|
+
await writeFile(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
|
|
37
|
+
}
|
|
38
|
+
async function installHooks(hooks, targetDir) {
|
|
39
|
+
const hooksDir = join(targetDir, "hooks");
|
|
40
|
+
await ensureDir(hooksDir);
|
|
41
|
+
const srcDir = join(getAssetsDir(), "hooks");
|
|
42
|
+
const settingsPath = join(targetDir, "settings.json");
|
|
43
|
+
for (const hook of hooks) {
|
|
44
|
+
const dest = join(hooksDir, hook.file);
|
|
45
|
+
await backupIfExists(dest);
|
|
46
|
+
await copyFileUtil(join(srcDir, hook.file), dest);
|
|
47
|
+
const hookCommand = `node ${dest}`;
|
|
48
|
+
await mergeHookSettings(settingsPath, hook.hookType, hook.matcher, hookCommand);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
installHooks
|
|
54
|
+
};
|