dsh-ecc-skills 0.4.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 (278) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +99 -0
  3. package/cordis.patch.yml +5 -0
  4. package/lib/index.js +195 -0
  5. package/package.json +46 -0
  6. package/skills/accessibility/SKILL.md +147 -0
  7. package/skills/agent-architecture-audit/SKILL.md +257 -0
  8. package/skills/agent-eval/SKILL.md +147 -0
  9. package/skills/agent-harness-construction/SKILL.md +74 -0
  10. package/skills/agent-introspection-debugging/SKILL.md +154 -0
  11. package/skills/agent-payment-x402/SKILL.md +225 -0
  12. package/skills/agent-self-evaluation/SKILL.md +182 -0
  13. package/skills/agent-sort/SKILL.md +216 -0
  14. package/skills/agentic-engineering/SKILL.md +64 -0
  15. package/skills/agentic-os/SKILL.md +388 -0
  16. package/skills/ai-first-engineering/SKILL.md +52 -0
  17. package/skills/ai-regression-testing/SKILL.md +386 -0
  18. package/skills/android-clean-architecture/SKILL.md +340 -0
  19. package/skills/angular-developer/SKILL.md +155 -0
  20. package/skills/api-connector-builder/SKILL.md +121 -0
  21. package/skills/api-design/SKILL.md +524 -0
  22. package/skills/architecture-decision-records/SKILL.md +180 -0
  23. package/skills/article-writing/SKILL.md +80 -0
  24. package/skills/automation-audit-ops/SKILL.md +143 -0
  25. package/skills/autonomous-agent-harness/SKILL.md +274 -0
  26. package/skills/autonomous-loops/SKILL.md +611 -0
  27. package/skills/backend-patterns/SKILL.md +562 -0
  28. package/skills/benchmark/SKILL.md +95 -0
  29. package/skills/benchmark-methodology/SKILL.md +191 -0
  30. package/skills/benchmark-optimization-loop/SKILL.md +71 -0
  31. package/skills/blender-motion-state-inspection/SKILL.md +165 -0
  32. package/skills/blueprint/SKILL.md +106 -0
  33. package/skills/brand-discovery/SKILL.md +145 -0
  34. package/skills/brand-voice/SKILL.md +98 -0
  35. package/skills/browser-qa/SKILL.md +105 -0
  36. package/skills/bun-runtime/SKILL.md +85 -0
  37. package/skills/canary-watch/SKILL.md +108 -0
  38. package/skills/carrier-relationship-management/SKILL.md +212 -0
  39. package/skills/cisco-ios-patterns/SKILL.md +164 -0
  40. package/skills/ck/SKILL.md +148 -0
  41. package/skills/claude-devfleet/SKILL.md +112 -0
  42. package/skills/click-path-audit/SKILL.md +245 -0
  43. package/skills/clickhouse-io/SKILL.md +445 -0
  44. package/skills/code-tour/SKILL.md +254 -0
  45. package/skills/codebase-onboarding/SKILL.md +234 -0
  46. package/skills/codehealth-mcp/SKILL.md +167 -0
  47. package/skills/coding-standards/SKILL.md +551 -0
  48. package/skills/competitive-platform-analysis/SKILL.md +214 -0
  49. package/skills/competitive-report-structure/SKILL.md +162 -0
  50. package/skills/compose-multiplatform-patterns/SKILL.md +300 -0
  51. package/skills/config-gc/SKILL.md +120 -0
  52. package/skills/configure-ecc/SKILL.md +206 -0
  53. package/skills/connections-optimizer/SKILL.md +190 -0
  54. package/skills/content-engine/SKILL.md +132 -0
  55. package/skills/content-hash-cache-pattern/SKILL.md +162 -0
  56. package/skills/context-budget/SKILL.md +136 -0
  57. package/skills/continuous-agent-loop/SKILL.md +46 -0
  58. package/skills/contract-first/SKILL.md +287 -0
  59. package/skills/cost-aware-llm-pipeline/SKILL.md +184 -0
  60. package/skills/cost-tracking/SKILL.md +97 -0
  61. package/skills/council/SKILL.md +204 -0
  62. package/skills/council-multi-model/SKILL.md +167 -0
  63. package/skills/cpp-coding-standards/SKILL.md +724 -0
  64. package/skills/cpp-testing/SKILL.md +325 -0
  65. package/skills/crosspost/SKILL.md +112 -0
  66. package/skills/csharp-testing/SKILL.md +322 -0
  67. package/skills/customer-billing-ops/SKILL.md +141 -0
  68. package/skills/customs-trade-compliance/SKILL.md +263 -0
  69. package/skills/dart-flutter-patterns/SKILL.md +564 -0
  70. package/skills/dashboard-builder/SKILL.md +109 -0
  71. package/skills/data-scraper-agent/SKILL.md +765 -0
  72. package/skills/data-throughput-accelerator/SKILL.md +74 -0
  73. package/skills/database-migrations/SKILL.md +430 -0
  74. package/skills/deep-research/SKILL.md +160 -0
  75. package/skills/defi-amm-security/SKILL.md +167 -0
  76. package/skills/delivery-gate/SKILL.md +126 -0
  77. package/skills/deployment-patterns/SKILL.md +428 -0
  78. package/skills/design-system/SKILL.md +83 -0
  79. package/skills/dev-team/SKILL.md +203 -0
  80. package/skills/django-celery/SKILL.md +458 -0
  81. package/skills/django-patterns/SKILL.md +735 -0
  82. package/skills/django-security/SKILL.md +644 -0
  83. package/skills/django-tdd/SKILL.md +730 -0
  84. package/skills/django-verification/SKILL.md +470 -0
  85. package/skills/dmux-workflows/SKILL.md +192 -0
  86. package/skills/docker-patterns/SKILL.md +520 -0
  87. package/skills/documentation-lookup/SKILL.md +91 -0
  88. package/skills/dotnet-patterns/SKILL.md +322 -0
  89. package/skills/dynamic-workflow-mode/SKILL.md +124 -0
  90. package/skills/e2e-testing/SKILL.md +327 -0
  91. package/skills/ecc-tools-cost-audit/SKILL.md +161 -0
  92. package/skills/email-ops/SKILL.md +122 -0
  93. package/skills/energy-procurement/SKILL.md +228 -0
  94. package/skills/enterprise-agent-ops/SKILL.md +51 -0
  95. package/skills/error-handling/SKILL.md +377 -0
  96. package/skills/eval-harness/SKILL.md +271 -0
  97. package/skills/evm-token-decimals/SKILL.md +131 -0
  98. package/skills/exa-search/SKILL.md +108 -0
  99. package/skills/fal-ai-media/SKILL.md +289 -0
  100. package/skills/fastapi-patterns/SKILL.md +514 -0
  101. package/skills/finance-billing-ops/SKILL.md +128 -0
  102. package/skills/flox-environments/SKILL.md +497 -0
  103. package/skills/flutter-dart-code-review/SKILL.md +436 -0
  104. package/skills/foundation-models-on-device/SKILL.md +243 -0
  105. package/skills/frontend-a11y/SKILL.md +446 -0
  106. package/skills/frontend-design-direction/SKILL.md +93 -0
  107. package/skills/frontend-patterns/SKILL.md +657 -0
  108. package/skills/fsharp-testing/SKILL.md +281 -0
  109. package/skills/gan-style-harness/SKILL.md +279 -0
  110. package/skills/generating-python-installer/SKILL.md +820 -0
  111. package/skills/git-workflow/SKILL.md +716 -0
  112. package/skills/github-ops/SKILL.md +145 -0
  113. package/skills/golang-patterns/SKILL.md +676 -0
  114. package/skills/golang-testing/SKILL.md +721 -0
  115. package/skills/google-workspace-ops/SKILL.md +96 -0
  116. package/skills/growth-log/SKILL.md +128 -0
  117. package/skills/healthcare-cdss-patterns/SKILL.md +246 -0
  118. package/skills/healthcare-emr-patterns/SKILL.md +160 -0
  119. package/skills/healthcare-eval-harness/SKILL.md +208 -0
  120. package/skills/healthcare-phi-compliance/SKILL.md +146 -0
  121. package/skills/hermes-imports/SKILL.md +89 -0
  122. package/skills/hexagonal-architecture/SKILL.md +277 -0
  123. package/skills/hipaa-compliance/SKILL.md +79 -0
  124. package/skills/homelab-network-readiness/SKILL.md +170 -0
  125. package/skills/homelab-network-setup/SKILL.md +130 -0
  126. package/skills/homelab-pihole-dns/SKILL.md +275 -0
  127. package/skills/homelab-vlan-segmentation/SKILL.md +312 -0
  128. package/skills/homelab-wireguard-vpn/SKILL.md +306 -0
  129. package/skills/hookify-rules/SKILL.md +128 -0
  130. package/skills/inherit-legacy-style/SKILL.md +157 -0
  131. package/skills/intent-driven-development/SKILL.md +360 -0
  132. package/skills/inventory-demand-planning/SKILL.md +247 -0
  133. package/skills/investor-materials/SKILL.md +97 -0
  134. package/skills/investor-outreach/SKILL.md +92 -0
  135. package/skills/ios-icon-gen/SKILL.md +158 -0
  136. package/skills/iterative-retrieval/SKILL.md +212 -0
  137. package/skills/ito-baskets/SKILL.md +263 -0
  138. package/skills/ito-compute/SKILL.md +151 -0
  139. package/skills/ito-inference/SKILL.md +119 -0
  140. package/skills/ito-training/SKILL.md +123 -0
  141. package/skills/java-coding-standards/SKILL.md +384 -0
  142. package/skills/jira-integration/SKILL.md +303 -0
  143. package/skills/jpa-patterns/SKILL.md +152 -0
  144. package/skills/knowledge-ops/SKILL.md +155 -0
  145. package/skills/kotlin-coroutines-flows/SKILL.md +285 -0
  146. package/skills/kotlin-exposed-patterns/SKILL.md +720 -0
  147. package/skills/kotlin-ktor-patterns/SKILL.md +690 -0
  148. package/skills/kotlin-patterns/SKILL.md +712 -0
  149. package/skills/kotlin-testing/SKILL.md +825 -0
  150. package/skills/kubernetes-patterns/SKILL.md +756 -0
  151. package/skills/laravel-patterns/SKILL.md +416 -0
  152. package/skills/laravel-plugin-discovery/SKILL.md +230 -0
  153. package/skills/laravel-security/SKILL.md +948 -0
  154. package/skills/laravel-tdd/SKILL.md +675 -0
  155. package/skills/laravel-verification/SKILL.md +180 -0
  156. package/skills/latency-critical-systems/SKILL.md +75 -0
  157. package/skills/lead-intelligence/SKILL.md +322 -0
  158. package/skills/liquid-glass-design/SKILL.md +279 -0
  159. package/skills/living-docs-governance/SKILL.md +137 -0
  160. package/skills/llm-trading-agent-security/SKILL.md +147 -0
  161. package/skills/logistics-exception-management/SKILL.md +222 -0
  162. package/skills/loop-design-check/SKILL.md +143 -0
  163. package/skills/mailtrap-email-integration/SKILL.md +77 -0
  164. package/skills/make-interfaces-feel-better/SKILL.md +152 -0
  165. package/skills/manim-video/SKILL.md +90 -0
  166. package/skills/market-research/SKILL.md +76 -0
  167. package/skills/marketing-campaign/SKILL.md +114 -0
  168. package/skills/mcp-server-patterns/SKILL.md +70 -0
  169. package/skills/messages-ops/SKILL.md +105 -0
  170. package/skills/ml-adoption-playbook/SKILL.md +57 -0
  171. package/skills/mle-workflow/SKILL.md +348 -0
  172. package/skills/motion-advanced/SKILL.md +597 -0
  173. package/skills/motion-foundations/SKILL.md +300 -0
  174. package/skills/motion-patterns/SKILL.md +435 -0
  175. package/skills/motion-ui/SKILL.md +576 -0
  176. package/skills/mysql-patterns/SKILL.md +413 -0
  177. package/skills/nanoclaw-repl/SKILL.md +34 -0
  178. package/skills/nasiko-control-plane/SKILL.md +49 -0
  179. package/skills/nestjs-patterns/SKILL.md +231 -0
  180. package/skills/netmiko-ssh-automation/SKILL.md +174 -0
  181. package/skills/network-bgp-diagnostics/SKILL.md +168 -0
  182. package/skills/network-config-validation/SKILL.md +211 -0
  183. package/skills/network-interface-health/SKILL.md +153 -0
  184. package/skills/nextjs-turbopack/SKILL.md +58 -0
  185. package/skills/nodejs-keccak256/SKILL.md +103 -0
  186. package/skills/nutrient-document-processing/SKILL.md +168 -0
  187. package/skills/nuxt4-patterns/SKILL.md +101 -0
  188. package/skills/opensource-pipeline/SKILL.md +256 -0
  189. package/skills/orch-add-feature/SKILL.md +45 -0
  190. package/skills/orch-build-mvp/SKILL.md +49 -0
  191. package/skills/orch-change-feature/SKILL.md +43 -0
  192. package/skills/orch-fix-defect/SKILL.md +43 -0
  193. package/skills/orch-pipeline/SKILL.md +121 -0
  194. package/skills/orch-refine-code/SKILL.md +44 -0
  195. package/skills/parallel-execution-optimizer/SKILL.md +74 -0
  196. package/skills/perl-patterns/SKILL.md +505 -0
  197. package/skills/perl-security/SKILL.md +504 -0
  198. package/skills/perl-testing/SKILL.md +476 -0
  199. package/skills/plan-canvas/SKILL.md +196 -0
  200. package/skills/plankton-code-quality/SKILL.md +237 -0
  201. package/skills/postgres-patterns/SKILL.md +148 -0
  202. package/skills/prediction-market-oracle-research/SKILL.md +64 -0
  203. package/skills/prediction-market-risk-review/SKILL.md +61 -0
  204. package/skills/prisma-patterns/SKILL.md +401 -0
  205. package/skills/product-capability/SKILL.md +142 -0
  206. package/skills/product-lens/SKILL.md +93 -0
  207. package/skills/production-audit/SKILL.md +207 -0
  208. package/skills/production-scheduling/SKILL.md +238 -0
  209. package/skills/project-flow-ops/SKILL.md +112 -0
  210. package/skills/prompt-optimizer/SKILL.md +398 -0
  211. package/skills/python-patterns/SKILL.md +751 -0
  212. package/skills/python-testing/SKILL.md +817 -0
  213. package/skills/pytorch-patterns/SKILL.md +397 -0
  214. package/skills/quality-nonconformance/SKILL.md +260 -0
  215. package/skills/quarkus-patterns/SKILL.md +723 -0
  216. package/skills/quarkus-security/SKILL.md +468 -0
  217. package/skills/quarkus-tdd/SKILL.md +812 -0
  218. package/skills/quarkus-verification/SKILL.md +481 -0
  219. package/skills/ralphinho-rfc-pipeline/SKILL.md +68 -0
  220. package/skills/react-native-patterns/SKILL.md +326 -0
  221. package/skills/react-patterns/SKILL.md +342 -0
  222. package/skills/react-performance/SKILL.md +575 -0
  223. package/skills/react-testing/SKILL.md +424 -0
  224. package/skills/recsys-pipeline-architect/SKILL.md +115 -0
  225. package/skills/recursive-decision-ledger/SKILL.md +81 -0
  226. package/skills/redis-patterns/SKILL.md +404 -0
  227. package/skills/regex-vs-llm-structured-text/SKILL.md +221 -0
  228. package/skills/remotion-video-creation/SKILL.md +43 -0
  229. package/skills/repo-scan/SKILL.md +170 -0
  230. package/skills/research-ops/SKILL.md +113 -0
  231. package/skills/returns-reverse-logistics/SKILL.md +240 -0
  232. package/skills/rules-distill/SKILL.md +265 -0
  233. package/skills/rust-patterns/SKILL.md +500 -0
  234. package/skills/rust-testing/SKILL.md +501 -0
  235. package/skills/safety-guard/SKILL.md +76 -0
  236. package/skills/santa-method/SKILL.md +307 -0
  237. package/skills/scientific-db-pubmed-database/SKILL.md +176 -0
  238. package/skills/scientific-db-uspto-database/SKILL.md +178 -0
  239. package/skills/scientific-pkg-gget/SKILL.md +167 -0
  240. package/skills/scientific-thinking-literature-review/SKILL.md +193 -0
  241. package/skills/scientific-thinking-scholar-evaluation/SKILL.md +161 -0
  242. package/skills/search-first/SKILL.md +183 -0
  243. package/skills/security-bounty-hunter/SKILL.md +100 -0
  244. package/skills/security-scan/SKILL.md +166 -0
  245. package/skills/seo/SKILL.md +155 -0
  246. package/skills/skill-scout/SKILL.md +141 -0
  247. package/skills/skill-stocktake/SKILL.md +195 -0
  248. package/skills/social-graph-ranker/SKILL.md +155 -0
  249. package/skills/social-publisher/SKILL.md +130 -0
  250. package/skills/springboot-patterns/SKILL.md +315 -0
  251. package/skills/springboot-security/SKILL.md +273 -0
  252. package/skills/springboot-tdd/SKILL.md +159 -0
  253. package/skills/springboot-verification/SKILL.md +232 -0
  254. package/skills/swift-actor-persistence/SKILL.md +144 -0
  255. package/skills/swift-concurrency-6-2/SKILL.md +216 -0
  256. package/skills/swift-protocol-di-testing/SKILL.md +191 -0
  257. package/skills/swiftui-patterns/SKILL.md +259 -0
  258. package/skills/taste/SKILL.md +264 -0
  259. package/skills/tdd-workflow/SKILL.md +583 -0
  260. package/skills/team-agent-orchestration/SKILL.md +111 -0
  261. package/skills/team-builder/SKILL.md +169 -0
  262. package/skills/terminal-opener/SKILL.md +55 -0
  263. package/skills/terminal-ops/SKILL.md +110 -0
  264. package/skills/tinystruct-patterns/SKILL.md +279 -0
  265. package/skills/token-budget-advisor/SKILL.md +134 -0
  266. package/skills/ui-demo/SKILL.md +466 -0
  267. package/skills/ui-to-vue/SKILL.md +135 -0
  268. package/skills/uncloud/SKILL.md +344 -0
  269. package/skills/unified-memory/SKILL.md +170 -0
  270. package/skills/unified-notifications-ops/SKILL.md +188 -0
  271. package/skills/verification-loop/SKILL.md +129 -0
  272. package/skills/video-editing/SKILL.md +311 -0
  273. package/skills/videodb/SKILL.md +375 -0
  274. package/skills/vite-patterns/SKILL.md +450 -0
  275. package/skills/vue-patterns/SKILL.md +471 -0
  276. package/skills/windows-desktop-e2e/SKILL.md +888 -0
  277. package/skills/workspace-surface-audit/SKILL.md +126 -0
  278. package/skills/x-api/SKILL.md +235 -0
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: agent-payment-x402
3
+ description: Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.
4
+ metadata:
5
+ origin: community
6
+ ---
7
+
8
+ # Agent Payment Execution (x402)
9
+
10
+ Enable AI agents to make policy-gated payments with built-in spending controls. Uses the x402 HTTP payment protocol and MCP tools so agents can pay for external services, APIs, or other agents without custodial risk.
11
+
12
+ ## When to Use
13
+
14
+ Use when: your agent needs to pay for an API call, purchase a service, settle with another agent, enforce per-task spending limits, or manage a non-custodial wallet. Pairs naturally with cost-aware-llm-pipeline and security-review skills.
15
+
16
+ ## Decision Tree
17
+
18
+ Choose the integration path based on whether your agent is buying access to a paid API or charging others for one:
19
+
20
+ | Need | Recommended path |
21
+ |------|------------------|
22
+ | Agent pays a 402-gated API on Base or another agentwallet-supported chain | Use `agentwallet-sdk` as an MCP payment server with strict spending policy |
23
+ | Agent pays a 402-gated API on X Layer | Use OKX Agent Payments Protocol from `okx/onchainos-skills`; `okx-x402-payment` is a deprecated legacy alias |
24
+ | TypeScript API charges agents | Use OKX Payments TypeScript seller SDK docs for Express, Hono, Fastify, or Next.js |
25
+ | Go API charges agents | Use OKX Payments Go seller SDK docs for Gin, Echo, or `net/http` |
26
+ | Rust API charges agents | Use OKX Payments Rust seller SDK docs for Axum |
27
+ | Java API charges agents | Use OKX Payments Java seller SDK docs for Spring Boot 2/3, Java EE, or Jakarta |
28
+ | Python API charges agents | Check the current OKX Payments repository before implementation; a Python seller guide may not be available |
29
+
30
+ ## Supported Networks
31
+
32
+ - `agentwallet-sdk`: use the package docs to confirm current network coverage before production. Base Sepolia is the safest development default; Base mainnet is the production path called out by the original skill.
33
+ - OKX Payments / X Layer: current seller docs target X Layer (`eip155:196`) and USDT0 settlement. Fetch current SDK docs before generating production code because payment packages and facilitator behavior can change quickly.
34
+
35
+ ## How It Works
36
+
37
+ ### x402 Protocol
38
+ x402 extends HTTP 402 (Payment Required) into a machine-negotiable flow. When a server returns `402`, the agent's payment tool negotiates price, checks budget, signs a transaction, and retries only inside the policy and confirmation boundary set by the orchestrator.
39
+
40
+ ### Spending Controls
41
+ Every payment tool call enforces a `SpendingPolicy`:
42
+ - **Per-task budget** — max spend for a single agent action
43
+ - **Per-session budget** — cumulative limit across an entire session
44
+ - **Allowlisted recipients** — restrict which addresses/services the agent can pay
45
+ - **Rate limits** — max transactions per minute/hour
46
+
47
+ ### Non-Custodial Wallets
48
+ Agents hold their own keys via ERC-4337 smart accounts. The orchestrator sets policy before delegation; the agent can only spend within bounds. No pooled funds, no custodial risk.
49
+
50
+ ## MCP Integration
51
+
52
+ The payment layer exposes standard MCP tools that slot into any Claude Code or agent harness setup.
53
+
54
+ > **Security note**: Always pin the package version. This tool manages private keys — unpinned `npx` installs introduce supply-chain risk.
55
+
56
+ ### Option A: agentwallet-sdk (Base / multi-chain)
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "agentpay": {
62
+ "command": "npx",
63
+ "args": ["agentwallet-sdk@6.0.0"]
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ ### Available Tools (agent-callable)
70
+
71
+ | Tool | Purpose |
72
+ |------|---------|
73
+ | `get_balance` | Check agent wallet balance |
74
+ | `send_payment` | Send payment to address or ENS |
75
+ | `check_spending` | Query remaining budget |
76
+ | `list_transactions` | Audit trail of all payments |
77
+
78
+ > **Note**: Spending policy is set by the **orchestrator** before delegating to the agent — not by the agent itself. This prevents agents from escalating their own spending limits. Configure policy via `set_policy` in your orchestration layer or pre-task hook, never as an agent-callable tool.
79
+
80
+ ### Option B: OKX Agent Payments Protocol (X Layer)
81
+
82
+ Use this path for X Layer x402, Multi-Party Payment (MPP), session payment, charge, and A2A charge flows.
83
+
84
+ For buyer-side agent flows:
85
+
86
+ 1. Install or reference the current `okx/onchainos-skills` repository.
87
+ 2. Use `skills/okx-agent-payments-protocol/SKILL.md` as the dispatcher.
88
+ 3. Treat `skills/okx-x402-payment/SKILL.md` as a deprecated compatibility alias, not as the canonical skill.
89
+ 4. Require explicit user confirmation before wallet status checks or payment actions. Do not hide payment execution behind a generic tool call.
90
+
91
+ For seller-side API flows, fetch the latest language-specific guide before generating code:
92
+
93
+ | Runtime | Current guide |
94
+ |---------|---------------|
95
+ | TypeScript | `https://raw.githubusercontent.com/okx/payments/main/typescript/SELLER.md` |
96
+ | Go | `https://raw.githubusercontent.com/okx/payments/main/go/x402/SELLER.md` |
97
+ | Rust | `https://raw.githubusercontent.com/okx/payments/main/rust/x402/SELLER.md` |
98
+ | Java | `https://raw.githubusercontent.com/okx/payments/main/java/SELLER.md` |
99
+
100
+ Do not copy examples from older docs without checking the current OKX repository. Current OKX guidance uses `okx-agent-payments-protocol` as the dispatcher, and Java seller docs are now available.
101
+
102
+ ## Examples
103
+
104
+ ### Budget enforcement in an MCP client
105
+
106
+ When building an orchestrator that calls the agentpay MCP server, enforce budgets before dispatching paid tool calls.
107
+
108
+ > **Prerequisites**: Install the package before adding the MCP config — `npx` without `-y` will prompt for confirmation in non-interactive environments, causing the server to hang: `npm install -g agentwallet-sdk@6.0.0`
109
+
110
+ ```typescript
111
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
112
+ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
113
+
114
+ async function main() {
115
+ // 1. Validate credentials before constructing the transport.
116
+ // A missing key must fail immediately — never let the subprocess start without auth.
117
+ const walletKey = process.env.WALLET_PRIVATE_KEY;
118
+ if (!walletKey) {
119
+ throw new Error("WALLET_PRIVATE_KEY is not set — refusing to start payment server");
120
+ }
121
+
122
+ // Connect to the agentpay MCP server via stdio transport.
123
+ // Whitelist only the env vars the server needs — never forward all of process.env
124
+ // to a third-party subprocess that manages private keys.
125
+ const transport = new StdioClientTransport({
126
+ command: "npx",
127
+ args: ["agentwallet-sdk@6.0.0"],
128
+ env: {
129
+ PATH: process.env.PATH ?? "",
130
+ NODE_ENV: process.env.NODE_ENV ?? "production",
131
+ WALLET_PRIVATE_KEY: walletKey,
132
+ },
133
+ });
134
+ const agentpay = new Client({ name: "orchestrator", version: "1.0.0" });
135
+ await agentpay.connect(transport);
136
+
137
+ // 2. Set spending policy before delegating to the agent.
138
+ // Always verify success — a silent failure means no controls are active.
139
+ const policyResult = await agentpay.callTool({
140
+ name: "set_policy",
141
+ arguments: {
142
+ per_task_budget: 0.50,
143
+ per_session_budget: 5.00,
144
+ allowlisted_recipients: ["api.example.com"],
145
+ },
146
+ });
147
+ if (policyResult.isError) {
148
+ throw new Error(
149
+ `Failed to set spending policy — do not delegate: ${JSON.stringify(policyResult.content)}`
150
+ );
151
+ }
152
+
153
+ // 3. Use preToolCheck before any paid action
154
+ await preToolCheck(agentpay, 0.01);
155
+ }
156
+
157
+ // Pre-tool hook: fail-closed budget enforcement with four distinct error paths.
158
+ async function preToolCheck(agentpay: Client, apiCost: number): Promise<void> {
159
+ // Path 1: Reject invalid input (NaN/Infinity bypass the < comparison)
160
+ if (!Number.isFinite(apiCost) || apiCost < 0) {
161
+ throw new Error(`Invalid apiCost: ${apiCost} — action blocked`);
162
+ }
163
+
164
+ // Path 2: Transport/connectivity failure
165
+ let result;
166
+ try {
167
+ result = await agentpay.callTool({ name: "check_spending" });
168
+ } catch (err) {
169
+ throw new Error(`Payment service unreachable — action blocked: ${err}`);
170
+ }
171
+
172
+ // Path 3: Tool returned an error (e.g., auth failure, wallet not initialised)
173
+ if (result.isError) {
174
+ throw new Error(
175
+ `check_spending failed — action blocked: ${JSON.stringify(result.content)}`
176
+ );
177
+ }
178
+
179
+ // Path 4: Parse and validate the response shape
180
+ let remaining: number;
181
+ try {
182
+ const parsed = JSON.parse(
183
+ (result.content as Array<{ text: string }>)[0].text
184
+ );
185
+ if (!Number.isFinite(parsed?.remaining)) {
186
+ throw new TypeError("missing or non-finite 'remaining' field");
187
+ }
188
+ remaining = parsed.remaining;
189
+ } catch (err) {
190
+ throw new Error(
191
+ `check_spending returned unexpected format — action blocked: ${err}`
192
+ );
193
+ }
194
+
195
+ // Path 5: Budget exceeded
196
+ if (remaining < apiCost) {
197
+ throw new Error(
198
+ `Budget exceeded: need $${apiCost} but only $${remaining} remaining`
199
+ );
200
+ }
201
+ }
202
+
203
+ main().catch((err) => {
204
+ console.error(err);
205
+ process.exitCode = 1;
206
+ });
207
+ ```
208
+
209
+ ## Best Practices
210
+
211
+ - **Set budgets before delegation**: When spawning sub-agents, attach a SpendingPolicy via your orchestration layer. Never give an agent unlimited spend.
212
+ - **Pin your dependencies**: Always specify an exact version in your MCP config (e.g., `agentwallet-sdk@6.0.0`). Verify package integrity before deploying to production.
213
+ - **Audit trails**: Use `list_transactions` in post-task hooks to log what was spent and why.
214
+ - **Fail closed**: If the payment tool is unreachable, block the paid action — don't fall back to unmetered access.
215
+ - **Pair with security-review**: Payment tools are high-privilege. Apply the same scrutiny as shell access.
216
+ - **Test with testnets first**: Use Base Sepolia for development; switch to Base mainnet for production.
217
+
218
+ ## Production Reference
219
+
220
+ - **npm**: [`agentwallet-sdk`](https://www.npmjs.com/package/agentwallet-sdk)
221
+ - **Merged into NVIDIA NeMo Agent Toolkit**: [PR #17](https://github.com/NVIDIA/NeMo-Agent-Toolkit-Examples/pull/17) — x402 payment tool for NVIDIA's agent examples
222
+ - **Protocol spec**: [x402.org](https://x402.org)
223
+ - **OKX Payments SDKs**: [`okx/payments`](https://github.com/okx/payments) — TypeScript, Go, Rust, and Java seller integrations for X Layer x402
224
+ - **OKX Agent Payments Protocol skill**: [`okx/onchainos-skills`](https://github.com/okx/onchainos-skills/tree/main/skills/okx-agent-payments-protocol)
225
+ - **OKX Payments overview**: [web3.okx.com/onchainos/dev-docs/payments/overview](https://web3.okx.com/onchainos/dev-docs/payments/overview)
@@ -0,0 +1,182 @@
1
+ ---
2
+ name: agent-self-evaluation
3
+ description: Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.
4
+ origin: ECC
5
+ ---
6
+
7
+ # Agent Self-Evaluation
8
+
9
+ After completing a complex task, the agent pauses to rate its own output against a structured 5-axis rubric. This is NOT a pass/fail gate — it's a deliberate reflection step that catches omissions, flags overconfidence, and surface areas for improvement before the user has to.
10
+
11
+ ## When to Activate
12
+
13
+ - After writing code that spans 3+ files or 50+ lines
14
+ - After completing a multi-step workflow (implement → test → review)
15
+ - After a debugging session that involved 3+ attempts
16
+ - After producing a design document, architecture decision, or written analysis
17
+ - When the user asks "how good was that?" or "rate yourself"
18
+ - At the end of any session Stop hook (if configured — see `references/hook-integration.md`)
19
+
20
+ ## Core Concepts
21
+
22
+ ### The 5 Evaluation Axes
23
+
24
+ | Axis | Question | What it catches |
25
+ |---|---|---|
26
+ | **Accuracy** | Are the facts, claims, and outputs correct? | Hallucinations, wrong API names, incorrect syntax, false statements |
27
+ | **Completeness** | Did it cover everything the user asked for? | Missed edge cases, unhandled error paths, forgotten requirements, skipped subtasks |
28
+ | **Clarity** | Is the explanation understandable and well-structured? | Confusing explanations, jargon without definition, missing context, rambling |
29
+ | **Actionability** | Can the user act on the output immediately? | Vague suggestions, missing steps, "you should X" without showing how, no verification path |
30
+ | **Conciseness** | Did it use the minimum words/tokens needed? | Redundancy, over-explanation, repeating the user's question verbatim, filler content |
31
+
32
+ ### Scoring Scale
33
+
34
+ ```
35
+ 5 — Exceptional: no reasonable improvement possible
36
+ 4 — Good: minor nits only, no substantive gaps
37
+ 3 — Adequate: meets the request but has a notable weakness on at least one axis
38
+ 2 — Weak: has a clear gap that affects usability or correctness
39
+ 1 — Poor: fundamentally misses the request or contains significant errors
40
+ ```
41
+
42
+ ### The Evidence Rule
43
+
44
+ Every score below 5 MUST cite specific evidence. A score of 3 cannot just say "could be better" — it must say exactly what is missing or wrong. The mantra: **"Show the gap, don't just name it."**
45
+
46
+ ## Workflow
47
+
48
+ ### Step 1: Collect the Raw Material
49
+
50
+ Gather what you'll evaluate:
51
+
52
+ ```
53
+ - The original user request (read back from conversation)
54
+ - Your final response/output (the deliverable)
55
+ - Any tool outputs that verify correctness (test results, exit codes, lint output)
56
+ - Any user feedback received during the task (corrections, "try again", "that's not right")
57
+ ```
58
+
59
+ ### Step 2: Score Each Axis Independently
60
+
61
+ Work through the 5 axes one at a time. For each:
62
+
63
+ 1. Read the axis question
64
+ 2. Find evidence (or lack of evidence) in the output
65
+ 3. Assign a score 1-5
66
+ 4. If score < 5, write a one-sentence improvement note citing the gap
67
+
68
+ Do NOT average the scores in your head first and then work backwards. Score each axis fresh.
69
+
70
+ ### Step 3: Produce the Evaluation Report
71
+
72
+ Use the template from `templates/evaluation-report.md`. The report must include:
73
+
74
+ ```
75
+ - One-line summary
76
+ - 5-axis scorecard (score + evidence per axis)
77
+ - Overall score (simple average, rounded to 1 decimal)
78
+ - 1-3 specific improvements ranked by impact
79
+ - Self-check: "Would the user agree with this assessment?"
80
+ ```
81
+
82
+ ### Step 4: Apply the Improvement
83
+
84
+ If any axis scored 3 or below:
85
+
86
+ 1. State what you would do differently
87
+ 2. If the gap is fixable in < 30 seconds (missing link, unclear phrasing), fix it now
88
+ 3. If the gap requires rework, flag it explicitly: "This axis scored [reason] because [evidence]. Re-running with [specific fix] would likely raise it to [score]."
89
+
90
+ ## Code Examples
91
+
92
+ ### Example: Good Evaluation (Score 4+)
93
+
94
+ ```
95
+ Task: Add retry logic to HTTP client
96
+
97
+ Scorecard:
98
+ Accuracy: 5 — All API calls correct. Verified: retries use
99
+ exponential backoff. No hallucinated methods.
100
+ Completeness: 4 — Covered happy path + 3 error cases. Missing:
101
+ timeout handling for hung connections.
102
+ Clarity: 5 — Code comments explain backoff formula.
103
+ PR description links to incident that motivated this.
104
+ Actionability:5 — Single merge. No follow-up tasks. Tests pass.
105
+ Conciseness: 4 — 47 lines total. The retry loop could be extracted
106
+ into a helper to drop ~8 lines.
107
+
108
+ Overall: 4.6 — One gap (timeout handling). Fix before merging.
109
+ ```
110
+
111
+ ### Example: Weak Evaluation (Score 2-3)
112
+
113
+ ```
114
+ Task: Add retry logic to HTTP client
115
+
116
+ Scorecard:
117
+ Accuracy: 2 — Used urllib3 which doesn't match our
118
+ httpx-based codebase. Wrong library.
119
+ Completeness: 3 — Works for GET. POST/PUT not handled (user
120
+ said "all HTTP requests").
121
+ Clarity: 4 — Code is readable. Good variable names.
122
+ Actionability:2 — "Add tests" mentioned but no test file created.
123
+ User has to write tests before merging.
124
+ Conciseness: 3 — 120 lines. The retry config is duplicated in
125
+ 3 places instead of one shared RetryConfig object.
126
+
127
+ Overall: 2.8 — Wrong library used. Needs httpx rewrite.
128
+ Fix accuracy first (switch to httpx), then extend to all
129
+ HTTP methods, then consolidate config.
130
+ ```
131
+
132
+ ## Anti-Patterns
133
+
134
+ ### "Everything is a 5"
135
+
136
+ ```
137
+ FAIL: Accuracy: 5 — All good.
138
+ Completeness: 5 — Everything covered.
139
+ Clarity: 5 — Clear.
140
+ ```
141
+
142
+ No evidence cited. This is self-congratulation, not evaluation. A real 5 requires proving there's nothing to improve.
143
+
144
+ ### Over-penalizing for scope creep
145
+
146
+ ```
147
+ FAIL: Completeness: 2 — Didn't handle WebSocket connections or
148
+ gRPC streaming (user didn't ask for these)
149
+ ```
150
+
151
+ Only evaluate against what the user actually requested, not what you could have additionally built.
152
+
153
+ ### Using the evaluation to re-litigate
154
+
155
+ ```
156
+ FAIL: "As I said earlier, this approach is wrong. Score: 1"
157
+ ```
158
+
159
+ The evaluation is about the delivered output, not about re-arguing design decisions that were already made. If the approach was wrong, that should have been caught before delivery.
160
+
161
+ ### Mixing personal preference with objective gaps
162
+
163
+ ```
164
+ FAIL: "Score: 3. I don't like Python decorators."
165
+ ```
166
+
167
+ "Don't like" is not evidence. Cite a concrete readability, testability, or correctness concern, or leave the score at 4+.
168
+
169
+ ## Best Practices
170
+
171
+ - **Evaluate the output, not the process.** The user cares about what you delivered, not how many iterations you took.
172
+ - **One improvement per weak axis.** Don't list 5 things for one axis — pick the highest-impact gap.
173
+ - **Tie improvements to user impact.** "Missing error handling means the user's API call will crash silently" beats "add error handling."
174
+ - **Be specific about what 'fixed' looks like.** "Re-run with httpx transport configured for retries" beats "fix the library issue."
175
+ - **Use tool outputs as evidence.** If tests passed, cite them. If lint is clean, cite it. Don't guess — grep for the proof.
176
+ - **If you can't find any gaps, try harder.** A perfect score across all 5 axes is rare. Ask: "If I were the user, what would annoy me about this output?"
177
+
178
+ ## Related Skills
179
+
180
+ - `agent-eval` — Head-to-head comparison of different coding agents on benchmark tasks
181
+ - `verification-loop` — Systematic verification of outputs against expected results
182
+ - `security-review` — Security-focused code review checklist
@@ -0,0 +1,216 @@
1
+ ---
2
+ name: agent-sort
3
+ description: Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.
4
+ metadata:
5
+ origin: ECC
6
+ ---
7
+
8
+ # Agent Sort
9
+
10
+ Use this skill when a repo needs a project-specific ECC surface instead of the default full install.
11
+
12
+ The goal is not to guess what "feels useful." The goal is to classify ECC components with evidence from the actual codebase.
13
+
14
+ ## When to Use
15
+
16
+ - A project only needs a subset of ECC and full installs are too noisy
17
+ - The repo stack is clear, but nobody wants to hand-curate skills one by one
18
+ - A team wants a repeatable install decision backed by grep evidence instead of opinion
19
+ - You need to separate always-loaded daily workflow surfaces from searchable library/reference surfaces
20
+ - A repo has drifted into the wrong language, rule, or hook set and needs cleanup
21
+
22
+ ## Non-Negotiable Rules
23
+
24
+ - Use the current repository as the source of truth, not generic preferences
25
+ - Every DAILY decision must cite concrete repo evidence
26
+ - LIBRARY does not mean "delete"; it means "keep accessible without loading by default"
27
+ - Do not install hooks, rules, or scripts that the current repo cannot use
28
+ - Prefer ECC-native surfaces; do not introduce a second install system
29
+
30
+ ## Outputs
31
+
32
+ Produce these artifacts in order:
33
+
34
+ 1. DAILY inventory
35
+ 2. LIBRARY inventory
36
+ 3. install plan
37
+ 4. verification report
38
+ 5. optional `skill-library` router if the project wants one
39
+
40
+ ## Classification Model
41
+
42
+ Use two buckets only:
43
+
44
+ - `DAILY`
45
+ - should load every session for this repo
46
+ - strongly matched to the repo's language, framework, workflow, or operator surface
47
+ - `LIBRARY`
48
+ - useful to retain, but not worth loading by default
49
+ - should remain reachable through search, router skill, or selective manual use
50
+
51
+ ## Evidence Sources
52
+
53
+ Use repo-local evidence before making any classification:
54
+
55
+ - file extensions
56
+ - package managers and lockfiles
57
+ - framework configs
58
+ - CI and hook configs
59
+ - build/test scripts
60
+ - imports and dependency manifests
61
+ - repo docs that explicitly describe the stack
62
+
63
+ Useful commands include:
64
+
65
+ ```bash
66
+ rg --files
67
+ rg -n "typescript|react|next|supabase|django|spring|flutter|swift"
68
+ cat package.json
69
+ cat pyproject.toml
70
+ cat Cargo.toml
71
+ cat pubspec.yaml
72
+ cat go.mod
73
+ ```
74
+
75
+ ## Parallel Review Passes
76
+
77
+ If parallel subagents are available, split the review into these passes:
78
+
79
+ 1. Agents
80
+ - classify `agents/*`
81
+ 2. Skills
82
+ - classify `skills/*`
83
+ 3. Commands
84
+ - classify `commands/*`
85
+ 4. Rules
86
+ - classify `rules/*`
87
+ 5. Hooks and scripts
88
+ - classify hook surfaces, MCP health checks, helper scripts, and OS compatibility
89
+ 6. Extras
90
+ - classify contexts, examples, MCP configs, templates, and guidance docs
91
+
92
+ If subagents are not available, run the same passes sequentially.
93
+
94
+ ## Core Workflow
95
+
96
+ ### 1. Read the repo
97
+
98
+ Establish the real stack before classifying anything:
99
+
100
+ - languages in use
101
+ - frameworks in use
102
+ - primary package manager
103
+ - test stack
104
+ - lint/format stack
105
+ - deployment/runtime surface
106
+ - operator integrations already present
107
+
108
+ ### 2. Build the evidence table
109
+
110
+ For every candidate surface, record:
111
+
112
+ - component path
113
+ - component type
114
+ - proposed bucket
115
+ - repo evidence
116
+ - short justification
117
+
118
+ Use this format:
119
+
120
+ ```text
121
+ skills/frontend-patterns | skill | DAILY | 84 .tsx files, next.config.ts present | core frontend stack
122
+ skills/django-patterns | skill | LIBRARY | no .py files, no pyproject.toml | not active in this repo
123
+ rules/typescript/* | rules | DAILY | package.json + tsconfig.json | active TS repo
124
+ rules/python/* | rules | LIBRARY | zero Python source files | keep accessible only
125
+ ```
126
+
127
+ ### 3. Decide DAILY vs LIBRARY
128
+
129
+ Promote to `DAILY` when:
130
+
131
+ - the repo clearly uses the matching stack
132
+ - the component is general enough to help every session
133
+ - the repo already depends on the corresponding runtime or workflow
134
+
135
+ Demote to `LIBRARY` when:
136
+
137
+ - the component is off-stack
138
+ - the repo might need it later, but not every day
139
+ - it adds context overhead without immediate relevance
140
+
141
+ ### 4. Build the install plan
142
+
143
+ Translate the classification into action:
144
+
145
+ - DAILY skills -> install or keep in `.claude/skills/`
146
+ - DAILY commands -> keep as explicit shims only if still useful
147
+ - DAILY rules -> install only matching language sets
148
+ - DAILY hooks/scripts -> keep only compatible ones
149
+ - LIBRARY surfaces -> keep accessible through search or `skill-library`
150
+
151
+ If the repo already uses selective installs, update that plan instead of creating another system.
152
+
153
+ ### 5. Create the optional library router
154
+
155
+ If the project wants a searchable library surface, create:
156
+
157
+ - `.claude/skills/skill-library/SKILL.md`
158
+
159
+ That router should contain:
160
+
161
+ - a short explanation of DAILY vs LIBRARY
162
+ - grouped trigger keywords
163
+ - where the library references live
164
+
165
+ Do not duplicate every skill body inside the router.
166
+
167
+ ### 6. Verify the result
168
+
169
+ After the plan is applied, verify:
170
+
171
+ - every DAILY file exists where expected
172
+ - stale language rules were not left active
173
+ - incompatible hooks were not installed
174
+ - the resulting install actually matches the repo stack
175
+
176
+ Return a compact report with:
177
+
178
+ - DAILY count
179
+ - LIBRARY count
180
+ - removed stale surfaces
181
+ - open questions
182
+
183
+ ## Handoffs
184
+
185
+ If the next step is interactive installation or repair, hand off to:
186
+
187
+ - `configure-ecc`
188
+
189
+ If the next step is overlap cleanup or catalog review, hand off to:
190
+
191
+ - `skill-stocktake`
192
+
193
+ If the next step is broader context trimming, hand off to:
194
+
195
+ - `strategic-compact`
196
+
197
+ ## Output Format
198
+
199
+ Return the result in this order:
200
+
201
+ ```text
202
+ STACK
203
+ - language/framework/runtime summary
204
+
205
+ DAILY
206
+ - always-loaded items with evidence
207
+
208
+ LIBRARY
209
+ - searchable/reference items with evidence
210
+
211
+ INSTALL PLAN
212
+ - what should be installed, removed, or routed
213
+
214
+ VERIFICATION
215
+ - checks run and remaining gaps
216
+ ```
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: agentic-engineering
3
+ description: Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.
4
+ metadata:
5
+ origin: ECC
6
+ ---
7
+
8
+ # Agentic Engineering
9
+
10
+ Use this skill for engineering workflows where AI agents perform most implementation work and humans enforce quality and risk controls.
11
+
12
+ ## Operating Principles
13
+
14
+ 1. Define completion criteria before execution.
15
+ 2. Decompose work into agent-sized units.
16
+ 3. Route model tiers by task complexity.
17
+ 4. Measure with evals and regression checks.
18
+
19
+ ## Eval-First Loop
20
+
21
+ 1. Define capability eval and regression eval.
22
+ 2. Run baseline and capture failure signatures.
23
+ 3. Execute implementation.
24
+ 4. Re-run evals and compare deltas.
25
+
26
+ ## Task Decomposition
27
+
28
+ Apply the 15-minute unit rule:
29
+ - each unit should be independently verifiable
30
+ - each unit should have a single dominant risk
31
+ - each unit should expose a clear done condition
32
+
33
+ ## Model Routing
34
+
35
+ - Haiku: classification, boilerplate transforms, narrow edits
36
+ - Sonnet: implementation and refactors
37
+ - Opus: architecture, root-cause analysis, multi-file invariants
38
+
39
+ ## Session Strategy
40
+
41
+ - Continue session for closely-coupled units.
42
+ - Start fresh session after major phase transitions.
43
+ - Compact after milestone completion, not during active debugging.
44
+
45
+ ## Review Focus for AI-Generated Code
46
+
47
+ Prioritize:
48
+ - invariants and edge cases
49
+ - error boundaries
50
+ - security and auth assumptions
51
+ - hidden coupling and rollout risk
52
+
53
+ Do not waste review cycles on style-only disagreements when automated format/lint already enforce style.
54
+
55
+ ## Cost Discipline
56
+
57
+ Track per task:
58
+ - model
59
+ - token estimate
60
+ - retries
61
+ - wall-clock time
62
+ - success/failure
63
+
64
+ Escalate model tier only when lower tier fails with a clear reasoning gap.