clawpowers 1.1.3 → 2.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 (74) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/LICENSE +44 -0
  3. package/README.md +202 -384
  4. package/SECURITY.md +72 -0
  5. package/dist/index.d.ts +844 -0
  6. package/dist/index.js +2536 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +52 -42
  9. package/.claude-plugin/manifest.json +0 -19
  10. package/.codex/INSTALL.md +0 -36
  11. package/.cursor-plugin/manifest.json +0 -21
  12. package/.opencode/INSTALL.md +0 -52
  13. package/ARCHITECTURE.md +0 -69
  14. package/bin/clawpowers.js +0 -625
  15. package/bin/clawpowers.sh +0 -91
  16. package/docs/demo/clawpowers-demo.cast +0 -197
  17. package/docs/demo/clawpowers-demo.gif +0 -0
  18. package/docs/launch-images/25-skills-breakdown.jpg +0 -0
  19. package/docs/launch-images/clawpowers-vs-superpowers.jpg +0 -0
  20. package/docs/launch-images/economic-code-optimization.jpg +0 -0
  21. package/docs/launch-images/native-vs-bridge-2.jpg +0 -0
  22. package/docs/launch-images/native-vs-bridge.jpg +0 -0
  23. package/docs/launch-images/post1-hero-lobster.jpg +0 -0
  24. package/docs/launch-images/post2-dashboard.jpg +0 -0
  25. package/docs/launch-images/post3-superpowers.jpg +0 -0
  26. package/docs/launch-images/post4-before-after.jpg +0 -0
  27. package/docs/launch-images/post5-install-now.jpg +0 -0
  28. package/docs/launch-images/ultimate-stack.jpg +0 -0
  29. package/docs/launch-posts.md +0 -76
  30. package/docs/quickstart-first-transaction.md +0 -204
  31. package/gemini-extension.json +0 -32
  32. package/hooks/session-start +0 -205
  33. package/hooks/session-start.cmd +0 -43
  34. package/hooks/session-start.js +0 -163
  35. package/runtime/demo/README.md +0 -78
  36. package/runtime/demo/x402-mock-server.js +0 -230
  37. package/runtime/feedback/analyze.js +0 -621
  38. package/runtime/feedback/analyze.sh +0 -546
  39. package/runtime/init.js +0 -210
  40. package/runtime/init.sh +0 -178
  41. package/runtime/metrics/collector.js +0 -361
  42. package/runtime/metrics/collector.sh +0 -308
  43. package/runtime/payments/ledger.js +0 -305
  44. package/runtime/payments/ledger.sh +0 -262
  45. package/runtime/payments/pipeline.js +0 -459
  46. package/runtime/persistence/store.js +0 -433
  47. package/runtime/persistence/store.sh +0 -303
  48. package/skill.json +0 -106
  49. package/skills/agent-bounties/SKILL.md +0 -553
  50. package/skills/agent-payments/SKILL.md +0 -479
  51. package/skills/brainstorming/SKILL.md +0 -233
  52. package/skills/content-pipeline/SKILL.md +0 -282
  53. package/skills/cross-project-knowledge/SKILL.md +0 -345
  54. package/skills/dispatching-parallel-agents/SKILL.md +0 -305
  55. package/skills/economic-code-optimization/SKILL.md +0 -265
  56. package/skills/executing-plans/SKILL.md +0 -255
  57. package/skills/finishing-a-development-branch/SKILL.md +0 -260
  58. package/skills/formal-verification-lite/SKILL.md +0 -441
  59. package/skills/learn-how-to-learn/SKILL.md +0 -235
  60. package/skills/market-intelligence/SKILL.md +0 -323
  61. package/skills/meta-skill-evolution/SKILL.md +0 -325
  62. package/skills/prospecting/SKILL.md +0 -454
  63. package/skills/receiving-code-review/SKILL.md +0 -225
  64. package/skills/requesting-code-review/SKILL.md +0 -206
  65. package/skills/security-audit/SKILL.md +0 -353
  66. package/skills/self-healing-code/SKILL.md +0 -369
  67. package/skills/subagent-driven-development/SKILL.md +0 -244
  68. package/skills/systematic-debugging/SKILL.md +0 -355
  69. package/skills/test-driven-development/SKILL.md +0 -416
  70. package/skills/using-clawpowers/SKILL.md +0 -160
  71. package/skills/using-git-worktrees/SKILL.md +0 -261
  72. package/skills/verification-before-completion/SKILL.md +0 -254
  73. package/skills/writing-plans/SKILL.md +0 -276
  74. package/skills/writing-skills/SKILL.md +0 -260
@@ -1,261 +0,0 @@
1
- ---
2
- name: using-git-worktrees
3
- description: Manage isolated Git worktrees for parallel branch development. Activate when you need to work on multiple branches simultaneously or isolate subagent work.
4
- version: 1.0.0
5
- requires:
6
- tools: [git, bash]
7
- runtime: false
8
- metrics:
9
- tracks: [worktrees_created, conflicts_encountered, isolation_violations, lifecycle_completion_rate]
10
- improves: [conflict_prediction, worktree_naming, cleanup_timing]
11
- ---
12
-
13
- # Using Git Worktrees
14
-
15
- ## When to Use
16
-
17
- Apply this skill when:
18
-
19
- - Working on 2+ branches simultaneously without switching
20
- - Running subagents in parallel (each needs its own working directory)
21
- - Testing a feature while bug-fixing on another branch
22
- - Reviewing a colleague's branch while continuing your own work
23
- - Running long-running processes (tests, builds) on one branch while editing another
24
-
25
- **Skip when:**
26
- - You only have one branch active at a time
27
- - Your editor doesn't handle multiple root directories well
28
- - The branches share files that would conflict on disk (same path, different content)
29
-
30
- ## Core Methodology
31
-
32
- ### Understanding Worktrees
33
-
34
- A Git worktree is a separate working directory linked to the same repository. Each worktree:
35
- - Has its own checked-out branch
36
- - Has its own working tree state (staged/unstaged changes)
37
- - Shares the repository's history, objects, and refs
38
- - Cannot have the same branch checked out as another worktree
39
-
40
- ```
41
- .git/ ← Shared repository database
42
- worktrees/
43
- feature-auth/ ← Worktree metadata
44
- feature-payments/ ← Worktree metadata
45
-
46
- ../feature-auth/ ← Separate directory on disk
47
- src/
48
- tests/
49
-
50
- ../feature-payments/ ← Separate directory on disk
51
- src/
52
- tests/
53
- ```
54
-
55
- ### Worktree Lifecycle
56
-
57
- #### Create
58
-
59
- ```bash
60
- # Create worktree for existing branch
61
- git worktree add ../feature-auth feature/auth-service
62
-
63
- # Create worktree and new branch simultaneously
64
- git worktree add -b feature/payments ../feature-payments main
65
-
66
- # Create worktree from specific commit
67
- git worktree add ../hotfix-3.1 v3.1.0
68
- ```
69
-
70
- **Naming convention for parallel subagent work:**
71
- ```bash
72
- # Use task or feature name as both branch and directory
73
- git worktree add ../clawpowers-task-auth feature/task-auth
74
- git worktree add ../clawpowers-task-db feature/task-db
75
- git worktree add ../clawpowers-task-api feature/task-api
76
- ```
77
-
78
- #### Verify
79
-
80
- ```bash
81
- git worktree list
82
- # output:
83
- # /Users/you/project a3f9b2c [main]
84
- # /Users/you/feature-auth 0000000 [feature/auth-service]
85
- # /Users/you/feature-payments 0000000 [feature/payments]
86
- ```
87
-
88
- #### Work in the Worktree
89
-
90
- Each worktree is a full working directory. Navigate to it and work normally:
91
-
92
- ```bash
93
- cd ../feature-auth
94
- git status # Independent of main working tree
95
- git add src/auth.py
96
- git commit -m "feat(auth): implement JWT issuance"
97
- ```
98
-
99
- Changes in one worktree are invisible to others until merged.
100
-
101
- #### Sync with Main
102
-
103
- When you need to update a worktree with latest main:
104
-
105
- ```bash
106
- cd ../feature-auth
107
- git fetch origin
108
- git rebase origin/main # Preferred: linear history
109
- # or
110
- git merge origin/main # If rebase would cause conflicts
111
- ```
112
-
113
- Run `git worktree list` first — if another worktree has the same base, check for merge conflicts proactively.
114
-
115
- #### Cleanup
116
-
117
- When the branch is merged:
118
-
119
- ```bash
120
- # From main repository directory
121
- git worktree remove ../feature-auth # Removes directory
122
- git branch -d feature/auth-service # Remove branch
123
-
124
- # If the worktree has uncommitted changes and you want to force:
125
- git worktree remove --force ../feature-auth
126
-
127
- # List remaining worktrees to verify
128
- git worktree list
129
- ```
130
-
131
- **Cleanup checklist:**
132
- - [ ] Branch is merged to main (or PR is approved)
133
- - [ ] Worktree has no uncommitted changes
134
- - [ ] No processes are running in the worktree directory
135
- - [ ] Remove directory, then remove branch
136
-
137
- ### Conflict Prevention
138
-
139
- Worktrees share the index but have separate working trees. Common conflicts:
140
-
141
- **Same branch in two worktrees:** Git prevents this — you'll get an error:
142
- ```
143
- fatal: 'feature/auth-service' is already checked out
144
- ```
145
-
146
- **Solution:** Use separate branches even for related work.
147
-
148
- **Both worktrees editing the same file:** Legal, but merging will require conflict resolution:
149
- ```bash
150
- # Check overlap before creating worktrees
151
- git diff --name-only main..feature/branch-a
152
- git diff --name-only main..feature/branch-b
153
- # If outputs overlap, consider sequential rather than parallel work
154
- ```
155
-
156
- **Submodule issues:** Worktrees and submodules interact poorly. If your repo uses submodules, test worktree creation in a non-submodule path first.
157
-
158
- ### Pattern: Subagent Work Isolation
159
-
160
- The primary ClawPowers use case: give each subagent its own worktree.
161
-
162
- ```bash
163
- # Main orchestrator creates worktrees
164
- TASKS=("auth" "db" "api" "tests")
165
- for task in "${TASKS[@]}"; do
166
- git worktree add "../${REPO_NAME}-task-${task}" -b "feature/task-${task}" main
167
- echo "Created worktree for task-${task} at ../${REPO_NAME}-task-${task}"
168
- done
169
-
170
- # Each subagent receives its worktree path
171
- # Subagent-auth works in: ../project-task-auth/
172
- # Subagent-db works in: ../project-task-db/
173
- # They cannot interfere with each other's files
174
-
175
- # After all subagents complete, merge in dependency order
176
- MERGE_ORDER=("db" "auth" "api" "tests")
177
- git checkout main
178
- for task in "${MERGE_ORDER[@]}"; do
179
- git merge --no-ff "feature/task-${task}" -m "merge: task-${task}"
180
- git worktree remove "../${REPO_NAME}-task-${task}"
181
- git branch -d "feature/task-${task}"
182
- done
183
- ```
184
-
185
- ### Pattern: Hotfix While Feature Work Continues
186
-
187
- ```bash
188
- # You're in the middle of a long feature
189
- git worktree list
190
- # /Users/you/project [feature/auth-service]
191
-
192
- # Production alert fires — need to hotfix
193
- git worktree add ../hotfix main
194
- cd ../hotfix
195
- # ... fix the bug ...
196
- git commit -m "fix: critical payment timeout in production"
197
- git push origin hotfix/payment-timeout
198
- # PR/merge the hotfix from this worktree
199
-
200
- # Back to feature work
201
- cd ../project # Original feature work untouched
202
- git status # Clean, feature work is exactly where you left it
203
- ```
204
-
205
- ## ClawPowers Enhancement
206
-
207
- When `~/.clawpowers/` runtime is initialized:
208
-
209
- **Worktree Lifecycle Management:**
210
-
211
- ```bash
212
- # Register a worktree
213
- bash runtime/persistence/store.sh set "worktree:task-auth:path" "../project-task-auth"
214
- bash runtime/persistence/store.sh set "worktree:task-auth:branch" "feature/task-auth"
215
- bash runtime/persistence/store.sh set "worktree:task-auth:status" "active"
216
- bash runtime/persistence/store.sh set "worktree:task-auth:created_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
217
-
218
- # List all active worktrees with their status
219
- bash runtime/persistence/store.sh list "worktree:*:status"
220
- ```
221
-
222
- If a session is interrupted, the worktree registry shows which are active and which branches they hold — preventing orphaned worktrees.
223
-
224
- **Conflict Prediction:**
225
-
226
- Before creating parallel worktrees, the framework checks for file overlap:
227
-
228
- ```bash
229
- # For each planned worktree pair, check for overlapping file changes
230
- # High overlap = schedule sequentially; low overlap = safe to parallelize
231
- bash runtime/persistence/store.sh set "worktree:conflict_check:task-auth_vs_task-db" "no_overlap"
232
- ```
233
-
234
- **Cleanup Automation:**
235
-
236
- After merge detection, automatically prompt for worktree cleanup:
237
-
238
- ```bash
239
- bash runtime/feedback/analyze.sh --worktrees
240
- # Output:
241
- # Merged branches with active worktrees:
242
- # - feature/task-auth (merged 3 hours ago) → worktree at ../project-task-auth
243
- # Run: git worktree remove ../project-task-auth && git branch -d feature/task-auth
244
- ```
245
-
246
- ## Anti-Patterns
247
-
248
- | Anti-Pattern | Why It Fails | Correct Approach |
249
- |-------------|-------------|-----------------|
250
- | Checking out same branch in two worktrees | Git prevents this — error on checkout | Each worktree must have a unique branch |
251
- | Never cleaning up worktrees | Disk fills up, confusion about active branches | Cleanup immediately after branch merges |
252
- | `--force` on worktree with uncommitted work | Loses uncommitted changes permanently | Commit or stash before removing |
253
- | Parallel worktrees editing the same file | Merge conflicts on integration | Check file overlap before creating parallel worktrees |
254
- | Forgetting which worktree you're in | Wrong branch gets commits | `git worktree list` before committing |
255
- | Long-lived worktrees diverging from main | Painful rebase/merge on integration | Regularly sync worktrees with `git rebase origin/main` |
256
-
257
- ## Integration with Other Skills
258
-
259
- - Used by `subagent-driven-development` for task isolation
260
- - Used by `dispatching-parallel-agents` for concurrent work
261
- - Used by `finishing-a-development-branch` when cleaning up
@@ -1,254 +0,0 @@
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