/devops-skills:k8s-yaml-generatorfrom devops-skills
Generates, validates, and manages Kubernetes YAML resources including Deployments, Services, ConfigMaps, StatefulSets, and CRDs. Fetches CRD documentation via Context7 for version-aware manifest creation.
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.
None: SKILL.md is the whole skill.
This skill provides a complete workflow for generating Kubernetes YAML resources with built-in validation and intelligent CRD support. Generate production-ready manifests for any Kubernetes resource type, with automatic validation and version-aware documentation lookup for custom resources.
Use this skill when:
Follow this workflow when generating Kubernetes YAML resources:
Gather information about:
For CRDs specifically:
When dealing with Custom Resource Definitions (CRDs):
IMPORTANT: Always consider version compatibility when working with CRDs
Step 2a: Identify the CRD and Version
apiVersion: argoproj.io/v1alpha1, kind: ApplicationapiVersion: networking.istio.io/v1beta1, kind: VirtualServiceapiVersion: cert-manager.io/v1, kind: CertificateStep 2b: Resolve Library ID using Context7 MCP
Use the mcp__context7__resolve-library-id tool to find the correct library:
libraryName: "<project-name>"
Examples:
libraryName: "argo-cd"libraryName: "istio"libraryName: "cert-manager"The tool will return:
/org/project or /org/project/version)Select the most appropriate library based on:
Step 2c: Fetch Documentation using Context7 MCP
Use the mcp__context7__get-library-docs tool with the selected library ID:
context7CompatibleLibraryID: "/org/project/version"
topic: "specific CRD type or feature"
page: 1
Examples:
context7CompatibleLibraryID: "/argoproj/argo-cd/v2.9.0", topic: "application crd spec", page: 1context7CompatibleLibraryID: "/istio/istio/1.20.0", topic: "virtualservice", page: 1If context is insufficient:
page parameter (page: 2, page: 3, etc.) with the same topicStep 2d: Fallback to Web Search
If context7 MCP fails or returns insufficient information:
WebSearch tool with version-specific queries"<CRD-name> <version> spec documentation""ArgoCD Application v1alpha1 spec documentation""Istio VirtualService v1beta1 configuration""cert-manager Certificate v1 spec fields"CRITICAL: Always include version information in web searches to ensure compatibility
Apply Kubernetes best practices:
General Best Practices:
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-abc123
app.kubernetes.io/version: "1.0.0"
app.kubernetes.io/component: frontend
app.kubernetes.io/part-of: myplatform
app.kubernetes.io/managed-by: claude-code
annotations:
description: "Purpose of this resource"
contact: "[email protected]"
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
Security Best Practices:
securityContext)imagePullPolicy: Always or IfNotPresent appropriatelyFor CRDs:
Common Resource Templates:
Deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
namespace: default
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/version: "1.0.0"
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: myplatform
app.kubernetes.io/managed-by: claude-code
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
template:
metadata:
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/version: "1.0.0"
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: myplatform
app.kubernetes.io/managed-by: claude-code
spec:
containers:
- name: myapp
image: myapp:1.0.0
ports:
- containerPort: 8080
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
Service:
apiVersion: v1
kind: Service
metadata:
name: myapp-service
namespace: default
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: myplatform
app.kubernetes.io/managed-by: claude-code
spec:
type: ClusterIP # or LoadBalancer, NodePort
selector:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
ports:
- protocol: TCP
port: 80
targetPort: 8080
name: http
ConfigMap:
apiVersion: v1
kind: ConfigMap
metadata:
name: myapp-config
namespace: default
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/component: config
app.kubernetes.io/part-of: myplatform
app.kubernetes.io/managed-by: claude-code
data:
app.properties: |
key1=value1
key2=value2
config.json: |
{
"setting": "value"
}
CRITICAL: Always validate generated YAML using the devops-skills:k8s-yaml-validator skill
After generating the YAML resource, immediately invoke the devops-skills:k8s-yaml-validator skill:
Use the Skill tool:
Skill: devops-skills:k8s-yaml-validator
The devops-skills:k8s-yaml-validator skill will:
yamllintkubeconformWait for validation results and address any issues:
If validation fails:
Once validation passes:
Format:
# Generated and validated Kubernetes resource
# Resource: <Type>
# Namespace: <namespace>
# Validation: Passed
<YAML content here>
Suggest next steps:
# Apply the resource
kubectl apply -f <filename>.yaml
# Verify the resource
kubectl get <resource-type> <name> -n <namespace>
# Check status
kubectl describe <resource-type> <name> -n <namespace>
When generating multiple related resources:
--- separatorExample multi-document YAML:
apiVersion: v1
kind: ConfigMap
metadata:
name: myapp-config
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/part-of: myplatform
data:
key: value
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/part-of: myplatform
spec:
# deployment spec with matching labels
---
apiVersion: v1
kind: Service
metadata:
name: myapp-service
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/part-of: myplatform
spec:
# service spec with matching selector
When targeting specific Kubernetes versions:
extensions/v1beta1 to networking.k8s.io/v1 in K8s 1.19+Best practices for namespace handling:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp
namespace: argocd
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/part-of: myplatform
app.kubernetes.io/managed-by: argocd
spec:
project: default
source:
repoURL: https://github.com/org/repo
targetRevision: HEAD
path: manifests
destination:
server: https://kubernetes.default.svc
namespace: myapp
syncPolicy:
automated:
prune: true
selfHeal: true
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: myapp
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/component: networking
app.kubernetes.io/part-of: myplatform
spec:
hosts:
- myapp.example.com
gateways:
- myapp-gateway
http:
- route:
- destination:
host: myapp-service
port:
number: 8080
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: myapp-tls
namespace: default
labels:
app.kubernetes.io/name: myapp
app.kubernetes.io/instance: myapp-prod
app.kubernetes.io/component: tls
app.kubernetes.io/part-of: myplatform
spec:
secretName: myapp-tls-secret
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- myapp.example.com
This skill works seamlessly with:
The k8s-generator skill provides:
Always follow the core workflow: Understand → Fetch CRD Docs (if needed) → Generate → Validate → Deliver
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
31 skills in this plugin
/ansible-generatorComprehensive toolkit for generating best practice Ansible playbooks, roles, tasks, and inventory files./ansible-validatorComprehensive toolkit for validating, linting, testing, and automating Ansible playbooks, roles, and collections. Use this skill when working with Ansible files (.yml, .yaml playbooks, roles, inventories), validating automation code, debugging playbook execution, performing dry-run testing with check mode, or working with custom modules and collections./azure-pipelines-generatorComprehensive toolkit for generating best practice Azure DevOps Pipelines following current standards and conventions. Use this skill when creating new Azure Pipelines, implementing CI/CD workflows, or building deployment pipelines.Other plugins' skills for the same job
Generated from the plugin's indexed repository (gitjfmd/ansible-skills) — no native marketplace selected
npx claudepluginhub p/gitjfmd-devops-skills-devops-skills-plugin