agentleFS
voyager67voyager67/JaneStreet-Agentic-Skills/skills/exchange-gateway-engineering/SKILL.md

exchange-gateway-engineering

Skill13 starsChanged 5 days agoApache-2.0View on GitHub

Design, audit, or troubleshoot exchange connectivity and order-entry state machines, including protocol parsing, sequence handling, acknowledgements, rejects, cancel/replace, throttles, disconnect recovery, and session controls. Use for FIX, OUCH-like, or binary gateway work.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat an exchange gateway as a correctness-critical distributed state machine.

    line 7
  2. Distinctive:

    Test with a simulator or certification environment: Use deterministic message transcripts, malformed messages, timeout injection, …

    line 17
  3. Distinctive:

    Never infer order state solely from a local timeout.

    line 22
  4. Distinctive:

    Never retry a non-idempotent order blindly after a disconnect.

    line 23
  5. Distinctive:

    Do not ignore unknown messages or unexpected state transitions.

    line 24
  6. Distinctive:

    Do not log secrets, session keys, private certificates, or account credentials.

    line 25
  7. Very specific:

    Do not place/cancel/replace live orders without explicit user authorization and the required operational approvals.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Exchange Gateway and Order-State Engineering

Treat an exchange gateway as a correctness-critical distributed state machine. A local send is not an exchange acknowledgement; a timeout is not proof that an order was rejected or cancelled.

Workflow

  1. Use the exact venue specification. Record protocol/version, session type, framing, field encoding, order types/TIF, price and quantity scales, sequence rules, heartbeat, throttle, cancel/replace semantics, and business-day changes.
  2. Model order states explicitly. Define accepted, pending new, working, partially filled, pending cancel, pending replace, filled, cancelled, rejected, expired, and unknown/reconciliation-required states as applicable. Map every inbound/outbound message and legal transition.
  3. Separate request IDs from venue order IDs. Persist client order ID, venue order ID, session sequence, original/replace chain, parent strategy ID, and idempotency key. Never reuse identifiers outside protocol rules.
  4. Handle asynchronous races. Design for fill-during-cancel, partial-fill-during-replace, duplicate acknowledgements, late rejects, cancel reject, disconnect during send, and reconnect before reconciliation. Keep state monotone only where the protocol allows it.
  5. Implement sequencing and recovery. Detect gaps and duplicates. Follow venue-defined retransmission, recovery, session reset, and open-order reconcilation. Do not resume order flow on an uncertain state.
  6. Enforce backpressure and throttles. Bound outbound queues, prioritize risk-reducing cancels where policy allows, monitor rate limits, and define behavior when the exchange or network stalls.
  7. Test with a simulator or certification environment. Use deterministic message transcripts, malformed messages, timeout injection, reconnects, sequence resets, partial fills, and recovery tests. Do not test on a live venue without explicit authorization.
  8. Audit every transition. Persist raw inbound/outbound messages, timestamps, state transitions, decision source, and error path with sensitive credentials redacted.

Guardrails

  • Never infer order state solely from a local timeout.
  • Never retry a non-idempotent order blindly after a disconnect.
  • Do not ignore unknown messages or unexpected state transitions.
  • Do not log secrets, session keys, private certificates, or account credentials.
  • Do not place/cancel/replace live orders without explicit user authorization and the required operational approvals.

Deliverable

Return protocol/version references, state diagram, transition table, recovery plan, throttle/backpressure design, fault-injection test matrix, audit fields, and unresolved edge cases.

Further reading

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.