agentleFS
stevancrisstevancris/sre-ai-agent/skills/oncall-runbook/SKILL.md

oncall-runbook

Skill0 starsChanged 5 months agoMITView on GitHub

Look up, execute, and maintain on-call runbooks. Use when you receive an alert, need step-by-step remediation guidance, want to find the right runbook for a service, or need to create a new runbook for an alert that currently has none. Trigger keywords: runbook, on-call, oncall, alert firing, pagerduty, opsgenie, what do I do, how do I fix, remediation steps, service down, alert triggered, need guidance, step by step.

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. About 0 are common, 16 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

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

    Before loading context files, check if context/CONTEXT.md exists in the current directory.

    line 16
  2. Distinctive:

    Use the answers inline for this session.

    line 28
  3. Very specific:

    Before looking up any runbook, search skills/knowledge-base/patterns/ for a pattern matching the service name or alert description.

    line 37
  4. Distinctive:

    If a match is found, surface it immediately:

    line 46
  5. Very specific:

    If no pattern found: "First time seeing this — building knowledge as we go." Proceed to runbook lookup and run knowledge-capture when …

    line 61
  6. Very specific:

    Read context/CONTEXT.md and context/company/tech-stack.md.

    line 65
  7. Distinctive:

    Ask the user for (or extract from their message):

    line 68
  8. Very specific:

    Search skills/oncall-runbook/references/ using Glob and Grep for a file matching the service name or alert name.

    line 74
  9. Distinctive:

    If a runbook is found:

    line 77
  10. Very specific:

    Check off steps as the user confirms completion: [x] vs [ ].

    line 79
  11. Distinctive:

    If a step fails or produces unexpected output, branch into diagnostic mode.

    line 80
  12. Distinctive:

    If no runbook is found:

    line 82
  13. Distinctive:

    After the new runbook is generated, offer to walk through it.

    line 85
  14. Distinctive:

    If a runbook step fails or output is unexpected:

    line 88
  15. Distinctive:

    Ask: "What did you see instead of the expected output?"

    line 89
  16. Very specific:

    Check the service's recent logs: kubectl logs -l app=<service> --since=15m

    line 90
  17. Very specific:

    Check recent events: kubectl describe pod -l app=<service>

    line 91
  18. Distinctive:

    Check dependencies: are upstream services healthy?

    line 92
  19. Distinctive:

    After 20 minutes of investigation without resolution:

    line 96
  20. Distinctive:

    All personas: if data loss or P0 severity is suspected, escalate immediately.

    line 99
  21. Distinctive:

    If yes, update the runbook file with the new findings.

    line 107
  22. Distinctive:

    Never skip the "expected output" for each runbook step.

    line 119
  23. Distinctive:

    If the runbook leads to a destructive action (delete pod, restart deployment), output the command for the user to run manually and warn: …

    line 122
  24. Distinctive:

    After resolution, always prompt to update the runbook.

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

On-Call Runbook Skill

Setup Check

Before loading context files, check if context/CONTEXT.md exists in the current directory.

If context/CONTEXT.md exists — read it and proceed normally.

If context/CONTEXT.md does not exist — this skill was installed standalone (e.g. via npx skills add). Ask the user these questions before proceeding:

  1. Role — junior-sre / senior-sre / sre-manager (shapes output depth and tone)
  2. Cloud provider — aws / gcp / azure / on-prem / hybrid
  3. Observability stack — e.g. Datadog, Prometheus+Grafana, New Relic
  4. Company name and primary services affected (if relevant to this task)

Use the answers inline for this session. For persistent setup across all skills, suggest:

pipx install sre-agent
sre-agent init

Instructions

Step 0: Search Knowledge Base First (MANDATORY)

Before looking up any runbook, search skills/knowledge-base/patterns/ for a pattern matching the service name or alert description.

# Agent executes:
Glob: skills/knowledge-base/patterns/<service-name>*.md
Grep: skills/knowledge-base/patterns/ — keywords from alert name

If a match is found, surface it immediately:

⚡ This failure mode has been seen before.

Pattern: <name> | Last seen: <date> | Resolved in: ~X min

Fastest path (skip to what works):
  → <step 1 from pattern>
  → <step 2 from pattern>

Skip these (dead ends from prior incidents):
  → <dead end 1>
  → <dead end 2>

If no pattern found: "First time seeing this — building knowledge as we go." Proceed to runbook lookup and run knowledge-capture when resolved.

Step 1: Load Context

Read context/CONTEXT.md and context/company/tech-stack.md.

Step 2: Identify the Alert

Ask the user for (or extract from their message):

  • Service name
  • Alert name or condition
  • What they are currently observing (error message, metric value, etc.)

Step 3: Find the Runbook

Search skills/oncall-runbook/references/ using Glob and Grep for a file matching the service name or alert name.

If a runbook is found:

  • Load it and walk through it step by step.
  • Check off steps as the user confirms completion: [x] vs [ ].
  • If a step fails or produces unexpected output, branch into diagnostic mode.

If no runbook is found:

  • Inform the user: "No runbook found for this alert. Creating one now."
  • Invoke the runbook-generator skill.
  • After the new runbook is generated, offer to walk through it.

Step 4: Diagnostic Mode (when a step fails)

If a runbook step fails or output is unexpected:

  1. Ask: "What did you see instead of the expected output?"
  2. Check the service's recent logs: kubectl logs -l app=<service> --since=15m
  3. Check recent events: kubectl describe pod -l app=<service>
  4. Check dependencies: are upstream services healthy?
  5. Generate a modified recovery path based on the actual observation.

Step 5: Escalation Decision

After 20 minutes of investigation without resolution:

  • Junior SRE: **[ESCALATE]** — page the secondary on-call now.
  • Senior SRE: Surface the escalation option; let the user decide.
  • All personas: if data loss or P0 severity is suspected, escalate immediately.

Step 6: Post-Resolution Runbook Update

After resolution, ask:

  • "Did the runbook need any corrections or additions?"
  • "Were there any steps that didn't apply?"
  • "Did you discover anything new about this failure mode?"

If yes, update the runbook file with the new findings.


References

  • references/runbook-template.md — standard structure for all runbooks
  • references/alert-catalog.md — index of known alerts and their runbook locations

Guidelines

  • Never skip the "expected output" for each runbook step; it is how the user knows if the step worked.
  • Diagnostic mode is not debugging from scratch — stay focused on the alert's failure mode.
  • If the runbook leads to a destructive action (delete pod, restart deployment), output the command for the user to run manually and warn: "This will cause a brief restart. Confirm?"
  • After resolution, always prompt to update the runbook; stale runbooks are worse than none.

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.