Manages operational lifecycle, risk mitigation, and system health for high-frequency trading platforms.

Install

mkdir -p .claude/skills/hft-ops && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13878" && unzip -o skill.zip -d .claude/skills/hft-ops && rm skill.zip

Installs to .claude/skills/hft-ops

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

<!-- REVIEW-2026-04-17: unreferenced by rules/workflows/teams/agents. Confirm or delete. --> --- name: hft-ops description: Use when working on platform operations — session lifecycle, autonomy degradation, position flattening, margin monitoring, pre/post market checks, backup, o
280 chars · catalog description✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • →Govern wall-clock session lifecycles per product track
  • →Monitor autonomy and health for auto-degradation
  • →Perform emergency position flattening within a deadline
  • →Monitor broker margin availability
  • →Execute pre-market and post-market checks
  • →Automate ClickHouse backup

How it works

The skill manages HFT operations through session governors, autonomy monitors, and various utility modules, ensuring safe trading by controlling lifecycles, risk, and system health.

Inputs & outputs

You give it
Operational parameters and system status
You get back
Managed trading session, degraded autonomy mode, flattened positions, or operational reports

When to use hft-ops

  • →Monitor margin availability
  • →Emergency position flattening
  • →Diagnose system degradation
  • →Daily PnL reporting

About this skill

Operations

src/hft_platform/ops/ plus the local runtime. Anything on the production host (THESHOW) is governed by .agent/rules/41-deployment.md, never by this file.

Session phases (wall-clock, not event-driven)

INIT(0) -> PRE_OPEN(1) -> OPEN(2) -> CLOSE_ONLY(3) -> FORCE_FLAT(4) -> CLOSED(5)

session_governor.py (SessionGovernor, TrackGate, SessionPhase) is driven by config/base/session_governor.yaml, one track per product family. TrackGate gives strategies an O(1) per-symbol phase lookup: OPEN normal, CLOSE_ONLY closing orders only, FORCE_FLAT flattener active, CLOSED intents rejected; unknown symbols map to CLOSED unless HFT_TRACK_GATE_DEFAULT_OPEN=1.

Autonomy degradation

autonomy_monitor.py watches ClickHouse write staleness, feed gaps and reconnect flapping, queue depth, RSS, drawdown, reconciliation drift, WAL backlog. Modes (autonomy.py): NORMAL -> PLATFORM_REDUCE_ONLY -> HALT.

NORMAL --auto--> PLATFORM_REDUCE_ONLY --auto (critical)--> HALT
HALT --X auto--> NORMAL        (only manual_rearm.py, an operator action)
  • HALT blocks new orders; cancels stay allowed. The autonomy HALT never auto-recovers (data loss needs hft ops rearm-platform).
  • A latch must be clearable by something that does not depend on it already being clear. HALT alone does not flatten; risk/loss_exit.py closes the book for a daily-loss stop, an expiry, an operator hft ops flatten, and the kill switch (the last only when an operator set it and a recent reconciliation confirmed the positions; never for the startup recovery gate).
  • The StormGuard latches end on evidence since 2026-10-24: daily_loss at the next 05:00 roll, reconciliation_mismatch after two clean reconciliations; only the kill switch needs a person (docs/runbooks/halt-recovery.md).
  • flatten_gate.py carries hft ops flatten requests to the supervisor.
  • Autonomy reason codes are a frozen set (for metrics): add a code to the set before using it.
  • Other modules: margin_monitor, platform_degrade, strategy_governor, backup, config_snapshot, daily_pnl_report, evidence, preflight_checker.

Commands

make pre-market-check      # containers, ClickHouse, Redis, WAL backlog, Prometheus scrape
make post-market-check     # WAL drained, recorder healthy, row counts, PnL reconciled
make recorder-status
uv run hft check           # config validation
make drill-ck-down         # 30 s ClickHouse outage (WAL fallback)
make drill-wal-pressure
make drill-recon-mismatch
make rollback-drill
make canary-auto

Local stack

Local only: docker compose up -d --build, docker compose ps, docker compose logs -f hft-engine, or make start / make stop / make logs. Production uses different commands (up -d there destroys the engine's writable layer).

Ports: engine metrics 9090, ClickHouse 8123/9000, Redis 6379, Prometheus 9091, Grafana 3000, Alertmanager 9093. Key env: HFT_MODE, HFT_ORDER_MODE, HFT_CLICKHOUSE_ENABLED, HFT_RECORDER_MODE, HFT_GATEWAY_ENABLED, HFT_OBS_POLICY; the rest is in config-env. Live-impacting config changes follow docs/operations/change-control.md (what, why, risk, rollback; test in HFT_MODE=sim; watch metrics; keep a rollback ready).

Done when

Behavior is covered by tests of the state transition (including the edge that must not be taken), make pre-market-check is green locally, and nothing in the change auto-deploys or auto-recovers from HALT.

When not to use it

  • →When auto-recovery from HALT is desired
  • →When remote deployment should be automated

Limitations

  • →HALT requires manual rearm , never auto-recover from HALT.
  • →FORCE_FLAT has 120s deadline , timeout = fail, escalate.
  • →Remote deployment is manual , never auto-deploy.

How it compares

This skill provides a structured and automated framework for high-frequency trading operations, including predefined session phases and autonomy degradation, which is more controlled than manual oversight.

Compared to similar skills

hft-ops side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
hft-ops (this skill)07moReviewAdvanced
aws-billing-and-cost-management06moReviewIntermediate
system-info19moReviewBeginner
it-operations111moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry