agentleFS
RidhuanDEVRidhuanDEV/claude-skills/shadow-resilience/SKILL.md

shadow-resilience

Skill1 starsChanged yesterdayMITView on GitHub

Disaster Recovery & Business Continuity. Use when running automated DB backup restore drills (RPO/RTO verification), chaos/fault injection, circuit breakers, or graceful degradation planning.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run pg_restore or gunzip < backup.sql.gz | mysql and record elapsed wall-clock seconds.

    line 21
  2. Very specific:

    Always execute docker rm -f -v <container> (and docker image rm -f <temp-image> if a custom image was built) in the finally block so zero …

    line 25
  3. Distinctive:

    Run failure-injection tests strictly against isolated staging/test fixtures (never live production without explicit authorization): inject …

    line 43

≈ “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

Shadow Resilience (/shadow-resilience) — Disaster Recovery Drills, RPO/RTO & Graceful Degradation

A backup that has never been restored is not a backup. Use /shadow-resilience to verify that the application survives dependency outages and can be recovered within contractual RPO (Recovery Point Objective) and RTO (Recovery Time Objective).


1. Automated Backup Restore Drill Protocol (Proving RPO & RTO)

[!CAUTION] Strict Isolation Rule: Always execute restore drills against an isolated temporary container or staging database (db_restore_drill_temp), NEVER overwriting the live production database!

The 5-Step Restore Drill Verification

  1. Fetch Latest Production Backup Artifact: Pull the latest .dump / .sql.gz from backup storage and verify its .sha256 checksum.
  2. Spin Up Ephemeral Restore Container: Launch an isolated Postgres/MySQL/MariaDB container (--rm --label shadow.ephemeral=true on a temporary local port) inside a try / finally (trap EXIT) block.
  3. Execute Restore & Measure Duration (Actual RTO):
    • Run pg_restore or gunzip < backup.sql.gz | mysql and record elapsed wall-clock seconds.
  4. Verify Data Integrity & Recency (Actual RPO):
    • Query row counts on core transaction tables (users, orders, audit_logs) and check MAX(created_at) to verify the data lag is within the target RPO.
  5. Tear Down & Log Drill Evidence:
    • Always execute docker rm -f -v <container> (and docker image rm -f <temp-image> if a custom image was built) in the finally block so zero stopped containers or orphan volumes remain, then write an auditable drill report (docs/ops/restore-drill-YYYY-MM.md — compatible with /shadow-doc monthly maintenance reports!).

2. Graceful Degradation & Fault-Isolation Patterns

Design the application so a non-critical subsystem failure never takes down the entire system:

Failure ScenarioBad Behavior (Fragile)Resilient Behavior (/shadow-resilience)
Redis Cache DownEvery API call throws 500 Internal Server ErrorLog warning, bypass cache (or serve stale in-memory fallback with rate limit), keep core auth/transactions working.
SMTP / WhatsApp Gateway DownUser registration or order approval hangs for 60s then fails 500Commit DB transaction + write to outbox_events; background worker retries delivery when gateway recovers.
Analytics / Export Worker OOMCrashes main API process sharing the same containerIsolate heavy report/export workers into a separate process/container with bounded memory limits.
Database Connection SpikeApp opens 1,000 raw connections and crashes PostgresEnforce bounded connection pool (max: 20) + PgBouncer + fast queue timeout (5s) returning 503 Retry-After.

3. Scoped Fault Injection, Bulkheads & Queue Recovery

  • Run failure-injection tests strictly against isolated staging/test fixtures (never live production without explicit authorization): inject dependency HTTP 503s, broker disconnects, and slow-consumer stalls.
  • Isolate critical APIs from heavy export/AI workers using separate pools/queues (bulkheads) and verify dead-letter queue replay procedures (/shadow-concurrency) restore backlog safely without exceeding DB pool budgets.

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.