Helm chart structure and templating pack#646
Conversation
Add helm-pack.json with 56 Helm best practice entries covering chart structure, template patterns, security, values conventions, dependencies, RBAC, networking, and lifecycle hooks. All entries use category=kubernetes with helm and generate-k8s-manifests tags for proper tool matching. Also adds helm-pack.test.ts with schema validation, structural invariant checks, and matcher integration tests to verify entries surface correctly for Helm-related queries.
There was a problem hiding this comment.
Pull request overview
Adds a new Helm-focused knowledge pack and expands unit tests to ensure Helm-related knowledge is validated, loaded, and discoverable via the matcher—improving Helm chart guidance coverage in the knowledge system.
Changes:
- Added
knowledge/packs/helm-pack.jsonwith Helm chart structure/templating recommendations and tags. - Added
test/unit/knowledge/helm-pack.test.tsto validate schema/structure and verify matcher behavior for Helm queries. - Updated knowledge loader and taxonomy tests/docs to account for the new Helm pack and
helmtag.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/unit/knowledge/loader.test.ts | Updates expectations/formatting for built-in pack list and pack count after adding Helm pack. |
| test/unit/knowledge/helm-pack.test.ts | New targeted unit tests for Helm pack schema/invariants and matcher integration. |
| knowledge/TAG_TAXONOMY.md | Documents new helm tool tag and adds a version-history entry. |
| knowledge/packs/helm-pack.json | New Helm knowledge pack entries (rules) with tags and patterns for matcher-based retrieval. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| console.log(` Total Packs: ${expectedPackCount}`); | ||
| console.log(` Total Entries: ${entries.length}`); | ||
| console.log(` Avg Entries/Pack: ${Math.round(entries.length / expectedPackCount)}`); | ||
|
|
||
| const categoryCounts = entries.reduce((acc, entry) => { | ||
| acc[entry.category] = (acc[entry.category] || 0) + 1; | ||
| return acc; | ||
| }, {} as Record<string, number>); | ||
| const categoryCounts = entries.reduce( |
There was a problem hiding this comment.
In the statistics block, expectedPackCount is still hardcoded to 28, but earlier in this file the built-in pack count was updated to 29 (and the directory listing includes helm-pack.json). This makes the logged pack/avg numbers inconsistent; update the constant (or derive it from expectedPacks.length / directory listing) so it stays in sync.
| ### v1.1.0 (2026-04-08) | ||
| - Added `helm` tool tag for Helm chart generation knowledge | ||
| - Added Helm knowledge pack with 56 entries across 10 categories | ||
|
|
There was a problem hiding this comment.
The version history entry claims the Helm knowledge pack has “56 entries across 10 categories”, but the new helm pack entries are all in the kubernetes category (and tests enforce that). Please correct this line to avoid misleading documentation (e.g., “56 entries across 10 topic areas/tags” or “56 entries in the kubernetes category”).
| { | ||
| "id": "helm-whitespace-trim-hyphen", | ||
| "category": "kubernetes", | ||
| "pattern": "helm|template|whitespace|{{-| -}}|yaml", | ||
| "recommendation": "Use hyphen trimming markers deliberately in templates to control whitespace. Missing or misplaced `{{-` / `-}}` commonly introduces blank lines or indentation breakage.", |
There was a problem hiding this comment.
This pattern contains unescaped { / } (e.g., {{-), which will throw during new RegExp(entry.pattern, ...) in the matcher and cause the entry to be skipped for pattern matching. Escape the braces (or change the pattern to avoid literal Go-template delimiters) so it remains a valid JavaScript RegExp.
Add tests for helm packs ensuring helm context is retrieved
Also adds helm-pack.test.ts with schema validation, structural invariant checks, and matcher integration tests to verify entries surface correctly for Helm-related queries.