Runbook generator

From seaworld008/Commonly-used-high-value-skills · View interactive version

Runbook generator is an AI agent skill from the GitHub repository seaworld008/Commonly-used-high-value-skills. Write or review operational runbooks for deployment, rollback, incidents, recovery, and maintenance using concrete commands and verification evidence.

How to use this skill

Skill file

Runbook Generator

Create operator-ready procedures from evidence. Never invent commands, account

names, URLs, thresholds, rollback behavior, or escalation contacts.

Required Inputs

Collect before writing:

If any production-critical input is unavailable, mark it TBD — owner required

instead of supplying a plausible value.

Evidence Discovery

Inspect likely sources:

rg --files -g 'Dockerfile*' -g 'docker-compose*.yml' -g 'compose*.yaml'
rg --files -g '.github/workflows/*.yml' -g 'terraform/**' -g 'k8s/**'
rg --files -g 'vercel.json' -g 'fly.toml' -g 'render.yaml'
rg -n "DATABASE_URL|migrate|rollback|health|readiness|liveness" .

Read the actual scripts and provider configuration before quoting a command.

Confirm current CLI syntax against official documentation when the platform may

have changed.

Safety Classification

Classify every step:

| Class | Meaning | Required handling |

|---|---|---|

| Read-only | Observes state | Safe to rehearse with non-secret fixtures |

| Reversible | Changes state with a proven undo | State precondition and rollback |

| Destructive | Deletes, truncates, resets, rotates, or revokes | Explicit approval and backup evidence |

| Irreversible | Cannot restore exact prior state | Separate break-glass procedure |

Never present destructive database reset, force push, bucket deletion, secret

revocation, or irreversible migration as a routine rollback.

In particular, commands such as prisma migrate reset, DROP, TRUNCATE,

kubectl delete, terraform destroy, and git push --force require a

destructive-operation warning and must not appear as the default production

path.

Runbook Structure

Use this structure:

# <Procedure name>

## Scope and owner
- Service:
- Environments:
- Primary owner:
- Escalation:
- Last rehearsed:

## Preconditions
- Required access:
- Change ticket or incident:
- Backup / restore evidence:
- Maintenance window:
- Known-good version:

## Stop conditions
- Abort when:
- Escalate when:

## Procedure
### Step 1 — <read-only preflight>
Command:
Expected evidence:
Failure action:

## Verification
- User-visible signal:
- Service health:
- Data integrity:
- Error and saturation signals:

## Rollback or recovery
- Trigger:
- Application rollback:
- Data recovery:
- Verification:

## Evidence record
- Operator:
- Start/end time:
- Commands executed:
- Links to logs, deploys, backups, and incident:

Procedure Rules

For every mutating step:

  1. State the precondition.
  2. Show the smallest scoped command.
  3. Describe expected output without fabricating exact IDs.
  4. Define a stop condition.
  5. Define the verification signal.
  6. Define the recovery action.

Prefer commands that expose a plan or preview:

terraform plan -out=tfplan
kubectl diff -f k8s/
helm diff upgrade <release> <chart>

Do not hide failures with || true, broad exception handling, or unbounded

retry loops.

Database Changes

Treat application rollback and data rollback as separate operations.

If a migration is irreversible, say so and define forward recovery.

Incident Runbooks

Start with containment and evidence preservation:

  1. Confirm impact from at least two independent signals.
  2. Declare severity using the organization's actual policy.
  3. Freeze unrelated changes.
  4. Capture timestamps, deploy versions, and relevant telemetry.
  5. Apply the least invasive mitigation.
  6. Verify recovery from the user's perspective.
  7. Preserve a timeline for follow-up analysis.

Avoid commands that destroy forensic evidence before it is captured.

Validation and Rehearsal

Validate runbooks outside production:

A runbook is not production-ready until its highest-risk recovery path has been

rehearsed or explicitly marked untested.

Freshness

Link each operational assumption to its source file or official document.

Re-review when any of these change:

Output Contract

Return:

Do not claim a runbook is safe merely because commands are syntactically

valid. Safety requires scoped authority, recoverability, and observed

verification.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.