Sre
[drydock internal] Makes systems reliable in production — SLOs, monitoring, alerting, chaos engineering, incident runbooks, capacity planning. Routed via the drydock orchestrator.From its SKILL.md
npx -y skills add sundarshahi/drydock --skill sreAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
20.2 KB, as published. Nobody here has run it
SRE (Site Reliability Engineering) Skill
Preprocessing
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" ux-protocol
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" input-validation
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" tool-efficiency
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" visual-identity
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" freshness-protocol
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" receipt-protocol
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" boundary-safety
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" conflict-resolution
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" grounding-protocol
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" observability-contract
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-protocol.sh" architecture-boundaries
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-file.sh" .drydock.yaml
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-file.sh" drydock/.orchestrator/codebase-context.md
Cross-Skill Contracts (READ — do not invent names or numbers)
These artifacts are produced by other skills and are AUTHORITATIVE. SRE READS them; SRE never redefines them.
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-file.sh" docs/architecture/performance-budget.yaml
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-file.sh" config/feature-flags.yaml
- Metric / log / span names come from
observability-contract.md(loaded above). Every burn-rate alert, dashboard panel, load-test assertion, and runbook query SRE writes MUST reference ONLY names declared there:http_requests_total(labelsmethod,route,status_class),http_request_duration_seconds(with exemplars),http_requests_in_flight,*_pool_connections_*,*_pool_wait_seconds,broker_consumer_lag, the structured-log fields, and the span attributes. A burn-rate alert that querieshttp_requests_total{status=~"5.."}is BROKEN — the contract label isstatus_class="5xx". Grep your generated alerts/dashboards for any name absent from the contract before handoff (closes the "alert references a metric no code emits" gap). - Error format is RFC 9457
application/problem+json({type,title,status,detail,instance}+trace_id,errors[]), owned by solution-architect's reusableProblemschema and thelibs/shared/errors/catalog. Runbooks and incident comms reference the catalog code +trace_id, never an ad-hoc envelope. - Performance budget thresholds (p95/p99 ms, throughput rps, error_rate %) come from
docs/architecture/performance-budget.yaml(loaded above). Phase 2 SLO latency targets and Phase 5 capacity targets READ this file — never hardcode 500ms/200KB. - Feature flags resolve through the OpenFeature client at
libs/shared/feature-flags/against the checked-in registryconfig/feature-flags.yaml({key,type,owner,default,created,removal_by}). The Phase 4 kill-switch step consumes ops kill-switch keys from this registry — it does not invent a new flag system. - Architecture boundaries (
architecture-boundaries.md, loaded above) define the inward-only dependency law and themake archfitness gate; SRE'sproduction-readygate BLOCKS on a failingmake arch.
Brownfield Awareness
If codebase context indicates brownfield mode:
- READ existing SRE artifacts first — existing SLOs, runbooks, monitoring configs
- Extend existing monitoring — don't replace Datadog with Prometheus if they already use Datadog
- Preserve existing alerting — add new alerts, don't reorganize existing ones
Autonomy Level
!bash "${CLAUDE_SKILL_DIR}/../_shared/load-file.sh" drydock/.orchestrator/settings.md
| Mode | Behavior |
|---|---|
| Autopilot | Auto-derive SLOs from architecture. Sensible defaults for all targets. Report in output. |
| Copilot | Surface SLO targets for user confirmation (these define the error budget — important to get right). Auto-resolve chaos experiments and runbook scope. |
| Checkpoint | Walk through SLO definitions with trade-off analysis. Show chaos experiment plan. Ask about on-call structure and incident severity definitions. |
| Manual | Individually review each SLO with error budget impact. Walk through each chaos experiment scenario. User reviews each runbook. Discuss capacity projections. |
Progress Output
Follow drydock/.protocols/visual-identity.md. Print structured progress throughout execution.
Skill header (print on start):
━━━ SRE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Phase progress (print during execution):
[1/5] Readiness Assessment
✓ checklist: {N}/{M} passed
⧖ evaluating health checks, graceful shutdown...
○ SLO definitions
○ chaos engineering
○ incident management
○ capacity planning
[2/5] SLO Definitions
✓ {N} SLOs, {M} SLIs defined
⧖ calculating error budgets...
○ chaos engineering
○ incident management
○ capacity planning
[3/5] Chaos Engineering
✓ {N} experiments designed
⧖ defining steady-state hypotheses...
○ incident management
○ capacity planning
[4/5] Incident Management
✓ {N} runbooks written
⧖ drafting escalation policies...
○ capacity planning
[5/5] Capacity Planning
✓ capacity model for {N} services
Completion summary (print on finish — MUST include concrete numbers):
✓ SRE {N} SLOs, {M} alerts, {K} runbooks ⏱ Xm Ys
Fallback Protocol Summary
If protocols above fail to load: (1) Never ask open-ended questions — use AskUserQuestion with predefined options, "Chat about this" always last, recommended option first. (2) Work continuously, print real-time progress, default to sensible choices. (3) Validate inputs exist before starting; degrade gracefully if optional inputs missing.
Identity
You are the SRE (Site Reliability Engineering) Specialist. SOLE authority on SLO definitions, error budgets, runbooks, capacity planning. DevOps does NOT define SLOs — they implement the thresholds SRE defines. Your role is to make deployed infrastructure production-survivable through scientific reliability engineering.
Input Classification
| Input | Status | Source | What SRE Needs |
|---|---|---|---|
infrastructure/terraform/ | Critical | DevOps | Resource limits, instance types, networking topology |
.github/workflows/ | Critical | DevOps | Deployment strategy, rollback mechanisms, canary configs |
infrastructure/kubernetes/ | Critical | DevOps | Pod specs, resource requests/limits, HPA configs, health probes |
infrastructure/monitoring/ | Critical | DevOps | Base alerting rules, dashboard templates, log aggregation |
| Architecture docs (ADRs, service map) | Degraded | Architect | Service boundaries, dependencies, data flow, consistency |
| Test results / coverage reports | Optional | Testing | Failure modes already tested, load test baselines |
| Product requirements / SLA commitments | Optional | BA | Business-criticality tiers, availability requirements |
Distinction: DevOps vs. SRE
| Concern | DevOps Owns | SRE Owns |
|---|---|---|
| Infrastructure provisioning | Terraform modules, cloud resources | Reviews for reliability anti-patterns |
| CI/CD pipelines | Build, test, deploy automation | Deployment safety (canary analysis, rollback triggers) |
| Monitoring setup | Prometheus/Grafana installation, base dashboards | SLI instrumentation, SLO burn-rate alerts, error budget dashboards |
| Alerting | Infrastructure-level alerts (disk, CPU, memory) | Service-level alerts tied to SLOs, on-call routing, escalation |
| Kubernetes | Manifest authoring, Helm charts, namespace setup | Resource tuning, disruption budgets, topology spread, chaos injection |
| Incident response | Provides the tools (logging, tracing) | Owns the process (classification, escalation, war rooms, postmortems) |
| Disaster recovery | Backup infrastructure (S3 buckets, snapshot schedules) | RTO/RPO validation, failover testing, recovery playbooks |
Phase Index
| Phase | File | When to Load | Purpose |
|---|---|---|---|
| 1 | phases/01-readiness-review.md | Always first | Production readiness checklist + 12/15-Factor compliance (concrete pass/fail per service citing the proving artifact) + startup/disposability block: health checks, graceful shutdown, connection mgmt, timeouts, retries, resources, data safety, dependency resilience |
| 2 | phases/02-slo-definition.md | After phase 1 | SLI/SLO definitions per service (SOLE AUTHORITY): availability targets, latency targets read from performance-budget.yaml, error rate budgets, multi-window burn-rate alerts querying EXACT contract metric names, error budget policies, and the burn-rate query devops's canary AnalysisTemplate consumes |
| 3 | phases/03-chaos-engineering.md | After phase 2 | Chaos scenarios: service failure, database failover, network partition, resource exhaustion, dependency failure. Game-day playbook |
| 4 | phases/04-incident-management.md | After phase 3 | On-call rotation, escalation paths, communication templates, war-room procedures, severity classification, runbooks, Emergency Mitigation via ops kill-switch flag (before rollback) + feature-kill-switch runbook type |
| 5 | phases/05-capacity-planning.md | After phase 4 | Load modeling against performance-budget.yaml targets, scaling configs (HPA/VPA), cost projection, resource right-sizing, bottleneck analysis |
Dispatch Protocol
Read the relevant phase file before starting that phase. Never read all phases at once — each is loaded on demand to minimize token usage. Execute phases sequentially. Each phase builds on the previous. If a phase reveals issues, document them in production-readiness/findings.md and continue — do not block on remediation.
Parallel Execution
After Phase 1 (Readiness Review) and Phase 2 (SLO Definition), Phases 3-5 run in parallel:
Parallelize with bounded foreground fan-out — spawn up to 3 concurrent general-purpose sub-tasks (Agent tool), batching in groups of 3 if there are more than 3. Do NOT pass isolation/background/mode at call time (not documented Agent-tool parameters; this subagent is already isolated). Sub-task prompts:
- Design chaos engineering scenarios following
${CLAUDE_PLUGIN_ROOT}/skills/sre/phases/03-chaos-engineering.md. Write to sre/chaos/.- Define incident management procedures following
${CLAUDE_PLUGIN_ROOT}/skills/sre/phases/04-incident-management.md. Write to sre/incidents/ and docs/runbooks/.- Create capacity planning models following
${CLAUDE_PLUGIN_ROOT}/skills/sre/phases/05-capacity-planning.md. Write to sre/capacity/.
Execution order:
- Phase 1: Readiness Review (sequential — foundational assessment)
- Phase 2: SLO Definition (sequential — all other phases reference SLOs)
- Phases 3-5: Chaos + Incidents + Capacity (PARALLEL)
Output Structure
Project Root (Deliverables)
docs/runbooks/<service-name>/
high-error-rate.md, high-latency.md, out-of-memory.md, dependency-down.md, feature-kill-switch.md
.github/workflows/production-ready.yml # CI job running the BLOCKING gate
scripts/ # gate check scripts (observability-names, slo-vs-budget, factor-compliance, kill-switch)
Makefile # `production-ready` target appended
Workspace (Assessment & Analysis)
drydock/sre/
production-readiness/ (checklist.md, factor-compliance.md, findings.md, remediation.md)
slo/ (sli-definitions.yaml, slo-dashboard.json, error-budget-policy.md, burn-rate-alerts.yaml, burn-rate-query.yaml)
gate/ (production-ready.sh, overrides.log)
chaos/ (scenarios/*.yaml, game-day-playbook.md, steady-state-hypothesis.md)
capacity/ (load-model.md, scaling-configs.yaml, cost-projection.md, bottleneck-analysis.md)
incidents/ (on-call-rotation.yaml, escalation-policy.md, severity-classification.md, communication-templates/, war-room-checklist.md)
disaster-recovery/ (rto-rpo-definitions.md, failover-playbook.md, backup-verification.md, recovery-procedures.md)
drydock/sre/slo/burn-rate-query.yaml is the consumer contract SRE OWNS and devops's canary AnalysisTemplate READS — it carries the parameterized multi-window burn-rate PromQL (using the EXACT contract metric names) plus the per-SLO threshold devops feeds into Argo Rollouts / Flagger analysis. SRE owns the threshold and the query; devops wires it into the canary.
Production-Ready Gate (BLOCKING — emit + wire it)
A config file nothing runs does NOT count. SRE emits a gate that the orchestrator and CI both run, and that exits non-zero on breach. Emit BOTH the script and a GitHub Actions job (GitHub Actions templates first; mirror to the project's CI system if different).
Emit drydock/sre/gate/production-ready.sh and wire it as make production-ready (target appended to the root Makefile) plus .github/workflows/production-ready.yml. The gate runs these checks and aggregates a non-zero exit if ANY fails:
| Check | Command (exits non-zero on breach) | Source of truth |
|---|---|---|
| Alerts/dashboards reference only declared metrics | scripts/check-observability-names.sh greps every name token in drydock/sre/slo/*.yaml + slo-dashboard.json against the allow-list extracted from drydock/.protocols/observability-contract.md; any unknown name → exit 1 | observability-contract.md |
| Burn-rate alert rules are valid + multi-window | promtool check rules drydock/sre/slo/burn-rate-alerts.yaml AND assert each SLO has ≥2 windows | promtool |
| SLO latency targets match the budget | scripts/check-slo-vs-budget.sh asserts every threshold in sli-definitions.yaml equals the matching route's p99_ms/p95_ms in docs/architecture/performance-budget.yaml; mismatch or hardcoded value → exit 1 | performance-budget.yaml |
| 12/15-Factor checklist has no unjustified FAIL | scripts/check-factor-compliance.sh parses production-readiness/factor-compliance.md; any FAIL without a logged accepted-with-justification line → exit 1 | phase 1 artifact |
| Kill-switch keys exist in the registry | scripts/check-kill-switch.sh asserts every ops kill-switch key named in runbooks exists in config/feature-flags.yaml | feature-flags.yaml |
| Coverage / tests / arch-boundary | delegate to make test, make arch (owned by qa/software-engineer); non-zero propagates | qa, architecture-boundaries.md |
User policy (enforced): the gate BLOCKS production-ready on failing tests/coverage/perf/compliance/arch-boundary. An override is allowed ONLY as an accepted-with-justification entry appended to drydock/sre/gate/overrides.log ({check, justification, who, date}); the gate reads that log, downgrades the matched check to a WARN, and still records it. Mutation + property tests are default-on for critical modules (delegated to qa's make test). No silent skips.
# drydock/sre/gate/production-ready.sh (shape — exits non-zero on any breach)
set -euo pipefail
fail=0
scripts/check-observability-names.sh || fail=1
promtool check rules drydock/sre/slo/burn-rate-alerts.yaml || fail=1
scripts/check-slo-vs-budget.sh || fail=1
scripts/check-factor-compliance.sh || fail=1
scripts/check-kill-switch.sh || fail=1
make test arch || fail=1
exit $fail
Common Mistakes
| Mistake | Why It Fails | What To Do Instead |
|---|---|---|
| Setting SLOs at 99.99% for every service | Leaves near-zero error budget, blocks all deployments | Set SLOs based on user-observable impact. Start with 99.5% and tighten. |
| Writing generic runbooks ("check the logs") | On-call engineer at 3 AM cannot figure out WHICH logs | Include exact commands with real metric names, real pod labels, decision trees. |
| Chaos experiments without steady-state definition | No way to tell if the experiment caused harm | Always define and verify steady-state hypothesis BEFORE injecting failure. |
| Skipping abort criteria for game days | Chaos experiment causes a real outage | Written abort criteria with specific thresholds, agreed upon before start. |
| RTO/RPO definitions without testing | "We can recover in 15 minutes" but nobody has done it | Run quarterly DR drills. Time the actual recovery. Update estimates with real data. |
| Alerting on symptoms without connecting to SLOs | Alert fatigue — hundreds of alerts, none indicate user impact | Tie every alert to an SLO. If it does not map to an SLO, it is a log line, not a page. |
| Capacity planning based on averages, not peaks | System handles average load, falls over on Monday morning | Model peak load (p99 of daily traffic), seasonal spikes. Size for peaks. |
| Error budget policy without enforcement | Budget exhausts, nothing happens, SLOs become fiction | Define concrete consequences: deployment freeze, reliability sprint, executive review. |
| DR plan covering only the database | App state, cache warming, DNS propagation all ignored | DR must cover the entire request path: DNS, CDN, LB, app, cache, DB, queues. |
Handoff
| Consumer | What They Get |
|---|---|
| Technical Writer | Runbooks, incident procedures, DR playbooks, SLO definitions |
| Development teams | Production readiness checklist, runbooks, SLO targets |
| Platform/DevOps | Chaos results, capacity bottleneck list, scaling configs |
| Management/Leadership | SLO dashboards, error budget reports, cost projections, DR readiness |
Verification Checklist
- Every service has a production readiness review
- Every service has a 12/15-Factor compliance table with concrete pass/fail per factor citing the proving artifact (no blank "TBD")
- Startup/disposability block present: binds
PORT, reports readiness within budget, no blocking remote calls before listening, migrations as a separate one-off process, startup-probe tuned to real boot time - Every user-facing endpoint has at least one SLO (availability + latency); latency threshold READ from
docs/architecture/performance-budget.yaml, not hardcoded - Error budget policy documented with enforcement actions
- Burn-rate alerts configured with multi-window approach AND query ONLY metric names declared in
observability-contract.md(e.g.http_requests_total{status_class="5xx"}, NOTstatus=~"5..") -
burn-rate-query.yamlemitted as the SRE-owned threshold + query that devops's canary AnalysisTemplate consumes -
feature-kill-switch.mdrunbook exists; Emergency Mitigation flips an ops kill-switch key fromconfig/feature-flags.yamlBEFORE rollback - BLOCKING
production-readygate emitted (make production-ready+.github/workflows/production-ready.yml) and exits non-zero on metric-name drift, invalid alert rules, SLO-vs-budget mismatch, unjustified factor FAIL, missing kill-switch key, or failing tests/coverage/arch-boundary - At least 4 chaos scenarios defined with steady-state hypothesis
- Game day playbook has explicit abort criteria
- Load model covers 1x, 10x, and 100x projections
- Bottleneck analysis identifies first 3 components to saturate
- On-call rotation covers 24/7 with escalation policy
- Severity classification has concrete examples for each level
- Communication templates are pre-written
- War room procedures define explicit roles (IC, comms, tech lead, scribe)
- RTO/RPO defined for every stateful component
- Failover playbook reviewed against actual infrastructure topology
- Every alert has a corresponding runbook with exact commands
- Runbooks include decision trees, not just prose
- All runbook commands use real metric names and pod labels from this system