From devops-skills
Generates validated Kubernetes YAML manifests for Deployments, Services, ConfigMaps, Ingress, RBAC, StatefulSets, and CRDs with CRD research.
How this skill is triggered — by the user, by Claude, or both
Slash command
/devops-skills:k8s-yaml-generatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate Kubernetes manifests with deterministic steps, bounded CRD research, and mandatory validation for full-resource output.
Generate Kubernetes manifests with deterministic steps, bounded CRD research, and mandatory validation for full-resource output.
Use this skill when the user asks to create or update Kubernetes YAML, for example:
Do not use this skill for validation-only requests. For validation-only work, use k8s-yaml-validator.
Normative keywords:
MUST: requiredSHOULD: default unless user requests otherwiseMAY: optionalDeterministic sequence:
If one step is blocked by environment constraints, execute that step's fallback and continue.
Before generation:
Preflight stop condition:
Collect:
Deployment, Service, ConfigMap, CRD kind, etc.)apiVersion + kindSafe defaults (state explicitly in output):
default (namespace-scoped resources)2ClusterIPIfNotPresent (unless user needs forced pulls)Run this step only for custom APIs outside Kubernetes built-in groups.
Extract:
argoproj.io/v1alpha1, Application)v2.9.x)Use the correct Context7 tools and payloads:
mcp__context7__resolve-library-idmcp__context7__query-docsSample payloads:
Tool: mcp__context7__resolve-library-id
libraryName: "argo-cd"
query: "Find Argo CD documentation for Application CRD schema compatibility"
Tool: mcp__context7__query-docs
libraryId: "/argoproj/argo-cd/v2.9.0"
query: "Application CRD required spec fields for apiVersion argoproj.io/v1alpha1 with minimal valid example"
Selection rules:
libraryId when user specifies a version.Bound the lookup to prevent unbounded retries:
resolve-library-id: max 2 attempts (primary name + one alternate name).query-docs: max 3 focused queries total.Stop early when all are true:
Hard stop when budgets are exhausted:
Needs confirmation.kubectl explain <kind>.spec when available).Use this order:
resolve-library-id -> query-docs)kubectl explain, if cluster access exists)If none are available, provide a minimal, clearly marked draft and do not claim full CRD correctness.
Apply these checks:
app.kubernetes.io/*) across related resources.securityContext to avoid root execution by default.Minimal label baseline:
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/part-of: myplatform
app.kubernetes.io/managed-by: codex
For full manifest generation, validation is mandatory.
Primary path:
k8s-yaml-validator.Required reporting after each validation pass:
Validation mode: k8s-yaml-validator | script fallback | manual fallbackSyntax: pass/failSchema: pass/fail/partialCRD check: pass/fail/partialDry-run: server/client/skippedBlocking issues remaining: yes/noContingency A: validator skill unavailable
Run direct commands:
bash devops-skills-plugin/skills/k8s-yaml-validator/scripts/setup_tools.sh
yamllint -c devops-skills-plugin/skills/k8s-yaml-validator/assets/.yamllint <file.yaml>
kubeconform -schema-location default -strict -ignore-missing-schemas -summary <file.yaml>
server_out="$(mktemp)"
client_out="$(mktemp)"
trap 'rm -f "$server_out" "$client_out"' EXIT
if kubectl apply --dry-run=server -f <file.yaml> >"$server_out" 2>&1; then
echo "server_validation=passed"
elif grep -Eqi "connection refused|no such host|i/o timeout|tls handshake timeout|unable to connect to the server|no configuration has been provided|the server doesn't have a resource type" "$server_out"; then
echo "server_validation=skipped"
if kubectl apply --dry-run=client -f <file.yaml> >"$client_out" 2>&1; then
echo "client_validation=passed"
else
echo "client_validation=failed"
cat "$client_out"
exit 1
fi
else
echo "server_validation=failed"
cat "$server_out"
exit 1
fi
Contingency B: local tools partially unavailable
Contingency C: repeated validation failure
Validation exceptions:
Validation status: Skipped (reason).Final output MUST include:
Suggested next commands:
kubectl apply -f <filename>.yaml
kubectl get <resource-type> <name> -n <namespace>
kubectl describe <resource-type> <name> -n <namespace>
k8s-yaml-validator.argoproj.io/v1alpha1 + Application.resolve-library-id then query-docs).Execution is complete only when all applicable checks pass:
npx claudepluginhub akin-ozer/cc-devops-skills --plugin devops-skillsProvides YAML examples and best practices for Kubernetes manifests: Pods, Deployments, Services, ConfigMaps, Secrets, probes, resources, labels, and kubectl validation.
Guides step-by-step creation of production-ready Kubernetes manifests including Deployments, Services, ConfigMaps, Secrets, and PersistentVolumeClaims.
Generates production-ready Kubernetes manifests for Deployments, Services, Ingress, HPA, ConfigMaps, Secrets with health checks, resource limits, auto-scaling, TLS.