agentleFS
worldlibertyworldliberty/agentpay-sdk/skills/add-plugin/SKILL.md

add-plugin

Skill460 starsChanged 8 months agoMITView on GitHub

Use this skill when the user wants to add a new payment feature family to AgentPay (a new merchant protocol, chain flow, or paid-API integration) or generalize an existing one. Features live in the unprivileged payments service (`crates/agentpay-paymentd/src/features/<family>`), are exposed through documented methods in `crates/agentpay-api`, sign only through the signer daemon as the calling agent, and get a thin `agentpay` client command. Follow "Adding a paymentd method" in `docs/daemon-api.md`.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for tasks like "add support for merchant protocol X" or "add a new chain flow".

    line 8
  2. Very specific:

    All payment logic lives in agentpay-paymentd, which runs as an unprivileged service account, holds no keys, and does all network I/O.

    line 12
  3. Distinctive:

    Every signature comes from the signer daemon through the agent's own credentials, so its policies, spending limits, and manual approvals …

    line 18
  4. Very specific:

    Read "Adding a paymentd method" and "Manual approval in payment flows" in docs/daemon-api.md, then the closest reference family above.

    line 42
  5. Very specific:

    Add request and response fixtures, register them in src/tests/payments.rs, and add the spec entry with the fixtures verbatim.

    line 46
  6. Very specific:

    Run cargo xtask gen-api to regenerate docs/api/schema.json and client/src/generated/.

    line 48
  7. Very specific:

    If the feature needs a new signed action, add it to agentpay-domain and agentpay-policy first, so the signer daemon can reconstruct and …

    line 50
  8. Very specific:

    Add the client command (--json output, exit codes 0/1/2/3/4, all text in copy/).

    line 53
  9. Very specific:

    Update skills/agentpay-sdk (SKILL.md and references) with the new command.

    line 54

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add A Payments Feature Family

Use this skill for tasks like "add support for merchant protocol X" or "add a new chain flow".

Ground Truth

  • All payment logic lives in agentpay-paymentd, which runs as an unprivileged service account, holds no keys, and does all network I/O. The client (client/) only parses flags, calls the service through the generated types, and renders output.
  • The wire contract is crates/agentpay-api (#![deny(missing_docs)]), documented in docs/daemon-api.md. It is a public, versioned contract (API 1.x): new methods, optional fields, and new error kinds are minor additions; anything else is a major change.
  • Every signature comes from the signer daemon through the agent's own credentials, so its policies, spending limits, and manual approvals apply. Never sign in paymentd, never add a key, and never call signer admin methods from paymentd.
  • The step-by-step recipe is "Adding a paymentd method" in docs/daemon-api.md. Follow it exactly.

Layout

PieceLocation
Wire types and docscrates/agentpay-api/src/payments/<family>.rs, variants in payments/mod.rs
Fixturescrates/agentpay-api/fixtures/payments/<family>/<Method>.{request,response}.json
Speca #### <Method> entry under "Payments methods" in docs/daemon-api.md
Handlercrates/agentpay-paymentd/src/features/<family>.rs or features/<family>/
Routeone arm in crates/agentpay-paymentd/src/dispatch.rs
Chain accessa ChainProvider under crates/agentpay-paymentd/src/chains/
Paid HTTP helpersfeatures/http.rs (merchant client), features/payer.rs (Payer)
Client commandclient/src/commands/<group>.ts, wording in client/src/copy/

Reference implementations: features/x402/ (paid HTTP with a structured EIP-3009 signature), features/mpp/ (charges, sessions, persisted state), features/evm/ (transactions, nonces, manual-approval resume), features/solana/.

Deterministic Workflow

  1. Read "Adding a paymentd method" and "Manual approval in payment flows" in docs/daemon-api.md, then the closest reference family above.
  2. Define the wire types, request and response variants, and error kinds in agentpay-api, with rustdoc covering access, auth, units, side effects, idempotency, and errors.
  3. Add request and response fixtures, register them in src/tests/payments.rs, and add the spec entry with the fixtures verbatim.
  4. Run cargo xtask gen-api to regenerate docs/api/schema.json and client/src/generated/.
  5. Implement the handler under features/<family>; route it with one arm in dispatch.rs.
  6. If the feature needs a new signed action, add it to agentpay-domain and agentpay-policy first, so the signer daemon can reconstruct and policy-check it from structured fields. Never ask the signer daemon to sign an opaque hash.
  7. Add the client command (--json output, exit codes 0/1/2/3/4, all text in copy/).
  8. Update skills/agentpay-sdk (SKILL.md and references) with the new command.
  9. Verify (below).

Implementation Rules

  • Amounts on the wire are DecimalU128 strings; say whether a field is base units or whole units.
  • Validate every merchant input before signing; check every signature signerd returns before it leaves the process.
  • Manual approval: either resend the exact stored action (ResumeApproved) or document why the flow cannot be resumed, as for x402 and MPP.
  • Secrets (tokens, merchant credentials, passphrases) never go in logs, error messages, arguments, or environment variables; wipe them after use with zeroize.
  • No unwrap outside tests. Every file stays under 1,000 lines.
  • Third-party protocols: reuse an existing crate where it exposes open traits for signing (as x402-types and mpp do) rather than reimplementing the protocol.

Testing Rule

  • Unit-test handlers with signer::testing::InProcessSigner (a real in-memory signer daemon with policies) and ScriptedSigner; use mock RPC servers and the scripted merchant in features/http/merchant.rs. Never hit live third-party services in tests.
  • Cover policy denial, manual approval, malformed merchant answers, and the "nothing was signed" guarantee for rejected inputs.
  • Extend crates/agentpay-paymentd/tests/e2e.rs for an end-to-end check over real sockets.
  • Client: Vitest tests against the fake daemon (client/test/helpers/fake-daemon.ts) using the API fixtures.

Verify

just lint     # fmt, clippy -D warnings, file length, no JavaScript, gen-api --check, API docs
just test
just client-test && just client-lint

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.