clawpowers 1.1.4 → 2.2.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 (131) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/COMPATIBILITY.md +13 -0
  3. package/KNOWN_LIMITATIONS.md +19 -0
  4. package/LICENSE +44 -0
  5. package/LICENSING.md +10 -0
  6. package/README.md +378 -210
  7. package/SECURITY.md +52 -0
  8. package/dist/index.d.ts +1477 -0
  9. package/dist/index.js +3464 -0
  10. package/dist/index.js.map +1 -0
  11. package/native/Cargo.lock +4863 -0
  12. package/native/Cargo.toml +73 -0
  13. package/native/crates/canonical/Cargo.toml +24 -0
  14. package/native/crates/canonical/src/lib.rs +673 -0
  15. package/native/crates/compression/Cargo.toml +20 -0
  16. package/native/crates/compression/benches/compression_bench.rs +42 -0
  17. package/native/crates/compression/src/lib.rs +393 -0
  18. package/native/crates/evm-eth/Cargo.toml +13 -0
  19. package/native/crates/evm-eth/src/lib.rs +105 -0
  20. package/native/crates/fee/Cargo.toml +15 -0
  21. package/native/crates/fee/src/lib.rs +281 -0
  22. package/native/crates/index/Cargo.toml +16 -0
  23. package/native/crates/index/src/lib.rs +277 -0
  24. package/native/crates/policy/Cargo.toml +17 -0
  25. package/native/crates/policy/src/lib.rs +614 -0
  26. package/native/crates/security/Cargo.toml +22 -0
  27. package/native/crates/security/src/lib.rs +478 -0
  28. package/native/crates/tokens/Cargo.toml +13 -0
  29. package/native/crates/tokens/src/lib.rs +534 -0
  30. package/native/crates/verification/Cargo.toml +23 -0
  31. package/native/crates/verification/src/lib.rs +333 -0
  32. package/native/crates/wallet/Cargo.toml +20 -0
  33. package/native/crates/wallet/src/lib.rs +261 -0
  34. package/native/crates/x402/Cargo.toml +30 -0
  35. package/native/crates/x402/src/lib.rs +423 -0
  36. package/native/ffi/Cargo.toml +34 -0
  37. package/native/ffi/build.rs +4 -0
  38. package/native/ffi/index.node +0 -0
  39. package/native/ffi/src/lib.rs +352 -0
  40. package/native/ffi/tests/integration.rs +354 -0
  41. package/native/pyo3/Cargo.toml +26 -0
  42. package/native/pyo3/pyproject.toml +16 -0
  43. package/native/pyo3/src/lib.rs +407 -0
  44. package/native/pyo3/tests/test_smoke.py +180 -0
  45. package/native/wasm/Cargo.toml +44 -0
  46. package/native/wasm/pkg/.gitignore +6 -0
  47. package/native/wasm/pkg/clawpowers_wasm.d.ts +208 -0
  48. package/native/wasm/pkg/clawpowers_wasm.js +872 -0
  49. package/native/wasm/pkg/clawpowers_wasm_bg.wasm +0 -0
  50. package/native/wasm/pkg/clawpowers_wasm_bg.wasm.d.ts +40 -0
  51. package/native/wasm/pkg/package.json +17 -0
  52. package/native/wasm/pkg-node/.gitignore +6 -0
  53. package/native/wasm/pkg-node/clawpowers_wasm.d.ts +143 -0
  54. package/native/wasm/pkg-node/clawpowers_wasm.js +798 -0
  55. package/native/wasm/pkg-node/clawpowers_wasm_bg.wasm +0 -0
  56. package/native/wasm/pkg-node/clawpowers_wasm_bg.wasm.d.ts +40 -0
  57. package/native/wasm/pkg-node/package.json +13 -0
  58. package/native/wasm/src/lib.rs +433 -0
  59. package/package.json +71 -44
  60. package/src/skills/catalog.ts +435 -0
  61. package/src/skills/executor.ts +56 -0
  62. package/src/skills/index.ts +3 -0
  63. package/src/skills/itp/SKILL.md +112 -0
  64. package/src/skills/loader.ts +193 -0
  65. package/.claude-plugin/manifest.json +0 -19
  66. package/.codex/INSTALL.md +0 -36
  67. package/.cursor-plugin/manifest.json +0 -21
  68. package/.opencode/INSTALL.md +0 -52
  69. package/ARCHITECTURE.md +0 -69
  70. package/bin/clawpowers.js +0 -625
  71. package/bin/clawpowers.sh +0 -91
  72. package/docs/demo/clawpowers-demo.cast +0 -197
  73. package/docs/demo/clawpowers-demo.gif +0 -0
  74. package/docs/launch-images/25-skills-breakdown.jpg +0 -0
  75. package/docs/launch-images/clawpowers-vs-superpowers.jpg +0 -0
  76. package/docs/launch-images/economic-code-optimization.jpg +0 -0
  77. package/docs/launch-images/native-vs-bridge-2.jpg +0 -0
  78. package/docs/launch-images/native-vs-bridge.jpg +0 -0
  79. package/docs/launch-images/post1-hero-lobster.jpg +0 -0
  80. package/docs/launch-images/post2-dashboard.jpg +0 -0
  81. package/docs/launch-images/post3-superpowers.jpg +0 -0
  82. package/docs/launch-images/post4-before-after.jpg +0 -0
  83. package/docs/launch-images/post5-install-now.jpg +0 -0
  84. package/docs/launch-images/ultimate-stack.jpg +0 -0
  85. package/docs/launch-posts.md +0 -76
  86. package/docs/quickstart-first-transaction.md +0 -204
  87. package/gemini-extension.json +0 -32
  88. package/hooks/session-start +0 -205
  89. package/hooks/session-start.cmd +0 -43
  90. package/hooks/session-start.js +0 -163
  91. package/runtime/demo/README.md +0 -78
  92. package/runtime/demo/x402-mock-server.js +0 -230
  93. package/runtime/feedback/analyze.js +0 -621
  94. package/runtime/feedback/analyze.sh +0 -546
  95. package/runtime/init.js +0 -210
  96. package/runtime/init.sh +0 -178
  97. package/runtime/metrics/collector.js +0 -361
  98. package/runtime/metrics/collector.sh +0 -308
  99. package/runtime/payments/ledger.js +0 -305
  100. package/runtime/payments/ledger.sh +0 -262
  101. package/runtime/payments/pipeline.js +0 -455
  102. package/runtime/persistence/store.js +0 -433
  103. package/runtime/persistence/store.sh +0 -303
  104. package/skill.json +0 -106
  105. package/skills/agent-bounties/SKILL.md +0 -553
  106. package/skills/agent-payments/SKILL.md +0 -479
  107. package/skills/brainstorming/SKILL.md +0 -233
  108. package/skills/content-pipeline/SKILL.md +0 -282
  109. package/skills/cross-project-knowledge/SKILL.md +0 -345
  110. package/skills/dispatching-parallel-agents/SKILL.md +0 -305
  111. package/skills/economic-code-optimization/SKILL.md +0 -265
  112. package/skills/executing-plans/SKILL.md +0 -255
  113. package/skills/finishing-a-development-branch/SKILL.md +0 -260
  114. package/skills/formal-verification-lite/SKILL.md +0 -441
  115. package/skills/learn-how-to-learn/SKILL.md +0 -235
  116. package/skills/market-intelligence/SKILL.md +0 -323
  117. package/skills/meta-skill-evolution/SKILL.md +0 -325
  118. package/skills/prospecting/SKILL.md +0 -454
  119. package/skills/receiving-code-review/SKILL.md +0 -225
  120. package/skills/requesting-code-review/SKILL.md +0 -206
  121. package/skills/security-audit/SKILL.md +0 -353
  122. package/skills/self-healing-code/SKILL.md +0 -369
  123. package/skills/subagent-driven-development/SKILL.md +0 -244
  124. package/skills/systematic-debugging/SKILL.md +0 -355
  125. package/skills/test-driven-development/SKILL.md +0 -416
  126. package/skills/using-clawpowers/SKILL.md +0 -160
  127. package/skills/using-git-worktrees/SKILL.md +0 -261
  128. package/skills/validator/SKILL.md +0 -281
  129. package/skills/verification-before-completion/SKILL.md +0 -254
  130. package/skills/writing-plans/SKILL.md +0 -276
  131. package/skills/writing-skills/SKILL.md +0 -260
@@ -0,0 +1,193 @@
1
+ /**
2
+ * ClawPowers Agent — Skill Loader
3
+ * Discovers skills from skill directories, validates SKILL.md frontmatter.
4
+ */
5
+
6
+ import { readdirSync, readFileSync, existsSync, statSync } from 'node:fs';
7
+ import { join } from 'node:path';
8
+ import type { SkillManifest, SkillRequirements, Profile } from '../types.js';
9
+
10
+ // ─── YAML Frontmatter Parser ──────────────────────────────────────────────────
11
+
12
+ interface ParsedFrontmatter {
13
+ name?: string;
14
+ description?: string;
15
+ metadata?: {
16
+ openclaw?: {
17
+ requires?: {
18
+ bins?: string[];
19
+ env?: string[];
20
+ config?: string[];
21
+ };
22
+ };
23
+ };
24
+ }
25
+
26
+ /**
27
+ * Parse YAML frontmatter from a SKILL.md file content.
28
+ * Expects format: ---\n<yaml>\n---\n<content>
29
+ */
30
+ export function parseFrontmatter(content: string): ParsedFrontmatter {
31
+ const match = content.match(/^---\n([\s\S]*?)\n---/);
32
+ if (!match?.[1]) {
33
+ return {};
34
+ }
35
+
36
+ const yamlText = match[1];
37
+ const result: ParsedFrontmatter = {};
38
+
39
+ // Simple YAML parser for our known structure
40
+ const lines = yamlText.split('\n');
41
+ let currentKey = '';
42
+ let inRequires = false;
43
+ let requiresKey = '';
44
+ const requires: { bins?: string[]; env?: string[]; config?: string[] } = {};
45
+
46
+ for (const line of lines) {
47
+ const trimmed = line.trim();
48
+ if (trimmed === '' || trimmed.startsWith('#')) continue;
49
+
50
+ // Top-level keys
51
+ const topLevel = line.match(/^(\w+):\s*(.*)$/);
52
+ if (topLevel?.[1]) {
53
+ currentKey = topLevel[1];
54
+ const val = topLevel[2]?.trim().replace(/^["']|["']$/g, '') ?? '';
55
+ if (currentKey === 'name' && val) result.name = val;
56
+ if (currentKey === 'description' && val) result.description = val;
57
+ inRequires = false;
58
+ continue;
59
+ }
60
+
61
+ // metadata.openclaw.requires detection
62
+ if (trimmed === 'openclaw:') continue;
63
+ if (trimmed === 'requires:') {
64
+ inRequires = true;
65
+ continue;
66
+ }
67
+
68
+ if (inRequires) {
69
+ const reqKey = trimmed.match(/^(\w+):\s*(.*)$/);
70
+ if (reqKey?.[1]) {
71
+ requiresKey = reqKey[1];
72
+ // Inline array: bins: ["node", "git"]
73
+ const inlineArr = reqKey[2]?.match(/\[(.*)\]/);
74
+ if (inlineArr?.[1]) {
75
+ const items = inlineArr[1].split(',').map(s => s.trim().replace(/^["']|["']$/g, ''));
76
+ if (requiresKey === 'bins') requires.bins = items;
77
+ if (requiresKey === 'env') requires.env = items;
78
+ if (requiresKey === 'config') requires.config = items;
79
+ }
80
+ continue;
81
+ }
82
+ // List item under requires key
83
+ const listItem = trimmed.match(/^-\s*["']?(.+?)["']?$/);
84
+ if (listItem?.[1] && requiresKey) {
85
+ if (requiresKey === 'bins') {
86
+ requires.bins = requires.bins ?? [];
87
+ requires.bins.push(listItem[1]);
88
+ }
89
+ if (requiresKey === 'env') {
90
+ requires.env = requires.env ?? [];
91
+ requires.env.push(listItem[1]);
92
+ }
93
+ if (requiresKey === 'config') {
94
+ requires.config = requires.config ?? [];
95
+ requires.config.push(listItem[1]);
96
+ }
97
+ }
98
+ }
99
+ }
100
+
101
+ if (Object.keys(requires).length > 0) {
102
+ result.metadata = { openclaw: { requires } };
103
+ }
104
+
105
+ return result;
106
+ }
107
+
108
+ // ─── Skill Discovery ──────────────────────────────────────────────────────────
109
+
110
+ /**
111
+ * Load a single skill manifest from a directory containing SKILL.md
112
+ */
113
+ export function loadSkillManifest(skillDir: string): SkillManifest | null {
114
+ const skillMdPath = join(skillDir, 'SKILL.md');
115
+ if (!existsSync(skillMdPath)) {
116
+ return null;
117
+ }
118
+
119
+ const content = readFileSync(skillMdPath, 'utf-8');
120
+ const frontmatter = parseFrontmatter(content);
121
+
122
+ if (!frontmatter.name || !frontmatter.description) {
123
+ return null;
124
+ }
125
+
126
+ let requirements: SkillRequirements | null = null;
127
+ const req = frontmatter.metadata?.openclaw?.requires;
128
+ if (req) {
129
+ requirements = {
130
+ bins: req.bins ?? [],
131
+ env: req.env ?? [],
132
+ config: req.config ?? [],
133
+ };
134
+ }
135
+
136
+ return {
137
+ name: frontmatter.name,
138
+ description: frontmatter.description,
139
+ path: skillDir,
140
+ requirements,
141
+ };
142
+ }
143
+
144
+ /**
145
+ * Discover all skills in a directory. Each subdirectory with a valid SKILL.md
146
+ * becomes a skill manifest.
147
+ */
148
+ export function discoverSkills(skillsDir: string): SkillManifest[] {
149
+ if (!existsSync(skillsDir)) {
150
+ return [];
151
+ }
152
+
153
+ const entries = readdirSync(skillsDir);
154
+ const manifests: SkillManifest[] = [];
155
+
156
+ for (const entry of entries) {
157
+ const fullPath = join(skillsDir, entry);
158
+ if (!statSync(fullPath).isDirectory()) continue;
159
+
160
+ const manifest = loadSkillManifest(fullPath);
161
+ if (manifest) {
162
+ manifests.push(manifest);
163
+ }
164
+ }
165
+
166
+ return manifests.sort((a, b) => a.name.localeCompare(b.name));
167
+ }
168
+
169
+ /**
170
+ * Filter skills based on active profile.
171
+ * Returns only skills that are listed in the profile's skill list.
172
+ */
173
+ export function getActiveSkills(
174
+ allSkills: SkillManifest[],
175
+ profile: Profile
176
+ ): SkillManifest[] {
177
+ const profileSkillSet = new Set(profile.skills);
178
+ return allSkills.filter(skill => profileSkillSet.has(skill.name));
179
+ }
180
+
181
+ /**
182
+ * List skills with their active/inactive status for a given profile.
183
+ */
184
+ export function listSkillsWithStatus(
185
+ allSkills: SkillManifest[],
186
+ profile: Profile
187
+ ): Array<{ skill: SkillManifest; active: boolean }> {
188
+ const profileSkillSet = new Set(profile.skills);
189
+ return allSkills.map(skill => ({
190
+ skill,
191
+ active: profileSkillSet.has(skill.name),
192
+ }));
193
+ }
@@ -1,19 +0,0 @@
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
- }
package/.codex/INSTALL.md DELETED
@@ -1,36 +0,0 @@
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.
@@ -1,21 +0,0 @@
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
- }
@@ -1,52 +0,0 @@
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.
package/ARCHITECTURE.md DELETED
@@ -1,69 +0,0 @@
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.