aeonfun/aeon/distribute-tokens
Claude Code and agent skill by aeonfun/aeon
- community
Checking that the SKILL.md file is still in the repository.
Two-phase contributor rewards - plan builds a tier-priced payout from the repo's merged-PR ranking; send executes it on-chain via Bankr Wallet API with per-recipient idempotency and dry-run.
Install
npx vskill@latest install aeonfun/aeon/distribute-tokensSKILL.md
The same SKILL.md was published earlier as aeonfun/aeon/distribute-tokens.
${var} — Phase + target selector. Grammar:[plan:|all:][dry-run:]<target>- `(empty) /<label>/dry-run:<label>→ **send** phase: distribute a list frommemory/distributions.yml` (empty = first list). [default — no prefix]-plan:/plan:<week>/plan:dry-run/plan:dry-run:<week>→ plan phase only: compute rewards from the repo's merged PRs and write the list intomemory/distributions.yml.-all:/all:<week>/all:dry-run/all:dry-run:<week>→ plan then send in one run.<label>is a distribution-list label (e.g.contributors-2026-W17).<week>is an ISO week (2026-W17); empty<week>= most recent completed ISO week.dry-run:previews without side effects (no yml/state writes in plan; no transfers in send).
Why this design
This skill owns the whole contributor flywheel: who deserves what (plan) and moving the money (send). It is split into two phases that can run independently or chained.
Plan phase — the wiring the project was missing. Merged PRs already name the people moving the project, but shipped work had no path to a wallet credit. The plan phase is that wiring: it ranks contributors by the PRs they merged in the target week (straight from the GitHub API), prices each eligible contributor against a tier table, and writes a labelled list into memory/distributions.yml — the exact file the send phase reads. Keeping a human-visible diff on memory/distributions.yml between plan and execution is the cheapest possible audit trail when real money is involved: the plan lands in git, and the operator (or all: mode, or a chained step) runs the send next.
Send phase — this moves real money. The biggest failure mode is double-sending (re-runs, retries after partial failures, day-rollover bypass of "skip if today" logic) or sending into a black hole (no preflight balance, deprecated API path, missing handle resolution). The send phase therefore:
- Persists per-recipient idempotency state in
memory/state/distributions.jsonkeyed on(list, recipient, date_utc)with the txHash. A successful transfer is never re-sent within the same UTC day, even across re-runs or workflow restarts. - Two-phase execution: RESOLVE (validate config, key, balance, resolve all handles → addresses, build plan) → EXECUTE (send each transfer, persist state after each one). RESOLVE failures abort before any send.
- Dry-run mode outputs the full plan with no transfers.
- Wallet API only for actual transfers — Bankr's docs deprecate the Agent API for transfers. Agent API is used only for handle→address resolution.
The two phases stay decoupled by design: the send phase is the only sanctioned transfer path and owns the idempotency state file, so the plan phase never touches transfer state. all: mode simply runs plan then send in sequence (plan writes the list, send reads it), so nothing is re-implemented.
Config
Reads two independent config/state surfaces depending on phase:
memory/distributions.yml— the distribution lists (read by send, written by plan).- The plan phase computes its ranking live from the repo's merged PRs via the GitHub API — no input file (see Phase A).
memory/state/distributions.json— per-recipient send idempotency (read/written by send).memory/state/contributor-reward-state.json— plan idempotency + first-PR-bonus history (read/written by plan).
If memory/distributions.yml is missing when the send phase needs it, bootstrap with a commented template (see Send Step 1) and exit cleanly with DISTRIBUTE_TOKENS_OK — bootstrapped distributions.yml; edit and re-run.
Required secrets
| Secret | Phase | Purpose | |
|---|---|---|---|
BANKR_API_KEY | send (and any dry-run send, which still preflights) | Bankr API key (bk_...). Must be read-write with Wallet API enabled. Read-only keys → 403. Not needed for `plan:` (pure local file I/O). |
Token addresses on Base
- USDC:
0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 - ETH (native):
tokenAddress: "0x0000000000000000000000000000000000000000",isNativeToken: true
Tier pricing (plan phase)
| Rank in leaderboard | Reward (USDC) | |
|---|---|---|
| 1 | 25 | |
| 2 | 15 | |
| 3 | 10 | |
| 4 | 5 | |
| 5 | 5 |
First-PR bonus: +5 USDC, additive, applied once-ever per login (tracked in memory/state/contributor-reward-state.json). Rewards landing your first merged upstream PR — the highest-leverage signal in the leaderboard scoring.
Eligibility floor: score ≥ 10 AND the contributor must own a non-empty @handle (logins without @ prefix in the table are skipped — bots and parsing artifacts). A single merged upstream PR (+10) qualifies — the goal is to reward shipped work, not gate on volume.
Default token: USDC on Base. Operator can override per-recipient amounts in memory/distributions.yml after the plan is written if a special bonus is warranted.
Read memory/MEMORY.md and scan the last ~3 days of memory/logs/ for anything already reported (don't re-report the same signal).
Step 0 — Parse the selector and dispatch
Shell shape. Each Bash call is one allowed command (pipes are fine). The run refuses a call that sets a variable (today=$(date ...), JOB=$(./secretcurl ...), RESP=$(./secretcurl ...)), uses if / for / while or [ ... ] tests, calls sleep or sed, or joins commands with ;, && or ||, and each refusal costs a model turn. So get a date with a bare date call and write the printed value into later commands; write the repo, week bounds, logins, handles, job ids, addresses and amounts into each command literally (the <TODAY>, <JOB_ID>, <ADDR> style placeholders in the snippets); poll a Bankr job by repeating one call, never a loop; wait with a one-line python3 -c "import time; time.sleep(N)" call; create and change files under memory/ with Write/Edit.
Resolve time anchors up front with one bare call:
It prints today; today_utc is the same value. Later steps write it in literally as <TODAY> (shown as ${today} / ${today_utc} in the templates below).
Parse ${var}:
- Phase prefix. If
${var}starts withplan:→PHASE=plan, stripplan:. Else if it starts withall:→PHASE=all, stripall:. Else →PHASE=sendand do not strip anything (the remaining legacy grammar is parsed by the send phase itself). - Dry-run. For
PHASE=plan/all: if the remainder starts withdry-run(optionallydry-run:), setMODE=dry-runand strip that token; elseMODE=execute. (ForPHASE=send, the send phase parsesdry-run:itself — see Send Step 1.) - Target.
PHASE=send: the (unstripped) var is the send target —dry-run:<label>or<label>or empty.PHASE=plan/all: the remainder is an optional<week>. If it matches^\d{4}-W\d{2}$, setTARGET_WEEK=<week>; else rundate -u +%G-W%Vas its own Bash call and take the printed value asTARGET_WEEK(ISO-8601 week-numbering year + week -%G/%Vnot%Y/%U, so Monday-anchored weeks roll over correctly across years).
Dispatch:
PHASE=plan→ run Phase A only.PHASE=send→ run Phase B only.PHASE=all→ run Phase C (A then B).
Selector examples: ` → send first list · contributors-2026-W17 → send that list · dry-run:contributors-2026-W17 → dry-run send · plan: → plan most recent leaderboard · plan:2026-W17 → plan that week · plan:dry-run → plan preview · all: → plan + send most recent · all:dry-run:2026-W17` → full end-to-end preview for that week.
Phase A — Plan (reward computation)
Ranks the target week's merged-PR authors (GitHub API) and turns that ranking into a tier-priced list in memory/distributions.yml.
A1. Determine the target week and repo
REPO- the running instance's repo. Runecho "$GITHUB_REPOSITORY"as its own call; if it printsowner/repo, that isREPO. If it prints an empty line, rungit config --get remote.origin.urlas its own call and take theowner/repopart of the URL yourself (drop the host prefix and any trailing.git).TARGET_WEEKcomes from the selector; empty = the most recent completed ISO week (the last full Mon–Sun). Compute its UTC boundsWEEK_START..WEEK_ENDas ISO datetimes (YYYY-MM-DDT00:00:00Z).
A2. Rank contributors by merged PRs in the week
Compute the ranking directly from GitHub — no upstream skill or article required.
- Fetch every PR merged inside the window, by author (one call, with
REPO,WEEK_STARTandWEEK_ENDwritten in literally):
gh api -X GET search/issues -f q="repo:<REPO> is:pr is:merged merged:<WEEK_START>..<WEEK_END>" --paginate --jq '.items[].user.login'
- Drop bot authors (
*[bot],dependabot*,github-actions*). Count each remaining login's merged PRs →score. Rank byscoredescending; tie-break by earliest merge time, then login ascending. - First-PR ✨ per ranked login - did they have any prior merged PR to the repo? One call per login, the login written in literally:
gh api -X GET search/issues -f q="repo:<REPO> is:pr is:merged author:<LOGIN> merged:<<WEEK_START>" --jq '.total_count' → 0 means this is their first-ever merged PR (set first_pr_marker = ✨).
- If zero merged PRs in the window → log
CONTRIBUTOR_REWARD_NO_MERGED_PRS — week ${TARGET_WEEK}tomemory/logs/${today}.md, exit silently (no notify). Nothing shipped, nothing to reward. - If the GitHub API is unreachable (see Network note for the
gh api→ WebFetch fallback) → logCONTRIBUTOR_REWARD_API_FAIL, notify the operator, exit.
A3. Load plan idempotency state
Bootstrap with {"weeks": {}, "first_pr_bonus_paid": []} if the file doesn't exist.
A4. Compute the plan
For each ranked login with rank ≤ 5 AND score ≥ 1 (at least one merged PR):
- Look up
base_amountfrom the tier table (rank 1→25, 2→15, 3→10, 4-5→5). - If
first_pr_marker == "✨"ANDlogin ∉ first_pr_bonus_paid→ setfirst_pr_bonus = true,amount = base_amount + 5. Otherwisefirst_pr_bonus = false,amount = base_amount. - Build row:
{ rank, login, score, base_amount, first_pr_bonus, amount }.
If weeks[TARGET_WEEK] already exists in state → this week was already processed. Diff the current plan against state.weeks[TARGET_WEEK].rewards keyed on login:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/distribute-tokens/SKILL.md
Popularity
- Repository stars
- 760
- Repository forks
- 271
- 7-day trend score
- 33
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aeonfun/aeon/distribute-tokens)