alpaca-broker-reconciliation-idempotency

alpaca-broker-reconciliation-idempotency is a skill for Claude Code, Codex from alpacahq/alpaca-skills. It costs 83 tokens per session (2,189 once invoked), scanned A, original, Apache-2.0.

A set of practices for keeping a local database accurate when it mirrors Alpaca Broker, a service for building investment accounts and trading applications.

In plain words
What is it for?
Use it when adding safe retries, duplicate protection, status mapping, event snapshots, polling, and regular checks that repair differences between Alpaca and your database.
Why use it?
Alpaca updates may arrive late, repeat, be missed, or later be corrected, so a single API response or event cannot be treated as final.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding safe retries, duplicate protection, status mapping, event snapshots, polling, and regular checks that repair differences between Alpaca and your database.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alpacahq/alpaca-skills/reconciliation-idempotency
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alpacahq/alpaca-skills --skill reconciliation-idempotency
Clone the repo
git clone --depth 1 https://github.com/alpacahq/alpaca-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for alpaca-broker-reconciliation-idempotency

README.md
[![agentmods](https://agentmods.dev/badge/skills/alpacahq/alpaca-skills/reconciliation-idempotency/github.svg)](https://agentmods.dev/skills/alpacahq/alpaca-skills/reconciliation-idempotency)
Your own site
<a href="https://agentmods.dev/skills/alpacahq/alpaca-skills/reconciliation-idempotency"><img src="https://agentmods.dev/badge/skills/alpacahq/alpaca-skills/reconciliation-idempotency/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for alpaca-broker-reconciliation-idempotency

Your own site · 80×15
<a href="https://agentmods.dev/skills/alpacahq/alpaca-skills/reconciliation-idempotency"><img src="https://agentmods.dev/badge/skills/alpacahq/alpaca-skills/reconciliation-idempotency.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,189 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00083 $0.02189
Opus 5.5 $0.00033 $0.00876
Sonnet 5.5 $0.00017 $0.00438
Haiku 4.5 $0.00008 $0.00219

Measured 7d ago against content hash bea06ec2ae64, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

alpaca-broker-reconciliation-idempotency scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/broker-api/reconciliation-idempotency/SKILL.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Alpaca — Reconciliation & Idempotency

This is the skill that separates a demo from production. Alpaca is an asynchronous, eventually-consistent system: writes settle later, events can be missed or replayed, some rails emit no events at all, and "executed" can still be reversed. Your job is to make your local database a faithful, self-healing mirror of Alpaca's state.

Read alpaca-broker-integration first for base URLs and auth (client-credentials Bearer token; legacy Basic still works), then alpaca-broker-sse-events and the relevant domain skills. This skill is the architecture that ties them together.

The core principle

Treat Alpaca as the source of truth and your DB as a cache that must converge to it. Every write is a request, not a fact. Every event is a hint, not a guarantee. Correctness comes from idempotent processing plus a reconciliation loop — never from assuming any single call or event succeeded exactly once.

1. Three layers of defense

Layer 1 — Idempotent writes      : never create a duplicate when you retry
Layer 2 — Idempotent event intake: never double-process a replayed/duplicate event
Layer 3 — Reconciliation sweep   : re-pull authoritative state and fix any drift

You need all three. Layer 1+2 keep you correct in the happy/retry case; Layer 3 catches everything that still slips through (downtime, bugs, missing events, corrections).

2. Layer 1 — Idempotent writes

Every money/order write must be safe to retry, because you can't tell a timeout apart from a success.

  • Orders: set your own client_order_id (≤128 chars) derived from your transaction ID. On a lost response, look the order up via orders:by_client_order_id before retrying.
  • Journals: send an Idempotency-Key header. Same key + same body returns the original journal; same key + different body → 422. (See alpaca-broker-journals.)
  • Local-first ordering: write your intent row (with a generated key) before the network call, so a crash mid-call leaves a record you can reconcile — never an orphaned Alpaca object you can't find.
  • Persist the returned Alpaca ID immediately (account_id, order_id, journal_id, transfer_id). It is your only correlation key for events and reconciliation.

Read the full file on GitHub · 103 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed · +1 lines · +1 tokens per session bea06ec2ae64
  2. 1mo ago First seen · 102 lines · 82 tokens per session scan A fdf0c4c7f7d4

Subscribe to this mod's changes

alpaca-broker-reconciliation-idempotency is a skill published in the GitHub repository alpacahq/alpaca-skills (157 stars, last pushed today), licensed Apache-2.0. It adds 83 tokens to every session and 2,189 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

aomi-transact

Build natural-language crypto/DeFi agents and EVM MCP plugins (Claude Code, Cursor, Codex, Gemini). Aomi turns prompts into wallet-signed txs on Ethereum, Base, Arbitrum, Optimism, Polygon, Linea — non-custodial, fork-simulated. 40+ apps: Uniswap, Aave, Lido, Morpho, GMX, Hyperliquid, Polymarket.

sickn33/agentic-awesome-skills · 95 tokens

aws-cost-cleanup

Automated cleanup of unused AWS resources to reduce costs.

sickn33/agentic-awesome-skills · 15 tokens

aws-cost-operations

AWS cost optimization, monitoring, and operational excellence expert. Use when analyzing AWS bills, estimating costs, setting up CloudWatch alarms, querying logs, auditing CloudTrail activity, or assessing security posture.

sickn33/agentic-awesome-skills · 44 tokens

alpha-vantage

Access 20+ years of global financial data: equities, options, forex, crypto, commodities, economic indicators, and 50+ technical indicators.

sickn33/agentic-awesome-skills · 34 tokens

defi-protocol-templates

Implement DeFi protocols with production-ready templates for staking, AMMs, governance, and lending systems. Use when building decentralized finance applications or smart contract protocols.

rmyndharis/antigravity-skills · 38 tokens

database-cloud-optimization-cost-optimize

You are a cloud cost optimization expert specializing in reducing infrastructure expenses while maintaining performance and reliability. Analyze cloud spending, identify savings opportunities, and implement cost-effective architectures across AWS, Azure, and GCP.

rmyndharis/antigravity-skills · 48 tokens