agentleFS
CaduS0uzaCaduS0uza/qa-supreme/skills/chaos-resilience/SKILL.md

chaos-resilience

Skill1 starsChanged 2 months agoMITView on GitHub

Test how the system behaves when its dependencies fail — timeouts, 500s, slow networks, partial outages, retries and idempotency. Use when asked about resilience, failure modes, error handling, or "what happens if the payment provider is down".

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every dependency will fail.

    line 8
  2. Distinctive:

    Start in tests, not in production.

    line 12

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

Chaos & Resilience

Every dependency will fail. The only question is whether your product degrades or corrupts.

Failure injection at the boundary

Start in tests, not in production. Playwright and MSW can break any dependency deterministically:

await page.route('**/api/payments/**', route => route.fulfill({ status: 503, body: '{"error":"unavailable"}' }))
await page.route('**/api/products', route => route.abort('failed'))                    // network dead
await page.route('**/api/search', async route => { await new Promise(r => setTimeout(r, 12000)); route.continue() })  // slow

The failure matrix

For each external dependency (payment, email, storage, auth provider, search, queue, third-party API):

FailureExpected behaviorNever acceptable
Timeoutbounded wait, user told, retry offeredinfinite spinner
500actionable error, state preservedwhite screen, lost form data
429backoff with jitter, queuedhammering the provider
Partial successidempotent retry converges to one effectdouble charge, duplicate email
Slow (10s+)loading state, cancel optionfrozen UI, main thread blocked
Dead entirelydegraded mode or clear outage messagecascading failure of unrelated features

Non-negotiable properties

  • Timeouts everywhere. A request without a timeout is an outage waiting for a slow dependency.
  • Idempotency keys on every write that can be retried. Test the retry explicitly.
  • Backoff with jitter. Synchronized retries are a self-inflicted DDoS.
  • Circuit breaker on repeated failures, with a tested half-open recovery.
  • No data corruption on partial failure: either the whole transaction or none of it.
  • The user always learns something true. "Something went wrong" with no state is a defect.

Beyond the test suite

Game days on staging with real infrastructure faults (kill a pod, sever the database, fill the disk) belong to SRE, in a rehearsed window, with a rollback path and an owner watching. Never inject faults into production traffic on your own initiative — that is an operational decision with blast radius far beyond QA.

Output

DEPENDENCY payments
  timeout 12s      -> spinner never resolves, no error shown          FAIL  checkout.tsx:120
  503              -> error shown, cart preserved, retry works        PASS
  retry after 500  -> second charge created                           FAIL  charges.ts:88 (no idempotency key)

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.