Agent skill
new-function
Add a new template function to jhelm (Helm or Sprig)
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/new-function
SKILL.md
Add a new template function
Guided workflow for adding a new template function named $ARGUMENTS.
Step 1: Determine the category
Helm functions (in jhelm-gotemplate/src/main/java/.../helm/):
conversion/ConversionFunctions.java— YAML/JSON conversion (toYaml, fromJson, etc.)template/TemplateFunctions.java— Template inclusion (include, tpl, required)kubernetes/KubernetesFunctions.java— Kubernetes integration (lookup)chart/ChartFunctions.java— Chart utilities (semverCompare, certificate generation)
Sprig functions (in jhelm-gotemplate/src/main/java/.../sprig/):
strings/StringFunctions.java— String manipulationcollections/CollectionFunctions.java— List/dict operationslogic/LogicFunctions.java— default, empty, coalesce, ternarymath/MathFunctions.java— Arithmetic operationsencoding/EncodingFunctions.java— Base64, SHA, etc.crypto/CryptoFunctions.java— UUID, random, encryptiondate/DateFunctions.java— Date formatting/manipulationreflection/ReflectionFunctions.java— Type checkingnetwork/NetworkFunctions.java— DNS lookupsemver/SemverFunctions.java— Semantic versioning
Step 2: Implement the function
- Add the function to the appropriate category class
- Follow existing patterns in that class (method signature, error handling)
- Use
@Slf4jfor logging if needed - For strict variants, create a
must*version that throws on error
Step 3: Registration
The function auto-registers via the coordinator:
- Helm functions:
HelmFunctions.java→getFunctionCategories() - Sprig functions:
SprigFunctionsRegistry.java→getFunctionCategories()
If adding a new category, update getFunctionCategories() in the appropriate coordinator.
Step 4: Add tests
Add tests in the corresponding test class (e.g., Helm4FunctionsTest.java, or the test class for the Sprig category).
Step 5: Verify
Run the relevant module tests:
./mvnw test -pl jhelm-gotemplate
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?