ai-governance
Generate and enforce policy gates for AI coding agents (Copilot, Claude Code) — real-time session hooks that deny protected-path edits and dangerous commands,…
Generate, test, audit, debug, and migrate Kyverno policies using the new CEL-based policy types (ValidatingPolicy, MutatingPolicy, GeneratingPolicy, ImageValidatingPolicy — all apiVersion policies.kyverno.io/v1). Covers matchConstraints, matchConditions, CEL
> /plugin marketplace add nitinjain999/platform-skills > /plugin install platform-skills@platform-skills
How it fires
How this command gets triggered: by you, by Claude, or both.
/kyvernoContext preview
What this command does when you run it.
Generate, test, audit, debug, and migrate Kyverno policies using the new CEL-based policy types (ValidatingPolicy, MutatingPolicy, GeneratingPolicy, ImageValidatingPolicy — all apiVersion policies.kyverno.io/v1). Covers matchConstraints, matchConditions, CEL
name: kyverno description: Generate, test, audit, debug, and migrate Kyverno policies using the new CEL-based policy types (ValidatingPolicy, MutatingPolicy, GeneratingPolicy, ImageValidatingPolicy — all apiVersion policies.kyverno.io/v1). Covers matchConstraints, matchConditions, CEL validations/mutations, generator.Apply(), Audit→Deny promotion, PolicyException, kyverno-cli testing, and migration from legacy ClusterPolicy or PodSecurityPolicy. Use when asked to "write a Kyverno policy", "test a ValidatingPolicy", "audit my cluster for violations", "why is my policy not firing", or "migrate from ClusterPolicy". argument-hint: "[generate|test|audit|debug|migrate] [policy description or file path]" title: "Kyverno Command" sidebar_label: "kyverno" custom_edit_url: null
Write, test, audit, debug, and migrate Kyverno policies using the new CEL-based policy types.
All new policies use `apiVersion: policies.kyverno.io/v1`. Legacy `ClusterPolicy` (`kyverno.io/v1`) still works but is deprecated in v1.17 and planned for removal in v1.20.
---
When invoked with no arguments, ask before proceeding:
**Q1 — Mode?**
What do you need? 1. generate — write a new production-ready Kyverno policy 2. test — write kyverno-test.yaml fixtures and run kyverno-cli 3. audit — analyse PolicyReport data from a running cluster 4. debug — diagnose why a policy is not behaving as expected 5. migrate — convert a legacy ClusterPolicy or PodSecurityPolicy Enter 1–5 or mode name:
**Q2 — Context** (after mode selected, one at a time):
Then proceed into the relevant mode below.
---
Write a production-ready Kyverno policy from a description.
Steps: 1. Ask for: policy type (ValidatingPolicy / MutatingPolicy / GeneratingPolicy / ImageValidatingPolicy), target resource kinds, whether cluster-wide or namespace-scoped, and whether to start in Audit or Deny mode 2. Start in `validationActions: [Audit]` unless the user explicitly requests Deny — blocking admission with an untested policy is high blast radius 3. Generate the policy with:
4. Show the kyverno-cli command to dry-run: `kyverno apply <policy.yaml> --resource <manifest.yaml> --detailed-results`
Reference: `references/kyverno.md` → ValidatingPolicy, MutatingPolicy, GeneratingPolicy, ImageValidatingPolicy
Write a `kyverno-test.yaml` manifest and companion resource fixtures.
Steps: 1. Read the policy — identify: kind, `matchConstraints` resource rules, `matchConditions`, and what each validation expression approves vs denies 2. For each validation, create:
3. Build `kyverno-test.yaml`:
name: <policy-name>-test
policies:
- <policy-file>.yaml
resources:
- resources/<passing-manifest>.yaml
- resources/<failing-manifest>.yaml
results:
- policy: <policy-name>
rule: <validation-name-or-autogen>
resource: <passing-resource-name>
kind: <Kind>
result: pass
- policy: <policy-name>
rule: <validation-name-or-autogen>
resource: <failing-resource-name>
kind: <Kind>
result: fail4. Run: `kyverno test .` — all results must match 5. Note: CEL `resource.Get()` / `resource.List()` (used in GeneratingPolicy) are not available in CLI tests — those require cluster-side testing
Reference: `references/kyverno.md` → kyverno-cli Testing
Analyse PolicyReport data from a running cluster and produce an actionable violation summary.
Steps: 1. Collect violation data:
kubectl get policyreport -A -o json \
| jq '[.items[].results[] | select(.result == "fail")]'
kubectl get clusterpolicyreport -o json \
| jq '[.items[].results[] | select(.result == "fail")]'2. Group violations by policy (highest severity first), then by resource kind — identify highest-volume policies first 3. For each violated policy:
A production-grade field handbook for platform, DevOps, SRE, and cloud engineers covering Kubernetes, Flux CD, Terraform, GitHub Actions, AWS, OPA/Rego, KEDA, Karpenter, supply chain security, Falco, observability, and more.
Repo: nitinjain999/platform-skills
Generate and enforce policy gates for AI coding agents (Copilot, Claude Code) — real-time session hooks that deny protected-path edits and dangerous commands,…
Generate, convert, and maintain animated GitHub-safe Markdown documents with animated SVG diagrams. Covers four SVG patterns (architecture flow, lifecycle…
AWS profile management for MCP servers — discover profiles across SSO, Granted, and assumed-role chains, check credential TTL, switch profiles across VS Code…
Structured guidance for AWS CloudFront distributions, WAF web ACLs, Lambda@Edge, CloudFront Functions, Firewall Manager multi-account enforcement, and IAM/IRSA…
Azure identity (Workload Identity, OIDC, Entra ID), resource tagging, AKS platform patterns, RBAC scoping, and production-readiness review — with Terraform…
Design, run, and debug Chaos Engineering experiments on Kubernetes using Litmus Chaos v3 and Chaos Mesh v2. Covers fault injection (pod-delete, network-loss,…