Boîte à outils d'ingénierie du chaos

VérifiéPrudence

Exécutez des expériences d'ingénierie du chaos pour tester la résilience du système en injectant des pannes (latence réseau, crash de services, épuisement des ressources). Validez la dégradation progressive et la récupération auto.

Spar Skills Guide Bot
DevOpsAvancé
06/08/2026
Claude CodeCodex
#chaos-engineering#resilience-testing#fault-injection#observability#incident-response

Recommandé pour

Synthèse automatique

Ce skill guide l'exécution d'expériences de chaos engineering contrôlées pour vérifier la résilience, la tolérance aux pannes et la capacité de récupération d'un système distribué.

Points forts

  • Méthodologie structurée : hypothèse de steady-state, rayon d'impact, montée en charge progressive des expériences
  • Catalogue concret de catégories de pannes (réseau, processus, dépendance, état) avec valeurs typiques
  • Garde-fous explicites : durée maximale, seuils d'abandon automatique, kill switch manuel
  • Liste d'observations précieuses (circuit breakers, retries, fallback, alerting) et livrables d'analyse avec plan d'action

Limites

  • Suppose un environnement de staging instrumenté et un outil de chaos déjà installé (toxiproxy, Pumba, Litmus, Chaos Mesh) : le skill ne les installe pas
  • Ne couvre que le déroulé méthodologique, pas la configuration réelle des outils ni des dashboards
  • Reste risqué si l'approbation d'équipe et les triggers d'abandon ne sont pas réellement en place
Quand l'utiliser

À utiliser lorsqu'une équipe veut valider en staging le comportement d'un système distribué face à des pannes injectées et documenter les faiblesses de résilience.

Quand l'éviter

À éviter en production sans garde-fous ni approbation, ou si aucun monitoring, baseline de métriques et moyen de rollback ne sont disponibles.

Analyse de sécurité

Prudence
Score qualité79/100

This is a standard chaos-engineering playbook that uses powerful, deliberately destructive operations (process kills, resource exhaustion, fault injection, data-state manipulation) for a legitimate resilience-testing purpose. There is no exfiltration, obfuscation, curl|sh, or safety-disabling content, and it explicitly frames experiments as staging-only with approval and rollback. Because the instructions can cause real outages if misapplied and the tool allowlist doesn't match the shown commands, 'caution' rather than 'safe' is appropriate.

Points d'attention
  • •Content is inherently disruptive by design: instructs killing pods/processes, exhausting CPU/memory, filling disk, blocking dependencies, and 'corrupting data' — legitimate for chaos engineering but high-impact if run against the wrong environment
  • •No enforced guardrail in the file itself; safety depends entirely on the operator honoring the stated prerequisites (staging-only, approval, blast radius, rollback)
  • •Declared Bash scope (test:chaos-*) does not cover the example commands shown (toxiproxy-cli, npm test, kubectl/Litmus), so the allowlist is inconsistent with the instructions
  • •Guidance to 'deploy chaos agent inside the target network' and 'add security group rules' nudges toward loosening network segmentation
Comment cette analyse est faite

Exemples

Inject network latency
Run a chaos experiment in staging: inject 500ms of network latency between the checkout service and the payment API, watch error rate and p99 latency, and abort automatically if the error rate goes above 5%.
Kill a service instance
Test the resilience of our order service by killing one of its three instances, then report whether the circuit breaker opens, how retries behave, and how long autoscaling takes to bring a healthy instance back.
Plan a dependency outage
Design a chaos experiment that blocks access to our Redis cache, starting from a written steady-state hypothesis, a defined blast radius, and a documented rollback plan, and include the experiment definition file.

name: running-chaos-tests description: | Execute chaos engineering experiments to test system resilience. Use when performing specialized testing. Trigger with phrases like "run chaos tests", "test resilience", or "inject failures".

allowed-tools: Read, Write, Edit, Grep, Glob, Bash(test:chaos-*) version: 1.0.0 author: Jeremy Longshore jeremy@intentsolutions.io license: MIT compatible-with: claude-code, codex, openclaw

Chaos Engineering Toolkit

Overview

Execute controlled chaos engineering experiments to test system resilience, fault tolerance, and recovery capabilities. Injects failures including network latency, service crashes, resource exhaustion, and dependency outages to verify that systems degrade gracefully and recover automatically.

Prerequisites

  • Distributed system or microservice architecture deployed in a staging/test environment
  • Monitoring and alerting configured (Grafana, Datadog, CloudWatch, or Prometheus)
  • Rollback capability for the target environment (manual or automated)
  • Chaos engineering tool installed (toxiproxy, Pumba, Litmus, or Chaos Mesh)
  • Explicit approval from the team to run chaos experiments
  • Steady-state hypothesis defined (what "healthy" looks like in metrics)

Instructions

  1. Define the steady-state hypothesis:
    • Identify measurable indicators of normal system behavior (e.g., p99 latency < 500ms, error rate < 0.1%, all health checks pass).
    • Record baseline metrics before injecting any failures.
    • Define the blast radius -- which services and users are affected by the experiment.
  2. Design chaos experiments by category:
    • Network: Inject latency (200-2000ms), packet loss (5-50%), DNS failure, connection timeout.
    • Process: Kill a service instance, exhaust CPU or memory, fill disk.
    • Dependency: Block access to database, cache, or external API.
    • State: Corrupt data, introduce clock skew, simulate split-brain scenarios.
  3. Start with minimal impact and increase gradually:
    • Begin with read-only experiments (network latency on non-critical path).
    • Progress to service-level failures (kill one instance of a multi-instance service).
    • Only move to data-level chaos after infrastructure chaos is validated.
  4. Execute each experiment with safeguards:
    • Set a maximum experiment duration (5-15 minutes).
    • Configure automatic rollback triggers (error rate > 5% triggers abort).
    • Monitor system metrics in real-time during the experiment.
    • Have a manual kill switch ready (script to remove all injected failures immediately).
  5. Observe and record system behavior during the experiment:
    • Did circuit breakers activate? How quickly?
    • Did auto-scaling trigger? How long until new instances were healthy?
    • Did retries succeed? Were they idempotent?
    • Did fallback mechanisms engage (cached responses, degraded mode)?
    • Were alerts triggered? Did on-call receive notification?
  6. After the experiment, verify full recovery:
    • Remove all injected failures.
    • Verify steady-state hypothesis holds again within expected recovery time.
    • Check for data inconsistencies or orphaned state.
  7. Document findings and create action items for resilience improvements.

Output

  • Chaos experiment definition files (YAML or JSON) with hypothesis, method, and rollback
  • Experiment execution log with timeline of injected failures and observed effects
  • System behavior report covering circuit breakers, retries, fallbacks, and alerts
  • Recovery timeline showing time-to-detection and time-to-recovery
  • Action items for resilience improvements (retry policies, circuit breaker tuning, fallback additions)

Error Handling

| Error | Cause | Solution | |-------|-------|---------| | Experiment caused production outage | Blast radius larger than expected or missing safeguards | Always run in staging first; reduce scope; add automatic abort triggers; require approval | | System did not recover after experiment | Auto-healing mechanisms not configured or too slow | Add health-check-based restarts; configure auto-scaling; implement circuit breaker patterns | | Monitoring missed the failure | Alerting thresholds too lenient or wrong metrics monitored | Tighten alert thresholds; add specific alerts for the failure mode tested; verify alert channels | | Chaos tool cannot access target | Network segmentation or security policies blocking the tool | Deploy chaos agent inside the target network; add security group rules for the chaos controller | | Data corruption persists after rollback | Stateful failure injection without transaction protection | Use read-only chaos first; snapshot databases before stateful experiments; implement compensating transactions |

Examples

toxiproxy network latency injection:

set -euo pipefail
# Create a proxy for the database connection
toxiproxy-cli create postgres_proxy -l 0.0.0.0:15432 -u postgres-host:5432  # 15432: PostgreSQL port

# Inject 500ms latency
toxiproxy-cli toxic add postgres_proxy -t latency -a latency=500 -a jitter=100  # HTTP 500 Internal Server Error

# Run tests while latency is active
npm test -- --grep "handles slow database"

# Remove the toxic
toxiproxy-cli toxic remove postgres_proxy -n latency_downstream

Kubernetes pod kill experiment (Litmus Chaos):

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: api-pod-kill
spec:
  appinfo:
    appns: default
    applabel: "app=api-server"
  chaosServiceAccount: litmus-admin
  experiments:
    - name: pod-delete
      spec:
        components:
          env:
            - name: TOTAL_CHAOS_DURATION
              value: "60"
            - name: CHAOS_INTERVAL
              value: "10"
            - name: FORCE
              value: "true"

Custom chaos script (process kill and verify recovery):

#!/bin/bash
set -euo pipefail
echo "=== Chaos Experiment: API server kill ==="
echo "Hypothesis: System recovers within 30 seconds"

# Record baseline
BASELINE=$(curl -s -o /dev/null -w '%{http_code}' http://app.test/health)
echo "Baseline health: $BASELINE"

# Kill one API instance
docker kill api-server-1

# Monitor recovery
for i in $(seq 1 30); do
  STATUS=$(curl -s -o /dev/null -w '%{http_code}' --max-time 2 http://app.test/health)
  echo "T+${i}s: HTTP $STATUS"
  if [ "$STATUS" = "200" ]; then  # HTTP 200 OK
    echo "RECOVERED at T+${i}s"
    break
  fi
  sleep 1
done

Resources

  • Principles of Chaos Engineering: https://principlesofchaos.org/
  • toxiproxy: https://github.com/Shopify/toxiproxy
  • Litmus Chaos: https://litmuschaos.io/
  • Chaos Mesh (Kubernetes): https://chaos-mesh.org/
  • Pumba (Docker chaos): https://github.com/alexei-led/pumba
  • Netflix Chaos Engineering: https://netflixtechblog.com/tagged/chaos-engineering

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/chaos-engineering-toolkit-msh3ut5c' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/chaos-engineering-toolkit-msh3ut5c/download' --output '.skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md.part' && mv '.skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md.part' '.skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Outils déclarés par l’auteur (à vérifier dans votre agent) : Read, Write, Edit, Grep, Glob, Bash(test:chaos-*)

Extrait original : Prerequisites
  • Distributed system or microservice architecture deployed in a staging/test environment
  • Monitoring and alerting configured (Grafana, Datadog, CloudWatch, or Prometheus)
  • Rollback capability for the target environment (manual or automated)
  • Chaos engineering tool installed (toxiproxy, Pumba, Litmus, or Chaos Mesh)
  • Explicit approval from the team to run chaos experiments
  • Steady-state hypothesis defined (what "healthy" looks like in metrics)

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md' && test -s '.skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/running-chaos-tests' && cp -R '.skill-downloads/chaos-engineering-toolkit-msh3ut5c' '.claude/skills/running-chaos-tests'

Codex
test -f '.skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md' && test -s '.skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/running-chaos-tests' && cp -R '.skill-downloads/chaos-engineering-toolkit-msh3ut5c' '.agents/skills/running-chaos-tests'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/chaos-engineering-toolkit-msh3ut5c'

openskills read 'chaos-engineering-toolkit-msh3ut5c'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/chaos-engineering-toolkit-msh3ut5c/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires