/algo-trading-skills:broker-api-changelog-diffing-toolfrom algo-trading-skills
Diffs two OpenAPI schema snapshots to detect breaking changes like removed endpoints, new required parameters, enum mutations, and type changes. Use before upgrading broker SDKs to fail CI before changes reach production order paths.
Ships in algo-trading-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Invoke this before upgrading a broker SDK version or pulling a new API specification (Binance, Coinbase, IBKR Client Portal and similar publish OpenAPI documents). Broker releases introduce silent breaking changes — a removed nested response field, a parameter that quietly became mandatory, a new order status the state machine has never seen. This skill diffs two schema snapshots and classifies what changed, so a CI job can fail the build before the change reaches an order path.
The tool is a gate, and its failure modes are asymmetric: a false positive costs a developer a few minutes, a false negative ships a broken integration. Everything about its classification is biased accordingly.
#/...) references are
followed. External and remote $refs are reported as UNRESOLVED_REF — that region was
not compared, and treating the report as complete when one is present is a mistake.#/definitions/... references resolve, but Swagger 2.0's
body parameters and top-level consumes/produces are not modeled; the request-body
logic assumes OpenAPI 3.x requestBody.content. Convert 2.0 documents to 3.x first.oneOf, anyOf, allOf and discriminator are not
evaluated; schemas using them will diff only at the level the tool can see.components/definitions sections the
$refs point at — a spec split across files must be bundled first, or references will
come back unresolved.Load both documents and let the differ reject unusable input. diff_schemas
raises SchemaDiffError when a document is not a mapping or has no paths. This is
deliberate: a failed download or a wrong path yields an empty document, and a differ
that shrugs and reports zero changes turns the gate green at exactly the moment it
matters.
Diff endpoints. Removed paths and removed methods are CRITICAL_BREAKING. Only
real HTTP methods are treated as operations — a Path Item Object also legally carries
parameters, servers, summary, description and $ref, and path-level
parameters are diffed as shared across every operation.
Resolve $ref before comparing anything. Real broker specs describe payloads
almost entirely through references, and a $ref schema carries no type, properties
or enum of its own. Resolution follows #/components/schemas/... and
#/definitions/... against the document each side came from, with cycle protection for
self-referential models.
Treat absence as a change. A removed response status code, a removed request or
response content type, and a removed requestBody are all breaking and all invisible
to a differ that walks only the keys present on both sides.
Check requirement transitions in both directions. A request field or parameter
moving into required breaks callers that omit it. A response field moving out of
required breaks parsers that assume it is present. Both matter; they are not the same
check.
Classify enums by direction. A request enum constrains what the client may send, so removing a value is breaking. A response enum constrains what the client must handle, so adding a value is breaking — a new order status silently breaks an exhaustive state machine. Newly imposing a request constraint, and dropping a response constraint, are breaking too.
Gate the build. report.exit_code is 0 when compatible and 1 otherwise;
report.format_report() renders the findings severity-first. is_compatible is False
if any change is MEDIUM_BREAKING or higher.
Full procedure: see
references/workflows.md. Severity matrix and classification rationale: seereferences/standards.md. Printable pre-flight checklist: seeassets/checklist.md.
$ref schemas without resolving them. Both sides look like empty objects,
every check is skipped, and a release that deleted an entire response model reports
clean. This is the single most likely way to get a false green.UNRESOLVED_REF finding. It is informational in severity but it means a
region of the schema was never compared. Bundle the spec and re-run.if key in new: compare(...) cannot see any of them.type. OpenAPI 3.1 allows type: ["object", "null"] where 3.0
used nullable: true. An equality test against the literal "object" silently skips
property diffing, and comparing the two spellings reports a mutation that never happened.parameters is a list and
summary is a string; calling .get() on them raises on a perfectly valid document.Order.parent → Order is ordinary,
and resolving references without a cycle guard hangs the build.python -m unittest discover -s skills/broker-api-changelog-diffing-tool/scripts$ref, delete a field from the
referenced component, and confirm REMOVED_RESPONSE_FIELD is reported. A differ that
passes every inline-schema test can still fail this one, which is the case that matters.SchemaDiffError rather than reporting compatible.parameters and summary does not raise.broker-api-versioning-migration-playbookbroker-api-deprecation-notice-monitoringsandbox-vs-production-endpoint-driftbroker-agnostic-adapter-interfaceWhat SKILL.md sets; muted values are Claude Code's defaults
36 skills in this plugin
/alpaca-paper-live-key-separationUse when a bot connects to the Alpaca Trading API and must never cross paper keys with the live endpoint; pins the base URL per environment, checks the key prefix, probes /v2/account and requires an explicit ALLOW_LIVE_TRADING flag./api-key-least-privilege-audit-toolUse before deploying a live bot, to audit existing broker API keys for scopes they do not need. Flags withdrawal, transfer and admin rights that turn a leaked execution key into theft./broker-account-margin-call-handlingUse when a bot trades a Reg T, portfolio or futures margin account and must act before the broker liquidates: tiered maintenance-margin warnings cross-checked against broker excess liquidity, initial-margin order gating and liquidity-aware de-leveraging.npx claudepluginhub himanshuj16/algo-trading-skills --plugin algo-trading-broker-integrationOther plugins' skills for the same job