sre-k8s-safe-remediation
Skill4 starsChanged 25 days agoMITView on GitHub
Use when a fix from sre-k8s-triage needs a kubectl or helm write (rollback, restart, scale, pod delete, Helm rollback): evidence, GitOps/HPA ownership check, preview, explicit approval, verify.
In this repository84 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/sre-safety-gates.mdcCursor rule
- sre-awsSkill
- sre-azureSkill
- sre-capacity-planningSkill
- sre-change-safetySkill
- sre-chaos-engineeringSkill
- sre-cloud-cost-reviewSkill
- sre-database-triageSkill
- sre-datadogSkill
- sre-dependency-mappingSkill
- sre-diagnosticsSkill
- sre-dr-backup-testSkill
- sre-dynatraceSkill
- sre-emudhra-ca-checkSkill
- sre-engineerSkill
- sre-expiry-auditSkill
- sre-gcpSkill
- sre-incident-commandSkill
- sre-incident-communicationSkill
- sre-k8s-triageSkill
- sre-k8s-upgrade-autopilotSkill
- sre-message-queue-triageSkill
- sre-migration-safetySkill
- sre-observability-cost-cutterSkill
- sre-observability-query-cookbookSkill
- sre-oncall-auditSkill
- sre-oncall-handoffSkill
- sre-pagerduty-opsgenieSkill
- sre-php2shell-checkSkill
- sre-postmortem-templatesSkill
- sre-production-readinessSkill
- sre-prometheus-grafanaSkill
- sre-remediation-actionsSkill
- sre-runbook-templatesSkill
- sre-safety-gatesSkill
- sre-security-incident-triageSkill
- sre-service-mesh-triageSkill
- sre-slo-alertingSkill
- sre-slo-burn-rate-rulesSkill
- sre-terraformSkill
- sre-toil-reviewSkill
- sre-awsSkill
- sre-azureSkill
- sre-capacity-planningSkill
- sre-change-safetySkill
- sre-chaos-engineeringSkill
- sre-cloud-cost-reviewSkill
- sre-database-triageSkill
- sre-datadogSkill
- sre-dependency-mappingSkill
- sre-diagnosticsSkill
- sre-dr-backup-testSkill
- sre-dynatraceSkill
- sre-emudhra-ca-checkSkill
- sre-engineerSkill
- sre-expiry-auditSkill
- sre-gcpSkill
- sre-incident-commandSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
- Distinctive: line 18
Every step below is read-only until step 5.
- Very specific: line 20
Pin the target: If the context, namespace and object were already pinned in this incident (for example by sre-k8s-triage), reuse them and …
- Very specific: line 21
Capture evidence: Run bash ../sre-k8s-triage/scripts/k8s-triage-snapshot.sh --context <ctx> -n <ns>.
- Very specific: line 28
Verify: Run kubectl --context <ctx> -n <ns> rollout status <obj> --timeout=120s, kubectl --context <ctx> -n <ns> events --for <obj> | tail …
- Distinctive: line 29
Stop and escalate: if metrics worsen, the command fails, or the output is unexpected.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.
Files
Kubernetes safe remediation
Safety gates (REQUIRED)
- Read-only diagnosis first.
- Propose each change with risk (low/med/high) and reversibility.
- Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
- Act only as approved, verify, and stop and escalate if anything gets worse.
Full rules: sre-safety-gates. Command risk labels: sre-remediation-actions. Requires sre-k8s-triage (scripts and references).
Every step below is read-only until step 5. Never skip the approval in step 4.
- Pin the target. If the context, namespace and object were already pinned in this incident (for example by
sre-k8s-triage), reuse them and say so. Otherwise get--context <ctx>,-n <ns>and the object name from the user. Runkubectl config get-contexts <ctx>. Never use the current context implicitly. - Capture evidence. Run
bash ../sre-k8s-triage/scripts/k8s-triage-snapshot.sh --context <ctx> -n <ns>. The output stays outside the repo and should be treated as sensitive. If a snapshot from this incident is less than 30 minutes old, cite its path and reuse it instead. - Check who owns the object.
- GitOps: look for
argocd.argoproj.io/*orkustomize.toolkit.fluxcd.io/*labels/annotations (kubectl --context <ctx> -n <ns> get <obj> -o jsonpath='{.metadata.labels}{.metadata.annotations}'). If present, prefer a Git revert:git revert <bad-commit>in the config repo, merge it through the normal review, then let Argo CD or Flux sync it. A barerollout undoorhelm rollbackis reverted at the next sync; if you must use one during the incident, pause auto-sync first (with approval) and revert in Git before resuming it. See the GitOps notes in the Rollback table ofsre-remediation-actions. - HPA:
kubectl --context <ctx> get hpa -n <ns>. If an HPA targets the object, don'tscale; adjust the HPA. - Helm:
helm --kube-context <ctx> -n <ns> list, thenhelm --kube-context <ctx> -n <ns> history <rel>.
- GitOps: look for
- Propose, then wait. Give the exact command, the risk, whether it's reversible, how to roll back, and the expected impact. Look each one up in destructive-commands.md. Preview where possible:
kubectl diff -f,apply --dry-run=server,helm diff upgrade --suppress-secrets/helm upgrade --dry-run=server --hide-secret. Stop and get explicit approval. - Execute exactly the approved command, with
--contextand-n. Run one object at a time. Don't add--force,--grace-period=0,--allor-lunless they were approved explicitly. - Verify. Run
kubectl --context <ctx> -n <ns> rollout status <obj> --timeout=120s,kubectl --context <ctx> -n <ns> events --for <obj> | tail -n 50, and check the error-rate/SLO metrics and the dependency that caused the page (for example database connections viasre-database-triage). Record what changed, when, and who approved it. - Stop and escalate if metrics worsen, the command fails, or the output is unexpected; propose the rollback and do not try another fix without approval.
Output
- Target (context, namespace, object), evidence path, ownership findings, the approved command and approver, verification result
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
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.

