Claude-skill-registry helm-scaffold
Generate production-ready Helm charts for Kubernetes applications. Use when users need to create new Helm charts, convert Kubernetes manifests to Helm templates, scaffold charts for Deployments/StatefulSets/Jobs/CronJobs, create multi-environment configurations, or standardize organizational chart templates with CNCF/Helm best practices. Uses Python scaffolding script and template assets for automated generation.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/helm-scaffold" ~/.claude/skills/majiayu000-claude-skill-registry-helm-scaffold && rm -rf "$T"
skills/data/helm-scaffold/SKILL.mdHelm Scaffold
Automate production-ready Helm chart generation using template assets, Python scaffolding scripts, and Kubernetes best practices through conversational interaction.
Core Capabilities
- Automated scaffolding using Python script (
)scripts/scaffold_chart.py - Template-based generation from
directoryassets/templates/ - Convert Kubernetes manifests to Helm templates
- Multi-environment configurations (dev, staging, prod)
- Organizational standardization with team policies
- Comprehensive testing with dry-run workflows
Quick Start
For simple chart generation, use the Python scaffolding script directly:
python3 scripts/scaffold_chart.py <chart-name> \ --workload-type deployment \ --output /mnt/user-data/outputs \ --ingress \ --hpa
Workflow Decision Tree
User Request ├─ Simple chart (name + type provided) │ └─ Use scaffold_chart.py directly ├─ Complex chart (many options) │ └─ Ask clarifying questions, then use scaffold_chart.py ├─ Manifest conversion │ └─ Manual templatization process └─ Custom requirements └─ Manual generation with template references
Interactive Workflow
Step 1: Understand Use Case
Identify the scenario:
- Simple new chart: Use
with user-provided paramsscaffold_chart.py - Complex chart: Ask questions, build command
- Manifest conversion: Extract variables, templatize
- Team template: Apply organizational standards
Step 2: Gather Requirements
Minimum required:
- Chart name
- Workload type (deployment, statefulset, job, cronjob)
Optional (ask if not provided):
- Container image repository and tag
- Application port
- Include Ingress? (--ingress flag)
- Include HPA? (--hpa flag)
- Include ConfigMap? (--configmap flag)
- Multi-environment configs?
Step 3: Generate Chart
Option A: Using scaffold_chart.py (Recommended)
For straightforward charts, execute the Python script:
import subprocess cmd = [ 'python3', 'scripts/scaffold_chart.py', chart_name, '--workload-type', workload_type, '--output', '/mnt/user-data/outputs' ] if include_ingress: cmd.append('--ingress') if include_hpa: cmd.append('--hpa') if include_configmap: cmd.append('--configmap') subprocess.run(cmd, check=True)
The script automatically:
- Creates chart directory structure
- Copies template files from
assets/templates/ - Replaces
placeholder with actual chart nameCHARTNAME - Includes only requested resources
- Applies best practices
Option B: Manual Generation
For custom requirements, manually copy and modify templates:
- Read template from
assets/templates/<workload>/<file>.yaml - Replace
with actual chart nameCHARTNAME - Customize based on user requirements
- Write to
/home/claude/<chart-name>/templates/
Step 4: Multi-Environment Configuration
If user requests dev/staging/prod configs, create additional values files:
values-dev.yaml:
replicaCount: 1 resources: limits: {cpu: 200m, memory: 128Mi} requests: {cpu: 25m, memory: 32Mi} env: - name: LOG_LEVEL value: "debug"
values-prod.yaml:
replicaCount: 3 resources: limits: {cpu: 1000m, memory: 512Mi} requests: {cpu: 100m, memory: 128Mi} autoscaling: enabled: true minReplicas: 3 maxReplicas: 10
Step 5: Testing Instructions
Always provide comprehensive testing workflow:
# Navigate to chart directory cd <chart-name> # 1. Validate chart structure helm lint . # 2. Render templates locally helm template <chart-name> . # 3. Dry run installation helm install <chart-name> . --dry-run --debug # 4. Test with specific values helm template <chart-name> . -f values-dev.yaml # 5. Deploy to test namespace kubectl create namespace test helm install <chart-name> . -n test # 6. Verify deployment kubectl get all -n test helm status <chart-name> -n test # 7. Cleanup helm uninstall <chart-name> -n test kubectl delete namespace test
Step 6: Deliver Output
- Chart is created in
/mnt/user-data/outputs/<chart-name>/ - Provide download link
- Include testing instructions
- Explain customization options
Workload Types
Load
references/workload-types.md for detailed decision tree and characteristics.
Quick reference:
- Deployment: Stateless apps (web, API, microservices)
- StatefulSet: Stateful apps (databases, caches) - stable IDs, persistent storage
- Job: One-time tasks (migrations, ETL)
- CronJob: Scheduled tasks (backups, reports)
Template locations:
assets/templates/deployment/deployment.yamlassets/templates/statefulset/statefulset.yamlassets/templates/job/job.yamlassets/templates/cronjob/cronjob.yaml
Converting Manifests to Helm
When user provides raw Kubernetes YAML:
- Analyze manifests: Identify resources and configurable values
- Extract variables: Images, replicas, ports, resources, env-specific settings
- Create values.yaml: Organize extracted values logically
- Templatize YAML:
- Replace hardcoded values with
{{ .Values.* }} - Use
for names{{ include "CHARTNAME.fullname" . }} - Use
for labels{{ include "CHARTNAME.labels" . }}
- Replace hardcoded values with
- Add helpers: Copy
and customizeassets/templates/_helpers.tpl - Document: Explain what was parameterized
Template Assets Structure
assets/templates/ ├── Chart.yaml # Base chart metadata ├── values.yaml # Complete values with all options ├── .helmignore # Files to ignore ├── _helpers.tpl # Helper functions (CHARTNAME placeholder) ├── NOTES.txt # Post-install instructions ├── deployment/ │ └── deployment.yaml # Deployment template ├── statefulset/ │ └── statefulset.yaml # StatefulSet template ├── job/ │ └── job.yaml # Job template ├── cronjob/ │ └── cronjob.yaml # CronJob template ├── service/ │ └── service.yaml # Service template ├── ingress/ │ └── ingress.yaml # Ingress template ├── hpa/ │ └── hpa.yaml # HPA template ├── configmap/ │ └── configmap.yaml # ConfigMap template └── rbac/ └── serviceaccount.yaml # ServiceAccount template
All templates use
CHARTNAME placeholder which is replaced by the script.
Scripts
scaffold_chart.py
Purpose: Automated chart generation from templates
Usage:
python3 scripts/scaffold_chart.py CHART_NAME [OPTIONS] Arguments: CHART_NAME Name of the Helm chart Options: -w, --workload-type Type: deployment, statefulset, job, cronjob (default: deployment) -o, --output Output directory (default: current directory) --ingress Include Ingress resource --hpa Include HorizontalPodAutoscaler --configmap Include ConfigMap
What it does:
- Creates chart directory structure
- Copies relevant templates from
assets/templates/ - Replaces
placeholderCHARTNAME - Includes only requested optional resources
- Applies best practices automatically
Best Practices (Auto-Applied)
The templates in
assets/templates/ already include:
- ✅ Standard Kubernetes labels (
)app.kubernetes.io/* - ✅ Security contexts (readOnlyRootFilesystem, runAsNonRoot, dropped capabilities)
- ✅ Resource limits and requests
- ✅ Health checks (liveness and readiness probes)
- ✅ Helper functions for naming and labels
- ✅ Proper selector labels
- ✅ Service account configuration
Organizational Standardization
For platform teams needing consistent charts:
- Capture standards: Ask about required labels, policies, security requirements
- Modify templates: Update
with org labelsassets/templates/_helpers.tpl - Generate: Use scaffold_chart.py with modified templates
- Document: Explain customization points
Example org-specific helper addition:
{{- define "CHARTNAME.orgLabels" -}} org.example.com/cost-center: {{ .Values.org.costCenter | required "Cost center required" }} org.example.com/team: {{ .Values.org.team | required "Team name required" }} {{- end }}
Success Criteria
Generated charts must:
- ✅ Pass
without errors (95%+ target)helm lint - ✅ Follow CNCF/Helm best practices
- ✅ Include security contexts by default
- ✅ Have resource limits configured
- ✅ Use standard Kubernetes labels
- ✅ Be deployment-ready within <15 minutes
References
Load as needed based on use case:
For workload selection:
- Decision tree, characteristics, when to use each typereferences/workload-types.md
For testing:
- Comprehensive dry-run workflows, mock values, validation commandsreferences/testing-guide.md
For best practices:
- CNCF/Helm standards, security guidelinesreferences/best-practices.md
For examples:
- Real-world chart scenariosreferences/examples.md
For template reference:
- Inline template documentationreferences/templates.md
Example Usage
Example 1: Simple Web App
User: "Create a Helm chart for my Node.js API" Claude: I'll create a chart for your Node.js API. A few quick questions: 1. What's the chart name? (e.g., "user-api") 2. What's your container image? (e.g., "myorg/user-api:1.0.0") 3. Do you need an Ingress? (yes/no) User: Name is user-api, image is myorg/user-api:1.0.0, yes to ingress Claude: [Executes] python3 scripts/scaffold_chart.py user-api \ --workload-type deployment \ --output /mnt/user-data/outputs \ --ingress [Chart generated successfully] [Provides testing instructions]
Example 2: Database
User: "Create a Helm chart for PostgreSQL with persistent storage" Claude: I'll create a StatefulSet chart for PostgreSQL. What storage size do you need? (e.g., 10Gi, 20Gi) User: 20Gi Claude: [Executes] python3 scripts/scaffold_chart.py postgresql \ --workload-type statefulset \ --output /mnt/user-data/outputs [Then manually adds persistence config to values.yaml] persistence: enabled: true size: 20Gi storageClass: standard
Example 3: Scheduled Backup
User: "Create a CronJob chart for nightly backups" Claude: [Executes] python3 scripts/scaffold_chart.py db-backup \ --workload-type cronjob \ --output /mnt/user-data/outputs [Then updates values.yaml with schedule] cronjob: schedule: "0 2 * * *"
Troubleshooting
Issue: Script fails to find templates Solution: Ensure running from skill directory or provide full path to script
Issue: CHARTNAME not replaced Solution: Script automatically handles this; if manual, use find/replace
Issue: Generated chart fails lint Solution: Check values.yaml for required fields, review templates
Notes
- Always use
when possible - it's faster and consistentscaffold_chart.py - Templates use
placeholder - script replaces automaticallyCHARTNAME - For complex customization, read templates from assets and modify manually
- Multi-environment configs are created separately after initial generation
- Testing instructions are critical - always include them