/algo-trading-skills:broker-api-deprecation-notice-monitoringfrom algo-trading-skills
Monitors broker API endpoints for deprecation signals by parsing RFC 8594 Sunset and RFC 9745 Deprecation headers plus changelog feeds into a dated migration deadline with escalation tier.
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 skill when operating long-running algorithmic trading systems against
REST/WebSocket broker APIs. Brokers retire legacy endpoints and change payload schemas,
and the announcement usually arrives weeks ahead — in a developer changelog, and
sometimes as an RFC 8594 Sunset or RFC 9745 Deprecation response header. This skill
turns those scattered signals into a dated, de-duplicated migration deadline with an
escalation tier attached.
The monitor is a deadline detector, and its failure modes are asymmetric: a false positive costs an engineer a few minutes reading a changelog entry, a false negative means a bot keeps calling an endpoint that stops answering mid-session. Every classification decision below is biased accordingly.
Sunset timestamps are hints:
"it is not guaranteed that the resource will, in fact, be available until that time
and will not be available after that time." An empty registry means nothing was
signalled, not that nothing is changing. Alpaca's Market Data API v1 retirement,
for instance, was announced in a blog post, not a header.broker-api-versioning-migration-playbook; detecting schema-level
breakage belongs to broker-api-changelog-diffing-tool.broker-status-page-monitoring-integration.Inspect live response headers. Hook inspect_http_headers into the HTTP client's
global response handler and check every response for Sunset (RFC 8594),
Deprecation (RFC 9745), Link with rel="sunset" or rel="deprecation"
(RFC 8288), and the non-standard X-API-Deprecation-Warning. This hook runs on the
same thread as live orders, so it must never raise into the caller — contain
unexpected failures, log them with a traceback, and return no notice.
Parse the two headers by their different contracts. Sunset is an HTTP-date, so
accept all three HTTP-date forms (IMF-fixdate, obsolete RFC 850, asctime). RFC 9745
Deprecation is a Structured Field Date — @1688169599, seconds since the epoch —
but deployed gateways still emit the pre-RFC Deprecation: true, which asserts
deprecation without dating it. Treat an unparseable Deprecation value as
"deprecated, date unknown", never as "not deprecated".
Keep deprecation and sunset distinct. Deprecation is when the broker stops
recommending the endpoint; sunset is when it stops answering. Derive urgency only
from the sunset date. If Sunset is earlier than Deprecation, the broker's own
metadata violates RFC 9745 Section 4 — log it and confirm the dates before planning
a migration around either.
Poll the developer changelog. Match deprecation keywords, then extract every
unambiguous date. Discard candidates that fall before the entry's publication date —
those are publication dates and release history, not deadlines — and take the
earliest of what survives, because a later date in the same entry is usually the
support window for the replacement API. Do not parse locale-ambiguous numeric dates
(11/12/2026): day-first and month-first are indistinguishable without knowing the
publisher, and guessing wrong moves a deadline by up to eleven months.
Classify urgency from a single clock reading. With $D$ = whole days remaining, floored, computed in UTC:
EXPIRED.CRITICAL_SUNSET_IMMINENT.WARNING_30_DAYS.NOTICE.Expiry is decided by comparing instants, not by testing whether the floored day
count reached zero. A sunset 23 hours away has zero whole days left and has not
expired; reporting it as EXPIRED tells the desk the migration window is gone while
a final day of it remains. The 7/30 day thresholds are operational conventions for
migration lead time — neither RFC mandates them — so they are configurable.
De-duplicate, then route. Key the registry by broker, endpoint, and entry
identity; alert on a new notice, an escalation, or a broker moving the sunset date,
and suppress pure de-escalation so routine re-inspection does not page anyone.
Route NOTICE to logs, WARNING_30_DAYS to Slack/Teams, and
CRITICAL_SUNSET_IMMINENT/EXPIRED to the on-call rota.
Full procedure: see
references/workflows.md. Standards reference: seereferences/standards.md. Printable pre-flight checklist: seeassets/checklist.md.
now_fn=datetime.datetime.now (naive) makes the
sunset subtraction raise TypeError on the first deprecated endpoint — converting
"this breaks in 30 days" into "this breaks now". Interpret naive clocks as UTC, and
contain unexpected errors rather than propagating them.NOTICE or as already-EXPIRED — a silent miss in the one place this skill exists to
prevent one.days_remaining == 0 as expired. timedelta.days floors, so a sunset
0.96 days away reports 0. Compare instants for expiry and keep the floored count for
display only.broker:GLOBAL_FEED means each new announcement evicts the previous one, so a broker
retiring three endpoints shows one outstanding deprecation.Deprecation: true is still the standard. RFC 9745 (Standards Track,
March 2025) requires a Structured Field Date; a parser written only for the boolean
form silently drops the date the broker actually supplied.Link header on commas. Commas are legal inside a link target, so
<https://x/docs?tags=v1,legacy>; rel="sunset" splits into two fragments and the
migration URL is lost. Match <target> forms directly, and compare rel as a whole
token — RFC 8288 allows several space-separated relation types in one parameter.days_remaining and the urgency tier from
two separate clock readings lets them straddle a threshold and disagree.python -m unittest discover -s skills/broker-api-deprecation-notice-monitoring/scripts
and confirm all tests pass.Sunset: Wed, 25 Nov 2026 00:00:00 GMT against a frozen
clock and confirm the extracted UTC date, the day count, and the escalation tier.CRITICAL, not
EXPIRED; exactly 7 days is CRITICAL; exactly 30 days is WARNING_30_DAYS.None, a list, and {"Sunset": None}, and confirm it
returns no notice and raises nothing.broker-api-versioning-migration-playbookbroker-api-changelog-diffing-toolbroker-status-page-monitoring-integrationstructured-logging-for-post-incident-forensicsWhat 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