Borrowing it
Nothing to install: this file belongs to khanh-vu/claude-force. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/khanh-vu/claude-force/main/.claude/skills/high-availability-patterns/SKILL.mdgit 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/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.
<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="Reviewed on agentmods" width="80" 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.5 | $0.00000 | $0.01118 |
| Sonnet 5.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 2mo 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.
- 2mo 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 (6 stars, last pushed 11mo 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
An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.
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 through opencli: the user's home timeline, tweet search, trending topics, bookmarks, a user's recent tweets, threads, articles, profiles, followers and following, and notifications. Use this skill whenever the user wants to know what people are saying on Twitter/X or fintwit about…
energy-procurement
Codified expertise for electricity and gas procurement, tariff optimization, demand charge management, renewable PPA evaluation, and multi-facility energy cost management. Informed by energy procurement managers with 15+ years experience at large commercial and industrial consumers. Includes market structure analysis…
airdrop-hunting-guide
Guide to finding and qualifying for crypto airdrops — eligibility criteria, farming strategies, on-chain activity requirements, Sybil detection avoidance, and tracking tools. Use when helping users understand airdrops, check eligibility, or plan participation strategies.
recipe-daily-pnl-report
Generate a daily profit and loss summary from trades and balances.