clawpowers 1.0.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/.claude-plugin/manifest.json +19 -0
- package/.codex/INSTALL.md +36 -0
- package/.cursor-plugin/manifest.json +21 -0
- package/.opencode/INSTALL.md +52 -0
- package/ARCHITECTURE.md +69 -0
- package/README.md +381 -0
- package/bin/clawpowers.js +390 -0
- package/bin/clawpowers.sh +91 -0
- package/gemini-extension.json +32 -0
- package/hooks/session-start +205 -0
- package/hooks/session-start.cmd +43 -0
- package/hooks/session-start.js +163 -0
- package/package.json +54 -0
- package/runtime/feedback/analyze.js +621 -0
- package/runtime/feedback/analyze.sh +546 -0
- package/runtime/init.js +172 -0
- package/runtime/init.sh +145 -0
- package/runtime/metrics/collector.js +361 -0
- package/runtime/metrics/collector.sh +308 -0
- package/runtime/persistence/store.js +433 -0
- package/runtime/persistence/store.sh +303 -0
- package/skill.json +74 -0
- package/skills/agent-payments/SKILL.md +411 -0
- package/skills/brainstorming/SKILL.md +233 -0
- package/skills/content-pipeline/SKILL.md +282 -0
- package/skills/dispatching-parallel-agents/SKILL.md +305 -0
- package/skills/executing-plans/SKILL.md +255 -0
- package/skills/finishing-a-development-branch/SKILL.md +260 -0
- package/skills/learn-how-to-learn/SKILL.md +235 -0
- package/skills/market-intelligence/SKILL.md +288 -0
- package/skills/prospecting/SKILL.md +313 -0
- package/skills/receiving-code-review/SKILL.md +225 -0
- package/skills/requesting-code-review/SKILL.md +206 -0
- package/skills/security-audit/SKILL.md +308 -0
- package/skills/subagent-driven-development/SKILL.md +244 -0
- package/skills/systematic-debugging/SKILL.md +279 -0
- package/skills/test-driven-development/SKILL.md +299 -0
- package/skills/using-clawpowers/SKILL.md +137 -0
- package/skills/using-git-worktrees/SKILL.md +261 -0
- package/skills/verification-before-completion/SKILL.md +254 -0
- package/skills/writing-plans/SKILL.md +276 -0
- package/skills/writing-skills/SKILL.md +260 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-before-completion
|
|
3
|
+
description: Run quality gates before any merge, deployment, or handoff. Activate when you're about to declare work done.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
requires:
|
|
6
|
+
tools: [git, bash]
|
|
7
|
+
runtime: false
|
|
8
|
+
metrics:
|
|
9
|
+
tracks: [gate_pass_rate, gates_failed, defect_escape_rate, verification_duration]
|
|
10
|
+
improves: [gate_selection, gate_ordering, parallel_gate_execution]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Verification Before Completion
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
Apply this skill when:
|
|
18
|
+
|
|
19
|
+
- You're about to open a PR or request a merge
|
|
20
|
+
- You're handing work to another agent or team member
|
|
21
|
+
- You're about to tag a release
|
|
22
|
+
- You've completed all tasks in a plan
|
|
23
|
+
- Someone says "are we done?"
|
|
24
|
+
|
|
25
|
+
**The rule:** Nothing moves forward until verification passes. This is a hard gate, not a suggestion.
|
|
26
|
+
|
|
27
|
+
**Skip when:**
|
|
28
|
+
- This is a work-in-progress (WIP) commit — label it as such
|
|
29
|
+
- You're committing to a draft branch specifically for CI to run (CI is the verification)
|
|
30
|
+
- The change is a single-line config fix with zero behavior impact
|
|
31
|
+
|
|
32
|
+
## Core Methodology
|
|
33
|
+
|
|
34
|
+
### The Verification Checklist
|
|
35
|
+
|
|
36
|
+
Run these gates in order. A failure at any gate stops the process — fix and restart verification from that gate.
|
|
37
|
+
|
|
38
|
+
#### Gate 1: Completeness
|
|
39
|
+
|
|
40
|
+
- [ ] All tasks in the plan are marked complete
|
|
41
|
+
- [ ] All done criteria in the plan are verified
|
|
42
|
+
- [ ] No TODOs, stubs, or `# FIXME` in production code paths
|
|
43
|
+
- [ ] All specified features are implemented
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Check for stubs
|
|
47
|
+
grep -r "TODO\|FIXME\|STUB\|NOTIMPLEMENTED\|raise NotImplementedError\|pass # " src/ --include="*.py"
|
|
48
|
+
grep -r "TODO\|FIXME\|STUB" src/ --include="*.ts" --include="*.js"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### Gate 2: Tests Pass
|
|
52
|
+
|
|
53
|
+
- [ ] Full test suite passes with zero failures
|
|
54
|
+
- [ ] Zero flaky tests in this run
|
|
55
|
+
- [ ] Test coverage meets threshold (≥80% line coverage for new code)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Python
|
|
59
|
+
pytest --tb=short -q
|
|
60
|
+
pytest --cov=src --cov-report=term-missing --cov-fail-under=80
|
|
61
|
+
|
|
62
|
+
# JavaScript/TypeScript
|
|
63
|
+
npm test -- --passWithNoTests
|
|
64
|
+
npx jest --coverage --coverageThreshold='{"global":{"lines":80}}'
|
|
65
|
+
|
|
66
|
+
# Go
|
|
67
|
+
go test ./... -count=1 -race
|
|
68
|
+
go test ./... -cover -covermode=atomic
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Gate 3: Static Analysis
|
|
72
|
+
|
|
73
|
+
- [ ] No linting errors
|
|
74
|
+
- [ ] No type errors (if typed language)
|
|
75
|
+
- [ ] No security scan findings (high/critical)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Python
|
|
79
|
+
ruff check src/
|
|
80
|
+
mypy src/ --strict
|
|
81
|
+
bandit -r src/ -ll # medium+ severity only
|
|
82
|
+
|
|
83
|
+
# JavaScript/TypeScript
|
|
84
|
+
npx eslint src/
|
|
85
|
+
npx tsc --noEmit
|
|
86
|
+
|
|
87
|
+
# Go
|
|
88
|
+
go vet ./...
|
|
89
|
+
staticcheck ./...
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### Gate 4: Build Succeeds
|
|
93
|
+
|
|
94
|
+
- [ ] Project builds without errors or warnings
|
|
95
|
+
- [ ] Dependencies are pinned (no floating versions in production)
|
|
96
|
+
- [ ] Build artifacts are reproducible
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Python
|
|
100
|
+
pip install -e . --quiet
|
|
101
|
+
python -c "import your_package" # smoke test import
|
|
102
|
+
|
|
103
|
+
# Node.js
|
|
104
|
+
npm ci # use ci not install (honors package-lock.json)
|
|
105
|
+
npm run build
|
|
106
|
+
|
|
107
|
+
# Go
|
|
108
|
+
go build ./...
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Gate 5: Integration Tests
|
|
112
|
+
|
|
113
|
+
- [ ] Integration tests pass (database, external services, etc.)
|
|
114
|
+
- [ ] API contract tests pass (if applicable)
|
|
115
|
+
- [ ] No regression in end-to-end test suite
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Integration tests (requires real DB, may need Docker)
|
|
119
|
+
pytest tests/integration/ -v
|
|
120
|
+
# Or
|
|
121
|
+
docker-compose up -d && pytest tests/integration/ && docker-compose down
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Gate 6: Security Scan
|
|
125
|
+
|
|
126
|
+
- [ ] No hardcoded secrets in new code
|
|
127
|
+
- [ ] Dependencies have no critical CVEs
|
|
128
|
+
- [ ] No SQL injection / XSS vectors in new endpoints
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Secret scanning
|
|
132
|
+
gitleaks detect --no-git -v
|
|
133
|
+
|
|
134
|
+
# Dependency audit
|
|
135
|
+
npm audit --audit-level=high
|
|
136
|
+
pip-audit --desc on
|
|
137
|
+
trivy fs . --severity HIGH,CRITICAL --exit-code 1
|
|
138
|
+
|
|
139
|
+
# SAST for known vulnerability patterns
|
|
140
|
+
bandit -r src/ -l # Python
|
|
141
|
+
semgrep --config=auto src/ # multi-language
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### Gate 7: Documentation
|
|
145
|
+
|
|
146
|
+
- [ ] Public API changes have updated docstrings/JSDoc
|
|
147
|
+
- [ ] README reflects any changed setup steps
|
|
148
|
+
- [ ] CHANGELOG updated with this change
|
|
149
|
+
- [ ] Any new environment variables are documented
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Check for undocumented public functions (Python)
|
|
153
|
+
pydocstyle src/ --add-ignore=D100,D104
|
|
154
|
+
|
|
155
|
+
# Verify CHANGELOG was updated
|
|
156
|
+
git diff HEAD~1 CHANGELOG.md | grep "^+" | wc -l # should be > 0
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Verification Report
|
|
160
|
+
|
|
161
|
+
After running all gates, produce a report:
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
## Verification Report — [Feature Name]
|
|
165
|
+
|
|
166
|
+
**Date:** [timestamp]
|
|
167
|
+
**Branch:** [branch name]
|
|
168
|
+
**Commit:** [short hash]
|
|
169
|
+
|
|
170
|
+
### Gate Results
|
|
171
|
+
| Gate | Status | Notes |
|
|
172
|
+
|------|--------|-------|
|
|
173
|
+
| 1. Completeness | ✅ PASS | All 8 plan tasks verified |
|
|
174
|
+
| 2. Tests | ✅ PASS | 127 tests, 0 failures, 84% coverage |
|
|
175
|
+
| 3. Static Analysis | ✅ PASS | 0 ruff errors, 0 mypy errors |
|
|
176
|
+
| 4. Build | ✅ PASS | Clean build, deps pinned |
|
|
177
|
+
| 5. Integration | ✅ PASS | 12 integration tests passing |
|
|
178
|
+
| 6. Security | ✅ PASS | 0 secrets, 0 critical CVEs |
|
|
179
|
+
| 7. Documentation | ✅ PASS | Docstrings updated, CHANGELOG updated |
|
|
180
|
+
|
|
181
|
+
**Verdict: READY FOR REVIEW**
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
If any gate fails:
|
|
185
|
+
|
|
186
|
+
```markdown
|
|
187
|
+
| 2. Tests | ❌ FAIL | test_payment_retry: AssertionError: expected 3 retries, got 1 |
|
|
188
|
+
|
|
189
|
+
**Verdict: NOT READY — address test failure before proceeding**
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Failure Protocol
|
|
193
|
+
|
|
194
|
+
When a gate fails:
|
|
195
|
+
|
|
196
|
+
1. **Stop** — don't open the PR
|
|
197
|
+
2. **Fix the specific failure** — don't work around it
|
|
198
|
+
3. **Re-run the full gate sequence from Gate 1** — a fix can break something earlier
|
|
199
|
+
4. **If the same gate fails twice**, escalate to `systematic-debugging`
|
|
200
|
+
|
|
201
|
+
**Exception:** If Gates 2-6 pass but Gate 7 (documentation) is being updated in a separate follow-up PR with a tracking issue, this is the only acceptable skip with documented justification.
|
|
202
|
+
|
|
203
|
+
## ClawPowers Enhancement
|
|
204
|
+
|
|
205
|
+
When `~/.clawpowers/` runtime is initialized:
|
|
206
|
+
|
|
207
|
+
**Automated Verification Suite Execution:**
|
|
208
|
+
|
|
209
|
+
Instead of running gates manually, execute the full suite:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# Run all verification gates automatically
|
|
213
|
+
bash runtime/persistence/store.sh set "verification:feature-name:started_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
214
|
+
|
|
215
|
+
# Gates execute in parallel where safe (Gates 3, 4, 6 can parallelize)
|
|
216
|
+
# Results saved to state store for resumability
|
|
217
|
+
|
|
218
|
+
bash runtime/persistence/store.sh set "verification:feature-name:gate2:status" "pass"
|
|
219
|
+
bash runtime/persistence/store.sh set "verification:feature-name:gate2:details" "127 tests, 0 failures"
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Historical Pass Rates:**
|
|
223
|
+
|
|
224
|
+
After 20+ verifications, `runtime/feedback/analyze.sh` reports:
|
|
225
|
+
- Which gate fails most often (target for process improvement)
|
|
226
|
+
- Average verification duration
|
|
227
|
+
- Defect escape rate (bugs found in review or production vs. caught by verification)
|
|
228
|
+
- Gates that catch zero issues over N runs (candidates for removal or replacement)
|
|
229
|
+
|
|
230
|
+
**Gate Configuration:**
|
|
231
|
+
|
|
232
|
+
Store project-specific gate thresholds:
|
|
233
|
+
```bash
|
|
234
|
+
bash runtime/persistence/store.sh set "config:verification:coverage_threshold" "85"
|
|
235
|
+
bash runtime/persistence/store.sh set "config:verification:security_level" "medium"
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Anti-Patterns
|
|
239
|
+
|
|
240
|
+
| Anti-Pattern | Why It Fails | Correct Approach |
|
|
241
|
+
|-------------|-------------|-----------------|
|
|
242
|
+
| "Tests probably pass" without running | False confidence, bugs escape | Run every time — no exceptions |
|
|
243
|
+
| Disabling tests to pass gate | Silences real bugs | Fix the code, never the test |
|
|
244
|
+
| Running only unit tests | Integration issues escape | All gates required |
|
|
245
|
+
| Skipping security scan "because it's internal" | Internal breaches exist | Security scan always |
|
|
246
|
+
| Fixing gate failures without re-running from Gate 1 | Fix introduces new failures | Full restart after any fix |
|
|
247
|
+
| Annotating known issues as "acceptable" | Debt accumulates, gets shipped | Fix it or don't ship |
|
|
248
|
+
|
|
249
|
+
## Integration with Other Skills
|
|
250
|
+
|
|
251
|
+
- Preceded by `executing-plans` (all plan tasks must be complete)
|
|
252
|
+
- Use `systematic-debugging` if tests fail
|
|
253
|
+
- Followed by `finishing-a-development-branch` or `requesting-code-review`
|
|
254
|
+
- Use `security-audit` for extended security coverage beyond Gate 6
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-plans
|
|
3
|
+
description: Transform a specification or goal into a sequenced implementation plan of concrete 2-5 minute tasks with dependency graph. Activate when someone asks you to plan work, before starting any substantial feature.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
requires:
|
|
6
|
+
tools: []
|
|
7
|
+
runtime: false
|
|
8
|
+
metrics:
|
|
9
|
+
tracks: [plan_accuracy, task_count, estimation_error, dependency_violations]
|
|
10
|
+
improves: [task_granularity, estimation_calibration, dependency_detection]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Writing Plans
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
Apply this skill when:
|
|
18
|
+
|
|
19
|
+
- You receive a specification that requires multiple distinct steps
|
|
20
|
+
- Work will take more than 30 minutes total
|
|
21
|
+
- Multiple people or agents will execute the work
|
|
22
|
+
- The execution order matters (dependencies exist)
|
|
23
|
+
- You need to communicate progress against milestones
|
|
24
|
+
- The risk of missing a step is high
|
|
25
|
+
|
|
26
|
+
**Skip when:**
|
|
27
|
+
- The task is a single, obvious action (just do it)
|
|
28
|
+
- The task is exploratory — you can't plan what you haven't understood yet
|
|
29
|
+
- The plan would take longer to write than the work itself
|
|
30
|
+
|
|
31
|
+
**Decision tree:**
|
|
32
|
+
```
|
|
33
|
+
Is the task > 30 min or > 1 context window?
|
|
34
|
+
├── No → execute directly
|
|
35
|
+
└── Yes → Do you understand the full scope?
|
|
36
|
+
├── No → brainstorming first, then write-plans
|
|
37
|
+
└── Yes → writing-plans ← YOU ARE HERE
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Core Methodology
|
|
41
|
+
|
|
42
|
+
### Phase 1: Specification Analysis
|
|
43
|
+
|
|
44
|
+
Before writing a single task, decompose the spec into its logical components:
|
|
45
|
+
|
|
46
|
+
1. **Parse the goal** — What is the desired end state? Not "build auth" but "users can register, log in, and maintain sessions securely"
|
|
47
|
+
2. **Identify components** — What distinct systems or modules need to exist?
|
|
48
|
+
3. **Find dependencies** — Which components require others to exist first?
|
|
49
|
+
4. **Identify risks** — What's most likely to go wrong? Plan for it early.
|
|
50
|
+
5. **Define done criteria** — How will you know the goal is achieved?
|
|
51
|
+
|
|
52
|
+
**Specification analysis template:**
|
|
53
|
+
```markdown
|
|
54
|
+
## Goal
|
|
55
|
+
[Single sentence: what exists when this is done that didn't exist before]
|
|
56
|
+
|
|
57
|
+
## Components
|
|
58
|
+
- [Component A]: [what it is and what it does]
|
|
59
|
+
- [Component B]: [what it is and what it does]
|
|
60
|
+
|
|
61
|
+
## Dependencies
|
|
62
|
+
- Component B requires Component A's [interface/data/service]
|
|
63
|
+
- Component C requires both A and B
|
|
64
|
+
|
|
65
|
+
## Risks
|
|
66
|
+
1. [Risk]: [mitigation]
|
|
67
|
+
2. [Risk]: [mitigation]
|
|
68
|
+
|
|
69
|
+
## Done Criteria
|
|
70
|
+
- [ ] [Observable, testable condition]
|
|
71
|
+
- [ ] [Observable, testable condition]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Phase 2: Task Sequencing
|
|
75
|
+
|
|
76
|
+
Break each component into atomic tasks. Rules for task granularity:
|
|
77
|
+
|
|
78
|
+
**Target size:** 2-5 minutes of execution time (not wall clock time — agent execution time)
|
|
79
|
+
**Signs a task is too large:**
|
|
80
|
+
- It contains "and" (two things)
|
|
81
|
+
- Its done criteria has more than 3 bullet points
|
|
82
|
+
- It could fail in more than 2 different ways
|
|
83
|
+
- It would produce more than 200 lines of code
|
|
84
|
+
|
|
85
|
+
**Signs a task is too small:**
|
|
86
|
+
- It produces less than 10 lines of code
|
|
87
|
+
- Its setup (imports, scaffolding) outweighs its work
|
|
88
|
+
- It has zero decision points
|
|
89
|
+
|
|
90
|
+
**Task format:**
|
|
91
|
+
```markdown
|
|
92
|
+
### Task N: [Action verb] [specific thing]
|
|
93
|
+
|
|
94
|
+
**Input:** [What this task needs to exist before it can run]
|
|
95
|
+
**Output:** [Exact file, function, or artifact produced]
|
|
96
|
+
**Duration:** [2-5 min]
|
|
97
|
+
**Done when:**
|
|
98
|
+
- [ ] [Specific, verifiable criterion]
|
|
99
|
+
- [ ] Tests pass (if applicable)
|
|
100
|
+
|
|
101
|
+
**Notes:** [Edge cases, non-obvious decisions, references]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Phase 3: Dependency Graph
|
|
105
|
+
|
|
106
|
+
After listing tasks, draw the dependency graph explicitly:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
Task 1: Database schema ──→ Task 3: Repository layer
|
|
110
|
+
Task 2: Domain models ──→ Task 3: Repository layer
|
|
111
|
+
Task 3: Repository layer ──→ Task 5: Service layer
|
|
112
|
+
Task 4: Auth middleware ──→ Task 6: Protected routes
|
|
113
|
+
Task 5: Service layer ──→ Task 6: Protected routes
|
|
114
|
+
Task 6: Protected routes ──→ Task 7: Integration tests
|
|
115
|
+
Task 7: Integration tests ──→ Task 8: Documentation
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Parallel execution opportunities** — tasks with no shared dependencies:
|
|
119
|
+
- Task 1 and Task 2 can run in parallel
|
|
120
|
+
- Task 4 can run in parallel with Tasks 1-3
|
|
121
|
+
|
|
122
|
+
Label these explicitly. If using `subagent-driven-development`, parallel tasks become parallel subagent dispatches.
|
|
123
|
+
|
|
124
|
+
### Phase 4: Risk-First Ordering
|
|
125
|
+
|
|
126
|
+
Within the constraint of the dependency graph, sequence tasks to:
|
|
127
|
+
1. **Prove the spike first** — If there's a technical uncertainty, make a task that resolves it early
|
|
128
|
+
2. **Hard tasks early** — Don't save the hardest part for last (discovery of blockers costs less time early)
|
|
129
|
+
3. **Reviewable checkpoints** — Insert verification tasks at natural boundaries
|
|
130
|
+
|
|
131
|
+
**Risk-first example:**
|
|
132
|
+
```
|
|
133
|
+
# BAD ordering (risk deferred to end)
|
|
134
|
+
Task 1: Build entire frontend
|
|
135
|
+
Task 2: Build entire backend
|
|
136
|
+
Task 3: Integrate (discovery: API shape is wrong, redo Task 1)
|
|
137
|
+
|
|
138
|
+
# GOOD ordering (risk surfaced early)
|
|
139
|
+
Task 1: Define API contract (OpenAPI spec)
|
|
140
|
+
Task 2: Backend stub that satisfies contract
|
|
141
|
+
Task 3: Frontend stub that calls contract
|
|
142
|
+
Task 4: Integration smoke test ← risk surfaced HERE, at task 4 not task 20
|
|
143
|
+
Task 5: Full backend implementation
|
|
144
|
+
Task 6: Full frontend implementation
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Phase 5: The Written Plan
|
|
148
|
+
|
|
149
|
+
Final output format:
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
# Plan: [Goal Name]
|
|
153
|
+
|
|
154
|
+
**Goal:** [Single sentence]
|
|
155
|
+
**Total tasks:** N
|
|
156
|
+
**Estimated duration:** [sum of task durations]
|
|
157
|
+
**Parallel opportunities:** [task numbers that can run concurrently]
|
|
158
|
+
|
|
159
|
+
## Done Criteria
|
|
160
|
+
- [ ] [Observable, testable condition]
|
|
161
|
+
- [ ] [Observable, testable condition]
|
|
162
|
+
|
|
163
|
+
## Dependency Graph
|
|
164
|
+
[ASCII or description]
|
|
165
|
+
|
|
166
|
+
## Tasks
|
|
167
|
+
|
|
168
|
+
### Task 1: [Name]
|
|
169
|
+
[Full task block]
|
|
170
|
+
|
|
171
|
+
### Task 2: [Name]
|
|
172
|
+
[Full task block]
|
|
173
|
+
|
|
174
|
+
...
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## ClawPowers Enhancement
|
|
178
|
+
|
|
179
|
+
When `~/.clawpowers/` runtime is initialized:
|
|
180
|
+
|
|
181
|
+
**Historical Estimation Calibration:**
|
|
182
|
+
|
|
183
|
+
Plans get compared to actual execution. After 5+ plans, calibration data is available:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# After plan execution completes
|
|
187
|
+
bash runtime/persistence/store.sh set "plan:auth-service:estimated_duration" "180"
|
|
188
|
+
bash runtime/persistence/store.sh set "plan:auth-service:actual_duration" "240"
|
|
189
|
+
|
|
190
|
+
# Read calibration
|
|
191
|
+
bash runtime/feedback/analyze.sh --skill writing-plans
|
|
192
|
+
# Output: Your 2-5 min tasks average 7.3 min actual. Adjust estimates by 1.5x.
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Dependency Graph Validation:**
|
|
196
|
+
|
|
197
|
+
Before executing a plan, validate the dependency graph has no cycles and all task inputs exist:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
bash runtime/persistence/store.sh set "plan:current:task_count" "8"
|
|
201
|
+
bash runtime/persistence/store.sh set "plan:current:deps" "3:1,2 4:- 5:3,4 6:4 7:5,6 8:7"
|
|
202
|
+
# Analyzer checks for cycles and unreachable tasks
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Plan Quality Scoring:**
|
|
206
|
+
|
|
207
|
+
Stored metrics enable quality scoring of plans over time:
|
|
208
|
+
- Estimation accuracy (actual / estimated)
|
|
209
|
+
- Task rework rate (tasks that required re-execution)
|
|
210
|
+
- Dependency violation rate (tasks executed out of order)
|
|
211
|
+
- Done criteria completeness (criteria met on first attempt)
|
|
212
|
+
|
|
213
|
+
## Anti-Patterns
|
|
214
|
+
|
|
215
|
+
| Anti-Pattern | Why It Fails | Correct Approach |
|
|
216
|
+
|-------------|-------------|-----------------|
|
|
217
|
+
| Tasks with "and" | Two risks, two outcomes, ambiguous done criteria | Split into two tasks |
|
|
218
|
+
| Vague done criteria | "Done" is subjective, causes rework debates | Observable, testable criteria only |
|
|
219
|
+
| Skipping dependency mapping | Execution order violations cause rework | Always draw the dependency graph |
|
|
220
|
+
| Planning with no spike | Technical unknown bites you at Task 15 | Schedule spike task first if uncertainty exists |
|
|
221
|
+
| Giant tasks (2 hours each) | Hard to track progress, hard to parallelize | Break down to 2-5 min granularity |
|
|
222
|
+
| Tiny tasks (1-2 min each) | Plan overhead exceeds value | Group related micro-tasks |
|
|
223
|
+
| Over-planning volatile specs | Plan becomes invalid before execution starts | Plan only what's stable, leave flexibility for the rest |
|
|
224
|
+
|
|
225
|
+
## Examples
|
|
226
|
+
|
|
227
|
+
### Example 1: Small Plan (4 tasks)
|
|
228
|
+
|
|
229
|
+
**Goal:** Add rate limiting to the API
|
|
230
|
+
|
|
231
|
+
```markdown
|
|
232
|
+
# Plan: API Rate Limiting
|
|
233
|
+
|
|
234
|
+
**Goal:** All API endpoints enforce per-user rate limits with 429 response on exceeded limits.
|
|
235
|
+
**Total tasks:** 4 | **Estimated:** 16 min
|
|
236
|
+
|
|
237
|
+
## Done Criteria
|
|
238
|
+
- [ ] Requests beyond limit receive 429 with Retry-After header
|
|
239
|
+
- [ ] Rate limit state persists across server restarts
|
|
240
|
+
- [ ] Tests cover limit enforcement and reset behavior
|
|
241
|
+
|
|
242
|
+
## Tasks
|
|
243
|
+
|
|
244
|
+
### Task 1: Write rate limit tests (RED)
|
|
245
|
+
**Input:** None | **Output:** tests/test_rate_limit.py (failing) | **Duration:** 3 min
|
|
246
|
+
**Done when:** Tests run and fail with ImportError
|
|
247
|
+
|
|
248
|
+
### Task 2: Implement RedisRateLimiter
|
|
249
|
+
**Input:** tests/test_rate_limit.py | **Output:** src/rate_limiter.py | **Duration:** 5 min
|
|
250
|
+
**Done when:** All rate limiter unit tests pass
|
|
251
|
+
|
|
252
|
+
### Task 3: Integrate rate limiter into middleware
|
|
253
|
+
**Input:** src/rate_limiter.py | **Output:** src/middleware/rate_limit.py | **Duration:** 4 min
|
|
254
|
+
**Done when:** Integration tests pass, middleware applies limits per endpoint
|
|
255
|
+
|
|
256
|
+
### Task 4: Add 429 response and Retry-After header
|
|
257
|
+
**Input:** src/middleware/rate_limit.py | **Output:** Modified middleware | **Duration:** 2 min
|
|
258
|
+
**Done when:** 429 response includes Retry-After with correct TTL
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Example 2: Dependency-heavy Plan (8 tasks with parallel opportunities)
|
|
262
|
+
|
|
263
|
+
**Goal:** Build notification service
|
|
264
|
+
|
|
265
|
+
**Parallel opportunities:** Tasks 1+2 concurrent, Tasks 4+5 concurrent
|
|
266
|
+
|
|
267
|
+
```markdown
|
|
268
|
+
### Task 1: Define notification event schema [parallel with Task 2]
|
|
269
|
+
### Task 2: Database migration for notification store [parallel with Task 1]
|
|
270
|
+
### Task 3: NotificationRepository (depends on 1, 2)
|
|
271
|
+
### Task 4: Email provider integration (depends on 1) [parallel with Task 5]
|
|
272
|
+
### Task 5: Push notification provider integration (depends on 1) [parallel with Task 4]
|
|
273
|
+
### Task 6: NotificationService orchestrator (depends on 3, 4, 5)
|
|
274
|
+
### Task 7: API endpoints (depends on 6)
|
|
275
|
+
### Task 8: Integration tests (depends on 7)
|
|
276
|
+
```
|