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,…
Cluster baseline scaffolding, RBAC diagnosis and generation, workload hardening, and structured pod/scheduling debug for plain Kubernetes across all distributions.
> /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.
/kubernetesContext preview
What this command does when you run it.
Cluster baseline scaffolding, RBAC diagnosis and generation, workload hardening, and structured pod/scheduling debug for plain Kubernetes across all distributions.
name: kubernetes description: Cluster baseline scaffolding, RBAC diagnosis and generation, workload hardening, and structured pod/scheduling debug for plain Kubernetes across all distributions. argument-hint: "[baseline|rbac|workload|debug] [namespace or manifest path]" title: "Kubernetes Command" sidebar_label: "kubernetes" custom_edit_url: null
Structured guidance for cluster baseline standards, RBAC, workload patterns, and operational debugging on Kubernetes.
/platform-skills:kubernetes baseline # generate namespace, RBAC, network policy, PDB, quota scaffold /platform-skills:kubernetes rbac # diagnose 401/403; generate Role/RoleBinding; simulate access /platform-skills:kubernetes workload # Deployment, HPA, probes, securityContext hardening /platform-skills:kubernetes debug # pod crashloop, OOMKill, pending scheduling, image pull errors
---
When invoked with no arguments, ask before proceeding:
**Q1 — Mode?**
What do you need? 1. baseline — namespace, RBAC, network policy, PDB, resource quota scaffold 2. rbac — diagnose 401/403, generate Role/RoleBinding, simulate access 3. workload — Deployment, HPA, probes, securityContext, PDB hardening 4. debug — crashloop, OOMKill, pending, image pull, general troubleshoot Enter 1–4 or mode name:
**Q2 — Context** (after mode selected):
---
**Triggers:** baseline, scaffold, new namespace, set up namespace, platform baseline
Read `references/kubernetes.md` before responding.
Generate the minimum platform baseline for a new namespace. Ask for namespace name and team before generating.
apiVersion: v1
kind: Namespace
metadata:
name: app-team
labels:
team: app-team
environment: production
managed-by: platform
annotations:
contact: platform@org.comapiVersion: v1
kind: ResourceQuota
metadata:
name: app-team-quota
namespace: app-team
spec:
hard:
requests.cpu: "4"
requests.memory: 8Gi
limits.cpu: "8"
limits.memory: 16Gi
pods: "20"
persistentvolumeclaims: "10"apiVersion: v1
kind: LimitRange
metadata:
name: container-defaults
namespace: app-team
spec:
limits:
- type: Container
default:
cpu: 500m
memory: 512Mi
defaultRequest:
cpu: 100m
memory: 128MiapiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
namespace: app-team
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
# Allow DNS egress — required for pod name resolution
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-dns-egress
namespace: app-team
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCPapiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: app-pdb
namespace: app-team
spec:
minAvailable: 1 # keep at least 1 pod running during voluntary disruptions
selector:
matchLabels:
app: app-teamkubectl apply --dry-run=server -f namespace-baseline/ # Confirm quota is applied kubectl describe resourcequota app-team-quota -n app-team # Confirm network policy is in place kubectl get networkpolicy -n app-team # Test DNS still works from a pod kubectl run dns-test --image=busybox --restart=Never --rm -it -n app-team \ -- nslookup kubernetes.default
**Handoffs:**
---
**Triggers:** 401, 403, forbidden, unauthorized, role, binding, service account, RBAC, can-i
Read `references/kubernetes.md` → RBAC troubleshooting section before responding.
| Code | Layer | First check | |---|---|---| | `401 Unauthorized` | Authentication failed | `kubectl auth whoami` — confirm identity | | `403 Forbidden` | Authorized identity, missing permission | `kubectl auth can-i` — confirm what is allowed |
# Test exactly what the service account can do kubectl auth can-i <verb> <resource> \ --as=system:serviceaccount:<namespace>:<sa-name> \ -n <namespace> # Examples kubectl auth can-i get pods \ --as=system:serviceaccount:app-team:app-controller \ -n app-team kubectl auth can-i list secrets \ --as=system:serviceaccount:app-team:app-controller \ -n app-team
kubectl get rolebindings,clusterrolebindings -A -o json \
| jq -r '
.items[]
| select(
.subjects[]?
| select(.kind=="ServiceAccount"
and .name=="<sa-name>"
and .namespace=="<namespace>")
)
| "\(.kind)/\(.metadata.namespace)/\(.metadata.name) -> \(.roleRef.name)"'apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pod-reader
namespace: app-team
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/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,…