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.zipInstalls 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, oKey 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
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.pycloses the book for a daily-loss stop, an expiry, an operatorhft 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_lossat the next 05:00 roll,reconciliation_mismatchafter two clean reconciliations; only the kill switch needs a person (docs/runbooks/halt-recovery.md). flatten_gate.pycarrieshft ops flattenrequests 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| hft-ops (this skill) | 0 | 7mo | Review | Advanced |
| aws-billing-and-cost-management | 0 | 6mo | Review | Intermediate |
| system-info | 1 | 9mo | Review | Beginner |
| it-operations | 1 | 11mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
aws-billing-and-cost-management
aws
|
system-info
Xxiii8322766509
系统信息查询技能。用于获取电脑硬件信息、系统状态、进程列表、磁盘空间等。当用户询问电脑配置、系统状态或性能信息时使用。
it-operations
davila7
Manages IT infrastructure, monitoring, incident response, and service reliability. Provides frameworks for ITIL service management, observability strategies, automation, backup/recovery, capacity planning, and operational excellence practices.
klingai-cost-controls
jeremylongshore
Implement cost controls and budget management for Kling AI. Use when managing spending limits, tracking costs, or preventing budget overruns. Trigger with phrases like 'klingai cost', 'kling ai budget', 'klingai spending', 'video generation costs'.
pagerduty-automation
T-Sunm
Automate PagerDuty tasks via Rube MCP (Composio): manage incidents, services, schedules, escalation policies, and on-call rotations. Always search tools first for current schemas.
oly
slaveOftime
Use when starting a long-running or interactive CLI command with oly, especially when it may need later input, should be detachable, or should keep durable logs for supervision and resume.