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.
Files changed (42) hide show
  1. package/.claude-plugin/manifest.json +19 -0
  2. package/.codex/INSTALL.md +36 -0
  3. package/.cursor-plugin/manifest.json +21 -0
  4. package/.opencode/INSTALL.md +52 -0
  5. package/ARCHITECTURE.md +69 -0
  6. package/README.md +381 -0
  7. package/bin/clawpowers.js +390 -0
  8. package/bin/clawpowers.sh +91 -0
  9. package/gemini-extension.json +32 -0
  10. package/hooks/session-start +205 -0
  11. package/hooks/session-start.cmd +43 -0
  12. package/hooks/session-start.js +163 -0
  13. package/package.json +54 -0
  14. package/runtime/feedback/analyze.js +621 -0
  15. package/runtime/feedback/analyze.sh +546 -0
  16. package/runtime/init.js +172 -0
  17. package/runtime/init.sh +145 -0
  18. package/runtime/metrics/collector.js +361 -0
  19. package/runtime/metrics/collector.sh +308 -0
  20. package/runtime/persistence/store.js +433 -0
  21. package/runtime/persistence/store.sh +303 -0
  22. package/skill.json +74 -0
  23. package/skills/agent-payments/SKILL.md +411 -0
  24. package/skills/brainstorming/SKILL.md +233 -0
  25. package/skills/content-pipeline/SKILL.md +282 -0
  26. package/skills/dispatching-parallel-agents/SKILL.md +305 -0
  27. package/skills/executing-plans/SKILL.md +255 -0
  28. package/skills/finishing-a-development-branch/SKILL.md +260 -0
  29. package/skills/learn-how-to-learn/SKILL.md +235 -0
  30. package/skills/market-intelligence/SKILL.md +288 -0
  31. package/skills/prospecting/SKILL.md +313 -0
  32. package/skills/receiving-code-review/SKILL.md +225 -0
  33. package/skills/requesting-code-review/SKILL.md +206 -0
  34. package/skills/security-audit/SKILL.md +308 -0
  35. package/skills/subagent-driven-development/SKILL.md +244 -0
  36. package/skills/systematic-debugging/SKILL.md +279 -0
  37. package/skills/test-driven-development/SKILL.md +299 -0
  38. package/skills/using-clawpowers/SKILL.md +137 -0
  39. package/skills/using-git-worktrees/SKILL.md +261 -0
  40. package/skills/verification-before-completion/SKILL.md +254 -0
  41. package/skills/writing-plans/SKILL.md +276 -0
  42. package/skills/writing-skills/SKILL.md +260 -0
@@ -0,0 +1,255 @@
1
+ ---
2
+ name: executing-plans
3
+ description: Execute an existing plan with progress tracking, interruption recovery, and milestone verification. Activate when you have a written plan and are ready to implement it.
4
+ version: 1.0.0
5
+ requires:
6
+ tools: [bash, git]
7
+ runtime: false
8
+ metrics:
9
+ tracks: [tasks_completed, rework_rate, interruption_recovery_time, milestone_hit_rate]
10
+ improves: [task_sequencing, checkpoint_frequency, verification_rigor]
11
+ ---
12
+
13
+ # Executing Plans
14
+
15
+ ## When to Use
16
+
17
+ Apply this skill when:
18
+
19
+ - You have a written plan (from `writing-plans` or equivalent) ready to execute
20
+ - Executing a multi-task sequence where progress matters
21
+ - You need to be able to pause and resume without losing context
22
+ - You're executing work that someone else is tracking
23
+
24
+ **Skip when:**
25
+ - You don't have a plan yet (use `writing-plans` first)
26
+ - The task is a single step (just execute it)
27
+ - You're mid-execution and don't need the overhead
28
+
29
+ **Relationship to other skills:**
30
+ ```
31
+ writing-plans → executing-plans → verification-before-completion → finishing-a-development-branch
32
+ ```
33
+
34
+ ## Core Methodology
35
+
36
+ ### Pre-Execution Setup
37
+
38
+ Before executing the first task:
39
+
40
+ 1. **Read the full plan** — Don't start mid-plan. Read it completely.
41
+ 2. **Verify preconditions** — All inputs for Task 1 must exist. If they don't, stop and get them.
42
+ 3. **Create execution checkpoint** — Save plan state to resume on interruption.
43
+ 4. **Identify parallel tasks** — Group concurrent tasks from the dependency graph.
44
+
45
+ **Checkpoint structure (file-based, no runtime required):**
46
+ ```json
47
+ {
48
+ "plan_name": "auth-service",
49
+ "started_at": "2026-03-21T14:00:00Z",
50
+ "tasks": {
51
+ "1": {"status": "pending"},
52
+ "2": {"status": "pending"},
53
+ "3": {"status": "pending"}
54
+ },
55
+ "current_task": null
56
+ }
57
+ ```
58
+
59
+ If runtime is available:
60
+ ```bash
61
+ bash runtime/persistence/store.sh set "execution:plan_name" "auth-service"
62
+ bash runtime/persistence/store.sh set "execution:task_1:status" "pending"
63
+ ```
64
+
65
+ ### Task Execution Loop
66
+
67
+ For each task in the plan (in dependency order):
68
+
69
+ **Step 1: Mark task in progress**
70
+ ```bash
71
+ # With runtime
72
+ bash runtime/persistence/store.sh set "execution:task_N:status" "in_progress"
73
+ bash runtime/persistence/store.sh set "execution:task_N:started_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
74
+ ```
75
+
76
+ **Step 2: Execute the task**
77
+ - Follow the task spec exactly — scope, deliverables, done criteria
78
+ - Do not expand scope ("while I'm here, I'll also...")
79
+ - Do not shrink scope ("this is probably good enough...")
80
+
81
+ **Step 3: Verify done criteria**
82
+
83
+ Each done criterion must be checked explicitly:
84
+ ```
85
+ Task 2 done criteria:
86
+ - [ ] Repository layer exists at src/repos/user_repo.py → CHECK: file exists ✓
87
+ - [ ] All repository tests pass → CHECK: pytest tests/test_user_repo.py → 8 passed ✓
88
+ - [ ] No raw SQL in service layer → CHECK: grep "SELECT\|INSERT\|UPDATE" src/services/ → 0 results ✓
89
+ ```
90
+
91
+ If any criterion fails: **stop, diagnose, fix, re-verify** — do not proceed to the next task.
92
+
93
+ **Step 4: Mark task complete**
94
+ ```bash
95
+ bash runtime/persistence/store.sh set "execution:task_N:status" "complete"
96
+ bash runtime/persistence/store.sh set "execution:task_N:completed_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
97
+ ```
98
+
99
+ **Step 5: Git commit the task output**
100
+
101
+ Each completed task gets its own commit:
102
+ ```bash
103
+ git add [task output files]
104
+ git commit -m "feat(auth): implement UserRepository with connection pooling
105
+
106
+ Task 2/8 of auth-service plan. Completes repository layer.
107
+ All 8 repository tests passing. Zero raw SQL in service layer."
108
+ ```
109
+
110
+ This makes the plan's execution history visible in git log and enables rollback to any task boundary.
111
+
112
+ ### Handling Parallel Tasks
113
+
114
+ When the plan identifies parallel tasks:
115
+
116
+ 1. Dispatch them concurrently (via `dispatching-parallel-agents` if agents, or concurrent execution)
117
+ 2. Wait for ALL parallel tasks to complete before proceeding
118
+ 3. Verify all parallel task done criteria before moving to dependent tasks
119
+ 4. If one parallel task fails, others continue — don't cancel them
120
+
121
+ ```
122
+ parallel_group = [Task 1, Task 2] # Both have no dependencies
123
+
124
+ Execute Task 1 and Task 2 concurrently
125
+ Wait for both → verify both → only then execute Task 3
126
+ ```
127
+
128
+ ### Milestone Verification
129
+
130
+ At natural boundaries (end of a logical phase), run a milestone verification:
131
+
132
+ 1. All tasks in the phase are marked complete
133
+ 2. All done criteria are checked
134
+ 3. Integration between phase tasks is verified (not just individual tasks)
135
+ 4. Run any integration tests that cover the phase boundary
136
+
137
+ **Example milestone:** After implementing the repository and service layers:
138
+ ```bash
139
+ # Milestone: data layer complete
140
+ pytest tests/ -k "repository or service" # All must pass
141
+ # Verify no circular imports
142
+ python -c "from src.services.user import UserService"
143
+ # Verify interface contracts
144
+ python -m mypy src/repos/ src/services/
145
+ ```
146
+
147
+ ### Interruption Recovery
148
+
149
+ If execution is interrupted (session ends, error halts, requirement change):
150
+
151
+ **With runtime:**
152
+ ```bash
153
+ # On resume
154
+ bash runtime/persistence/store.sh get "execution:plan_name"
155
+ # → auth-service
156
+
157
+ # Find last completed task
158
+ bash runtime/persistence/store.sh list "execution:task_*:status"
159
+ # → task_1: complete, task_2: complete, task_3: in_progress, task_4: pending
160
+
161
+ # Assess task_3: was it actually completed?
162
+ # Check: does the output exist? Do tests pass?
163
+ # If yes → mark complete, continue from task_4
164
+ # If no → re-execute task_3 from scratch
165
+ ```
166
+
167
+ **Without runtime:** Check git log for the last committed task, verify its done criteria, continue from the next task.
168
+
169
+ **Key principle:** Never assume a task is complete because it was started. Verify the done criteria on resume.
170
+
171
+ ### Scope Change During Execution
172
+
173
+ If requirements change mid-execution:
174
+
175
+ 1. **Stop** — don't continue executing the current plan
176
+ 2. **Assess** — how many tasks are invalidated by the change?
177
+ 3. **If < 20% of tasks affected:** modify affected tasks in place, re-verify done criteria
178
+ 4. **If > 20% of tasks affected:** return to `writing-plans` — the plan needs revision
179
+ 5. **Document the change** — what changed and why, update the plan document
180
+
181
+ Never silently adjust scope while executing. Make the change explicit.
182
+
183
+ ### Progress Reporting
184
+
185
+ When asked for progress, report against the plan:
186
+
187
+ ```
188
+ Plan: auth-service (8 tasks)
189
+ Progress: 5/8 complete (62.5%)
190
+
191
+ ✓ Task 1: Database schema
192
+ ✓ Task 2: Repository layer
193
+ ✓ Task 3: Service layer
194
+ ✓ Task 4: Auth middleware
195
+ ✓ Task 5: JWT utilities
196
+ ⟳ Task 6: Protected routes (in progress)
197
+ Task 7: Integration tests (pending)
198
+ Task 8: Documentation (pending)
199
+
200
+ Current: Implementing route guards for admin endpoints
201
+ ETA: ~12 min remaining
202
+ Blockers: None
203
+ ```
204
+
205
+ ## ClawPowers Enhancement
206
+
207
+ When `~/.clawpowers/` runtime is initialized:
208
+
209
+ **Milestone Persistence:** Every task completion and milestone hit is saved to `~/.clawpowers/state/`. If your laptop crashes at Task 6 of 8, you resume from Task 7, not Task 1.
210
+
211
+ ```bash
212
+ # Full execution history on resume
213
+ bash runtime/persistence/store.sh list "execution:*"
214
+ ```
215
+
216
+ **Progress Dashboard:** Generate a real-time execution report:
217
+
218
+ ```bash
219
+ bash runtime/feedback/analyze.sh --plan auth-service
220
+ # Output:
221
+ # Plan: auth-service
222
+ # Duration so far: 47 min (estimated 60 min total)
223
+ # Tasks: 5/8 complete
224
+ # Velocity: 1 task / 9.4 min (plan estimated: 1/7.5 min)
225
+ # Projected completion: +13 min
226
+ # Warning: Task 3 took 24 min vs estimated 5 min (spec was underspecified)
227
+ ```
228
+
229
+ **Interruption Recovery Statistics:** Tracks how often execution is interrupted and how long recovery takes, informing optimal checkpoint frequency.
230
+
231
+ **Rework Tracking:** When a task must be re-executed (done criteria failed), records the cause:
232
+ - Spec was ambiguous (improve `writing-plans`)
233
+ - Dependency missing (improve dependency mapping)
234
+ - Requirement changed (flag as scope change, not rework)
235
+ - Implementation error (improve task verification step)
236
+
237
+ ## Anti-Patterns
238
+
239
+ | Anti-Pattern | Why It Fails | Correct Approach |
240
+ |-------------|-------------|-----------------|
241
+ | Skipping done criteria verification | Tasks appear complete but aren't | Verify every criterion explicitly |
242
+ | Expanding task scope mid-execution | Creates unanticipated dependencies | Strict scope adherence; new scope = new task |
243
+ | Proceeding past a failed task | Subsequent tasks build on broken foundation | Stop, fix, re-verify, then continue |
244
+ | Not committing per task | Can't identify which task introduced a bug | Commit every task completion |
245
+ | Ignoring parallel opportunities | Sequential execution of parallel-safe tasks wastes time | Dispatch parallel tasks concurrently |
246
+ | Silently adjusting requirements | Plan/reality divergence | Explicit scope change protocol |
247
+ | Skipping milestone verification | Integration problems discovered late | Verify at every phase boundary |
248
+
249
+ ## Integration with Other Skills
250
+
251
+ - Preceded by `writing-plans` (plan must exist before execution)
252
+ - Use `subagent-driven-development` for parallel task dispatch
253
+ - Use `using-git-worktrees` for concurrent task isolation
254
+ - Followed by `verification-before-completion` before merging
255
+ - Use `systematic-debugging` when a task fails unexpectedly
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: finishing-a-development-branch
3
+ description: Clean up a completed feature branch, write changelog entry, optimize commit history, and prepare for merge. Activate when feature work is done and verified.
4
+ version: 1.0.0
5
+ requires:
6
+ tools: [git, bash]
7
+ runtime: false
8
+ metrics:
9
+ tracks: [squash_accuracy, changelog_quality, merge_conflicts, review_cycles_after_finish]
10
+ improves: [commit_message_quality, squash_strategy, changelog_format]
11
+ ---
12
+
13
+ # Finishing a Development Branch
14
+
15
+ ## When to Use
16
+
17
+ Apply this skill after:
18
+
19
+ - `verification-before-completion` passes all gates
20
+ - The feature is functionally complete
21
+ - You're ready to open a PR or merge to main
22
+
23
+ **Don't start this skill until verification passes.** Finishing a bad branch just makes it a clean bad branch.
24
+
25
+ ## Core Methodology
26
+
27
+ ### Step 1: Final State Verification
28
+
29
+ Before touching the branch:
30
+
31
+ ```bash
32
+ git status # Clean working tree (nothing unstaged)
33
+ git log --oneline main..HEAD # All your commits, review them
34
+ git diff main...HEAD # Full diff against main
35
+ ```
36
+
37
+ If there are uncommitted changes: commit them or stash them. If there are WIP commits ("temp", "wip", "debugging"), they need to be cleaned up in Step 3.
38
+
39
+ ### Step 2: Changelog Entry
40
+
41
+ Write the changelog before squashing. You have the full commit history available now — use it.
42
+
43
+ **Format:** Follow [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) conventions:
44
+
45
+ ```markdown
46
+ ## [Unreleased]
47
+
48
+ ### Added
49
+ - JWT-based authentication with RS256 signing (`auth.issue()`, `auth.validate()`)
50
+ - Session management with configurable TTL
51
+ - User registration endpoint with email verification flow
52
+
53
+ ### Changed
54
+ - `UserService.create()` now requires email verification before login is permitted
55
+
56
+ ### Fixed
57
+ - Connection pool exhaustion under concurrent load (was not releasing connections in error paths)
58
+
59
+ ### Security
60
+ - Added bcrypt password hashing (cost factor 12)
61
+ - Rate limiting on auth endpoints (10 req/min per IP)
62
+ ```
63
+
64
+ **Categories:**
65
+ - `Added` — New features
66
+ - `Changed` — Changes to existing functionality
67
+ - `Deprecated` — Soon-to-be-removed features
68
+ - `Removed` — Removed features
69
+ - `Fixed` — Bug fixes
70
+ - `Security` — Security-related changes
71
+
72
+ **Rules:**
73
+ - Write for humans, not for git log readers
74
+ - Link to issue numbers if they exist: `(#123)`
75
+ - Be specific about what changed, not how it changed
76
+ - One changelog entry per PR, not per commit
77
+
78
+ ### Step 3: Commit History Optimization
79
+
80
+ Review all commits between your branch and main:
81
+
82
+ ```bash
83
+ git log --oneline main..HEAD
84
+ ```
85
+
86
+ **Squash strategy:**
87
+
88
+ | Commit pattern | Action |
89
+ |---------------|--------|
90
+ | `wip`, `temp`, `debug` commits | Squash into parent |
91
+ | Multiple tiny commits for same logical change | Squash into one |
92
+ | Fix commits for mistakes in the same PR | Squash into the commit being fixed |
93
+ | Logical, independent changes | Keep separate |
94
+ | Each commit is one testable unit | Keep as-is |
95
+
96
+ **Interactive rebase:**
97
+ ```bash
98
+ git rebase -i main
99
+ # Opens editor — mark commits as:
100
+ # pick: keep as-is
101
+ # squash (s): merge into previous commit
102
+ # fixup (f): merge into previous commit, discard this commit's message
103
+ # reword (r): keep but edit the message
104
+ ```
105
+
106
+ **After squash, verify:**
107
+ ```bash
108
+ git log --oneline main..HEAD # Should show clean, logical commits
109
+ git diff main...HEAD # Diff should be identical to before squash
110
+ ```
111
+
112
+ ### Step 4: Conventional Commit Messages
113
+
114
+ Each remaining commit must use Conventional Commits format:
115
+
116
+ ```
117
+ <type>[optional scope]: <description>
118
+
119
+ [optional body]
120
+
121
+ [optional footer(s)]
122
+ ```
123
+
124
+ **Types:**
125
+ - `feat`: New feature (triggers MINOR version bump)
126
+ - `fix`: Bug fix (triggers PATCH version bump)
127
+ - `perf`: Performance improvement
128
+ - `refactor`: Code restructuring (no behavior change)
129
+ - `test`: Adding or fixing tests
130
+ - `docs`: Documentation only
131
+ - `ci`: CI/CD configuration
132
+ - `chore`: Dependency updates, tooling
133
+
134
+ **Breaking changes:** Add `!` after type or `BREAKING CHANGE:` footer
135
+ ```
136
+ feat!: remove deprecated V1 auth endpoints
137
+
138
+ BREAKING CHANGE: /api/v1/login and /api/v1/logout have been removed.
139
+ Use /api/v2/auth/login and /api/v2/auth/logout instead.
140
+ ```
141
+
142
+ **Examples:**
143
+ ```
144
+ feat(auth): implement JWT authentication with RS256 signing
145
+ fix(auth): release connection in error path of process_payment
146
+ perf(cache): add Redis-backed session cache for hot paths
147
+ ```
148
+
149
+ ### Step 5: Branch Cleanup Check
150
+
151
+ ```bash
152
+ # Verify the branch builds and tests pass after rebase
153
+ git checkout feature/auth
154
+ # [run test suite]
155
+ pytest # or npm test or go test ./...
156
+
157
+ # Verify clean diff (no accidental deletions)
158
+ git diff main...HEAD --stat
159
+ ```
160
+
161
+ ### Step 6: PR Description
162
+
163
+ Write the PR description while everything is fresh:
164
+
165
+ ```markdown
166
+ ## Summary
167
+
168
+ [2-3 sentences: what this PR does and why]
169
+
170
+ ## Changes
171
+
172
+ - [Key change 1]
173
+ - [Key change 2]
174
+ - [Key change 3]
175
+
176
+ ## Testing
177
+
178
+ - [What tests cover this change]
179
+ - [Any manual testing done]
180
+ - [Edge cases explicitly tested]
181
+
182
+ ## Breaking Changes
183
+
184
+ [None / description of any breaking changes]
185
+
186
+ ## Screenshots / Output
187
+
188
+ [If UI or CLI output changed, show before/after]
189
+
190
+ ## Checklist
191
+
192
+ - [x] Tests pass (127 passing, 0 failing)
193
+ - [x] Coverage ≥ 80% (84% for new code)
194
+ - [x] No linting errors
195
+ - [x] CHANGELOG updated
196
+ - [x] Documentation updated
197
+ ```
198
+
199
+ ### Step 7: Final Push
200
+
201
+ ```bash
202
+ git push origin feature/auth-service
203
+ # If after rebase:
204
+ git push origin feature/auth-service --force-with-lease # Never --force alone
205
+ ```
206
+
207
+ `--force-with-lease` is safe: it rejects the push if the remote branch has changed since your last fetch, preventing overwriting someone else's work.
208
+
209
+ ## ClawPowers Enhancement
210
+
211
+ When `~/.clawpowers/` runtime is initialized:
212
+
213
+ **Automated Squash Strategy:**
214
+
215
+ Based on commit history patterns, the framework suggests optimal squash boundaries:
216
+ ```bash
217
+ bash runtime/persistence/store.sh get "config:branch-finish:squash_strategy"
218
+ # → logical_units (keep separate commits per feature unit)
219
+ # → single_commit (squash entire branch to one commit for hotfixes)
220
+ ```
221
+
222
+ **Conventional Commit Enforcement:**
223
+
224
+ Before the push step, validate all commit messages:
225
+ ```bash
226
+ bash runtime/persistence/store.sh get "config:branch-finish:conventional_commits"
227
+ # → strict (reject non-conforming messages)
228
+ # → warn (flag but allow)
229
+ ```
230
+
231
+ **Changelog Quality Scoring:**
232
+
233
+ Stores past changelog entries and scores them on:
234
+ - Specificity (named functions/endpoints vs. vague descriptions)
235
+ - Completeness (all changes captured)
236
+ - Human readability
237
+
238
+ ```bash
239
+ bash runtime/metrics/collector.sh record \
240
+ --skill finishing-a-development-branch \
241
+ --outcome success \
242
+ --notes "auth-service: 12 commits → 4, conventional commits enforced, changelog written"
243
+ ```
244
+
245
+ ## Anti-Patterns
246
+
247
+ | Anti-Pattern | Why It Fails | Correct Approach |
248
+ |-------------|-------------|-----------------|
249
+ | Squashing all commits to one regardless of size | Loses traceability for large PRs | Squash to logical units, not one blob |
250
+ | `--force` push (not `--force-with-lease`) | Overwrites teammates' commits silently | Always `--force-with-lease` |
251
+ | Vague changelog ("various fixes") | Useless for users and future developers | Specific, named changes with context |
252
+ | Writing PR description after review starts | Reviewers lack context | Write description before requesting review |
253
+ | Not verifying after rebase | Rebase conflicts silently break behavior | Run full test suite after any rebase |
254
+ | WIP commits in merged history | Pollutes git log | Squash WIP commits unconditionally |
255
+
256
+ ## Integration with Other Skills
257
+
258
+ - Preceded by `verification-before-completion`
259
+ - Followed by `requesting-code-review`
260
+ - Use `using-git-worktrees` if finishing one of several concurrent branches