[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78D1TREQSAQAVRMVVGN0TA4":3,"skill-same:01M78D1TREQSAQAVRMVVGN0TA4":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M78D1TREQSAQAVRMVVGN0TA4","helm-chart-expert",null,"Use this skill when a task involves Helm chart templating, values file structure, subchart dependency management, or chart validation (lint\u002Ftemplate\u002Fdry-run) for the project's charts. Don't use it for Helm deploy orchestration (use deployment), Keycloak config (use keycloak), IaC drift (use infrastructure-as-code), or Docker builds (use docker-build).","atretyak1985\u002Fswarmery","atretyak1985","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1436737?v=4","01M78CTSX57YH0EYY9YGH0TWKX","Andrii Tretiak","01M78CTSXRPJPYQ7GNPMP45TYX",8,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Finfra-pack\u002Fskills\u002Fhelm-chart-expert\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: helm-chart-expert\ndescription: \"Use this skill when a task involves Helm chart templating, values file structure, subchart dependency management, or chart validation (lint\u002Ftemplate\u002Fdry-run) for the project's charts. Don't use it for Helm deploy orchestration (use deployment), Keycloak config (use keycloak), IaC drift (use infrastructure-as-code), or Docker builds (use docker-build).\"\nversion: \"1.0.0\"\nowner: \"swarmery-infra\"\ndocs:\n  status: reviewed\n  source_sha: 9ca1ca2b31c7\n  updated: 2026-08-06\n---\n\n# Purpose\n\nAuthor and validate Helm charts for the project's infrastructure and chart repos (project.json → repos). This skill covers chart structure, Go template patterns, values management, subchart dependencies, and validation workflows (lint, template render, dry-run). It does not cover end-to-end deploy orchestration (use `deployment`), Keycloak realm\u002Fclient configuration (use `keycloak`), IaC drift detection (use `infrastructure-as-code`), or Docker image builds (use `docker-build`).\n\n# When to use this skill (triggers)\n\n- Creating or modifying Helm chart templates (deployment, service, ingress, networkpolicy, etc.)\n- Structuring or reviewing `values.yaml` \u002F `values.\u003Cenv>.yaml` files\n- Managing subchart dependencies in `Chart.yaml` and `Chart.lock`\n- Running chart validation: `helm lint`, `helm template`, `helm upgrade --dry-run`\n- Debugging template rendering errors (nil pointer, label mismatch, values not applied)\n- Bumping chart versions and synchronizing umbrella\u002Fsubchart versions\n- Reviewing Helm template correctness with file:line citations\n\n# When NOT to use this skill (anti-triggers)\n\n- End-to-end deploy orchestration (helm upgrade to a live cluster) -- use `deployment`\n- Keycloak realm setup, client config, or Auth.js integration -- use `keycloak`\n- Terraform drift detection or post-incident IaC capture -- use `infrastructure-as-code`\n- Docker image builds or multi-arch buildx -- use `docker-build`\n- Migration safety checks or schema alignment -- use `migration-check`\n- GCP firewall rules or VM-level k8s debugging -- use `kubernetes-deployment`\n- CI\u002FCD pipeline YAML review -- use `gitlab-ci-cd`\n\n# Required environment (Runtime: .claude\u002Fskills\u002Fhelm-chart-expert\u002FSKILL.md)\n\n- Tools\u002Flibraries: `helm` (v3.10+), `kubectl` (v1.28+), `bash`\n- Repos: the project's infrastructure and chart repos (project.json → repos)\n- Validation script: `.claude\u002Fskills\u002Fhelm-chart-expert\u002Fscripts\u002Fvalidate-chart.sh`\n\n# Inputs\n\n- `chart_path: string` -- path to the chart directory (e.g., `\u003Cinfra-repo>\u002F`)\n- `values_file: string` (optional) -- path to the values file to validate against\n- `operation: enum` -- one of: `author`, `validate`, `review`, `debug`\n\n# Outputs\n\n**Format:** Advice, corrected template YAML, or a shell command sequence.\n\n**Length budget:** Corrected YAML max 60 lines per template file. Shell command sequences max 20 lines. Review findings max 40 lines.\n\n**Output template:**\n\n```\n## {operation} Result — {chart_path}\n\n### Findings\n| # | File:Line | Issue | Severity | Fix |\n|---|-----------|-------|----------|-----|\n| {n} | {file}:{line} | {description} | {HIGH|MEDIUM|LOW} | {corrected snippet or instruction} |\n\n### Validation Commands\n{ordered command list with pass\u002Ffail}\n\n### Confidence\n{HIGH|MEDIUM|LOW} — {rationale}\n```\n\nFor `validate`: ordered command list (lint, template, dry-run) with pass\u002Ffail assessment.\nFor `review`: structured findings table with file:line citations.\nFor `author`: corrected template YAML with inline comments.\n\n# Procedure (Checkpoint: after each step)\n\n1. **Identify chart and operation** -- Confirm which chart directory and which values file(s) are in scope.\n   Checkpoint: chart directory contains `Chart.yaml`.\n\n2. **Run validation first** -- Run `helm lint` and `helm template` before suggesting any upgrade. These two commands are independent and may run in parallel Bash calls.\n   Checkpoint: both exit 0.\n\n3. **Apply template patterns** -- Use defensive `| default dict` at ALL nesting levels. One resource per file. Namespaced template names via `_helpers.tpl`.\n   Checkpoint: every conditional chain protects all levels.\n\n4. **Dry-run before apply** -- Every upgrade example must show `--dry-run` as the first step.\n   Checkpoint: dry-run output reviewed before suggesting live apply.\n\n5. **Version sync** -- If a subchart version was bumped, verify umbrella `Chart.yaml` dep matches and `Chart.lock` is regenerated. A `check-chart-sync.sh` script typically lives in the chart repo (e.g. `scripts\u002Fcheck-chart-sync.sh`), not in this skill bundle.\n   Checkpoint: all three files (subchart Chart.yaml, umbrella Chart.yaml, Chart.lock) updated together.\n\n# Self-check before returning (anti-hallucination, confidence labels, format match)\n\n- [ ] Every `helm upgrade` command I suggested includes `--dry-run` as a preceding step\n- [ ] Template examples protect ALL nesting levels with `| default dict` (not just the body)\n- [ ] I used `{{ .Release.Namespace }}` instead of hardcoded namespace names\n- [ ] I did not include absolute developer home paths (used `$REPO_ROOT` or relative paths)\n- [ ] Chart version bump includes umbrella Chart.yaml + Chart.lock + subchart Chart.yaml\n- [ ] I cited which template file and values key are relevant to the recommendation, using file:line format\n- [ ] Secret values use `requireRealSecret` helper or `$VARIABLE` placeholders -- no plaintext\n- [ ] No mutable image tags (`:latest`, `:main`) appear in any YAML I produced -- only immutable digests or `$VARIABLE` placeholders\n- [ ] Output matches the output template format for the given operation\n- [ ] Confidence label (HIGH \u002F MEDIUM \u002F LOW) is attached to findings where the template nesting pattern depends on values file structure I have not inspected -- label those LOW\n\n# Common mistakes to avoid (DO NOT patterns)\n\n- DO NOT access nested values without `| default dict` at every level -- causes nil pointer errors when a values file omits a section\n- DO NOT hardcode namespaces in examples -- use `$NAMESPACE` or `{{ .Release.Namespace }}`\n- DO NOT put multiple K8s resources in one template file -- one resource per file\n- DO NOT show `helm upgrade` without a preceding `--dry-run` step -- silent failures in prod\n- DO NOT bump a subchart version without updating the umbrella `Chart.yaml` dep and regenerating `Chart.lock`\n- DO NOT embed environment-specific values (hostnames, project IDs) in templates -- put them in `values.\u003Cenv>.yaml`\n- DO NOT use mutable image tags (`:latest`, `:main`) in values files or templates -- use immutable digests (`sha256:...`) or `$VARIABLE` placeholders\n- DO NOT confuse this skill's scope with `deployment` -- this skill covers template authoring and validation only; `deployment` handles end-to-end orchestration\n\n# Escalation (stop-and-ask conditions)\n\n- Stop and ask when: the chart directory cannot be found or `Chart.yaml` is missing required fields\n- Stop and ask when: a subchart dependency cannot be resolved after `helm repo update`\n- Stop and ask when: the user is attempting a production upgrade without a values file -- redirect to `deployment` skill for orchestration\n- Stop and ask when: the user asks for end-to-end deploy orchestration -- redirect to `deployment`\n\n# Examples\n\n\u003Cexample name=\"defensive-template-for-optional-feature\">\n## Defensive template for optional feature\n\nThe infrastructure chart has an optional NetworkPolicy for Keycloak. If the `networkPolicy` section is absent from a values file, unprotected access causes a nil pointer error.\n\n**Wrong -- only body protected:**\n```yaml\n{{- if .Values.networkPolicy.keycloak.enabled }}\n  {{- $config := .Values.networkPolicy.keycloak.ingress | default dict }}\n{{- end }}\n```\n\n**Correct -- all levels protected:**\n```yaml\n{{- $networkPolicy := .Values.networkPolicy | default dict }}\n{{- $keycloakPolicy := $networkPolicy.keycloak | default dict }}\n{{- if (hasKey $keycloakPolicy \"enabled\") | ternary $keycloakPolicy.enabled false }}\n  {{- $ingressConfig := $keycloakPolicy.ingress | default dict }}\n  {{- if (hasKey $ingressConfig \"allowFromIngressController\") | ternary $ingressConfig.allowFromIngressController true }}\n    # ... ingress rules\n  {{- end }}\n{{- end }}\n```\n\n**Verification -- test all paths (lint and template can run in parallel):**\n```bash\nhelm template \u003Cinfra-release> . --values values.localdev.yaml       # full values\nhelm template \u003Cinfra-release> . --set feature.enabled=true          # minimal --set\nhelm template \u003Cinfra-release> .                                     # defaults only\nhelm template \u003Cinfra-release> . --values values.init.localdev.yaml  # bootstrap values\n```\n\u003C\u002Fexample>\n\n\u003Cexample name=\"subchart-version-bump-workflow\">\n## Subchart version bump workflow\n\nWhen bumping `charts\u002F\u003Capp>\u002FChart.yaml` version in the umbrella chart repo:\n\n```bash\n# 1. Bump subchart version\n#    Edit charts\u002F\u003Capp>\u002FChart.yaml -> version: 0.2.0\n\n# 2. Update umbrella Chart.yaml dependency to match\n#    Edit Chart.yaml -> dependencies.\u003Capp>.version: \"0.2.0\"\n\n# 3. Regenerate Chart.lock\nhelm dependency update .\n\n# 4. Verify (this script lives in the chart repo, not this skill bundle)\nbash scripts\u002Fcheck-chart-sync.sh\n\n# 5. Commit all three together\ngit add Chart.yaml Chart.lock charts\u002F\u003Capp>\u002FChart.yaml\n```\n\u003C\u002Fexample>\n\n\u003Cexample name=\"canonical-upgrade-with-dry-run\">\n## Canonical upgrade with dry-run first\n\n```bash\n# Step 1: Dry-run (always first)\nhelm upgrade --install \u003Cinfra-release> . \\\n  -f values.\u003CenvAlias>.populated.yaml \\\n  --namespace \"$NAMESPACE\" \\\n  --dry-run --debug\n\n# Step 2: Apply (defer to `deployment` skill for production orchestration)\nhelm upgrade --install \u003Cinfra-release> . \\\n  -f values.\u003CenvAlias>.populated.yaml \\\n  --namespace \"$NAMESPACE\" \\\n  --wait --atomic --timeout 8m \\\n  --description \"[ci $CI_PIPELINE_ID deploy] infra@$(git rev-parse --short HEAD)\"\n```\n\u003C\u002Fexample>\n\n\u003Cexample name=\"requireRealSecret-helper\">\n## requireRealSecret helper\n\nFor secret values that must not ship as `CHANGE_ME` in production:\n\n```yaml\n# _helpers.tpl\n{{- define \"app.requireRealSecret\" -}}\n{{- $value := index . 0 -}}\n{{- $name := index . 1 -}}\n{{- if or (eq $value \"\") (eq $value \"CHANGE_ME\") -}}\n{{- fail (printf \"secrets.%s required -- set a real value\" $name) -}}\n{{- end -}}\n{{- $value -}}\n{{- end -}}\n\n# secret.yaml\nauth-secret: {{ include \"app.requireRealSecret\" (list .Values.secrets.authSecret \"authSecret\") | quote }}\n```\n\u003C\u002Fexample>\n\n# Failure modes (symptom -> detection -> action)\n\n- **nil pointer in template**: symptom: `nil pointer evaluating interface {}.fieldName` -> detect: identify which values key is missing `| default dict` at the conditional level -> fix: add defensive extraction at every nesting level\n- **Chart.lock stale after subchart bump**: symptom: `can't get a valid version for dependency \u003Cname>` -> detect: compare subchart Chart.yaml version with umbrella Chart.yaml dep version -> fix: update umbrella dep, run `helm dependency update .`, commit both\n- **Values not applied**: symptom: default values appear instead of overrides -> detect: `helm get values \u003Crelease> -n $NAMESPACE` shows missing keys -> fix: verify `--values \u003Cfile>` flag was passed and check indentation in the values file\n- **Label mismatch blocking service discovery**: symptom: service can't find pods -> detect: compare `kubectl get pods --show-labels` with `kubectl get svc -o yaml | grep selector` -> fix: ensure both use the same selector labels from `_helpers.tpl`\n\n# Related skills (compose vs defer)\n\n- `deployment` -- **defer** to it for end-to-end deploy orchestration (helm upgrade to live clusters); this skill covers template authoring and validation only. For end-to-end deploy orchestration, use `deployment`.\n- `keycloak` -- **defer** to it for Keycloak realm\u002Fclient\u002FAuth.js config; this skill only covers the Helm values structure for the keycloakx subchart\n- `infrastructure-as-code` -- **defer** to it for IaC drift detection; **compose** with it when a manual helm override needs to be captured in code\n- `kubernetes-deployment` -- **defer** to it for k8s cluster operations, GCP firewall, minikube tunnel; **compose** when debugging a deployment that uses this chart\n- `migration-check` -- no direct overlap; migration scripts are not Helm-managed\n- `docker-build` -- **defer** to it for image builds; this skill only consumes image tags\u002Fdigests in values files\n\n# How to use\n\n## What it does\n\nThis skill helps you write and validate Helm charts: template files, values files, subchart dependencies, and chart versions. It focuses on getting the chart correct before anything reaches a cluster — defensive template patterns, `helm lint`, `helm template`, and `helm upgrade --dry-run`. It does not push releases to live clusters.\n\n## When to use it\n\n- You are writing or fixing a chart template (deployment, service, ingress, network policy) and want the nesting patterns right.\n- A render fails with `nil pointer evaluating interface {}.fieldName` and you need to find the values key that is missing a guard.\n- You bumped a subchart version and need the umbrella `Chart.yaml` and `Chart.lock` to stay in sync.\n- You want a chart reviewed with file:line citations and a severity per finding.\n\n## When not to use it\n\n- Running an upgrade against a live cluster end to end — use the `deployment` skill.\n- Keycloak realm, client, or auth integration config — use the `keycloak` skill.\n- Terraform drift or post-incident capture — use the `infrastructure-as-code` skill.\n- Building or pushing container images — use the `docker-build` skill.\n\n## How to invoke\n\n```\nSkill(skill: \"infra-pack:helm-chart-expert\")\n```\n\nInvoke it directly, or just describe the chart work — the skill's own triggers cover template edits, values structure, dependency bumps, and validation runs.\n\n## Inputs\n\n- `chart_path` — the chart directory containing `Chart.yaml` — required.\n- `values_file` — the values file to validate against — optional.\n- `operation` — one of `author`, `validate`, `review`, `debug` — required.\n\n## What you get back\n\nA result block headed `## {operation} Result — {chart_path}`, with a findings table (`File:Line`, issue, severity, fix), the ordered validation commands with pass\u002Ffail, and a HIGH\u002FMEDIUM\u002FLOW confidence label with its rationale. `author` returns corrected YAML with inline comments; `validate` returns the lint → template → dry-run sequence. Nothing is applied to a cluster.\n\n## Worked example\n\n```\nSkill(skill: \"infra-pack:helm-chart-expert\")\n\nRequest: \"values.\u003CenvAlias>.yaml has no networkPolicy section and the render\ndies with a nil pointer. chart_path: apps\u002F\u003CmainApp>\u002Fchart, operation: debug\"\n\nWhat happens: the skill runs helm lint and helm template first, traces the\nfailure to a conditional that guards only the leaf key, and returns the\ncorrected template that extracts every nesting level with `| default dict`,\nplus four helm template commands covering full values, --set, defaults only,\nand bootstrap values.\n```\n\n## Related\n\n- `deployment` — prefer it once the chart is correct and you need the release orchestrated.\n- `kubernetes-deployment` — prefer it for cluster-level debugging; compose with it when the failing workload comes from this chart.\n- `infrastructure-as-code` — compose with it when a manual override needs to be captured back into code.\n","# Purpose\n\nAuthor and validate Helm charts for the project's infrastructure and chart repos (project.json → repos). This skill covers chart structure, Go template patterns, values management, subchart dependencies, and validation workflows (lint, template render, dry-run). It does not cover end-to-end deploy orchestration (use `deployment`), Keycloak realm\u002Fclient configuration (use `keycloak`), IaC drift detection (use `infrastructure-as-code`), or Docker image builds (use `docker-build`).\n\n# When to use this skill (triggers)\n\n- Creating or modifying Helm chart templates (deployment, service, ingress, networkpolicy, etc.)\n- Structuring or reviewing `values.yaml` \u002F `values.\u003Cenv>.yaml` files\n- Managing subchart dependencies in `Chart.yaml` and `Chart.lock`\n- Running chart validation: `helm lint`, `helm template`, `helm upgrade --dry-run`\n- Debugging template rendering errors (nil pointer, label mismatch, values not applied)\n- Bumping chart versions and synchronizing umbrella\u002Fsubchart versions\n- Reviewing Helm template correctness with file:line citations\n\n# When NOT to use this skill (anti-triggers)\n\n- End-to-end deploy orchestration (helm upgrade to a live cluster) -- use `deployment`\n- Keycloak realm setup, client config, or Auth.js integration -- use `keycloak`\n- Terraform drift detection or post-incident IaC capture -- use `infrastructure-as-code`\n- Docker image builds or multi-arch buildx -- use `docker-build`\n- Migration safety checks or schema alignment -- use `migration-check`\n- GCP firewall rules or VM-level k8s debugging -- use `kubernetes-deployment`\n- CI\u002FCD pipeline YAML review -- use `gitlab-ci-cd`\n\n# Required environment (Runtime: .claude\u002Fskills\u002Fhelm-chart-expert\u002FSKILL.md)\n\n- Tools\u002Flibraries: `helm` (v3.10+), `kubectl` (v1.28+), `bash`\n- Repos: the project's infrastructure and chart repos (project.json → repos)\n- Validation script: `.claude\u002Fskills\u002Fhelm-chart-expert\u002Fscripts\u002Fvalidate-chart.sh`\n\n# Inputs\n\n- `chart_path: string` -- path to the chart directory (e.g., `\u003Cinfra-repo>\u002F`)\n- `values_file: string` (optional) -- path to the values file to validate against\n- `operation: enum` -- one of: `author`, `validate`, `review`, `debug`\n\n# Outputs\n\n**Format:** Advice, corrected template YAML, or a shell command sequence.\n\n**Length budget:** Corrected YAML max 60 lines per template file. Shell command sequences max 20 lines. Review findings max 40 lines.\n\n**Output template:**\n\n```\n## {operation} Result — {chart_path}\n\n### Findings\n| # | File:Line | Issue | Severity | Fix |\n|---|-----------|-------|----------|-----|\n| {n} | {file}:{line} | {description} | {HIGH|MEDIUM|LOW} | {corrected snippet or instruction} |\n\n### Validation Commands\n{ordered command list with pass\u002Ffail}\n\n### Confidence\n{HIGH|MEDIUM|LOW} — {rationale}\n```\n\nFor `validate`: ordered command list (lint, template, dry-run) with pass\u002Ffail assessment.\nFor `review`: structured findings table with file:line citations.\nFor `author`: corrected template YAML with inline comments.\n\n# Procedure (Checkpoint: after each step)\n\n1. **Identify chart and operation** -- Confirm which chart directory and which values file(s) are in scope.\n   Checkpoint: chart directory contains `Chart.yaml`.\n\n2. **Run validation first** -- Run `helm lint` and `helm template` before suggesting any upgrade. These two commands are independent and may run in parallel Bash calls.\n   Checkpoint: both exit 0.\n\n3. **Apply template patterns** -- Use defensive `| default dict` at ALL nesting levels. One resource per file. Namespaced template names via `_helpers.tpl`.\n   Checkpoint: every conditional chain protects all levels.\n\n4. **Dry-run before apply** -- Every upgrade example must show `--dry-run` as the first step.\n   Checkpoint: dry-run output reviewed before suggesting live apply.\n\n5. **Version sync** -- If a subchart version was bumped, verify umbrella `Chart.yaml` dep matches and `Chart.lock` is regenerated. A `check-chart-sync.sh` script typically lives in the chart repo (e.g. `scripts\u002Fcheck-chart-sync.sh`), not in this skill bundle.\n   Checkpoint: all three files (subchart Chart.yaml, umbrella Chart.yaml, Chart.lock) updated together.\n\n# Self-check before returning (anti-hallucination, confidence labels, format match)\n\n- [ ] Every `helm upgrade` command I suggested includes `--dry-run` as a preceding step\n- [ ] Template examples protect ALL nesting levels with `| default dict` (not just the body)\n- [ ] I used `{{ .Release.Namespace }}` instead of hardcoded namespace names\n- [ ] I did not include absolute developer home paths (used `$REPO_ROOT` or relative paths)\n- [ ] Chart version bump includes umbrella Chart.yaml + Chart.lock + subchart Chart.yaml\n- [ ] I cited which template file and values key are relevant to the recommendation, using file:line format\n- [ ] Secret values use `requireRealSecret` helper or `$VARIABLE` placeholders -- no plaintext\n- [ ] No mutable image tags (`:latest`, `:main`) appear in any YAML I produced -- only immutable digests or `$VARIABLE` placeholders\n- [ ] Output matches the output template format for the given operation\n- [ ] Confidence label (HIGH \u002F MEDIUM \u002F LOW) is attached to findings where the template nesting pattern depends on values file structure I have not inspected -- label those LOW\n\n# Common mistakes to avoid (DO NOT patterns)\n\n- DO NOT access nested values without `| default dict` at every level -- causes nil pointer errors when a values file omits a section\n- DO NOT hardcode namespaces in examples -- use `$NAMESPACE` or `{{ .Release.Namespace }}`\n- DO NOT put multiple K8s resources in one template file -- one resource per file\n- DO NOT show `helm upgrade` without a preceding `--dry-run` step -- silent failures in prod\n- DO NOT bump a subchart version without updating the umbrella `Chart.yaml` dep and regenerating `Chart.lock`\n- DO NOT embed environment-specific values (hostnames, project IDs) in templates -- put them in `values.\u003Cenv>.yaml`\n- DO NOT use mutable image tags (`:latest`, `:main`) in values files or templates -- use immutable digests (`sha256:...`) or `$VARIABLE` placeholders\n- DO NOT confuse this skill's scope with `deployment` -- this skill covers template authoring and validation only; `deployment` handles end-to-end orchestration\n\n# Escalation (stop-and-ask conditions)\n\n- Stop and ask when: the chart directory cannot be found or `Chart.yaml` is missing required fields\n- Stop and ask when: a subchart dependency cannot be resolved after `helm repo update`\n- Stop and ask when: the user is attempting a production upgrade without a values file -- redirect to `deployment` skill for orchestration\n- Stop and ask when: the user asks for end-to-end deploy orchestration -- redirect to `deployment`\n\n# Examples\n\n\u003Cexample name=\"defensive-template-for-optional-feature\">\n## Defensive template for optional feature\n\nThe infrastructure chart has an optional NetworkPolicy for Keycloak. If the `networkPolicy` section is absent from a values file, unprotected access causes a nil pointer error.\n\n**Wrong -- only body protected:**\n```yaml\n{{- if .Values.networkPolicy.keycloak.enabled }}\n  {{- $config := .Values.networkPolicy.keycloak.ingress | default dict }}\n{{- end }}\n```\n\n**Correct -- all levels protected:**\n```yaml\n{{- $networkPolicy := .Values.networkPolicy | default dict }}\n{{- $keycloakPolicy := $networkPolicy.keycloak | default dict }}\n{{- if (hasKey $keycloakPolicy \"enabled\") | ternary $keycloakPolicy.enabled false }}\n  {{- $ingressConfig := $keycloakPolicy.ingress | default dict }}\n  {{- if (hasKey $ingressConfig \"allowFromIngressController\") | ternary $ingressConfig.allowFromIngressController true }}\n    # ... ingress rules\n  {{- end }}\n{{- end }}\n```\n\n**Verification -- test all paths (lint and template can run in parallel):**\n```bash\nhelm template \u003Cinfra-release> . --values values.localdev.yaml       # full values\nhelm template \u003Cinfra-release> . --set feature.enabled=true          # minimal --set\nhelm template \u003Cinfra-release> .                                     # defaults only\nhelm template \u003Cinfra-release> . --values values.init.localdev.yaml  # bootstrap values\n```\n\u003C\u002Fexample>\n\n\u003Cexample name=\"subchart-version-bump-workflow\">\n## Subchart version bump workflow\n\nWhen bumping `charts\u002F\u003Capp>\u002FChart.yaml` version in the umbrella chart repo:\n\n```bash\n# 1. Bump subchart version\n#    Edit charts\u002F\u003Capp>\u002FChart.yaml -> version: 0.2.0\n\n# 2. Update umbrella Chart.yaml dependency to match\n#    Edit Chart.yaml -> dependencies.\u003Capp>.version: \"0.2.0\"\n\n# 3. Regenerate Chart.lock\nhelm dependency update .\n\n# 4. Verify (this script lives in the chart repo, not this skill bundle)\nbash scripts\u002Fcheck-chart-sync.sh\n\n# 5. Commit all three together\ngit add Chart.yaml Chart.lock charts\u002F\u003Capp>\u002FChart.yaml\n```\n\u003C\u002Fexample>\n\n\u003Cexample name=\"canonical-upgrade-with-dry-run\">\n## Canonical upgrade with dry-run first\n\n```bash\n# Step 1: Dry-run (always first)\nhelm upgrade --install \u003Cinfra-release> . \\\n  -f values.\u003CenvAlias>.populated.yaml \\\n  --namespace \"$NAMESPACE\" \\\n  --dry-run --debug\n\n# Step 2: Apply (defer to `deployment` skill for production orchestration)\nhelm upgrade --install \u003Cinfra-release> . \\\n  -f values.\u003CenvAlias>.populated.yaml \\\n  --namespace \"$NAMESPACE\" \\\n  --wait --atomic --timeout 8m \\\n  --description \"[ci $CI_PIPELINE_ID deploy] infra@$(git rev-parse --short HEAD)\"\n```\n\u003C\u002Fexample>\n\n\u003Cexample name=\"requireRealSecret-helper\">\n## requireRealSecret helper\n\nFor secret values that must not ship as `CHANGE_ME` in production:\n\n```yaml\n# _helpers.tpl\n{{- define \"app.requireRealSecret\" -}}\n{{- $value := index . 0 -}}\n{{- $name := index . 1 -}}\n{{- if or (eq $value \"\") (eq $value \"CHANGE_ME\") -}}\n{{- fail (printf \"secrets.%s required -- set a real value\" $name) -}}\n{{- end -}}\n{{- $value -}}\n{{- end -}}\n\n# secret.yaml\nauth-secret: {{ include \"app.requireRealSecret\" (list .Values.secrets.authSecret \"authSecret\") | quote }}\n```\n\u003C\u002Fexample>\n\n# Failure modes (symptom -> detection -> action)\n\n- **nil pointer in template**: symptom: `nil pointer evaluating interface {}.fieldName` -> detect: identify which values key is missing `| default dict` at the conditional level -> fix: add defensive extraction at every nesting level\n- **Chart.lock stale after subchart bump**: symptom: `can't get a valid version for dependency \u003Cname>` -> detect: compare subchart Chart.yaml version with umbrella Chart.yaml dep version -> fix: update umbrella dep, run `helm dependency update .`, commit both\n- **Values not applied**: symptom: default values appear instead of overrides -> detect: `helm get values \u003Crelease> -n $NAMESPACE` shows missing keys -> fix: verify `--values \u003Cfile>` flag was passed and check indentation in the values file\n- **Label mismatch blocking service discovery**: symptom: service can't find pods -> detect: compare `kubectl get pods --show-labels` with `kubectl get svc -o yaml | grep selector` -> fix: ensure both use the same selector labels from `_helpers.tpl`\n\n# Related skills (compose vs defer)\n\n- `deployment` -- **defer** to it for end-to-end deploy orchestration (helm upgrade to live clusters); this skill covers template authoring and validation only. For end-to-end deploy orchestration, use `deployment`.\n- `keycloak` -- **defer** to it for Keycloak realm\u002Fclient\u002FAuth.js config; this skill only covers the Helm values structure for the keycloakx subchart\n- `infrastructure-as-code` -- **defer** to it for IaC drift detection; **compose** with it when a manual helm override needs to be captured in code\n- `kubernetes-deployment` -- **defer** to it for k8s cluster operations, GCP firewall, minikube tunnel; **compose** when debugging a deployment that uses this chart\n- `migration-check` -- no direct overlap; migration scripts are not Helm-managed\n- `docker-build` -- **defer** to it for image builds; this skill only consumes image tags\u002Fdigests in values files\n\n# How to use\n\n## What it does\n\nThis skill helps you write and validate Helm charts: template files, values files, subchart dependencies, and chart versions. It focuses on getting the chart correct before anything reaches a cluster — defensive template patterns, `helm lint`, `helm template`, and `helm upgrade --dry-run`. It does not push releases to live clusters.\n\n## When to use it\n\n- You are writing or fixing a chart template (deployment, service, ingress, network policy) and want the nesting patterns right.\n- A render fails with `nil pointer evaluating interface {}.fieldName` and you need to find the values key that is missing a guard.\n- You bumped a subchart version and need the umbrella `Chart.yaml` and `Chart.lock` to stay in sync.\n- You want a chart reviewed with file:line citations and a severity per finding.\n\n## When not to use it\n\n- Running an upgrade against a live cluster end to end — use the `deployment` skill.\n- Keycloak realm, client, or auth integration config — use the `keycloak` skill.\n- Terraform drift or post-incident capture — use the `infrastructure-as-code` skill.\n- Building or pushing container images — use the `docker-build` skill.\n\n## How to invoke\n\n```\nSkill(skill: \"infra-pack:helm-chart-expert\")\n```\n\nInvoke it directly, or just describe the chart work — the skill's own triggers cover template edits, values structure, dependency bumps, and validation runs.\n\n## Inputs\n\n- `chart_path` — the chart directory containing `Chart.yaml` — required.\n- `values_file` — the values file to validate against — optional.\n- `operation` — one of `author`, `validate`, `review`, `debug` — required.\n\n## What you get back\n\nA result block headed `## {operation} Result — {chart_path}`, with a findings table (`File:Line`, issue, severity, fix), the ordered validation commands with pass\u002Ffail, and a HIGH\u002FMEDIUM\u002FLOW confidence label with its rationale. `author` returns corrected YAML with inline comments; `validate` returns the lint → template → dry-run sequence. Nothing is applied to a cluster.\n\n## Worked example\n\n```\nSkill(skill: \"infra-pack:helm-chart-expert\")\n\nRequest: \"values.\u003CenvAlias>.yaml has no networkPolicy section and the render\ndies with a nil pointer. chart_path: apps\u002F\u003CmainApp>\u002Fchart, operation: debug\"\n\nWhat happens: the skill runs helm lint and helm template first, traces the\nfailure to a conditional that guards only the leaf key, and returns the\ncorrected template that extracts every nesting level with `| default dict`,\nplus four helm template commands covering full values, --set, defaults only,\nand bootstrap values.\n```\n\n## Related\n\n- `deployment` — prefer it once the chart is correct and you need the release orchestrated.\n- `kubernetes-deployment` — prefer it for cluster-level debugging; compose with it when the failing workload comes from this chart.\n- `infrastructure-as-code` — compose with it when a manual override needs to be captured back into code.\n",{"docs":24,"name":5,"owner":28,"version":29,"description":7},{"status":25,"updated":26,"source_sha":27},"reviewed",1785974400000,"9ca1ca2b31c7","swarmery-infra","1.0.0","main","2d9e918cc79c9b17b59356780ff0a3da38a3e98a","plugins\u002Finfra-pack\u002Fskills\u002Fhelm-chart-expert",5,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery","https:\u002F\u002Fatretyak1985.github.io\u002Fswarmery\u002F","https:\u002F\u002Fgithub.com\u002Fatretyak1985","2026-11-11 04:29:12",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add atretyak1985\u002Fswarmery --skill helm-chart-expert",{"tool":44,"command":45},"bunx","bunx skills add atretyak1985\u002Fswarmery --skill helm-chart-expert",{"tool":47,"command":48},"pnpm","pnpm dlx skills add atretyak1985\u002Fswarmery --skill helm-chart-expert","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Finfra-pack\u002Fskills\u002Fhelm-chart-expert\u002FSKILL.md",true,[52],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"scripts\u002Fvalidate-chart.sh","SCRIPT","脚本",1495,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Finfra-pack\u002Fskills\u002Fhelm-chart-expert\u002Fscripts\u002Fvalidate-chart.sh",[59,66,72,79,86,93],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M78D4T1FFWFW19Z44AHH5BSY","short-desc","Too short.","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fshort-desc\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M78D4S0TWT42WXFJHC1DBN0R","no-frontmatter","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M78D4Q14P8DJ4W78N62F3EG2","global-skill","Fixture global skill (minimal user-scope shape, format doc §2.3).","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fglobal-skill\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M78D4N1JHGQJQ7EZ43KY5SV3","documented-skill","Fixture skill whose usage guide deliberately omits the Worked example subsection.","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fdocumented-skill\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M78D4KVNZ03GBKGDFJZWW5FJ","z","NOT auto-discovered — only skills\u002F is scanned for plugins (§2.2).","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fplugins\u002Fcache\u002Fmkt\u002Ftoolpack\u002F1.0.0\u002Fworkflow-skills\u002Fz\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M78D4JMBRZWK51HFE5RZJGHC","y","Plugin skill y from toolpack — stored as \"toolpack:y\".","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fplugins\u002Fcache\u002Fmkt\u002Ftoolpack\u002F1.0.0\u002Fskills\u002Fy\u002FSKILL.md",[],[]]