/devops-skills:policy-as-codefrom devops-skills
Enforces infrastructure and cluster rules automatically using OPA, Sentinel, and Kyverno policies evaluated against Terraform plans or admission requests. Helps write Rego/Sentinel policies, add admission controllers, wire policy checks into pipelines, and decide between enforcement and audit mode.
Ships in devops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A wiki page that says "all S3 buckets must be private" prevents nothing — it's read once, if ever, and forgotten by the next person who copies an old module. A policy written as code and evaluated automatically against every plan or admission request prevents the violation from landing at all, regardless of who wrote the change or whether they read the wiki.
The shift this skill is about is from auditing infrastructure after the fact to rejecting bad infrastructure before it's ever applied. An audit finding is a cleanup task; a policy failure is a change that never happened.
A policy that only runs in a nightly audit report is a compliance artifact. A policy that blocks the pipeline is a guardrail. Prefer the guardrail.
For side-by-side Kyverno YAML policies and OPA Gatekeeper Rego constraint templates, read
references/kyverno-and-rego.md.
The cheapest place to reject a bad change is before it's ever applied — evaluate policy against the Terraform plan output or the Kubernetes admission request, not against resources that already exist. By the time a nightly scan finds a public bucket, it's been public for up to a day.
deny[msg] {
input.resource_changes[_].change.after.acl == "public-read"
msg := "S3 buckets must not be created with public-read ACL"
}
Done when: a plan or manifest violating a written policy cannot be applied through the normal pipeline path, full stop.
A brand-new policy enforced immediately as a hard block will, with near certainty, break some legitimate change nobody anticipated when writing the rule — and the first thing anyone learns about the new policy is that it's an obstacle. Ship it as a warning first, watch what it flags against real traffic for a stretch, then flip it to enforcing.
Done when: every enforcing policy spent a defined audit-only period first, with its audit-period findings reviewed and resolved.
A policy tested only against a clean, minimal example plan will pass in testing and then choke
on the first real plan with nested modules, for_each, or conditional resources. Test with the
actual shape of plans and manifests this org produces.
count = 0 resources and multi-provider plans, and run every policy against all of them.Done when: every policy has an automated test asserting both a case it correctly blocks and a case it correctly allows.
A policy file that checks tagging, encryption, and instance sizing together is hard to debug when
it fails, and impossible to promote to enforcing incrementally — one false positive on tagging
blocks legitimate encryption enforcement too. Keep policies narrow and composable, the same
argument made for modules in terraform-modules.
deny-public-s3-acl, not
s3-policy.Done when: any single policy can be disabled or rolled back without affecting the enforcement status of any other rule.
Every policy will eventually be legitimately wrong for one specific case. Without a sanctioned, auditable way to request an exception, people will find an unsanctioned one — commenting out the check, splitting the resource into a separate unmanaged apply, or routing around the pipeline entirely, all of which are worse than the exception would have been.
Done when: there's a documented process to request a time-bound, logged exception to any policy, and every current exception has an owner and an expiry.
State which policies are enforcing versus still in audit mode, and what each one actually prevents. Name the honest gap — usually a policy still in audit-only mode past its promotion date, an exception with no expiry, or a rule with no failing-case test — rather than presenting policy coverage as complete.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
opa, sentinel, kyverno, rego, admission-controller, policy-enforcement
88 skills in this plugin
/alertingCovers designing alerts that page a human only when a human needs to act — symptom-based alerting over cause-based, multi-window burn-rate alerts on error budgets, severity tiers that route between page/ticket/dashboard, requiring every page to link a runbook, and tuning out alert fatigue. Use this whenever the user is writing a new alert rule, asking why on-call is paged too often or missing real incidents, choosing an alert threshold, or designing severity routing. For the SLO the burn-rate math comes from use `slo-definition`, and for what a runbook should contain use `runbooks`./api-gatewayCovers the managed front-door pattern for APIs — request routing, centralized auth, rate limiting and quotas, request/response shaping, and recognizing when a gateway helps versus becomes a bottleneck or single point of failure. Use this whenever the user is designing an API entry point, adding rate limits or quotas, centralizing auth for several backend services, transforming a request between an external and internal contract, or debugging a gateway timeout. For east-west traffic between internal services use `service-connectivity`, and for token issuance details use `iam-access-management`./argocd-operationsCovers running Argo CD day to day — structuring app-of-apps, choosing sync policies and waves, reading health versus sync status correctly, and unsticking a degraded or hung Application. Use this whenever the user mentions Argo CD, an Application stuck "Progressing" or "OutOfSync," app-of-apps or ApplicationSets, sync waves and hooks, or asks why a deploy shows synced but the workload is unhealthy. For the underlying model this tool implements use `gitops`; for automated canary analysis on top of it use `progressive-delivery`; for the workloads it manages use `kubernetes-operations`./artifact-managementVersions, stores, and promotes build outputs — registries, immutability, build-once-promote-many, retention and garbage collection, and provenance metadata. Use this whenever the user sets up an artifact or container registry, asks how to promote a build between environments without rebuilding, needs a retention or cleanup policy, or wants to trace where an artifact came from. For an image's contents and size use `image-optimization`; for vulnerability scanning use `image-scanning`./autoscalingCovers scaling Kubernetes workloads and nodes to demand — HPA on the right metric, VPA, cluster autoscaler, custom/external metrics, avoiding thrash with stabilization windows, and requests as the foundation underneath it all. Use this whenever the user is configuring an HPA, deciding between HPA and VPA, debugging autoscaling that flaps, or sizing a cluster autoscaler. For the requests/limits autoscaling depends on use `kubernetes-operations`; for cost tradeoffs use `cost-optimization`./backup-and-restoreDefines the discipline of building backups you can actually restore under pressure — RPO-driven frequency, restores rehearsed on a schedule, offsite immutable copies, encryption, and treating a backup that has never been restored as equivalent to no backup at all. Use this whenever the user sets up a backup job, chooses a retention policy, argues about RPO or RTO, asks whether current backups are enough, or plans for ransomware or accidental deletion. For the wider recovery plan use `disaster-recovery`, and for stateful platform durability use `stateful-workloads`.npx claudepluginhub arjunprabhulal/devops-skills --plugin devops-skills