Review an existing Helm chart and its values files: metadata, structure, dependency pinning, resources, security context, image tags, probes and plaintext secrets. Use when auditing a chart before release, checking per-environment values files for plaintext secrets or missing limits, or adding chart checks to CI (exit 0/1/2).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Helm Chart Builder?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/borghei-helm-chart-builder)
---
name: helm-chart-builder
description: >
Review an existing Helm chart and its values files: metadata, structure,
dependency pinning, resources, security context, image tags, probes and plaintext
secrets. Use when auditing a chart before release, checking per-environment values files for plaintext secrets or missing limits, or adding chart checks to CI (exit 0/1/2).
license: MIT + Commons Clause
metadata:
version: 1.0.0
author: borghei
category: engineering
domain: kubernetes
updated: 2026-11-08
tags: [helm, kubernetes, k8s, charts, devops]
---
# Helm Chart Builder
The agent reviews Helm charts that already exist: is the chart well-formed, are its dependencies pinned, and are its values safe to run in production. Despite the name, the tools analyse rather than generate; when a new chart is needed, start from `helm create`, then run this review.
## When to Use
- Reviewing a chart or its per-environment values files before a release.
- Adding chart checks to CI.
- Auditing third-party charts and values overrides for security defaults.
## Clarify First
Before analyzing the chart, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- **Chart path:** which chart directory to analyze (positional / `--path` / `--chart`).
- **Values files:** which environment values files to validate (sets `--values` and what gets checked against best practices).
- **Strictness:** strict/lint mode and JSON for CI (`--strict`, `--format json`).
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
## Workflow
1. **Analyse the chart** with `python3 scripts/chart_analyzer.py <chart>`: required files, `apiVersion: v2`, SemVer version, appVersion, dependency pinning and `Chart.lock`, NOTES.txt, `_helpers.tpl`, README.
2. **Validate every values file** with `python3 scripts/values_validator.py --values <file>...`: resources, security context, image tag, replicas, service type, ingress TLS, probes, autoscaling and plaintext secrets.
3. **Fix critical findings first** (missing required files, plaintext secrets), then warnings.
4. **Render and dry-run** with `helm lint`, `helm template` and `helm install --dry-run` (or `helm upgrade --install --dry-run=server` against a cluster). The analysers read text; only rendering proves the manifests.
5. **Verify** that both tools report no critical findings for every environment's values file and that the rendered manifests pass your policy checks.
Helm 4 (released late 2025) keeps chart `apiVersion: v2`, so v2 charts work with both Helm 3 and Helm 4. Check the Helm 4 release notes for changed CLI flags and plugin behaviour before upgrading CI.
## Quick Start
```bash
python3 scripts/chart_analyzer.py assets/flawed-chart # apiVersion v1, open version range, hardcoded namespace/image (exit 1)
python3 scripts/chart_analyzer.py assets/sound-chart # PASS (exit 0)
python3 scripts/values_validator.py --values assets/flawed_values.yaml # latest tag, plaintext secrets, no resources (exit 1)
python3 scripts/values_validator.py --values assets/sample_values.yaml # PASS (exit 0)
```
Real output (excerpt) of `python3 scripts/values_validator.py --values assets/flawed_values.yaml`:
```
HELM VALUES VALIDATION: assets/flawed_values.yaml
Read: 14 top-level keys
Findings: 3 critical, 3 warnings, 4 info
[CRITICAL]
[security] postgresPassword: Plaintext secret in values: `postgresPassword` (value not echoed).
Fix: Remove the literal and set `existingSecret: <secret-name>`; read it in the template with secretKeyRef ...
[WARNING]
[image] image.tag: image.tag is `latest`, which is non-deterministic.
Fix: Replace `tag: latest` with `tag: "<release you deploy, e.g. 2.4.1>"`.
...
FIX 6 issues
```
For CI, write one JSON report per tool (`--format json`; `--json` is an alias):
```bash
python3 scripts/chart_analyzer.py ./charts/my-app --format json --strict > chart-report.json
python3 scripts/values_validator.py --chart ./charts/my-app --values values-dev.yaml values-prod.yaml --format json > values-report.json
```
## Exit Codes
| Code | Meaning |
|------|---------|
| 0 | `PASS`: no critical or warning findings (info findings are advice only; `--strict` on the analyzer also fails on info) |
| 1 | `FIX n issues`: at least one critical or warning finding |
| 2 | Unusable input: path missing, not a chart directory (no `Chart.yaml`), file not UTF-8 text, or a file with no `key: value` content. One-line message on stderr, no traceback |
Text output ends with the verdict line and at most three ranked next actions. Info-level findings marked "heuristic" are judgement calls, not rules.
## Tools Overview
| Tool | What it checks | Key flags |
|------|----------------|-----------|
| `chart_analyzer.py` | Required files and dirs, Chart.yaml fields, `apiVersion: v2`, SemVer, appVersion, dependency ranges (`*`, open `>=`) and `Chart.lock`, hardcoded namespace/image in templates, NOTES.txt, README | `<chart dir>` or `--path`, `--strict`, `--format text\|json` |
| `values_validator.py` | Resources, security context, image tag (`latest` or empty), pull policy, replicaCount, service type, ingress TLS/class, probes, autoscaling, plaintext passwords/secrets/tokens and credentialed URLs (secret values are never printed) | `--values <files...>` or positional, `--chart` (locate relative paths), `--format text\|json` |
## Anti-Patterns
**Mistake:** Passwords and API keys in `values.yaml`.
**Why it happens:** It is the quickest way to make a chart install.
**Instead:** Values end up in git and in the release history Helm stores in the cluster. Reference an existing Secret (`existingSecret`), or use External Secrets or SOPS.
**Mistake:** Broad dependency ranges such as `12.x.x` without a committed `Chart.lock`.
**Why it happens:** Ranges feel like they keep the chart current.
**Instead:** Pin dependency versions, commit `Chart.lock`, and update deliberately.
**Mistake:** Treating a clean analyser run as a working chart.
**Why it happens:** No findings looks like a pass.
**Instead:** Template logic and `--set` overrides are not evaluated. Render with `helm template` and dry-run the install.
## Files
- `scripts/chart_analyzer.py`, `scripts/values_validator.py` — the tools above.
- `assets/sound-chart/`, `assets/sample_values.yaml` — pass (exit 0); `assets/flawed-chart/`, `assets/flawed_values.yaml` — deliberately flawed (exit 1); `assets/malformed_chart.txt`, `assets/malformed_values.yaml` — unusable (exit 2); `assets/contract.json` lists the runs.
- `examples/` — original flawed chart metadata and values, plus `values-production.yaml`.
## Scope & Limitations
**In Scope:**
- Static review of a Helm chart directory with `chart_analyzer.py`: required files, Chart.yaml fields and version format, template file checks, subchart dependency pinning, and NOTES.txt and README presence.
- Best-practice checks on one or more values files with `python3 scripts/values_validator.py --values <file>...`: resource requests and limits, security context, image tags, replica count, service, ingress TLS, probes and autoscaling.
- Text or JSON output, with `--strict` on the analyzer to also fail on info findings in CI.
- The chart review and pre-release workflows, backed by `references/helm-best-practices.md`.
**Out of Scope:**
- Rendering, linting, installing or upgrading charts. The scripts do not call `helm` or a cluster.
- Generating new charts or templates. The scripts review existing files.
- Kubernetes operators and custom controllers (see `engineering/kubernetes-operator/`).
- Building container images (see `engineering/docker-development/`) and designing CI pipelines (see `engineering/ci-cd-pipeline-builder/`).
**Important Caveats:**
- Both scripts read YAML with a small stdlib parser and inspect templates with regular expressions. Template logic, `--set` overrides and values merged at install time are not evaluated, so a clean report does not mean the rendered manifests are correct.
- `values_validator.py` checks each values file against fixed best-practice rules. The `--chart` flag only locates the files; values are not compared with what the chart's templates actually use.
- Findings are review prompts, not proof that a chart is secure or production ready. The reference lists `helm lint`, `helm template` and a dry-run install as the checks that cover rendering.
## Reference Documentation
- [references/helm-best-practices.md](references/helm-best-practices.md) — chart structure, template patterns, security defaults, values design and dependency management. Read when restructuring a chart or writing templates.