Vercel Composition Patterns
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
Reference of non-obvious Cardano ledger behaviors that have caused bugs in Dolos.
$ npx skills add txpipe/dolos --skill ledger-gotchas -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install txpipe/dolos ledger-gotchas --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/txpipe/dolos.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ledger-gotchas .claude/skills/ledger-gotchas && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "ledger-gotchas" agent skill from https://github.com/txpipe/dolos/tree/main/skills/ledger-gotchas into .claude/skills/ledger-gotchas/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ledger-gotchas", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/txpipe/dolos/tree/main/skills/ledger-gotchasType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add txpipe/dolos --skill ledger-gotchas -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install txpipe/dolos ledger-gotchas --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/txpipe/dolos.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/ledger-gotchas .agents/skills/ledger-gotchas && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "ledger-gotchas" agent skill from https://github.com/txpipe/dolos/tree/main/skills/ledger-gotchas into .agents/skills/ledger-gotchas/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ledger-gotchas", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add txpipe/dolos --skill ledger-gotchas -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install txpipe/dolos ledger-gotchas --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/txpipe/dolos.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/ledger-gotchas .cursor/skills/ledger-gotchas && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "ledger-gotchas" agent skill from https://github.com/txpipe/dolos/tree/main/skills/ledger-gotchas into .cursor/skills/ledger-gotchas/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ledger-gotchas", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/txpipe/dolos.git --path skills/ledger-gotchas--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add txpipe/dolos --skill ledger-gotchas -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install txpipe/dolos ledger-gotchas --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/txpipe/dolos.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/ledger-gotchas .gemini/skills/ledger-gotchas && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "ledger-gotchas" agent skill from https://github.com/txpipe/dolos/tree/main/skills/ledger-gotchas into .gemini/skills/ledger-gotchas/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ledger-gotchas", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install txpipe/dolos ledger-gotchasInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add txpipe/dolos --skill ledger-gotchas -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/txpipe/dolos.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/ledger-gotchas .github/skills/ledger-gotchas && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "ledger-gotchas" agent skill from https://github.com/txpipe/dolos/tree/main/skills/ledger-gotchas into .github/skills/ledger-gotchas/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ledger-gotchas", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add txpipe/dolos --skill ledger-gotchas -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install txpipe/dolos ledger-gotchas --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/txpipe/dolos.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/ledger-gotchas .opencode/skills/ledger-gotchas && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "ledger-gotchas" agent skill from https://github.com/txpipe/dolos/tree/main/skills/ledger-gotchas into .opencode/skills/ledger-gotchas/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ledger-gotchas", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
ledger-gotchasReference of non-obvious Cardano ledger behaviors that have caused bugs in Dolos.
Ledger Gotchas is an agent skill from txpipe/dolos. Reference of non-obvious Cardano ledger behaviors that have caused bugs in Dolos. Consult when debugging epoch pots mismatches or implementing new ledger logic.
Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development. The licence is Apache-2.0.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 7e973ea. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Ledger Gotchas loads about 2.8k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 1,453 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from txpipe/dolos at commit 7e973ea, republished under its Apache-2.0 licence (© txpipe). 1,453 words, ~2,835 tokens.
.claude/skills/ledger-gotchas/SKILL.md (or your agent's skills folder).Non-obvious behaviors in the Cardano ledger that differ from naive expectations. Each of these has caused at least one bug in Dolos. When debugging a mismatch or implementing new ledger logic, check this list first.
Gotcha: There is NO priority system for certificates. The Haskell ledger processes certificates in the exact order they appear in the block (tx order, then cert order within tx). A deregistration in tx 7 followed by a registration in tx 10 results in the account being registered.
What went wrong: Dolos had a priority() method that sorted deltas (registration=0, deregistration=5), causing certificates to apply out of order. A dereg+reg in the same slot resulted in the account appearing deregistered.
Rule: Always apply deltas in natural block traversal order. Never sort or reorder them.
Gotcha: The three NEWEPOCH sub-rules execute in this exact order:
applyRUpd -- rewards applied to accountsSNAP -- new mark snapshot captured; future pool params become currentPOOLREAP -- pools retired, deposits refundedConsequence: SNAP happens BEFORE POOLREAP. Pool deposit refunds from POOLREAP are NOT captured in the mark snapshot for that transition. They first appear in the NEXT epoch's mark.
Consequence: SNAP moves future pool params to current BEFORE POOLREAP runs. So when POOLREAP refunds a deposit, it uses the new pool params (potentially a different reward account than when the pool was originally registered).
Gotcha: Different operations write to different snapshot slots, which propagate to mark at different times.
| Operation | Writes to | Appears in mark |
|---|---|---|
unwrap_live_mut() | live | Next transition (E+1) |
scheduled_or_default() | next | Two transitions later (E+2) |
EWRAP reward visitors use unwrap_live_mut() (writes to live). EWRAP refund visitors (pool deposits, proposal deposits) use scheduled_or_default() (writes to next). This means refunds and rewards propagate to the stake snapshot at different times.
Gotcha: epoch_stake.epoch_no = N corresponds to the set snapshot at epoch N, which equals the mark snapshot captured at NEWEPOCH N-1, which reflects account state as of the end of epoch N-2.
This is the stake distribution used for leader election in epoch N. When comparing dolos stake against DBSync at performance_epoch = subject_epoch - 2, the fixture filename is stake-{performance_epoch}.csv.
Gotcha: Before Alonzo, MIR certificates for the same address OVERWRITE previous values rather than accumulating. Haskell uses Map.union (pre-Alonzo) vs Map.unionWith (<>) (Alonzo+).
Example: Two MIR certs for the same address: 100M then 32M. Pre-Alonzo result = 32M (last wins). Alonzo+ result = 132M (sum).
Rule: When protocol_version < 5, set overwrite = true on EnqueueMir. Only the last MIR per address per epoch is applied.
Gotcha: Before Allegra, each stake address receives at most ONE reward per epoch, even if delegated to multiple pools. The Haskell ledger uses Set.deleteFindMin to keep the minimum element per the Ord Reward instance.
Ord Reward rules:
LeaderReward < MemberReward (leader wins over member)Rule: When protocol < 3, if an account has multiple rewards, keep the one with the smallest (reward_type, pool_id) tuple. Leader < Member, then lexicographic pool hash comparison.
Gotcha: The eta (η) monetary expansion calculation uses only pool-produced blocks, NOT total blocks. Federated/OBFT blocks are excluded.
η = min(1, pool_blocks / ((1-d) × f × L))The Haskell ledger's BlocksMade map only tracks stake pool blocks. Using total blocks_minted (which includes federated blocks) inflates η and produces ~2.75% higher rewards during the decentralization transition.
Rule: Sum blocks_minted from individual pool snapshots only. Do not use rolling.mark().blocks_minted.
Gotcha: Rewards for unregistered accounts are filtered at TWO different points, with different routing:
hardforkBabbageForgoRewardPrefilter). Their would-be rewards stay in reserves (never leave the reward pot).frTotalUnregistered → casTreasury in applyRUpdFiltered.Rule: EWRAP-filtered rewards ALWAYS go to treasury. Never route them to reserves based on protocol version.
Gotcha: RUPD fires at 4k/f slots into the epoch (randomness stability window = 172,800 on mainnet), NOT at 3k/f (stability window = 129,600).
Accounts that deregister between 3k/f and 4k/f are still registered when RUPD runs. If you use the wrong boundary, these accounts are incorrectly excluded from reward calculation.
Gotcha: Pre-Conway (protocol 0-8) update proposals usually follow a 1-epoch lag: ratified in the submission epoch, enacted at EWRAP, effect at ESTART of next epoch. The RatifiedCurrentEpoch fallback handles this.
Exceptions:
Ratified(target_epoch) entries to avoid enacting one epoch too early.Ratified() set to the epoch where quorum was actually reached.Gotcha: Dolos doesn't implement DRep governance voting. All Conway proposal outcomes (ratified/canceled/expired) are hardcoded in crates/cardano/src/hacks.rs. Missing entries cause:
Rule: Ratified(enacted_epoch - 1) from DBSync's gov_action_proposal.enacted_epoch. Dropped proposals that expired naturally (dropped_epoch = expired_epoch + 1) don't need entries; the Unknown outcome lets them expire via max_epoch.
Gotcha: When a pool retires, the deposit is refunded to the pool's reward account. But pools can be re-registered with a different reward account. The refund goes to whichever reward account is current at POOLREAP time (after SNAP has already moved future params to current).
Check the full pool_update history in DBSync -- active_epoch_no determines when new params take effect. The last update active before the retirement epoch determines the refund recipient.
Gotcha: Pointer addresses encode (slot, tx_idx, cert_idx) to reference a stake registration certificate. Many on-chain pointer addresses contain intentionally garbage values (e.g., (12, 12, 12)) that point to nonexistent registrations. These map to None (no stake rights).
Dolos resolves pointers via a hardcoded lookup table in hacks.rs. New valid pointers must be resolved by querying DBSync's stake_registration table.
Gotcha: Pointer address components are encoded as variable-length integers in the address bytes, but Cardano decodes them as unbounded integers. Values can overflow u64 or contain astronomically large numbers like 18446744073709551615 (u64::MAX) or 16292793057. These are NOT necessarily invalid -- some overflow pointers resolve to real stake credentials on-chain.
Example from mainnet:
(18446744073709551615, 1221092, 2) → maps to a VALID AddrKeyhash(16292793057, 1011302, 20) → maps to NoneResolution: The standard DBSync SQL query (WHERE block.slot_no = <SLOT>) won't work for overflow pointers since the slot is invalid. Instead, use a block explorer to look up the full bech32 address (addr1g...) -- explorers typically show the resolved stake address. Multiple pointer addresses can share the same payment credential but have different pointer tuples; each tuple needs its own mapping entry.
| Constant | Mainnet | Preprod/Preview |
|---|---|---|
| Pool deposit | 500,000,000 lovelace | 500,000,000 lovelace |
| Key deposit | 2,000,000 lovelace | 2,000,000 lovelace |
When a delegation/stake diff is off by exactly one of these constants, it's almost certainly a deposit refund or registration timing issue.
The total lovelace in the system is always exactly 45,000,000,000,000,000 (45 billion ADA):
reserves + treasury + utxos + rewards + fees + obligations = max_supplyIf any pot is wrong, the error must appear somewhere else with opposite sign. Use this invariant to cross-check: if treasury is too low by X, then X must be too high in some other pot (usually reserves or rewards).
Gotcha: A single account's stake being off by N lovelace changes that pool's total stake, which changes the reward calculation for ALL the pool's delegators -- producing hundreds or thousands of ±1 lovelace rounding differences.
How to recognize:
stake diff shows 1 account off by an exact amount (e.g., 3,001,337)delegation diff shows 1 pool's total off by the same amountrewards diff shows many ±1 differences, all for delegators of that same poolepochs diff shows reserves/rewards off by a small amount (net rounding effect)Rule: When you see this pattern, ignore the reward diffs entirely. Find and fix the single stake root cause, and all diffs resolve together.
Gotcha: The shape of a mismatch tells you which work unit is wrong:
| Symptom | Likely work unit |
|---|---|
| Equal and opposite deltas between rewards and treasury | EWRAP -- unspendable reward routing |
| Rewards match but pots don't | EWRAP/ESTART -- pot aggregation or unspendable handling |
| Only a subset of pools/accounts affected | ROLL -- registration/retirement window or pool parameter update timing |
| Rounded or exact small delta | RUPD/EWRAP -- conditional logic or boundary condition |
| Thousands of ±1 reward diffs for one pool | ROLL/ESTART -- single stake error cascade (see above) |
© txpipe, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/ledger-gotchas of txpipe/dolos.
Open the folder on GitHubat commit 7e973ea
Ledger Gotchas next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Ledger Gotchas this skilltxpipe/dolos | 138 | — | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| Vercel Composition Patternssupabase/supabase | 111k | 59 repos | ~726 | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 296k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Typescript Advanced Typesrolling-scopes/rsschool-app | 10k | 25 repos | ~4.2k | Automated safety check: Pass | MPL-2.0 | |
| PR Babysitteropeninterpreter/openinterpreter | 69k | 3 repos | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Code Review ChecklistshareAI-lab/learn-claude-code | 78k | 5 repos | ~1.1k | Automated safety check: Pass | MIT |
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
rolling-scopes/rsschool-app
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.
openinterpreter/openinterpreter
Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.
shareAI-lab/learn-claude-code
Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.
onyx-dot-app/onyx
Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.
txpipe/dolos
Systematic workflow for debugging Cardano ledger epoch pots mismatches in Dolos.
txpipe/dolos
Reconcile the user-facing documentation under docs/content/ with the current source-of-truth in the codebase.
txpipe/dolos
Set up a new epochpots integration test with ground truth fixtures from DBSync
txpipe/dolos
Add a missing pointer address mapping to hacks.rs by looking up the stake credential in DBSync
txpipe/dolos
Architecture of the Dolos processing pipeline — WorkUnit lifecycle, executor modes, CardanoWorkUnit variants, WorkBuffer state machine, and sequencing.
txpipe/dolos
Update hardcoded Conway governance proposal mappings in hacks.rs by querying DBSync
Categories
Reference of non-obvious Cardano ledger behaviors that have caused bugs in Dolos. Ledger Gotchas is an agent skill from txpipe/dolos. Reference of non-obvious Cardano ledger behaviors that have caused bugs in Dolos.
Ledger Gotchas fits situations like: development work in your project.
Run `npx skills add txpipe/dolos --skill ledger-gotchas -a claude-code`. Or copy the skill folder (skills/ledger-gotchas in txpipe/dolos) into .claude/skills/ledger-gotchas in your project. Claude Code loads it when a task matches its description.
Run `npx skills add txpipe/dolos --skill ledger-gotchas -a codex`. Or copy the skill folder (skills/ledger-gotchas in txpipe/dolos) into .agents/skills/ledger-gotchas in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add txpipe/dolos --skill ledger-gotchas -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ledger-gotchas, .gemini/skills/ledger-gotchas, .github/skills/ledger-gotchas and .opencode/skills/ledger-gotchas in your project.
SKILL.md names no scripts, command-line tools or credentials: Ledger Gotchas is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Ledger Gotchas is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Ledger Gotchas: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
txpipe (a GitHub organization) maintains it in txpipe/dolos, which has 138 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 8, 2026.
Source: txpipe/dolos on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.