Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

alpaca-broker-reconciliation-idempotency

Skill by alpacahq

Alpaca Broker API reconciliation and idempotency skill. It shows how to keep a local database correct against Alpaca through idempotent writes, deduplicated events, polling and heal jobs. It is for developers designing the data layer of an Alpaca integration.

  • Score 70
  • 174 stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install alpaca-broker-reconciliation-idempotency

Built from the published package, never by AI.

git clone --depth 1 https://github.com/alpacahq/alpaca-skills /tmp/alpaca-skills && mkdir -p ~/.claude/skills && cp -r /tmp/alpaca-skills/skills/broker-api/reconciliation-idempotency ~/.claude/skills/alpaca-broker-reconciliation-idempotency

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install alpaca-broker-reconciliation-idempotency in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill is a design guide for the data-correctness layer of an Alpaca Broker API integration. It treats Alpaca as the source of truth and the local database as a cache that must converge to it. It covers three layers of defense: idempotent writes, idempotent event intake, and a reconciliation sweep. It also covers polling for rails that emit no events, a status mapping table, and eventual-consistency hazards such as reversed journals and corrections that create new IDs.

The skill points to other Alpaca skills for base URLs, auth, SSE event mechanics, and domain details. It says it applies to any Alpaca integration in any language. It is aimed at developers who need production-grade handling of retries, missed events, and status drift.

Written from the project's SKILL.md and checked against it.

What it can do

  • Idempotent writesExplains client order IDs, Idempotency-Key headers, and local-first intent rows so retries do not create duplicates.
  • Idempotent event intakeDescribes snapshot-first, ID-keyed upserts, status-guarded transitions, and per-account serialization for events.
  • Windowed heal jobsDescribes re-pulling activities, journals, and transfers over a time window and upserting them locally.
  • Polling for rails without eventsCovers scheduled polling of funding-wallet transfers, staggering pollers, and polling only non-terminal records.
  • Status mappingRecommends one explicit mapping table per domain from Alpaca statuses to internal statuses, tolerant of unknown values.
  • Eventual-consistency handlingLists hazards such as journal reversals, corrections with new IDs, and treating 200 responses as accepted, not settled.
  • Anti-pattern checklistLists common mistakes such as reconnecting SSE without a cursor and blind retries without idempotency keys.

What you need

  • Alpaca Broker API credentials (client-credentials Bearer token or legacy Basic auth)
  • Access to the Alpaca Broker API endpoints for accounts, journals, transfers, and activities

Try asking

  • Design an idempotent journal write flow for my Alpaca integration.
  • Create a heal job that re-pulls Alpaca activities and journals for the last 7 days.
  • Map Alpaca transfer statuses to my internal statuses, handling unknown values.

Good to know

  • Describes design patterns and does not ship code or a library.
  • Depends on other skills such as alpaca-broker-integration and alpaca-broker-sse-events for base details.
  • Polling implies latency, so expected lag must be documented.
  • GET /v1/accounts/activities is marked fully replaced but is the only source for activities before 2026-02-11.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/broker-api/reconciliation-idempotency/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to alpaca-broker-reconciliation-idempotency

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

alpaca-broker-reconciliation-idempotency: common questions

How do I avoid duplicate orders or journals when a request times out?

Use a client_order_id for orders and an Idempotency-Key header for journals, and store an intent row before the network call. On a lost response, look up the existing record before retrying.

What should I do if my SSE stream drops events during a deploy?

Persist and replay the event cursor, and run a windowed heal job that re-pulls activities, journals, and transfers and upserts them by Alpaca ID.

Why can a completed journal or transfer still change?

Journals can be reversed by cashiering and transfers can be RETURNED after appearing done, so the skill recommends reconciling past the happy terminal state for a window.

How do I install alpaca-broker-reconciliation-idempotency?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is alpaca-broker-reconciliation-idempotency free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is alpaca-broker-reconciliation-idempotency safe to use?

It scores 70 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to alpaca-broker-reconciliation-idempotency?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

alpaca-broker-reconciliation-idempotency Install

Add to stack

Loading.