Cc-devops-skills helm-generator
Create, scaffold, or generate Helm charts, Chart.yaml, values.yaml, templates, helpers.
git clone https://github.com/akin-ozer/cc-devops-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/akin-ozer/cc-devops-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/devops-skills-plugin/skills/helm-generator" ~/.claude/skills/akin-ozer-cc-devops-skills-helm-generator && rm -rf "$T"
devops-skills-plugin/skills/helm-generator/SKILL.mdHelm Chart Generator
Overview
Generate production-ready Helm charts with deterministic scaffolding, standard helpers, reusable templates, and validation loops.
Official Documentation:
- Helm Docs - Main documentation
- Chart Best Practices - Official best practices guide
- Template Functions - Built-in functions
- Sprig Functions - Extended function library
When to Use This Skill
| Use helm-generator | Use OTHER skill |
|---|---|
| Create new Helm charts | helm-validator: Validate/lint existing charts |
| Generate Helm templates | k8s-yaml-generator: Raw K8s YAML (no Helm) |
| Convert K8s manifests to Helm | k8s-debug: Debug deployed resources |
| Implement CRDs in Helm | k8s-yaml-validator: Validate K8s manifests |
Trigger Phrases
Use this skill when prompts include phrases like:
- "create Helm chart"
- "scaffold Helm chart"
- "generate Helm templates"
- "convert manifests to Helm chart"
- "build chart with Deployment/Service/Ingress"
Execution Flow
Follow these stages in order. Do not skip required stages.
Stage 1: Gather Requirements (Required)
Collect:
- Scope: full chart, specific templates, or conversion from manifests
- Workload:
,deployment
, orstatefulsetdaemonset - Image reference: repository, optional tag, or digest
- Ports: service port and container target port (separate values)
- Runtime settings: resources, probes, autoscaling, ingress, storage
- Security: service account, security contexts, optional RBAC/network policies
Use
request_user_input when critical fields are missing.
If
request_user_input is unavailable, ask in normal chat and continue with explicit assumptions.
| Missing Information | Question to Ask |
|---|---|
| Image repository/tag | "What container image should be used? (e.g., nginx:1.25)" |
| Service port | "What service port should be exposed?" |
| Container target port | "What container port should traffic be forwarded to?" |
| Resource limits | "What CPU/memory limits should be set? (e.g., 500m CPU, 512Mi memory)" |
| Probe endpoints | "What health check endpoints does the app expose? (e.g., /health, /ready)" |
| Scaling requirements | "Should autoscaling be enabled? If yes, min/max replicas and target CPU%?" |
| Workload type | "What workload type: Deployment, StatefulSet, or DaemonSet?" |
| Storage requirements | "Does the application need persistent storage? Size and access mode?" |
Do not silently assume critical settings.
Stage 2: Lookup CRD Documentation (Only if CRDs Are In Scope)
- Try Context7 first:
mcp__context7__resolve-library-idmcp__context7__query-docs
- Fallback chain if Context7 is unavailable or incomplete:
- Operator official docs (preferred)
- General web search
Also consult
references/crd_patterns.md for example patterns.
Stage 3: Scaffold Chart Structure (Required)
Run:
bash scripts/generate_chart_structure.sh <chart-name> <output-directory> [options]
Options:
- Supports repo-only, tagged image, registry ports, and digest refs--image <repo>
- Service port (default: 80)--port <number>
- Container target port (default: 8080)--target-port <number>
- Workload type: deployment, statefulset, daemonset (default: deployment)--type <type>
- Generate resource templates (deployment.yaml, service.yaml, etc.)--with-templates
- Include ingress template--with-ingress
- Include HPA template--with-hpa
- Overwrite existing chart without prompting--force
Image parsing behavior:
-> repository--image nginx:1.27
, tagnginx1.27
-> repository kept intact--image registry.local:5000/team/app
-> digest mode (no tag concatenation)--image ghcr.io/org/app@sha256:...
cannot be combined with digest image references--tag
Idempotency and overwrite behavior:
: prompts before overwrite;generate_chart_structure.sh
overwrites non-interactively.--force
: prompts before replacinggenerate_standard_helpers.sh
;templates/_helpers.tpl
bypasses prompt.--force
Expected scaffold shape:
mychart/ Chart.yaml values.yaml templates/ _helpers.tpl NOTES.txt serviceaccount.yaml service.yaml configmap.yaml secret.yaml deployment.yaml|statefulset.yaml|daemonset.yaml ingress.yaml (optional) hpa.yaml (optional) .helmignore
Stage 4: Generate Standard Helpers
Run:
bash scripts/generate_standard_helpers.sh <chart-name> <chart-directory>
Required helpers:
name, fullname, chart, labels, selectorLabels, serviceAccountName.
Fallback:
- If script execution is blocked, copy
and replaceassets/_helpers-template.tpl
with the chart name.CHARTNAME
Stage 5: Consult References and Generate Templates (Required)
Consult relevant references once at this stage:
for the resource patterns being generatedreferences/resource_templates.md
for templating function usagereferences/helm_template_functions.md
only when CRDs are in scopereferences/crd_patterns.md
Example file-open commands:
sed -n '1,220p' references/resource_templates.md sed -n '1,220p' references/helm_template_functions.md
Resource coverage from
references/resource_templates.md:
- Workloads: Deployment, StatefulSet, DaemonSet, Job, CronJob
- Services: Service, Ingress
- Config: ConfigMap, Secret
- RBAC: ServiceAccount, Role, RoleBinding, ClusterRole, ClusterRoleBinding
- Network: NetworkPolicy
- Autoscaling: HPA, PodDisruptionBudget
Required template patterns:
metadata: name: {{ include "mychart.fullname" . }} labels: {{- include "mychart.labels" . | nindent 4 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 2 }} {{- end }} annotations: {{- if and .Values.configMap .Values.configMap.enabled }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- end }}
Checksum annotations are required for workloads, but must be conditional and only reference generated templates (
configmap.yaml, secret.yaml).
Stage 6: Create values.yaml
Structure guidelines:
- Group related settings logically
- Document every value with
comments# -- - Provide sensible defaults
- Include security contexts, resource limits, probes
- Keep
andservice.port
separate and explicitservice.targetPort - Keep
/configMap.enabled
aligned with generated templatessecret.enabled
See
assets/values-schema-template.json for JSON Schema validation.
Stage 7: Validate
Preferred path: run the
helm-validator skill.
If skill invocation is unavailable, run local commands directly:
helm lint <chart-dir> helm template test <chart-dir>
If
helm is unavailable, report the block clearly and perform partial checks:
bash -n scripts/generate_chart_structure.shbash -n scripts/generate_standard_helpers.sh- Verify generated files and key fields manually
Re-run validation after any fixes.
Template Functions Quick Reference
See
references/helm_template_functions.md for complete guide.
| Function | Purpose | Example |
|---|---|---|
| Enforce required values | |
| Fallback value | |
| Quote strings | |
| Use helpers | |
| Convert to YAML | |
| Render as template | |
| Newline + indent | |
Working with CRDs
See
references/crd_patterns.md for complete examples.
Key points:
- CRDs you ship ->
directory (not templated, not deleted on uninstall)crds/ - CR instances ->
directory (fully templated)templates/ - Always look up documentation for CRD spec requirements
- Document operator dependencies in Chart.yaml annotations
Converting Manifests to Helm
- Parameterize: Names -> helpers, values ->
values.yaml - Apply patterns: Labels, conditionals,
for complex objectstoYaml - Add helpers: Create
with standard helpers_helpers.tpl - Validate: Run
(or local lint/template fallback), then test with different valueshelm-validator
Error Handling
| Issue | Solution |
|---|---|
| Template syntax errors | |
| Undefined values | and add / |
| Checksum include errors | Ensure and exist and / are set correctly |
| Port mismatch (Service vs container) | Set both and , then re-run |
| CRD validation fails | Verify apiVersion/spec fields with Context7 or operator docs, then re-render |
| Script argument failures | Run and pass required values for option flags |
Example Flows
Full scaffold with templates, ingress, HPA, and explicit port mapping:
bash scripts/generate_chart_structure.sh webapp ./charts \ --image ghcr.io/acme/webapp:2.3.1 \ --port 80 \ --target-port 8080 \ --type deployment \ --with-templates \ --with-ingress \ --with-hpa
Digest-based image scaffold:
bash scripts/generate_chart_structure.sh api ./charts \ --image ghcr.io/acme/api@sha256:0123456789abcdef \ --with-templates
Minimal scaffold without templates:
bash scripts/generate_chart_structure.sh starter ./charts
Scaffold Success Criteria
Mark complete only when all checks pass:
-
,Chart.yaml
,values.yaml
,.helmignore
, andtemplates/NOTES.txt
existtemplates/_helpers.tpl -
contains explicitvalues.yaml
andservice.portservice.targetPort - If
was used,--with-templates
,serviceaccount.yaml
,service.yaml
,configmap.yaml
, and one workload template existsecret.yaml - Generated workload template uses conditional checksum annotations for config/secret
- Image rendering logic supports tag and digest modes
- Validation completed (
skill or local fallback commands) and outcomes reportedhelm-validator
Resources
Scripts
| Script | Usage |
|---|---|
| |
| |
References
| File | Content |
|---|---|
| Complete template function guide |
| All K8s resource templates |
| CRD patterns (cert-manager, Prometheus, Istio, ArgoCD) |
Assets
| File | Purpose |
|---|---|
| Standard helpers template |
| JSON Schema for values validation |
Integration with helm-validator
After generating charts, invoke
helm-validator and close the loop:
- Generate chart/templates
- Run
(or local fallback commands)helm-validator - Fix identified issues
- Re-validate until passing