Skip to content

Add splits-v2 agent skill (draft) - #106

Open
zherring wants to merge 4 commits into
mainfrom
zherring/spike-agent-skills
Open

zherring wants to merge 4 commits into
mainfrom
zherring/spike-agent-skills

Conversation

@zherring

Copy link
Copy Markdown
Contributor

What

A first draft of a splits-v2 agent skill, at skills/splits-v2/:

  • SKILL.md (90 lines): when to use it, push vs pull, creating a split, distributing and withdrawing, Arc-specific token-id rules, safety rules.
  • references/distribute-existing-split.md: recovering a split's config, verifying it against splitHash(), and withdrawing for Pull splits.

Arc asked for Splits skills. This is the thin version: it holds no contract addresses or other volatile values, and points at the docs for those.

Depends on

#105 (Networks section with the Arc page). The skill links to networks/arc.md, which 404s until #105 is merged and deployed. Everything else it links to is live.

How the claims were checked

The Arc and SDK claims were checked against deployed bytecode, the SDK source (6.7.0), eth_call simulations, and four real transactions on Arc mainnet (four 0.1 USDC splits: Pull and Push, funded by ERC-20 transfer and by native send). Still simulation-only: wrong-id withdraw reverting, blocklisted and reverting recipients, and mutable-owner flows (update, pause).

Known caveats

  • The skill says distributorFeePercent max is 6.5535. The existing SDK docs say "<10". The contract limit is a uint16 on a 1e6 scale, so 6.5535 is right; the docs need a separate fix.
  • Several SDK docs pages have errors the skill works around (setPause vs setPaused, transferOwnership vs initiateControlTransfer, withdraw living on WarehouseClient). Those are not fixed here.
  • Not tested: installing it with npx skills add 0xSplits/docs, and whether agents actually invoke it. Skills are not reliably invoked, so the safety rules also live in the docs.
  • The skill includes a one-line pointer to Splits Treasury under "When not to use", phrased as an option for the user to decide on. Say if you'd rather drop it.

Not in this PR

Fund-moving recovery scripts. They exist but have not had an engineering review, so they are deliberately not bundled.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WmTHDeVKp4PcqbpqhvBGME

zherring and others added 2 commits October 23, 2026 17:45
Add skills/splits-v2/SKILL.md plus a reference for distributing splits the
caller did not create. Draft only; facts limited to the verified-facts ledger.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmTHDeVKp4PcqbpqhvBGME
Mainnet runs on Arc showed a Pull split keeps 1 unit in the contract and
1 in its own Warehouse bucket (plus rounding remainders), and each
recipient's Warehouse bucket keeps 1 that is carried into the next
withdraw.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmTHDeVKp4PcqbpqhvBGME
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
protocol-docs Ready Ready Preview Oct 26, 2026 11:11pm UTC

Request Review

@zherring
zherring marked this pull request as ready for review October 26, 2026 15:11
@zherring
zherring requested a review from mihoward21 October 26, 2026 15:12
A blocklisted distributor only reverts a Push distribute when the fee is
above 0, and a Pull split credits the distributor reward to the
Warehouse (it needs a withdraw) instead of paying it out.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmTHDeVKp4PcqbpqhvBGME

@mihoward21 mihoward21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zherring couple notes

- SDK: `SplitV2Client.getSplitMetadataViaProvider({ splitAddress, chainId })` rebuilds it from logs. On V2.1 and V2.2 it reads `updateBlockNumber()` and fetches that single block's logs, which works on Arc.
- Manual: call `updateBlockNumber()` on the split (V2.1 and V2.2, not V2.0), then `getLogs` for `SplitUpdated(Split)` from the split address at exactly that block. The latest config is the event at that block. The event is also emitted at creation.
- The SDK's data client path needs `apiConfig` and a subgraph-indexed chain; Arc is not one, so Arc always uses logs.
- Arc's public RPC caps `eth_getLogs` block ranges and rate-limits; prefer the single-block query.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think these are supposed to be generic docs? but they're kinda specific to arc. maybe chain specific things can go in a section at the bottom? or maybe there's some other way to structure it, but reads a bit odd right now


## 5. Pull withdrawals, per recipient

- Call `WarehouseClient.withdraw({ ownerAddress, tokenAddress })` once per recipient (and the distributor, if it earned a fee), per token id.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth referencing / linking to the sdk docs? i assume this file is for agents, right? i think having a high level thing to guide them makes sense, but may also be helpful to direct to the sdk docs for details: https://splits.org/protocol/docs/sdk

NOTE: i don't know how agent friendly those are, they were written a while ago

Comment thread skills/splits-v2/SKILL.md Outdated
@@ -0,0 +1,90 @@
---
name: splits-v2
description: Guides creating, updating, distributing, and withdrawing from Splits V2 push and pull splits and the Splits Warehouse using viem and @0xsplits/splits-sdk. Use when paying contributors or recipients from onchain revenue, choosing between push and pull splits, distributing a split someone else created, withdrawing Warehouse balances, using Splits on Arc, or choosing a USDC token id (the 0x3600 ERC-20 view versus the 0xEeee native sentinel). Covers safe defaults, dry runs, and where to read current contract addresses and SDK docs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here, this feels too specific to Arc. Unless this is meant to be an arc specific skill, but let's name it appropriately then

Comment thread skills/splits-v2/SKILL.md Outdated
| Factor | Push | Pull |
| --- | --- | --- |
| Recipients | Few, known, always able to receive | Many, unknown, or able to be blocklisted or revert |
| Payout | `distribute` pays recipients directly | `distribute` credits the Warehouse; each recipient must withdraw |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe worth mentioning that warehouse withdraws are permissionless? anyone can withdraw on behalf of the recipients. so you could do a pull split and still get funds into each recipients wallet if you wanted, its just more txs to do

Address review feedback on #106:
- description and body are chain-neutral; Arc gets one pointer bullet
- Arc rules move to references/arc.md (token ids, push/pull, SDK trap, RPC limits)
- distribute-existing-split.md is generic and links the SDK docs
- state that Warehouse withdraws are permissionless in the push/pull table

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmTHDeVKp4PcqbpqhvBGME

This branch was successfully deployed

1 active deployment
Preview — 968b264a Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants