order-lifecycle-safety

order-lifecycle-safety is a skill for Claude Code from mphinance/alpha-skills. It costs 73 tokens per session (810 once invoked), scanned A, original, MIT.

A set of rules for safely placing broker orders, including stable unique order IDs, audit records, and checking the broker's actual state before retrying. A broker is the service that receives and processes trading orders.

In plain words
What is it for?
Use it when building or reviewing order submission, retry handling, paper-versus-live checks, or client order ID logic.
Why use it?
Timeouts, crashes, and connection failures can leave it unclear whether an order was accepted. These rules help prevent duplicate orders, accidental changes, and unsafe retries.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the quant-skills plugin — 61 skills shipped together

Good fit Use it when building or reviewing order submission, retry handling, paper-versus-live checks, or client order ID logic.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mphinance/alpha-skills/order-lifecycle-safety
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 mphinance/alpha-skills --skill order-lifecycle-safety
Clone the repo
git clone --depth 1 https://github.com/mphinance/alpha-skills

Made for: Claude Code.

Or install quant-skills, the plugin that ships this one along with the rest of its 61 skills.

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 order-lifecycle-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/mphinance/alpha-skills/order-lifecycle-safety/github.svg)](https://agentmods.dev/skills/mphinance/alpha-skills/order-lifecycle-safety)
Your own site
<a href="https://agentmods.dev/skills/mphinance/alpha-skills/order-lifecycle-safety"><img src="https://agentmods.dev/badge/skills/mphinance/alpha-skills/order-lifecycle-safety/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 order-lifecycle-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/mphinance/alpha-skills/order-lifecycle-safety"><img src="https://agentmods.dev/badge/skills/mphinance/alpha-skills/order-lifecycle-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 810 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.
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.00073 $0.00810
Opus 5.5 $0.00029 $0.00324
Sonnet 5.5 $0.00015 $0.00162
Haiku 4.5 $0.00007 $0.00081

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

Security

Grade A, and why

order-lifecycle-safety 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 21d 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.

plugins/quant-skills/skills/order-lifecycle-safety/SKILL.md · 64 lines

How it starts

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

Order Lifecycle Safety

Pure markdown. No dependencies, no code to install. These are the rules an order path must own itself; do not assume an external approval gate exists.

1. Unique client_order_id on every order

  • Every order carries a client_order_id generated by your code, once, before the first send.
  • It must be unique per intended order and stable across retries of that same order.
  • Persist it (audit log) before sending, so a crash cannot lose it.
  • Respect broker length/charset limits: see references/broker-caveats.md.

2. Same terms vs different terms (REPLAY / ID_REUSED)

Repeat of an existing id Correct behaviour Label
Same id, same terms Return the first result; do not create a second order REPLAY
Same id, different terms Refuse; never mutate or resubmit under that id ID_REUSED

Implement this in your own layer (compare a hash of symbol, side, qty, type, price, TIF). Do not rely on the broker to do it; broker behaviour varies (see caveats).

3. Unknown outcome: reconcile before retry

A timeout, 5xx, dropped connection, or crash after send means the outcome is unknown, not failed.

  1. Mark the order UNKNOWN in the audit log.
  2. Look the order up by client id (or list recent orders and match).
  3. Found → adopt its status. Not found after the broker's lookup is known consistent → only then may you resend with the same client id.
  4. Lookup itself fails → stay UNKNOWN, alert a human. Never blind-retry.

4. Audit before forward

  1. Decide (allow/refuse).
  2. Write the decision, with the client id and terms, to an append-only audit log before forwarding.
  3. Forward to the broker.
  4. If forwarding raises or times out, append UNKNOWN (not FAILED) and go to section 3.
  5. Redact credentials from log lines.

If the audit write fails, do not forward: fail closed.

5. Environment-proof preflight

Never infer paper vs live from config, env var names, base URLs, or account-number shape. Config can be wrong or edited.

Read the full file on GitHub · 64 lines

Files

What ships with it

2 files 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. 21d ago First seen · 64 lines · 73 tokens per session scan A bd4afc38aa8e

Subscribe to this mod's changes

order-lifecycle-safety is a skill published in the GitHub repository mphinance/alpha-skills (34 stars, last pushed 22d ago), licensed MIT. It adds 73 tokens to every session and 810 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-11-13.

Related

order-lifecycle-safety compared with skills from other repositories

order-lifecycle-safety next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
order-lifecycle-safetymphinance/alpha-skillsSkill3422d agoMITA73Claude Code
sector-rotationHKUDS/Vibe-TradingSkill40kyesterdayMITA39Claude Code, Codex
strategy-pivot-designertradermonty/claude-trading-skillsSkill9.7kyesterdayMITA28Claude Code, Codex
twitter-readerhimself65/finance-skillsSkill3.6k1mo agoMITA110Claude Code
energy-procurementhashgraph-online/awesome-codex-pluginsSkill1.6kyesterdayApache-2.0A93Claude Code, Codex
airdrop-hunting-guidenirholas/three.wsSkill289todayApache-2.0A54Claude Code, Codex
cim-teardownmicrosoft/cat-agent-skillsSkill124todayMITA139Claude Code, Codex