kcl-composition-validator

Validate KCL Crossplane compositions with formatting, syntax, and render checks.

97|15|Updated Oct 2, 2023
One-click install
npx skills add https://github.com/Smana/cloud-native-ref --skill kcl-composition-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kcl-composition-validator
Source: https://github.com/Smana/cloud-native-ref/tree/main/.claude/skills/kcl-composition-validator
Command: npx skills add https://github.com/Smana/cloud-native-ref --skill kcl-composition-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces rigorous KCL formatting, syntax validation, and end-to-end render checks to prevent CI failures and catch critical bugs like mutation patterns early.

Core Features & Use Cases

  • Formatting & Syntax Validation: Ensures KCL code adheres to CI-enforced standards.
  • Render Validation: Tests crossplane render end-to-end to catch hidden issues before commit.
  • Pre-commit Guard: Integrates with pre-commit workflows to catch issues early in development.

Quick Start

From repository root, run the comprehensive validation script: ./scripts/validate-kcl-compositions.sh, or run a focused render check against an example: cd infrastructure/base/crossplane/configuration; crossplane render examples/app-basic.yaml app-composition.yaml functions.yaml --extra-resources examples/environmentconfig.yaml > /tmp/rendered.yaml

Frequently Asked Questions about kcl-composition-validator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate KCL Crossplane compositions before committing?

Validate KCL compositions by running the comprehensive validation script from repository root: ./scripts/validate-kcl-compositions.sh. This enforces formatting, syntax checks, and end-to-end render validation to catch CI failures and resource duplication early in your workflow.

What does KCL composition validation check for?

KCL composition validation enforces three stages: formatting compliance with CI standards, syntax and logic correctness, and end-to-end render validation. It catches mutation patterns, enforces inline conditionals and single-line list comprehensions, and detects resource duplication before deployment.

Can I test Crossplane render output locally before pushing changes?

Yes. Run a focused render check from infrastructure/base/crossplane/configuration: crossplane render examples/app-basic.yaml app-composition.yaml functions.yaml --extra-resources examples/environmentconfig.yaml > /tmp/rendered.yaml. This validates your KCL produces correct rendered resources without CI delay.

When should I use KCL validation in my development workflow?

Run validation when editing infrastructure/base/crossplane/configuration/kcl modules, working with KCL compositions or Crossplane resources, or before commits touching .k files. Integrate with pre-commit hooks to catch issues early and prevent CI failures.

What formatting rules does KCL validation enforce?

KCL validation enforces CI-enforced formatting standards including inline conditionals, single-line list comprehensions, and no trailing blank lines. These rules prevent syntax errors and ensure consistent code style across Crossplane configurations.

Does KCL validation work with existing Crossplane workflows?

Yes. KCL validation integrates with Crossplane render pipelines and pre-commit validation workflows. It validates compositions against your Crossplane configuration and functions, working within standard infrastructure-as-code deployment processes.