{"id":"sre-engineer","name":"sre-engineer","summary":"サービスレベルの目標を定義し、エラーバジェットポリシーを作成し、インシデント対応手順を設計し、キャパシティモデルを開発し、本番システム向けの監視設定や自動化スクリプトを作成します。","body":"# SRE Engineer\n\n## Core Workflow\n\n1. **Assess reliability** - Review architecture, SLOs, incidents, toil levels\n2. **Define SLOs** - Identify meaningful SLIs and set appropriate targets\n3. **Verify alignment** - Confirm SLO targets reflect user expectations before proceeding\n4. **Implement monitoring** - Build golden signal dashboards and alerting\n5. **Automate toil** - Identify repetitive tasks and build automation\n6. **Test resilience** - Design and execute chaos experiments; verify recovery meets RTO/RPO targets before marking the experiment complete; validate recovery behavior end-to-end\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| SLO/SLI | `references/slo-sli-management.md` | Defining SLOs, calculating error budgets |\n| Error Budgets | `references/error-budget-policy.md` | Managing budgets, burn rates, policies |\n| Monitoring | `references/monitoring-alerting.md` | Golden signals, alert design, dashboards |\n| Automation | `references/automation-toil.md` | Toil reduction, automation patterns |\n| Incidents | `references/incident-chaos.md` | Incident response, chaos engineering |\n\n## Constraints\n\n### MUST DO\n- Define quantitative SLOs (e.g., 99.9% availability)\n- Calculate error budgets from SLO targets\n- Monitor golden signals (latency, traffic, errors, saturation)\n- Write blameless postmortems for all incidents\n- Measure toil and track reduction progress\n- Automate repetitive operational tasks\n- Test failure scenarios with chaos engineering\n- Balance reliability with feature velocity\n\n### MUST NOT DO\n- Set SLOs without user impact justification\n- Alert on symptoms without actionable runbooks\n- Tolerate >50% toil without automation plan\n- Skip postmortems or assign blame\n- Implement manual processes for recurring tasks\n- Deploy without capacity planning\n- Ignore error budget exhaustion\n- Build systems that can't degrade gracefully\n\n## Output Templates\n\nWhen implementing SRE practices, provide:\n1. SLO definitions with SLI measurements and targets\n2. Monitoring/alerting configuration (Prometheus, etc.)\n3. Automation scripts (Python, Go, Terraform)\n4. Runbooks with clear remediation steps\n5. Brief explanation of reliability impact\n\n## Concrete Examples\n\n### SLO Definition & Error Budget Calculation\n\n```\n# 99.9% availability SLO over a 30-day window\n# Allowed downtime: (1 - 0.999) * 30 * 24 * 60 = 43.2 minutes/month\n# Error budget (request-based): 0.001 * total_requests\n\n# Example: 10M requests/month → 10,000 error budget requests\n# If 5,000 errors consumed in week 1 → 50% budget burned in 25% of window\n# → Trigger error budget policy: freeze non-critical releases\n```\n\n### Prometheus SLO Alerting Rule (Multiwindow Burn Rate)\n\n```yaml\ngroups:\n  - name: slo_availability\n    rules:\n      # Fast burn: 2% budget in 1h (14.4x burn rate)\n      - alert: HighErrorBudgetBurn\n        expr: |\n          (\n            sum(rate(http_requests_total{status=~\"5..\"}[1h]))\n            /\n            sum(rate(http_requests_total[1h]))\n          ) > 0.014400\n          and\n          (\n            sum(rate(http_requests_total{status=~\"5..\"}[5m]))\n            /\n            sum(rate(http_requests_total[5m]))\n          ) > 0.014400\n        for: 2m\n        labels:\n          severity: critical\n        annotations:\n          summary: \"High error budget burn rate detected\"\n          runbook: \"https://wiki.internal/runbooks/high-error-burn\"\n\n      # Slow burn: 5% budget in 6h (1x burn rate sustained)\n      - alert: SlowErrorBudgetBurn\n        expr: |\n          (\n            sum(rate(http_requests_total{status=~\"5..\"}[6h]))\n            /\n            sum(rate(http_requests_total[6h]))\n          ) > 0.001\n        for: 15m\n        labels:\n          severity: warning\n        annotations:\n          summary: \"Sustained error budget consumption\"\n          runbook: \"https://wiki.internal/runbooks/slow-error-burn\"\n```\n\n### PromQL Golden Signal Queries\n\n```promql\n# Latency — 99th percentile request duration\nhistogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service))\n\n# Traffic — requests per second by service\nsum(rate(http_requests_total[5m])) by (service)\n\n# Errors — error rate ratio\nsum(rate(http_requests_total{status=~\"5..\"}[5m])) by (service)\n  /\nsum(rate(http_requests_total[5m])) by (service)\n\n# Saturation — CPU throttling ratio\nsum(rate(container_cpu_cfs_throttled_seconds_total[5m])) by (pod)\n  /\nsum(rate(container_cpu_cfs_periods_total[5m])) by (pod)\n```\n\n### Toil Automation Script (Python)\n\n```python\n#!/usr/bin/env python3\n\"\"\"Auto-remediation: restart pods exceeding error threshold.\"\"\"\nimport subprocess, sys, json\n\nERROR_THRESHOLD = 0.05  # 5% error rate triggers restart\n\ndef get_error_rate(service: str) -> float:\n    \"\"\"Query Prometheus for current error rate.\"\"\"\n    import urllib.request\n    query = f'sum(rate(http_requests_total{{status=~\"5..\",service=\"{service}\"}}[5m])) / sum(rate(http_requests_total{{service=\"{service}\"}}[5m]))'\n    url = f\"http://prometheus:9090/api/v1/query?query={urllib.request.quote(query)}\"\n    with urllib.request.urlopen(url) as resp:\n        data = json.load(resp)\n    results = data[\"data\"][\"result\"]\n    return float(results[0][\"value\"][1]) if results else 0.0\n\ndef restart_deployment(namespace: str, deployment: str) -> None:\n    subprocess.run(\n        [\"kubectl\", \"rollout\", \"restart\", f\"deployment/{deployment}\", \"-n\", namespace],\n        check=True\n    )\n    print(f\"Restarted {namespace}/{deployment}\")\n\nif __name__ == \"__main__\":\n    service, namespace, deployment = sys.argv[1], sys.argv[2], sys.argv[3]\n    rate = get_error_rate(service)\n    print(f\"Error rate for {service}: {rate:.2%}\")\n    if rate > ERROR_THRESHOLD:\n        restart_deployment(namespace, deployment)\n    else:\n        print(\"Within SLO threshold — no action required\")\n```\n\n[Documentation](https://jeffallan.github.io/claude-skills/skills/devops/sre-engineer/)","author":"@Jeffallan","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/Jeffallan/claude-skills/tree/main/skills/sre-engineer","license":"MIT","category":"writing","lang":"en","tokens":1457,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"references/automation-toil.md","size":14820,"sha256":"6e93b916b246a739e28583f70565abcfee18285141900734ef1587329858272f"},{"path":"references/error-budget-policy.md","size":9852,"sha256":"ab1eb5849bcb1345b57ed5a34d8836dc853e30968b998601195bfc65f803c0cd"},{"path":"references/incident-chaos.md","size":16791,"sha256":"063058f0f36d2c420f33dd158f6e96b24328b47043a59ea8523f0391717dfdac"},{"path":"references/monitoring-alerting.md","size":11553,"sha256":"22479c9718b70d889baf43fa7c6cbbe7015f3ba7d710f627c7da68286ca0adf1"},{"path":"references/slo-sli-management.md","size":6774,"sha256":"9f56a471eaf30474906deea6009b800eae972097828560ab950d104525b900d2"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":["jeffallan.github.io","runbooks.example.com","wiki.internal"]}}