/devops-skills:k8s-yaml-generatorfrom devops-skills
Generates Kubernetes YAML manifests (Deployment, Service, ConfigMap, Ingress, RBAC, StatefulSet, CRDs) with deterministic steps, CRD research via Context7, and mandatory validation. Triggered by requests to create/update K8s YAML.
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.
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:
examples/configmap-secret.yaml (opens in a new tab)examples/deployment-service.yaml (opens in a new tab)examples/hpa-pdb.yaml (opens in a new tab)examples/ingress.yaml (opens in a new tab)examples/rbac-cluster-reader-optional.yaml (opens in a new tab)examples/rbac.yaml (opens in a new tab)examples/statefulset.yaml (opens in a new tab)references/resource_patterns.md (opens in a new tab)references/security_patterns.md (opens in a new tab)tests/test_regression.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub akin-ozer/cc-devops-skills --plugin devops-skills31 skills in this plugin
/ansible-generatorGenerate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars./ansible-validatorValidate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks./azure-pipelines-generatorGenerate/create/scaffold azure-pipelines.yml, stages, jobs, steps, or reusable templates./azure-pipelines-validatorValidate, lint, audit, or review azure-pipelines.yml — syntax, security, best practices./bash-script-generatorCreate, generate, write, or scaffold bash/shell scripts (.sh), automation, or CLI tools./bash-script-validatorValidate, lint, audit, or fix bash/shell/.sh scripts via ShellCheck.Other plugins' skills for the same job