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.
npx agentmods add skills/khanh-vu/claude-force/high-availability-patternsnpx skills add khanh-vu/claude-force --skill high-availability-patternsgit clone --depth 1 https://github.com/khanh-vu/claude-forceWrote 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.
[](https://agentmods.dev/skills/khanh-vu/claude-force/high-availability-patterns)<a href="https://agentmods.dev/skills/khanh-vu/claude-force/high-availability-patterns"><img src="https://agentmods.dev/badge/skills/khanh-vu/claude-force/high-availability-patterns.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.02794 |
| Opus 5 | $0.00000 | $0.01397 |
| Sonnet 5 | $0.00000 | $0.00559 |
| Haiku 4.5 | $0.00000 | $0.00279 |
Grade A, and why
high-availability-patterns 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 421 lines — stays where its author put it; the contents beside it link to each section on GitHub.
High Availability Patterns
Production-ready HA patterns for cryptocurrency trading systems with 99.99% uptime.
Active-Passive Architecture with Redis Leader Election
import redis
import asyncio
import time
import uuid
from typing import Optional
class LeaderElection:
"""Redis-based leader election for active-passive HA"""
def __init__(
self,
redis_client: redis.Redis,
service_name: str,
ttl_seconds: int = 10,
instance_id: Optional[str] = None
):
self.redis = redis_client
self.service_name = service_name
self.ttl = ttl_seconds
self.instance_id = instance_id or str(uuid.uuid4())
self.is_leader = False
self.lock_key = f"leader:{service_name}"
async def run_leader_election(self):
"""Continuous leader election loop"""
while True:
try:
# Try to acquire leadership
acquired = self.redis.set(
self.lock_key,
self.instance_id,
nx=True, # Only set if not exists
ex=self.ttl # Expire after TTL
)
if acquired:
if not self.is_leader:
logger.info(f"Instance {self.instance_id} became LEADER")
self.is_leader = True
await self._on_become_leader()
# Renew leadership
await self._renew_leadership()
else:
# Check if we were leader before
if self.is_leader:
logger.warning(f"Instance {self.instance_id} lost leadership")
self.is_leader = False
await self._on_lose_leadership()
# Sleep for half the TTL before renewing
await asyncio.sleep(self.ttl / 2)
except redis.RedisError as e:
logger.error(f"Leader election error: {e}")
self.is_leader = False
await asyncio.sleep(1)
async def _renew_leadership(self):
"""Renew leadership lock"""
try:
# Only renew if we still hold the lock
current_leader = self.redis.get(self.lock_key)
if current_leader and current_leader.decode() == self.instance_id:
self.redis.expire(self.lock_key, self.ttl)
else:
self.is_leader = False
logger.warning("Lost leadership during renewal")
except redis.RedisError as e:
logger.error(f"Leadership renewal failed: {e}")
self.is_leader = False
async def _on_become_leader(self):
"""Hook called when instance becomes leader"""
# Perform state reconciliation
await self._reconcile_state()
# Start active trading
await self._start_trading_engine()
# Send notification
logger.info("Transitioned to ACTIVE state")
async def _on_lose_leadership(self):
"""Hook called when instance loses leadership"""
# Stop trading immediately
await self._stop_trading_engine()
# Flush pending orders
await self._flush_pending_orders()
logger.info("Transitioned to PASSIVE state")
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.
- 5d ago First seen · 421 lines · 0 tokens per session scan A 4cd745094045
high-availability-patterns is a skill published in the GitHub repository khanh-vu/claude-force (5 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,794 tokens. 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-08-31.
Other skills, from other repositories
sector-rotation
行业轮动分析——申万行业景气度评分、行业动量排名、产业链传导、估值/盈利/资金流多维比较框架.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
Use when evaluating A-share limit-up (涨停板) setups through Chen Hao's sentiment and momentum lens: market emotion cycles, board strength, follow-through, and short-term aggressive momentum trading.
trading-risk-gate
Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.
vectorbt
High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics.