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,19 @@
1
+ {
2
+ "name": "clawpowers",
3
+ "version": "1.0.0",
4
+ "description": "Skills framework with runtime execution, persistent memory, self-improvement, and agent payments.",
5
+ "author": "AI Agent Economy",
6
+ "homepage": "https://github.com/up2itnow0822/clawpowers",
7
+ "license": "MIT",
8
+ "hooks": {
9
+ "session_start": "hooks/session-start"
10
+ },
11
+ "skills_directory": "skills/",
12
+ "runtime_directory": "runtime/",
13
+ "capabilities": [
14
+ "skill_injection",
15
+ "persistent_state",
16
+ "outcome_metrics",
17
+ "rsi_feedback"
18
+ ]
19
+ }
@@ -0,0 +1,36 @@
1
+ # ClawPowers for Codex — Installation
2
+
3
+ Fetch and follow these instructions to install ClawPowers skills in your Codex session.
4
+
5
+ ## Quick Install
6
+
7
+ Paste this into your Codex session:
8
+
9
+ ```
10
+ Fetch and follow instructions from https://raw.githubusercontent.com/up2itnow0822/clawpowers/main/.codex/INSTALL.md
11
+ ```
12
+
13
+ ## What Gets Installed
14
+
15
+ ClawPowers injects 20 skills into your agent context:
16
+
17
+ - **14 Core Development Skills** — TDD, subagent orchestration, systematic debugging, code review, git worktrees, planning, and more
18
+ - **6 Extended Skills** — Agent payments (x402), security auditing, content pipeline, market intelligence, lead prospecting, and metacognitive learning
19
+
20
+ ## Manual Setup
21
+
22
+ If the quick install fails, copy the contents of `skills/using-clawpowers/SKILL.md` from the repository root and paste it into your Codex session context.
23
+
24
+ ## Runtime Layer (Optional)
25
+
26
+ For persistent memory and self-improvement features:
27
+
28
+ ```bash
29
+ npx clawpowers init
30
+ ```
31
+
32
+ This creates `~/.clawpowers/` with state, metrics, checkpoints, and feedback directories.
33
+
34
+ ## Skills Reference
35
+
36
+ Once installed, skills activate automatically when Codex recognizes matching task patterns. See `skills/using-clawpowers/SKILL.md` for the full trigger map.
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "clawpowers",
3
+ "version": "1.0.0",
4
+ "description": "Skills framework with runtime execution, persistent memory, self-improvement, and agent payments for Cursor AI.",
5
+ "author": "AI Agent Economy",
6
+ "homepage": "https://github.com/up2itnow0822/clawpowers",
7
+ "license": "MIT",
8
+ "hooks": {
9
+ "session_start": "hooks/session-start"
10
+ },
11
+ "skills_directory": "skills/",
12
+ "runtime_directory": "runtime/",
13
+ "inject_on_start": true,
14
+ "inject_skill": "using-clawpowers",
15
+ "capabilities": [
16
+ "skill_injection",
17
+ "persistent_state",
18
+ "outcome_metrics",
19
+ "rsi_feedback"
20
+ ]
21
+ }
@@ -0,0 +1,52 @@
1
+ # ClawPowers for OpenCode — Installation
2
+
3
+ Fetch and follow these instructions to install ClawPowers skills in your OpenCode session.
4
+
5
+ ## Quick Install
6
+
7
+ Paste this into your OpenCode session:
8
+
9
+ ```
10
+ Fetch and follow instructions from https://raw.githubusercontent.com/up2itnow0822/clawpowers/main/.opencode/INSTALL.md
11
+ ```
12
+
13
+ ## What Gets Installed
14
+
15
+ ClawPowers injects 20 skills into your agent context:
16
+
17
+ - **14 Core Development Skills** — TDD, subagent orchestration, systematic debugging, code review, git worktrees, planning, and more
18
+ - **6 Extended Skills** — Agent payments (x402), security auditing, content pipeline, market intelligence, lead prospecting, and metacognitive learning
19
+
20
+ ## Session Hook Setup
21
+
22
+ To auto-inject ClawPowers on every OpenCode session start, add to your OpenCode configuration:
23
+
24
+ ```json
25
+ {
26
+ "hooks": {
27
+ "session_start": "bash /path/to/clawpowers/hooks/session-start"
28
+ }
29
+ }
30
+ ```
31
+
32
+ ## Manual Context Injection
33
+
34
+ Copy the contents of `skills/using-clawpowers/SKILL.md` and prepend it to your OpenCode session context. This gives you all skill triggers without the runtime layer.
35
+
36
+ ## Runtime Layer (Optional)
37
+
38
+ For persistent memory, outcome tracking, and self-improvement:
39
+
40
+ ```bash
41
+ npx clawpowers init
42
+ ```
43
+
44
+ Creates `~/.clawpowers/` with:
45
+ - `state/` — cross-session key-value store
46
+ - `metrics/` — JSONL outcome logs per skill
47
+ - `checkpoints/` — resumable workflow state
48
+ - `feedback/` — RSI analysis outputs
49
+
50
+ ## Skills Reference
51
+
52
+ Skills activate on pattern recognition. See `skills/using-clawpowers/SKILL.md` for the full list of 20 skills and their trigger conditions.
@@ -0,0 +1,69 @@
1
+ # ClawPowers Architecture
2
+
3
+ ## Design Principles
4
+
5
+ 1. **Skills execute, not just instruct.** Every skill can invoke tools, persist state, and measure outcomes.
6
+ 2. **Simplicity is a feature.** Complex functionality, simple interface. One SKILL.md per skill. Zero mandatory dependencies.
7
+ 3. **Progressive enhancement.** Works as static markdown (like competitors). Gains runtime powers when the persistence layer is available.
8
+ 4. **Platform-agnostic.** Same skills, same format, every platform: Claude Code, Cursor, Codex, OpenCode, Gemini CLI.
9
+ 5. **Self-improving.** The system gets better at helping you the more you use it.
10
+
11
+ ## Skill Format
12
+
13
+ Every skill is a directory containing a `SKILL.md` with YAML frontmatter:
14
+
15
+ ```yaml
16
+ ---
17
+ name: skill-name
18
+ description: When to trigger this skill
19
+ version: 1.0.0
20
+ requires:
21
+ tools: [] # Optional: CLI tools needed (e.g., git, npm, trivy)
22
+ runtime: false # Optional: true if skill needs persistence layer
23
+ metrics:
24
+ tracks: [] # What outcomes this skill measures
25
+ improves: [] # What parameters RSI can adjust
26
+ ---
27
+ ```
28
+
29
+ ## Runtime Layer (Optional, Additive)
30
+
31
+ The runtime layer lives at `~/.clawpowers/` and provides three services:
32
+
33
+ ### 1. Persistence (`runtime/persistence/`)
34
+ - File-based key-value store for cross-session state
35
+ - Checkpoint system for resumable workflows
36
+ - Schema: flat file key-value store under `state/`
37
+
38
+ ### 2. Metrics (`runtime/metrics/`)
39
+ - Outcome tracking per skill execution
40
+ - Time-to-completion, success rate, error patterns
41
+ - Statistical process control for anomaly detection
42
+ - Export to JSON for dashboard consumption
43
+
44
+ ### 3. Feedback (`runtime/feedback/`)
45
+ - RSI engine: measure → analyze → adapt cycle
46
+ - Parameter adjustment recommendations
47
+ - Skill effectiveness scoring
48
+ - Anti-pattern detection from execution history
49
+
50
+ ## Session Hook
51
+
52
+ The session-start hook (`hooks/session-start`) injects the `using-clawpowers` skill content into the agent context. This is the only mandatory injection — all other skills load on-demand via trigger matching.
53
+
54
+ The hook:
55
+ 1. Detects platform (Claude Code, Cursor, Codex, OpenCode, Gemini)
56
+ 2. Reads `skills/using-clawpowers/SKILL.md`
57
+ 3. Outputs platform-appropriate JSON for context injection
58
+ 4. Optionally initializes persistence layer if not present
59
+
60
+ ## Graceful Degradation
61
+
62
+ If the runtime layer is not installed:
63
+ - Skills still function as static methodology guides (same as competitors)
64
+ - Persistence features degrade to session-only memory
65
+ - Metrics are not collected
66
+ - RSI feedback is not available
67
+ - All extended skills that require tool execution note the limitation
68
+
69
+ This means ClawPowers works everywhere Superpowers works, and does more everywhere the runtime is available.
package/README.md ADDED
@@ -0,0 +1,381 @@
1
+ # 🦞 ClawPowers
2
+
3
+ **The skills framework that actually does something.**
4
+
5
+ ClawPowers gives your coding agent superpowers that go beyond instructions. While other frameworks hand your agent a reading list and hope for the best, ClawPowers gives it **runtime tools, persistent memory, self-improvement loops, and the ability to transact autonomously.**
6
+
7
+ ## Why ClawPowers?
8
+
9
+ | Feature | ClawPowers | Static Skills Frameworks |
10
+ |---------|-----------|--------------------------|
11
+ | Skills auto-load on session start | ✅ | ✅ |
12
+ | Runtime tool execution | ✅ | ❌ |
13
+ | Cross-session memory | ✅ | ❌ |
14
+ | Self-improvement (RSI) | ✅ | ❌ |
15
+ | Outcome tracking & metrics | ✅ | ❌ |
16
+ | Agent payments (x402) | ✅ | ❌ |
17
+ | Security scanning | ✅ | ❌ |
18
+ | Content pipeline | ✅ | ❌ |
19
+ | Market intelligence | ✅ | ❌ |
20
+ | Resumable workflows | ✅ | ❌ |
21
+ | Windows native support | ✅ | ❌ |
22
+ | Zero dependencies | ✅ | ✅ |
23
+
24
+ **20 skills.** 14 cover everything static frameworks do (TDD, subagent dev, debugging, planning, code review, git worktrees). 6 go where they can't — payments, security, content, prospecting, market intelligence, and metacognitive learning.
25
+
26
+ ## Requirements
27
+
28
+ - **Node.js >= 16** — for cross-platform runtime (Windows, macOS, Linux)
29
+ - **OR bash** — for Unix-native runtime (macOS, Linux, WSL2)
30
+ - **No other dependencies.** Zero. `package.json` has an empty `dependencies` object.
31
+
32
+ > Every user of Claude Code, Cursor, Codex, or Gemini CLI already has Node.js installed.
33
+ > No `requirements.txt` needed — this is not a Python project.
34
+
35
+ ## Installation
36
+
37
+ ### Universal (recommended — works on Windows, macOS, Linux)
38
+
39
+ ```bash
40
+ npx clawpowers init
41
+ ```
42
+
43
+ This downloads ClawPowers, creates the `~/.clawpowers/` runtime directory, and you're ready to go. Works in any terminal: Windows CMD, PowerShell, macOS Terminal, Linux shell.
44
+
45
+ ### OpenClaw
46
+
47
+ ```bash
48
+ openclaw skills install clawpowers
49
+ ```
50
+
51
+ Or install from GitHub directly:
52
+
53
+ ```bash
54
+ openclaw skills install github:up2itnow0822/clawpowers
55
+ ```
56
+
57
+ ClawPowers registers as a native OpenClaw skill with session hooks, runtime init, and all 20 skills auto-discoverable.
58
+
59
+ ### Claude Code (Plugin Marketplace)
60
+
61
+ ```bash
62
+ /plugin install clawpowers@claude-plugins-official
63
+ ```
64
+
65
+ Or register the marketplace first, then install:
66
+
67
+ ```bash
68
+ /plugin marketplace add up2itnow0822/clawpowers-marketplace
69
+ /plugin install clawpowers@clawpowers-marketplace
70
+ ```
71
+
72
+ ### Cursor
73
+
74
+ In Cursor Agent chat:
75
+
76
+ ```
77
+ /add-plugin clawpowers
78
+ ```
79
+
80
+ Or search for "clawpowers" in the Cursor plugin marketplace.
81
+
82
+ ### Codex
83
+
84
+ Tell Codex:
85
+
86
+ ```
87
+ Fetch and follow instructions from https://raw.githubusercontent.com/up2itnow0822/clawpowers/main/.codex/INSTALL.md
88
+ ```
89
+
90
+ ### OpenCode
91
+
92
+ Tell OpenCode:
93
+
94
+ ```
95
+ Fetch and follow instructions from https://raw.githubusercontent.com/up2itnow0822/clawpowers/main/.opencode/INSTALL.md
96
+ ```
97
+
98
+ ### Gemini CLI
99
+
100
+ ```bash
101
+ gemini extensions install https://github.com/up2itnow0822/clawpowers
102
+ ```
103
+
104
+ ### Manual (git clone)
105
+
106
+ ```bash
107
+ git clone https://github.com/up2itnow0822/clawpowers.git
108
+ cd clawpowers
109
+ node bin/clawpowers.js init # Windows, macOS, Linux
110
+ # or
111
+ bash bin/clawpowers.sh init # macOS, Linux only
112
+ ```
113
+
114
+ ### Verify Installation
115
+
116
+ Start a new session in your chosen platform and ask for something that triggers a skill — for example, "help me plan this feature" or "let's debug this issue." The agent should automatically apply the relevant ClawPowers skill.
117
+
118
+ Check runtime status anytime:
119
+
120
+ ```bash
121
+ npx clawpowers status
122
+ ```
123
+
124
+ ## What Makes ClawPowers Different
125
+
126
+ ### 1. Skills That Execute, Not Just Instruct
127
+
128
+ Static skills tell your agent *what to do*. ClawPowers skills can *do things themselves*:
129
+
130
+ - The **test-driven-development** skill doesn't just describe TDD — it runs mutation analysis on your tests to verify they actually catch bugs
131
+ - The **systematic-debugging** skill doesn't just list debugging steps — it maintains a persistent hypothesis tree across sessions so you never re-investigate the same dead end
132
+ - The **verification-before-completion** skill doesn't just say "verify" — it runs the actual verification suite and blocks completion until it passes
133
+
134
+ ### 2. Cross-Session Memory
135
+
136
+ Every ClawPowers skill can read from and write to a persistent state store. When your agent debugs an issue on Monday and encounters the same stack trace on Friday, it remembers what worked and what didn't. No more Groundhog Day debugging.
137
+
138
+ ```
139
+ ~/.clawpowers/
140
+ ├── state/ # Cross-session key-value store
141
+ ├── metrics/ # Outcome tracking per skill (JSONL)
142
+ ├── checkpoints/ # Resumable workflow state
143
+ ├── feedback/ # Self-improvement analysis
144
+ ├── memory/ # Persistent knowledge base
145
+ └── logs/ # Execution logs
146
+ ```
147
+
148
+ ### 3. Self-Improvement (RSI)
149
+
150
+ ClawPowers tracks what works and what doesn't. After every skill execution:
151
+
152
+ 1. **Measure** — Was the outcome successful? How long did it take? What went wrong?
153
+ 2. **Analyze** — Are there patterns in failures? Which task types need different approaches?
154
+ 3. **Adapt** — Adjust skill parameters, decomposition strategies, and review thresholds
155
+
156
+ ```bash
157
+ # Record an outcome
158
+ npx clawpowers metrics record --skill test-driven-development --outcome success --duration 1800
159
+
160
+ # Analyze performance
161
+ npx clawpowers analyze
162
+ ```
163
+
164
+ This isn't theoretical — it's the same RSI framework running in production trading systems with 268+ measured outcomes.
165
+
166
+ ### 4. Agent Payments (x402)
167
+
168
+ Your agent can pay for premium APIs, compute resources, and services autonomously — within smart-contract-enforced spending limits. No wallet draining. No surprise bills. Built on the payment infrastructure [integrated into NVIDIA's official NeMo Agent Toolkit](https://github.com/NVIDIA/NeMo-Agent-Toolkit-Examples/pull/17).
169
+
170
+ ### 5. Beyond Software Development
171
+
172
+ Static frameworks stop at coding methodology. ClawPowers includes skills for:
173
+
174
+ - **Security auditing** — Automated vulnerability scanning with Trivy, dependency checks, secret detection
175
+ - **Content pipeline** — Write, humanize, and publish technical content with platform-specific formatting
176
+ - **Market intelligence** — Research competitors, track trends, analyze opportunities
177
+ - **Prospecting** — Find leads matching your ICP, enrich contacts, output to CRM
178
+
179
+ ## Skills Reference
180
+
181
+ ### Core Development (14 skills)
182
+
183
+ | Skill | What It Does | Runtime Enhancement |
184
+ |-------|-------------|---------------------|
185
+ | `subagent-driven-development` | Orchestrate parallel subagents per task | Persistent execution DB, resumable checkpoints, outcome metrics |
186
+ | `test-driven-development` | RED-GREEN-REFACTOR enforcement | Mutation analysis, test portfolio management, effectiveness scoring |
187
+ | `writing-plans` | Spec → implementation plan | Historical task estimation, dependency validation, plan quality scoring |
188
+ | `executing-plans` | Execute plans with verification | Progress persistence, interruption recovery, milestone tracking |
189
+ | `brainstorming` | Structured ideation | Cross-session idea persistence, convergence tracking |
190
+ | `systematic-debugging` | Hypothesis-driven debugging | Persistent hypothesis tree, pattern matching against known issues |
191
+ | `verification-before-completion` | Pre-merge quality gates | Automated verification suite, historical pass rate tracking |
192
+ | `finishing-a-development-branch` | Branch cleanup and merge prep | Automated changelog, squash strategy optimization |
193
+ | `requesting-code-review` | Prepare and request review | Reviewer match scoring, review history |
194
+ | `receiving-code-review` | Process and implement feedback | Feedback pattern tracking, common issues database |
195
+ | `using-git-worktrees` | Isolated branch development | Worktree lifecycle management, conflict prediction |
196
+ | `using-clawpowers` | Meta-skill: how to use ClawPowers | Adaptive onboarding based on user skill level |
197
+ | `writing-skills` | Create new skills via TDD | Skill quality scoring, anti-pattern detection |
198
+ | `dispatching-parallel-agents` | Fan-out parallel execution | Load balancing, failure isolation, result aggregation |
199
+
200
+ ### Extended Capabilities (6 skills)
201
+
202
+ | Skill | What It Does | Why Static Frameworks Can't |
203
+ |-------|-------------|----------------------------|
204
+ | `agent-payments` | x402 payment protocol, spending limits, autonomous transactions | Requires runtime wallet interaction, smart contract calls |
205
+ | `security-audit` | Vulnerability scanning, secret detection, dependency audits | Requires tool execution (Trivy, gitleaks, npm audit) |
206
+ | `content-pipeline` | Write → humanize → format → publish | Requires API calls, platform auth, content transformation |
207
+ | `learn-how-to-learn` | Metacognitive protocols, anti-pattern detection, confidence calibration | Requires persistent learning state, outcome correlation |
208
+ | `market-intelligence` | Competitive analysis, trend detection, opportunity scoring | Requires web access, data aggregation, persistent tracking |
209
+ | `prospecting` | Lead generation, contact enrichment, CRM sync | Requires API calls (Exa, Apollo), structured output |
210
+
211
+ ## Architecture
212
+
213
+ ```
214
+ clawpowers/
215
+ ├── skills/ # 20 skill directories, each with SKILL.md
216
+ ├── runtime/
217
+ │ ├── persistence/ # Cross-session state (store.js + store.sh)
218
+ │ ├── metrics/ # Outcome tracking (collector.js + collector.sh)
219
+ │ ├── feedback/ # RSI self-improvement (analyze.js + analyze.sh)
220
+ │ ├── init.js # Cross-platform runtime setup
221
+ │ └── init.sh # Unix-native runtime setup
222
+ ├── hooks/
223
+ │ ├── session-start # Bash session hook (macOS/Linux)
224
+ │ ├── session-start.js # Node.js session hook (all platforms)
225
+ │ └── session-start.cmd # Windows batch wrapper
226
+ ├── bin/
227
+ │ ├── clawpowers.js # Cross-platform CLI (Windows/macOS/Linux)
228
+ │ └── clawpowers.sh # Unix-native CLI (macOS/Linux)
229
+ ├── plugins/ # Platform-specific plugin manifests
230
+ │ ├── .claude-plugin/ # Claude Code
231
+ │ ├── .cursor-plugin/ # Cursor
232
+ │ ├── .codex/ # Codex
233
+ │ ├── .opencode/ # OpenCode
234
+ │ └── gemini-extension.json # Gemini CLI
235
+ ├── tests/ # 366 test assertions
236
+ └── docs/ # Documentation
237
+ ```
238
+
239
+ **Dual runtime:** Every runtime script exists in both bash (`.sh`) and Node.js (`.js`). Unix users get native bash performance. Windows users get full functionality via Node.js. `npx clawpowers` auto-detects the best runtime for your platform.
240
+
241
+ ## Platform Support
242
+
243
+ | Platform | Windows | macOS | Linux | WSL2 |
244
+ |----------|---------|-------|-------|------|
245
+ | Claude Code | ✅ | ✅ | ✅ | ✅ |
246
+ | Cursor | ✅ | ✅ | ✅ | ✅ |
247
+ | Codex | ✅ | ✅ | ✅ | ✅ |
248
+ | OpenCode | ✅ | ✅ | ✅ | ✅ |
249
+ | Gemini CLI | ✅ | ✅ | ✅ | ✅ |
250
+
251
+ ## Runtime CLI Reference
252
+
253
+ ```bash
254
+ npx clawpowers init # Set up ~/.clawpowers/
255
+ npx clawpowers status # Runtime health check
256
+ npx clawpowers metrics record --skill <name> --outcome success|failure # Track outcome
257
+ npx clawpowers metrics show # View recent metrics
258
+ npx clawpowers metrics summary # Per-skill stats
259
+ npx clawpowers analyze # RSI performance analysis
260
+ npx clawpowers analyze --skill <name> # Analyze specific skill
261
+ npx clawpowers store set <key> <value> # Store persistent state
262
+ npx clawpowers store get <key> # Retrieve state
263
+ npx clawpowers store list [prefix] # List stored keys
264
+ ```
265
+
266
+ ## Security Model
267
+
268
+ ClawPowers takes agent autonomy seriously — which means taking agent *limits* seriously.
269
+
270
+ ### Runtime Isolation
271
+
272
+ - **State directory** (`~/.clawpowers/`) uses `700` permissions — owner-only access
273
+ - **Path traversal blocked** — keys containing `/` or `\` are rejected at the store level
274
+ - **No network access** — runtime scripts (store, metrics, analyze) are fully offline
275
+ - **No eval** — zero use of `eval()`, `Function()`, or dynamic code execution in any runtime script
276
+
277
+ ### Agent Payment Guardrails
278
+
279
+ The `agent-payments` skill uses `agentwallet-sdk` with hard on-chain spending limits:
280
+
281
+ ```
282
+ Agent wants to spend $15 → ✅ Auto-approved (under $25/tx limit)
283
+ Agent wants to spend $500 → ⏳ Queued for owner approval
284
+ Agent spent $490 today → 🛑 Next tx blocked ($500/day limit hit)
285
+ ```
286
+
287
+ - **Non-custodial** — your private key, your wallet. No third-party custody.
288
+ - **ERC-6551 token-bound accounts** — wallet is tied to an NFT. Portable, auditable, on-chain.
289
+ - **Smart-contract enforced** — spending policies live on-chain. The agent literally *cannot* bypass them, even with a prompt injection.
290
+ - **Owner override** — you can revoke, pause, or adjust limits at any time.
291
+
292
+ ### What This Means in Practice
293
+
294
+ Even if an agent is compromised (prompt injection, jailbreak, malicious skill), it cannot:
295
+ 1. Spend more than the per-transaction limit you set
296
+ 2. Exceed the daily/weekly spending cap you configured
297
+ 3. Access funds outside its ERC-6551 token-bound account
298
+ 4. Modify its own spending policy (only the owner wallet can)
299
+
300
+ **Recommendation:** Start with low limits ($5/tx, $25/day) and increase as you build confidence. The SDK supports per-token policies — set tighter limits on volatile assets, looser on stablecoins.
301
+
302
+ ## Agent Payment Demo
303
+
304
+ Here's a complete example of an agent autonomously paying for a premium API:
305
+
306
+ ### 1. Set Up the Wallet (One-Time)
307
+
308
+ ```typescript
309
+ import { createWallet, setSpendPolicy, NATIVE_TOKEN } from 'agentwallet-sdk';
310
+ import { createWalletClient, http } from 'viem';
311
+ import { privateKeyToAccount } from 'viem/accounts';
312
+ import { base } from 'viem/chains';
313
+
314
+ // Create wallet on Base (cheapest gas for agent operations)
315
+ const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
316
+ const walletClient = createWalletClient({ account, chain: base, transport: http() });
317
+
318
+ const wallet = createWallet({
319
+ accountAddress: '0xYourAgentWallet',
320
+ chain: 'base',
321
+ walletClient,
322
+ });
323
+
324
+ // Set spending guardrails: $5 per request, $50/day max
325
+ await setSpendPolicy(wallet, {
326
+ token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC on Base
327
+ perTxLimit: 5_000_000n, // 5 USDC per transaction
328
+ periodLimit: 50_000_000n, // 50 USDC per day
329
+ periodLength: 86400, // 24 hours
330
+ });
331
+ ```
332
+
333
+ ### 2. Agent Pays for Premium Data (Autonomous)
334
+
335
+ ```typescript
336
+ import { createX402Client } from 'agentwallet-sdk';
337
+
338
+ const x402 = createX402Client(wallet, {
339
+ supportedNetworks: ['base:8453'],
340
+ globalDailyLimit: 50_000_000n, // matches spend policy
341
+ globalPerRequestMax: 5_000_000n,
342
+ });
343
+
344
+ // Agent encounters a 402 Payment Required response — pays automatically
345
+ const response = await x402.fetch('https://api.premium-data.com/market-analysis');
346
+ const data = await response.json();
347
+ // Cost: $0.50 USDC, auto-approved (under $5 limit)
348
+ // Owner sees: tx hash on Base, fully auditable
349
+ ```
350
+
351
+ ### 3. Track Payment Outcomes (RSI Loop)
352
+
353
+ ```bash
354
+ # ClawPowers tracks every payment outcome
355
+ npx clawpowers metrics record \
356
+ --skill agent-payments \
357
+ --outcome success \
358
+ --duration 3 \
359
+ --notes "Paid $0.50 for market analysis API — data quality 9/10"
360
+
361
+ # After 10+ payments, analyze ROI
362
+ npx clawpowers analyze --skill agent-payments
363
+ # Output: success rate, avg cost, cost-per-successful-outcome
364
+ ```
365
+
366
+ ## Credential
367
+
368
+ Built by [AI Agent Economy](https://github.com/up2itnow0822) — the team behind:
369
+
370
+ - Payment infrastructure in [NVIDIA's official NeMo Agent Toolkit](https://github.com/NVIDIA/NeMo-Agent-Toolkit-Examples/pull/17)
371
+ - [agentwallet-sdk](https://www.npmjs.com/package/agentwallet-sdk) — agentwallet-sdk v6.0 — Full multi-chain agent wallet: x402 payments, Uniswap V3 swaps, CCTP bridging, ERC-8004 identity, mutual stake escrow, spending policies (741+ downloads/week)
372
+ - [agentpay-mcp](https://github.com/up2itnow0822/agentpay-mcp) — MCP payment server for AI agents
373
+ - Production trading systems with RSI self-improvement (268+ measured outcomes)
374
+
375
+ ## Contributing
376
+
377
+ We welcome contributions. Unlike some frameworks, we don't dismiss legitimate skill proposals with one-word responses. Open an issue or PR — every submission gets a genuine technical review.
378
+
379
+ ## License
380
+
381
+ MIT