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.
- package/CHANGELOG.md +94 -0
- package/LICENSE +44 -0
- package/README.md +202 -384
- package/SECURITY.md +72 -0
- package/dist/index.d.ts +844 -0
- package/dist/index.js +2536 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -42
- package/.claude-plugin/manifest.json +0 -19
- package/.codex/INSTALL.md +0 -36
- package/.cursor-plugin/manifest.json +0 -21
- package/.opencode/INSTALL.md +0 -52
- package/ARCHITECTURE.md +0 -69
- package/bin/clawpowers.js +0 -625
- package/bin/clawpowers.sh +0 -91
- package/docs/demo/clawpowers-demo.cast +0 -197
- package/docs/demo/clawpowers-demo.gif +0 -0
- package/docs/launch-images/25-skills-breakdown.jpg +0 -0
- package/docs/launch-images/clawpowers-vs-superpowers.jpg +0 -0
- package/docs/launch-images/economic-code-optimization.jpg +0 -0
- package/docs/launch-images/native-vs-bridge-2.jpg +0 -0
- package/docs/launch-images/native-vs-bridge.jpg +0 -0
- package/docs/launch-images/post1-hero-lobster.jpg +0 -0
- package/docs/launch-images/post2-dashboard.jpg +0 -0
- package/docs/launch-images/post3-superpowers.jpg +0 -0
- package/docs/launch-images/post4-before-after.jpg +0 -0
- package/docs/launch-images/post5-install-now.jpg +0 -0
- package/docs/launch-images/ultimate-stack.jpg +0 -0
- package/docs/launch-posts.md +0 -76
- package/docs/quickstart-first-transaction.md +0 -204
- package/gemini-extension.json +0 -32
- package/hooks/session-start +0 -205
- package/hooks/session-start.cmd +0 -43
- package/hooks/session-start.js +0 -163
- package/runtime/demo/README.md +0 -78
- package/runtime/demo/x402-mock-server.js +0 -230
- package/runtime/feedback/analyze.js +0 -621
- package/runtime/feedback/analyze.sh +0 -546
- package/runtime/init.js +0 -210
- package/runtime/init.sh +0 -178
- package/runtime/metrics/collector.js +0 -361
- package/runtime/metrics/collector.sh +0 -308
- package/runtime/payments/ledger.js +0 -305
- package/runtime/payments/ledger.sh +0 -262
- package/runtime/payments/pipeline.js +0 -459
- package/runtime/persistence/store.js +0 -433
- package/runtime/persistence/store.sh +0 -303
- package/skill.json +0 -106
- package/skills/agent-bounties/SKILL.md +0 -553
- package/skills/agent-payments/SKILL.md +0 -479
- package/skills/brainstorming/SKILL.md +0 -233
- package/skills/content-pipeline/SKILL.md +0 -282
- package/skills/cross-project-knowledge/SKILL.md +0 -345
- package/skills/dispatching-parallel-agents/SKILL.md +0 -305
- package/skills/economic-code-optimization/SKILL.md +0 -265
- package/skills/executing-plans/SKILL.md +0 -255
- package/skills/finishing-a-development-branch/SKILL.md +0 -260
- package/skills/formal-verification-lite/SKILL.md +0 -441
- package/skills/learn-how-to-learn/SKILL.md +0 -235
- package/skills/market-intelligence/SKILL.md +0 -323
- package/skills/meta-skill-evolution/SKILL.md +0 -325
- package/skills/prospecting/SKILL.md +0 -454
- package/skills/receiving-code-review/SKILL.md +0 -225
- package/skills/requesting-code-review/SKILL.md +0 -206
- package/skills/security-audit/SKILL.md +0 -353
- package/skills/self-healing-code/SKILL.md +0 -369
- package/skills/subagent-driven-development/SKILL.md +0 -244
- package/skills/systematic-debugging/SKILL.md +0 -355
- package/skills/test-driven-development/SKILL.md +0 -416
- package/skills/using-clawpowers/SKILL.md +0 -160
- package/skills/using-git-worktrees/SKILL.md +0 -261
- package/skills/verification-before-completion/SKILL.md +0 -254
- package/skills/writing-plans/SKILL.md +0 -276
- package/skills/writing-skills/SKILL.md +0 -260
package/README.md
CHANGED
|
@@ -1,445 +1,263 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ClawPowers
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Skills library for AI agents — payments, memory, RSI, wallet.** Drop-in capability layer for any agent framework.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Demo
|
|
8
|
-
|
|
9
|
-

|
|
10
|
-
|
|
11
|
-
*Install → persist state across sessions → track outcomes → self-improve. All from the terminal.*
|
|
12
|
-
|
|
13
|
-
## Why ClawPowers?
|
|
14
|
-
|
|
15
|
-
| Feature | ClawPowers | Static Skills Frameworks |
|
|
16
|
-
|---------|-----------|--------------------------|
|
|
17
|
-
| Skills auto-load on session start | ✅ | ✅ |
|
|
18
|
-
| Runtime tool execution | ✅ | ❌ |
|
|
19
|
-
| Cross-session memory | ✅ | ❌ |
|
|
20
|
-
| Self-improvement (RSI) | ✅ | ❌ |
|
|
21
|
-
| Outcome tracking & metrics | ✅ | ❌ |
|
|
22
|
-
| Agent payments (x402) | ✅ | ❌ |
|
|
23
|
-
| Security scanning | ✅ | ❌ |
|
|
24
|
-
| Content pipeline | ✅ | ❌ |
|
|
25
|
-
| Market intelligence | ✅ | ❌ |
|
|
26
|
-
| Resumable workflows | ✅ | ❌ |
|
|
27
|
-
| Windows native support | ✅ | ❌ |
|
|
28
|
-
| Zero dependencies | ✅ | ✅ |
|
|
29
|
-
|
|
30
|
-
**26 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. 4 are things no other framework even attempts — self-healing code, agents that rewrite their own methodology, cross-project knowledge transfer, and property-based formal verification.
|
|
31
|
-
|
|
32
|
-
## Requirements
|
|
33
|
-
|
|
34
|
-
- **Node.js >= 16** — for cross-platform runtime (Windows, macOS, Linux)
|
|
35
|
-
- **OR bash** — for Unix-native runtime (macOS, Linux, WSL2)
|
|
36
|
-
- **No other dependencies.** Zero. `package.json` has an empty `dependencies` object.
|
|
37
|
-
|
|
38
|
-
> Every user of Claude Code, Cursor, Codex, or Gemini CLI already has Node.js installed.
|
|
39
|
-
> No `requirements.txt` needed — this is not a Python project.
|
|
40
|
-
|
|
41
|
-
## Installation
|
|
42
|
-
|
|
43
|
-
### Universal (recommended — works on Windows, macOS, Linux)
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npx clawpowers init
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
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.
|
|
50
|
-
|
|
51
|
-
### OpenClaw
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
openclaw skills install clawpowers
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Or install from GitHub directly:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
openclaw skills install github:up2itnow0822/clawpowers
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
ClawPowers registers as a native OpenClaw skill with session hooks, runtime init, and all 24 skills auto-discoverable.
|
|
64
|
-
|
|
65
|
-
### Claude Code (Plugin Marketplace)
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
/plugin install clawpowers@claude-plugins-official
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Or register the marketplace first, then install:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
/plugin marketplace add up2itnow0822/clawpowers-marketplace
|
|
75
|
-
/plugin install clawpowers@clawpowers-marketplace
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Cursor
|
|
79
|
-
|
|
80
|
-
In Cursor Agent chat:
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
/add-plugin clawpowers
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Or search for "clawpowers" in the Cursor plugin marketplace.
|
|
87
|
-
|
|
88
|
-
### Codex
|
|
89
|
-
|
|
90
|
-
Tell Codex:
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
Fetch and follow instructions from https://raw.githubusercontent.com/up2itnow0822/clawpowers/main/.codex/INSTALL.md
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### OpenCode
|
|
97
|
-
|
|
98
|
-
Tell OpenCode:
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
Fetch and follow instructions from https://raw.githubusercontent.com/up2itnow0822/clawpowers/main/.opencode/INSTALL.md
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Gemini CLI
|
|
5
|
+
[](https://www.npmjs.com/package/clawpowers)
|
|
6
|
+
[](LICENSE)
|
|
105
7
|
|
|
106
8
|
```bash
|
|
107
|
-
|
|
9
|
+
npm install clawpowers
|
|
108
10
|
```
|
|
109
11
|
|
|
110
|
-
|
|
12
|
+
> **⚠️ Patent Pending:** The x402 payment detection, autonomous spending policy enforcement, and recursive self-improvement (RSI) systems described in this library are subject to pending patent applications. Use is governed by the BSL 1.1 license.
|
|
111
13
|
|
|
112
|
-
|
|
113
|
-
git clone https://github.com/up2itnow0822/clawpowers.git
|
|
114
|
-
cd clawpowers
|
|
115
|
-
node bin/clawpowers.js init # Windows, macOS, Linux
|
|
116
|
-
# or
|
|
117
|
-
bash bin/clawpowers.sh init # macOS, Linux only
|
|
118
|
-
```
|
|
14
|
+
---
|
|
119
15
|
|
|
120
|
-
|
|
16
|
+
## What Is This?
|
|
121
17
|
|
|
122
|
-
|
|
18
|
+
ClawPowers extracts the core capabilities from [ClawPowers-Agent](https://github.com/up2itnow0822/ClawPowers-Agent) into a standalone library. **No agent control loop** — bring your own agent framework and get:
|
|
123
19
|
|
|
124
|
-
|
|
20
|
+
- **x402 Payments** — Detect HTTP 402 responses, enforce spending policies, execute payments
|
|
21
|
+
- **Three-Tier Memory** — Working, episodic, procedural memory with crash recovery
|
|
22
|
+
- **RSI Engine** — Metrics collection, hypothesis generation, mutation, A/B testing
|
|
23
|
+
- **Wallet** — Generate, import, and sign with Ethereum-compatible wallets
|
|
24
|
+
- **Skills** — Discover, load, and track skill execution outcomes
|
|
125
25
|
|
|
126
|
-
|
|
127
|
-
npx clawpowers status
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## What Makes ClawPowers Different
|
|
131
|
-
|
|
132
|
-
### 1. Skills That Execute, Not Just Instruct
|
|
133
|
-
|
|
134
|
-
Static skills tell your agent *what to do*. ClawPowers skills can *do things themselves*:
|
|
135
|
-
|
|
136
|
-
- The **test-driven-development** skill doesn't just describe TDD — it runs mutation analysis on your tests to verify they actually catch bugs
|
|
137
|
-
- 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
|
|
138
|
-
- The **verification-before-completion** skill doesn't just say "verify" — it runs the actual verification suite and blocks completion until it passes
|
|
139
|
-
|
|
140
|
-
### 2. Cross-Session Memory
|
|
141
|
-
|
|
142
|
-
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.
|
|
26
|
+
## x402 Payment Flow
|
|
143
27
|
|
|
144
28
|
```
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
29
|
+
┌─────────┐ ┌──────────────┐ ┌───────────────┐ ┌──────────┐
|
|
30
|
+
│ Agent │────▶│ API Server │────▶│ detect402() │────▶│ Spending │
|
|
31
|
+
│ │ │ returns 402 │ │ parse x402 │ │ Policy │
|
|
32
|
+
└─────────┘ └──────────────┘ │ headers │ │ check │
|
|
33
|
+
└───────────────┘ └────┬─────┘
|
|
34
|
+
│
|
|
35
|
+
┌─────────────────▼─────────────────┐
|
|
36
|
+
│ PaymentExecutor │
|
|
37
|
+
│ ┌───────────┐ ┌─────────────┐ │
|
|
38
|
+
│ │ MCP Client │ │ Audit Log │ │
|
|
39
|
+
│ │ (agentpay) │ │ (append-only│ │
|
|
40
|
+
│ └─────┬─────┘ └─────────────┘ │
|
|
41
|
+
└───────┬───────────────────────────┘
|
|
42
|
+
│
|
|
43
|
+
┌───────▼───────┐
|
|
44
|
+
│ Base Network │
|
|
45
|
+
│ USDC Payment │
|
|
46
|
+
└───────────────┘
|
|
152
47
|
```
|
|
153
48
|
|
|
154
|
-
|
|
49
|
+
## Framework Compatibility
|
|
155
50
|
|
|
156
|
-
|
|
51
|
+
| Framework | Integration | Example |
|
|
52
|
+
|-----------|------------|---------|
|
|
53
|
+
| **LangChain** | `DynamicStructuredTool` | [`demos/langchain.ts`](demos/langchain.ts) |
|
|
54
|
+
| **Claude Code** | `CLAUDE.md` config | [`demos/claude-code.md`](demos/claude-code.md) |
|
|
55
|
+
| **ElizaOS** | Plugin pattern | [`demos/elizaos.ts`](demos/elizaos.ts) |
|
|
56
|
+
| **AutoGPT** | Direct import | See examples below |
|
|
57
|
+
| **CrewAI** | Tool wrapper | See examples below |
|
|
58
|
+
| **Custom** | Direct TypeScript import | See examples below |
|
|
157
59
|
|
|
158
|
-
|
|
159
|
-
2. **Analyze** — Are there patterns in failures? Which task types need different approaches?
|
|
160
|
-
3. **Adapt** — Adjust skill parameters, decomposition strategies, and review thresholds
|
|
60
|
+
## Quick Start
|
|
161
61
|
|
|
162
|
-
|
|
163
|
-
# Record an outcome
|
|
164
|
-
npx clawpowers metrics record --skill test-driven-development --outcome success --duration 1800
|
|
62
|
+
### Payments
|
|
165
63
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
This isn't theoretical — it's the same RSI framework running in production trading systems with 268+ measured outcomes.
|
|
171
|
-
|
|
172
|
-
### 4. Agent Payments (x402)
|
|
173
|
-
|
|
174
|
-
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).
|
|
175
|
-
|
|
176
|
-
### 5. Beyond Software Development
|
|
177
|
-
|
|
178
|
-
Static frameworks stop at coding methodology. ClawPowers includes skills for:
|
|
179
|
-
|
|
180
|
-
- **Security auditing** — Automated vulnerability scanning with Trivy, dependency checks, secret detection
|
|
181
|
-
- **Content pipeline** — Write, humanize, and publish technical content with platform-specific formatting
|
|
182
|
-
- **Market intelligence** — Research competitors, track trends, analyze opportunities
|
|
183
|
-
- **Prospecting** — Find leads matching your ICP, enrich contacts, output to CRM
|
|
184
|
-
|
|
185
|
-
## Skills Reference
|
|
186
|
-
|
|
187
|
-
### Core Development (14 skills)
|
|
188
|
-
|
|
189
|
-
| Skill | What It Does | Runtime Enhancement |
|
|
190
|
-
|-------|-------------|---------------------|
|
|
191
|
-
| `subagent-driven-development` | Orchestrate parallel subagents per task | Persistent execution DB, resumable checkpoints, outcome metrics |
|
|
192
|
-
| `test-driven-development` | RED-GREEN-REFACTOR enforcement | Mutation analysis, test portfolio management, effectiveness scoring |
|
|
193
|
-
| `writing-plans` | Spec → implementation plan | Historical task estimation, dependency validation, plan quality scoring |
|
|
194
|
-
| `executing-plans` | Execute plans with verification | Progress persistence, interruption recovery, milestone tracking |
|
|
195
|
-
| `brainstorming` | Structured ideation | Cross-session idea persistence, convergence tracking |
|
|
196
|
-
| `systematic-debugging` | Hypothesis-driven debugging | Persistent hypothesis tree, pattern matching against known issues |
|
|
197
|
-
| `verification-before-completion` | Pre-merge quality gates | Automated verification suite, historical pass rate tracking |
|
|
198
|
-
| `finishing-a-development-branch` | Branch cleanup and merge prep | Automated changelog, squash strategy optimization |
|
|
199
|
-
| `requesting-code-review` | Prepare and request review | Reviewer match scoring, review history |
|
|
200
|
-
| `receiving-code-review` | Process and implement feedback | Feedback pattern tracking, common issues database |
|
|
201
|
-
| `using-git-worktrees` | Isolated branch development | Worktree lifecycle management, conflict prediction |
|
|
202
|
-
| `using-clawpowers` | Meta-skill: how to use ClawPowers | Adaptive onboarding based on user skill level |
|
|
203
|
-
| `writing-skills` | Create new skills via TDD | Skill quality scoring, anti-pattern detection |
|
|
204
|
-
| `dispatching-parallel-agents` | Fan-out parallel execution | Load balancing, failure isolation, result aggregation |
|
|
205
|
-
|
|
206
|
-
### Extended Capabilities (6 skills)
|
|
207
|
-
|
|
208
|
-
| Skill | What It Does | Why Static Frameworks Can't |
|
|
209
|
-
|-------|-------------|----------------------------|
|
|
210
|
-
| `agent-payments` | x402 payment protocol, spending limits, autonomous transactions | Requires runtime wallet interaction, smart contract calls |
|
|
211
|
-
| `security-audit` | Vulnerability scanning, secret detection, dependency audits | Requires tool execution (Trivy, gitleaks, npm audit) |
|
|
212
|
-
| `content-pipeline` | Write → humanize → format → publish | Requires API calls, platform auth, content transformation |
|
|
213
|
-
| `learn-how-to-learn` | Metacognitive protocols, anti-pattern detection, confidence calibration | Requires persistent learning state, outcome correlation |
|
|
214
|
-
| `market-intelligence` | Competitive analysis, trend detection, opportunity scoring | Requires web access, data aggregation, persistent tracking |
|
|
215
|
-
| `prospecting` | Lead generation, contact enrichment, CRM sync | Requires API calls (Exa, Apollo), structured output |
|
|
216
|
-
|
|
217
|
-
### RSI Intelligence Layer (4 skills)
|
|
218
|
-
|
|
219
|
-
These skills don't exist in any other framework. They require runtime execution, persistent state, and self-modification capabilities that static prompt collections can never deliver.
|
|
220
|
-
|
|
221
|
-
| Skill | What It Does | Why This Changes Everything |
|
|
222
|
-
|-------|-------------|----------------------------|
|
|
223
|
-
| `meta-skill-evolution` | Every 50 tasks, analyzes outcome patterns, identifies the weakest skill, surgically rewrites its methodology, version bumps | Your agent's coding discipline improves autonomously over time. After 30 days it's measurably better than any static install |
|
|
224
|
-
| `self-healing-code` | On test failure: captures error → builds hypothesis tree → generates 2+ patches → applies with coverage guard → auto-commits winner | 3-cycle max with rollback. Turns red tests into green tests without human intervention |
|
|
225
|
-
| `cross-project-knowledge` | Persistent pattern library across ALL repos. Bug fixes, architecture decisions, and performance optimizations transfer between projects | Agent working on Project B benefits from everything learned on Projects A, C, D. Knowledge compounds |
|
|
226
|
-
| `formal-verification-lite` | Property-based testing with fast-check (JS), Hypothesis (Python), QuickCheck (Haskell). 5 property templates, 1000+ examples per property | Goes beyond "tests pass" to "tests actually prove correctness." Catches edge cases unit tests miss |
|
|
227
|
-
| `economic-code-optimization` | Autonomously spends micro-budgets on premium models, cloud GPUs, expert reviews when ROI justifies it. Tracks every cent and learns optimal spend ratios | Agents literally invest in their own performance. Spending efficiency improves over time via RSI feedback loop |
|
|
64
|
+
```typescript
|
|
65
|
+
import { SpendingPolicy, PaymentExecutor, detect402 } from 'clawpowers';
|
|
228
66
|
|
|
229
|
-
|
|
67
|
+
// Configure spending limits
|
|
68
|
+
const policy = new SpendingPolicy({
|
|
69
|
+
dailyLimit: 25, // $25/day
|
|
70
|
+
transactionLimit: 10, // $10 per tx
|
|
71
|
+
allowedDomains: ['api.example.com'],
|
|
72
|
+
});
|
|
230
73
|
|
|
74
|
+
// Create executor with your MCP client
|
|
75
|
+
const executor = new PaymentExecutor(policy, mcpClient);
|
|
76
|
+
|
|
77
|
+
// Detect and handle 402 responses
|
|
78
|
+
const payment = detect402({ status: 402, headers: responseHeaders });
|
|
79
|
+
if (payment) {
|
|
80
|
+
const result = await executor.executePayment({
|
|
81
|
+
amount: payment.amount,
|
|
82
|
+
currency: payment.currency,
|
|
83
|
+
recipient: payment.recipient,
|
|
84
|
+
domain: 'api.example.com',
|
|
85
|
+
x402Headers: payment.x402Headers,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
231
88
|
```
|
|
232
|
-
clawpowers/
|
|
233
|
-
├── skills/ # 26 skill directories, each with SKILL.md
|
|
234
|
-
├── runtime/
|
|
235
|
-
│ ├── persistence/ # Cross-session state (store.js + store.sh)
|
|
236
|
-
│ ├── metrics/ # Outcome tracking (collector.js + collector.sh)
|
|
237
|
-
│ ├── feedback/ # RSI self-improvement (analyze.js + analyze.sh)
|
|
238
|
-
│ ├── init.js # Cross-platform runtime setup
|
|
239
|
-
│ └── init.sh # Unix-native runtime setup
|
|
240
|
-
├── hooks/
|
|
241
|
-
│ ├── session-start # Bash session hook (macOS/Linux)
|
|
242
|
-
│ ├── session-start.js # Node.js session hook (all platforms)
|
|
243
|
-
│ └── session-start.cmd # Windows batch wrapper
|
|
244
|
-
├── bin/
|
|
245
|
-
│ ├── clawpowers.js # Cross-platform CLI (Windows/macOS/Linux)
|
|
246
|
-
│ └── clawpowers.sh # Unix-native CLI (macOS/Linux)
|
|
247
|
-
├── plugins/ # Platform-specific plugin manifests
|
|
248
|
-
│ ├── .claude-plugin/ # Claude Code
|
|
249
|
-
│ ├── .cursor-plugin/ # Cursor
|
|
250
|
-
│ ├── .codex/ # Codex
|
|
251
|
-
│ ├── .opencode/ # OpenCode
|
|
252
|
-
│ └── gemini-extension.json # Gemini CLI
|
|
253
|
-
├── tests/ # 366 test assertions
|
|
254
|
-
└── docs/ # Documentation
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
**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.
|
|
258
89
|
|
|
259
|
-
|
|
90
|
+
### Memory
|
|
260
91
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
92
|
+
```typescript
|
|
93
|
+
import { EpisodicMemory, ProceduralMemory, ContextInjector } from 'clawpowers';
|
|
94
|
+
|
|
95
|
+
// Episodic: Task history (append-only JSONL)
|
|
96
|
+
const episodic = new EpisodicMemory('~/.clawpowers/memory/episodic.jsonl');
|
|
97
|
+
await episodic.append({
|
|
98
|
+
taskId: 'task-1',
|
|
99
|
+
timestamp: new Date().toISOString(),
|
|
100
|
+
description: 'Built authentication module',
|
|
101
|
+
outcome: 'success',
|
|
102
|
+
lessonsLearned: ['Always test edge cases'],
|
|
103
|
+
skillsUsed: ['tdd'],
|
|
104
|
+
durationMs: 5000,
|
|
105
|
+
tags: ['auth'],
|
|
106
|
+
});
|
|
268
107
|
|
|
269
|
-
|
|
108
|
+
// Procedural: Skill effectiveness tracking
|
|
109
|
+
const procedural = new ProceduralMemory('~/.clawpowers/memory/procedural.json');
|
|
110
|
+
await procedural.update('tdd', { succeeded: true, durationMs: 5000, taskId: 'task-1' });
|
|
270
111
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
npx clawpowers metrics record --skill <name> --outcome success|failure # Track outcome
|
|
275
|
-
npx clawpowers metrics show # View recent metrics
|
|
276
|
-
npx clawpowers metrics summary # Per-skill stats
|
|
277
|
-
npx clawpowers analyze # RSI performance analysis
|
|
278
|
-
npx clawpowers analyze --skill <name> # Analyze specific skill
|
|
279
|
-
npx clawpowers store set <key> <value> # Store persistent state
|
|
280
|
-
npx clawpowers store get <key> # Retrieve state
|
|
281
|
-
npx clawpowers store list [prefix] # List stored keys
|
|
112
|
+
// Context injection: Relevant memories for new tasks
|
|
113
|
+
const injector = new ContextInjector(episodic, procedural);
|
|
114
|
+
const context = await injector.inject(goal, 2000); // 2000 token budget
|
|
282
115
|
```
|
|
283
116
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
ClawPowers works without any wallet.
|
|
117
|
+
### RSI (Recursive Self-Improvement)
|
|
287
118
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
119
|
+
```typescript
|
|
120
|
+
import { MetricsCollector, HypothesisEngine, MutationEngine, ABTestManager } from 'clawpowers';
|
|
121
|
+
|
|
122
|
+
// Collect metrics
|
|
123
|
+
const metrics = new MetricsCollector('task-metrics.jsonl', 'skill-metrics.jsonl');
|
|
124
|
+
await metrics.recordTaskMetrics({ taskId: 'task-1', outcome: 'success', /* ... */ });
|
|
125
|
+
|
|
126
|
+
// Generate improvement hypotheses
|
|
127
|
+
const hypothesis = new HypothesisEngine();
|
|
128
|
+
const hypotheses = hypothesis.analyze(skillStats, taskHistory);
|
|
129
|
+
|
|
130
|
+
// Create and test mutations
|
|
131
|
+
const mutations = new MutationEngine('mutations.jsonl');
|
|
132
|
+
const mutation = mutations.createMutation(hypotheses[0]);
|
|
133
|
+
|
|
134
|
+
// A/B test mutations
|
|
135
|
+
const ab = new ABTestManager();
|
|
136
|
+
const test = ab.startTest(mutation, baselineStats);
|
|
137
|
+
ab.recordResult(test.testId, newTaskMetrics);
|
|
138
|
+
const result = ab.evaluateTest(test.testId);
|
|
139
|
+
// result.decision: 'promote' | 'rollback' | 'continue'
|
|
301
140
|
```
|
|
302
141
|
|
|
303
|
-
|
|
304
|
-
- Keep disabled
|
|
305
|
-
- Enable Dry Run (observe what would happen)
|
|
306
|
-
- Enable Live Payments (set per-tx and daily limits)
|
|
142
|
+
### Wallet
|
|
307
143
|
|
|
308
|
-
|
|
144
|
+
```typescript
|
|
145
|
+
import { WalletManager } from 'clawpowers';
|
|
309
146
|
|
|
310
|
-
|
|
147
|
+
const wallet = new WalletManager({
|
|
148
|
+
chain: 'base',
|
|
149
|
+
dataDir: '~/.clawpowers/wallet',
|
|
150
|
+
});
|
|
311
151
|
|
|
312
|
-
|
|
313
|
-
|
|
152
|
+
const info = await wallet.generate();
|
|
153
|
+
console.log(info.address); // 0x...
|
|
314
154
|
```
|
|
315
155
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
## Security Model
|
|
319
|
-
|
|
320
|
-
ClawPowers takes agent autonomy seriously — which means taking agent *limits* seriously.
|
|
156
|
+
## Memory Module
|
|
321
157
|
|
|
322
|
-
|
|
158
|
+
| Layer | Storage | Purpose |
|
|
159
|
+
|-------|---------|---------|
|
|
160
|
+
| **Working** | In-process | Current task context with token budget |
|
|
161
|
+
| **Episodic** | JSONL file | Task history, searchable by keywords |
|
|
162
|
+
| **Procedural** | JSON file | Skill effectiveness tracking with atomic writes |
|
|
163
|
+
| **Checkpoint** | JSON files | Crash recovery, stale detection |
|
|
164
|
+
| **Context Injector** | Computed | Selects relevant memories for new tasks |
|
|
323
165
|
|
|
324
|
-
|
|
325
|
-
- **Path traversal blocked** — keys containing `/` or `\` are rejected at the store level
|
|
326
|
-
- **No network access** — runtime scripts (store, metrics, analyze) are fully offline
|
|
327
|
-
- **No eval** — zero use of `eval()`, `Function()`, or dynamic code execution in any runtime script
|
|
166
|
+
## RSI Module
|
|
328
167
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
The `agent-payments` skill uses `agentwallet-sdk` with hard on-chain spending limits:
|
|
168
|
+
The RSI engine implements a continuous improvement loop:
|
|
332
169
|
|
|
333
170
|
```
|
|
334
|
-
|
|
335
|
-
Agent wants to spend $500 → ⏳ Queued for owner approval
|
|
336
|
-
Agent spent $490 today → 🛑 Next tx blocked ($500/day limit hit)
|
|
171
|
+
measure → hypothesize → mutate → A/B test → promote/rollback → repeat
|
|
337
172
|
```
|
|
338
173
|
|
|
339
|
-
|
|
340
|
-
- **
|
|
341
|
-
- **
|
|
342
|
-
- **
|
|
343
|
-
|
|
344
|
-
### What This Means in Practice
|
|
174
|
+
**Tier Safety:**
|
|
175
|
+
- **T1** (Parameter Tuning) — Can auto-apply
|
|
176
|
+
- **T2** (Strategy Evolution) — Can auto-apply with notification
|
|
177
|
+
- **T3** (Skill Composition) — Requires testing gate
|
|
178
|
+
- **T4** (Architecture Proposals) — **ALWAYS requires human approval**
|
|
345
179
|
|
|
346
|
-
|
|
347
|
-
1. Spend more than the per-transaction limit you set
|
|
348
|
-
2. Exceed the daily/weekly spending cap you configured
|
|
349
|
-
3. Access funds outside its ERC-6551 token-bound account
|
|
350
|
-
4. Modify its own spending policy (only the owner wallet can)
|
|
180
|
+
Safety invariants (spending limits, identity, RSI definitions, sandbox boundaries, credentials) can **NEVER** be modified by RSI.
|
|
351
181
|
|
|
352
|
-
|
|
182
|
+
## Fee Structure
|
|
353
183
|
|
|
354
|
-
|
|
184
|
+
| Operation | Fee |
|
|
185
|
+
|-----------|-----|
|
|
186
|
+
| Transaction | 0.77% |
|
|
187
|
+
| Token Swap | 0.30% |
|
|
355
188
|
|
|
356
|
-
|
|
189
|
+
Fees are applied at the payment execution layer and are included in the transaction amount.
|
|
357
190
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
```typescript
|
|
361
|
-
import { createWallet, setSpendPolicy, NATIVE_TOKEN } from 'agentwallet-sdk';
|
|
362
|
-
import { createWalletClient, http } from 'viem';
|
|
363
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
364
|
-
import { base } from 'viem/chains';
|
|
191
|
+
## Python Integration
|
|
365
192
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
193
|
+
```python
|
|
194
|
+
import subprocess
|
|
195
|
+
import json
|
|
369
196
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
periodLength: 86400, // 24 hours
|
|
382
|
-
});
|
|
197
|
+
# Call ClawPowers via Node.js subprocess
|
|
198
|
+
result = subprocess.run(
|
|
199
|
+
['node', '-e', '''
|
|
200
|
+
import { detect402, SpendingPolicy } from "clawpowers";
|
|
201
|
+
const policy = new SpendingPolicy({ dailyLimit: 25, transactionLimit: 10, allowedDomains: [] });
|
|
202
|
+
const decision = policy.checkTransaction(5.00, "api.example.com");
|
|
203
|
+
console.log(JSON.stringify(decision));
|
|
204
|
+
'''],
|
|
205
|
+
capture_output=True, text=True
|
|
206
|
+
)
|
|
207
|
+
decision = json.loads(result.stdout)
|
|
383
208
|
```
|
|
384
209
|
|
|
385
|
-
|
|
210
|
+
## API Reference
|
|
211
|
+
|
|
212
|
+
### Payments
|
|
213
|
+
- `detect402(response)` — Parse x402 headers from 402 response
|
|
214
|
+
- `isPaymentRequired(error)` — Type guard for 402 errors
|
|
215
|
+
- `SpendingPolicy` — Enforce daily/transaction/domain limits
|
|
216
|
+
- `PaymentExecutor` — Execute payments via MCP client
|
|
217
|
+
|
|
218
|
+
### Memory
|
|
219
|
+
- `WorkingMemoryManager` — In-process context management
|
|
220
|
+
- `EpisodicMemory` — JSONL task history
|
|
221
|
+
- `ProceduralMemory` — Skill effectiveness tracking
|
|
222
|
+
- `CheckpointManager` — Crash recovery
|
|
223
|
+
- `ContextInjector` — Memory-to-context selection
|
|
224
|
+
|
|
225
|
+
### RSI
|
|
226
|
+
- `MetricsCollector` — Task/skill metrics in JSONL
|
|
227
|
+
- `HypothesisEngine` — Generate improvement hypotheses
|
|
228
|
+
- `MutationEngine` — Create/apply/revert mutations
|
|
229
|
+
- `ABTestManager` — A/B test mutations
|
|
230
|
+
- `RSIAuditLog` — Append-only audit trail
|
|
231
|
+
- `AutoResearcher` — Research solutions to failures
|
|
232
|
+
|
|
233
|
+
### Skills
|
|
234
|
+
- `discoverSkills(dir)` — Find skills in a directory
|
|
235
|
+
- `loadSkillManifest(dir)` — Load a single skill manifest
|
|
236
|
+
- `SkillExecutor` — Execute skills with outcome tracking
|
|
237
|
+
|
|
238
|
+
### Wallet
|
|
239
|
+
- `WalletManager` — High-level wallet operations
|
|
240
|
+
- `generateWallet(config)` — Generate new wallet
|
|
241
|
+
- `importWallet(key, config)` — Import existing wallet
|
|
242
|
+
- `signMessage(msg, keyFile, passphrase)` — Sign a message
|
|
243
|
+
|
|
244
|
+
### Config
|
|
245
|
+
- `loadConfig()` / `saveConfig()` — Zod-validated config CRUD
|
|
246
|
+
- `initConfig()` — Create default config
|
|
247
|
+
- `getConfigValue()` / `setConfigValue()` — Dot-notation access
|
|
386
248
|
|
|
387
|
-
|
|
388
|
-
import { createX402Client } from 'agentwallet-sdk';
|
|
389
|
-
|
|
390
|
-
const x402 = createX402Client(wallet, {
|
|
391
|
-
supportedNetworks: ['base:8453'],
|
|
392
|
-
globalDailyLimit: 50_000_000n, // matches spend policy
|
|
393
|
-
globalPerRequestMax: 5_000_000n,
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
// Agent encounters a 402 Payment Required response — pays automatically
|
|
397
|
-
const response = await x402.fetch('https://api.premium-data.com/market-analysis');
|
|
398
|
-
const data = await response.json();
|
|
399
|
-
// Cost: $0.50 USDC, auto-approved (under $5 limit)
|
|
400
|
-
// Owner sees: tx hash on Base, fully auditable
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
### 3. Track Payment Outcomes (RSI Loop)
|
|
404
|
-
|
|
405
|
-
```bash
|
|
406
|
-
# ClawPowers tracks every payment outcome
|
|
407
|
-
npx clawpowers metrics record \
|
|
408
|
-
--skill agent-payments \
|
|
409
|
-
--outcome success \
|
|
410
|
-
--duration 3 \
|
|
411
|
-
--notes "Paid $0.50 for market analysis API — data quality 9/10"
|
|
412
|
-
|
|
413
|
-
# After 10+ payments, analyze ROI
|
|
414
|
-
npx clawpowers analyze --skill agent-payments
|
|
415
|
-
# Output: success rate, avg cost, cost-per-successful-outcome
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
## Credential
|
|
419
|
-
|
|
420
|
-
Built by [AI Agent Economy](https://github.com/up2itnow0822) — the team behind:
|
|
249
|
+
## License
|
|
421
250
|
|
|
422
|
-
|
|
423
|
-
- [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)
|
|
424
|
-
- [agentpay-mcp](https://github.com/up2itnow0822/agentpay-mcp) — MCP payment server for AI agents
|
|
425
|
-
- Production trading systems with RSI self-improvement (268+ measured outcomes)
|
|
251
|
+
**Business Source License 1.1 (BSL 1.1)**
|
|
426
252
|
|
|
427
|
-
|
|
253
|
+
This software is licensed under the BSL 1.1. You may use it for non-production purposes freely. Production use requires a commercial license until the Change Date, after which the software converts to the Apache 2.0 license.
|
|
428
254
|
|
|
429
|
-
|
|
255
|
+
See [LICENSE](LICENSE) for full terms.
|
|
430
256
|
|
|
431
257
|
## Patent Notice
|
|
432
258
|
|
|
433
|
-
**Patent Pending
|
|
434
|
-
|
|
435
|
-
## Open Standard + Defensive Patent
|
|
436
|
-
|
|
437
|
-
We support the open x402 standard and encourage interoperable implementations. Our [provisional patent filing](https://github.com/up2itnow0822) is defensive — intended to prevent hostile monopolization and protect builders' ability to use open payment rails. Our goal is to be the safest, fastest, most complete implementation, and to help the ecosystem adopt secure agent payments.
|
|
259
|
+
⚠️ **Patent Pending:** The autonomous payment detection, spending policy enforcement, recursive self-improvement engine, and multi-tier memory systems implemented in this library are subject to pending patent applications filed by AI Agent Economy. Unauthorized commercial use may constitute patent infringement.
|
|
438
260
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
ClawPowers and agentwallet-sdk are non-custodial developer tooling. You control your own keys and set your own spending limits. You are responsible for compliance with applicable laws in your jurisdiction. This software is provided as-is under the MIT license. Nothing in this project constitutes financial advice, custody services, or money transmission.
|
|
442
|
-
|
|
443
|
-
## License
|
|
261
|
+
---
|
|
444
262
|
|
|
445
|
-
|
|
263
|
+
Built by [AI Agent Economy](https://github.com/up2itnow0822) 🦅
|