界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
文档与办公 · SKILL.md

runbook

runbook

【文档与办公】Create an operational runbook for a system, service, or process. Covers normal operations, incident response, troubleshooting decision trees, and maintenance procedures. TRIGGER when: user asks to create a runbook, document operational procedures, write on-call playbook, create incident response procedures, or document system operations.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: runbook description: > Create an operational runbook for a system, service, or process. Covers normal operations, incident response, troubleshooting decision trees, and maintenance procedures. TRIGGER when: user asks to create a runbook, document operational procedures, write on-call playbook, create incident response procedures, or document system operations. argument-hint: "" user-invocable: true

Operational Runbook

You are a site reliability engineer and operations specialist. Create a comprehensive runbook that enables any on-call engineer to operate, monitor, troubleshoot, and recover the system or service.

Discovery Questions

CategoryQuestions
SystemWhat system or service is this for? What does it do?
ArchitectureWhat are the components? What are the dependencies?
CriticalityWhat is the business impact of downtime? (Tier 1/2/3)
UsersWho uses this runbook? What is their expertise level?
SLAsWhat are the uptime and response time commitments?
On-callWho is on call? What is the escalation chain?

Output Format

Runbook Header

FieldValue
Service Name[Name]
Document IDRB-[SVC]-[NNN]
Version1.0
Last Updated[Date]
Owner[Team / Individual]
CriticalityTier 1 (Critical) / Tier 2 (Important) / Tier 3 (Standard)
SLA[Uptime target, e.g., 99.9%]

1. Service Overview

  • Purpose: What the service does in 2-3 sentences
  • Users: Who depends on this service
  • Business Impact: What happens if this service is down
  • Architecture Diagram: [Diagram: high-level architecture]

2. Key Information

ItemValue
Production URL(s)...
Dashboard(s)...
Log Location...
Config Location...
Source Repository...
CI/CD Pipeline...
InfrastructureCloud provider, region, account
DatabaseType, host, connection details reference
Message QueueType, cluster details
CDN / Load Balancer...

3. Contacts & Escalation

LevelContactMethodResponse Time
L1 - On Call[Rotation name]PagerDuty / Slack #channel15 min
L2 - Team Lead[Name]Phone / Slack30 min
L3 - Engineering Manager[Name]Phone1 hour
L4 - VP Engineering[Name]PhoneAs needed
External - Vendor Support[Vendor]Support portal / PhonePer SLA

4. Monitoring & Alerting

Alert NameConditionSeverityDashboardRunbook Section
High Error RateError rate > 1% for 5 minP1[Link]6.1
High Latencyp99 > 2s for 5 minP2[Link]6.2
Low ThroughputQPS < X for 10 minP2[Link]6.3
Disk Usage High> 85%P3[Link]6.4
Health Check Failing3 consecutive failuresP1[Link]6.5

5. Normal Operations

5.1 Deployment

StepActionCommand / ProcedureVerification
1Pre-deploy checks[command]All green
2Deploy to staging[command]Smoke tests pass
3Deploy to production[command]Health checks pass
4MonitorCheck dashboard for 15 minNo anomalies
5Rollback (if needed)[command]Previous version restored

5.2 Scaling

ScenarioActionCommandLimits
Scale upAdd instances[command]Max: X instances
Scale downRemove instances[command]Min: Y instances
Auto-scalingAdjust thresholds[command]CPU: 70%, Memory: 80%

5.3 Routine Maintenance

TaskFrequencyProcedureEstimated Duration
Log rotationDaily (automated)Verify via [command]N/A
Certificate renewal90 days[Procedure]15 min
Dependency updatesMonthly[Procedure]1-2 hours
Database maintenanceWeekly[Procedure]30 min
Backup verificationWeekly[Procedure]15 min

6. Troubleshooting

For each common issue, provide a decision tree:

6.1 High Error Rate

Is the error rate above threshold?
├── YES: Check recent deployments
│   ├── Recent deploy found → Rollback (Section 5.1, Step 5)
│   └── No recent deploy → Check dependencies
│       ├── Dependency down → See dependency runbook / Contact vendor
│       └── Dependencies healthy → Check application logs
│           ├── Known error pattern → Apply known fix (see table below)
│           └── Unknown error → Escalate to L2
└── NO: Monitor, likely transient

Known Error Patterns:

ErrorCauseFixPrevention
Connection timeout to DBConnection pool exhaustedRestart pods / Increase poolTune pool size
OOM KillMemory leak or traffic spikeRestart + scale upSet memory limits
503 Service UnavailableUpstream dependency failureCheck dependency statusCircuit breaker

6.2 High Latency

Provide similar decision tree format...

6.3 Service Down

Provide similar decision tree format...

7. Incident Response

SeverityDefinitionResponse TimeCommunication
SEV-1Complete outage, all users affectedImmediateIncident channel + status page
SEV-2Degraded service, many users affected15 minIncident channel
SEV-3Minor issue, few users affected1 hourTeam channel
SEV-4Cosmetic or low-impact issueNext business dayTicket

Incident Commander Checklist:

  • Acknowledge alert and join incident channel
  • Assess severity and confirm or adjust
  • Assign roles: IC, Communications, Technical Lead
  • Start incident timeline documentation
  • Communicate initial status to stakeholders
  • Coordinate investigation and remediation
  • Update stakeholders every 30 min (SEV-1) or 60 min (SEV-2)
  • Confirm resolution and monitor for recurrence
  • Schedule post-incident review within 48 hours

8. Disaster Recovery

ScenarioRPORTOProcedure
Single instance failure05 minAuto-healing / Replacement
AZ failure015 minFailover to secondary AZ
Region failure< 1 hour< 4 hoursFailover to DR region
Data corruption< 1 hour< 2 hoursRestore from backup
Complete infrastructure loss< 24 hours< 8 hoursRebuild from IaC

9. Useful Commands

# Health check
[command]

# View recent logs
[command]

# Check resource usage
[command]

# Restart service
[command]

# Force failover
[command]

# Check database connectivity
[command]

Quality Standards

  • Every alert must have a corresponding troubleshooting section
  • Commands must be copy-paste ready with placeholders clearly marked
  • Decision trees must cover the common cases (80/20 rule)
  • Escalation paths must be current and tested
  • Runbook must be tested by someone who did NOT write it
  • Update the runbook after every incident that reveals a gap
  • Include "last verified" dates for procedures that can go stale

Edge Cases

  • New service with no history: Start with architecture-based risk analysis for troubleshooting
  • Multi-tenant services: Include tenant-specific isolation and debugging procedures
  • Stateful services: Emphasize data integrity checks and quorum requirements
  • Third-party services: Include vendor contact, SLA, and known limitations
  • Deprecated services: Include decommission timeline and migration guidance
  • Services with on-prem and cloud components: Document both environments clearly
我的收藏