yaml-validator

Comprehensive YAML syntax validation, error fixing, and schema validation for various formats (GitHub Actions, Docker Compose, Kubernetes, GitLab CI). Use when Claude needs to: (1) Validate YAML syntax, (2) Check YAML files for errors, (3) Fix common YAML formatting issues, (4) Validate against schemas like GitHub Actions workflows, Docker Compose files, Kubernetes manifests, or GitLab CI pipelines, (5) Debug YAML parsing errors. Triggers on phrases like "check yaml", "validate yaml", "fix yaml errors", "yaml syntax".

16 stars

Best use case

yaml-validator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Comprehensive YAML syntax validation, error fixing, and schema validation for various formats (GitHub Actions, Docker Compose, Kubernetes, GitLab CI). Use when Claude needs to: (1) Validate YAML syntax, (2) Check YAML files for errors, (3) Fix common YAML formatting issues, (4) Validate against schemas like GitHub Actions workflows, Docker Compose files, Kubernetes manifests, or GitLab CI pipelines, (5) Debug YAML parsing errors. Triggers on phrases like "check yaml", "validate yaml", "fix yaml errors", "yaml syntax".

Teams using yaml-validator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/yaml-validator/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/yaml-validator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/yaml-validator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How yaml-validator Compares

Feature / Agentyaml-validatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Comprehensive YAML syntax validation, error fixing, and schema validation for various formats (GitHub Actions, Docker Compose, Kubernetes, GitLab CI). Use when Claude needs to: (1) Validate YAML syntax, (2) Check YAML files for errors, (3) Fix common YAML formatting issues, (4) Validate against schemas like GitHub Actions workflows, Docker Compose files, Kubernetes manifests, or GitLab CI pipelines, (5) Debug YAML parsing errors. Triggers on phrases like "check yaml", "validate yaml", "fix yaml errors", "yaml syntax".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# YAML Validator

Validate, fix, and check YAML files against schemas.

## Quick Start

### Basic Syntax Validation

Validate YAML files for syntax errors:

```bash
python scripts/validate_yaml.py file.yml
python scripts/validate_yaml.py file1.yml file2.yml  # Multiple files
python scripts/validate_yaml.py *.yml --quiet         # Only show errors
```

### Auto-Fix Common Errors

Automatically fix common YAML issues:

```bash
python scripts/fix_yaml.py file.yml -i              # Fix in-place
python scripts/fix_yaml.py file.yml > fixed.yml     # Output to new file
python scripts/fix_yaml.py *.yml -i --no-backup     # Fix without backups
```

Common fixes applied:
- Convert tabs to spaces
- Remove trailing whitespace
- Normalize indentation
- Add newline at end of file
- Remove excessive blank lines

### Schema Validation

Validate against specific schemas:

```bash
# Auto-detect schema type
python scripts/validate_schema.py workflow.yml

# Explicit schema type
python scripts/validate_schema.py -t home-assistant configuration.yaml
python scripts/validate_schema.py -t github-actions .github/workflows/ci.yml
python scripts/validate_schema.py -t docker-compose docker-compose.yml
python scripts/validate_schema.py -t kubernetes deployment.yml
python scripts/validate_schema.py -t gitlab-ci .gitlab-ci.yml

# List available schemas
python scripts/validate_schema.py --list-schemas
```

## Workflow

### When YAML validation is requested:

1. **Check syntax first**: Use `validate_yaml.py` to identify syntax errors
2. **Fix if needed**: Use `fix_yaml.py` to auto-fix common issues
3. **Validate schema**: Use `validate_schema.py` for format-specific validation

### For YAML errors:

1. Run validation to identify the issue
2. Check `references/common-errors.md` for guidance on specific error types
3. Apply fixes manually or use `fix_yaml.py`
4. Re-validate to confirm

### For schema validation:

1. Identify the YAML type (GitHub Actions, Docker Compose, etc.)
2. Run `validate_schema.py` with appropriate type
3. See `references/schemas.md` for schema-specific requirements

## Supported Schemas

- **home-assistant**: Home Assistant configuration files
- **github-actions**: GitHub Actions workflow files
- **docker-compose**: Docker Compose configuration files
- **kubernetes**: Kubernetes resource manifests
- **gitlab-ci**: GitLab CI/CD pipeline files

See `references/schemas.md` for detailed schema documentation.

## Common Error Patterns

For detailed error explanations and fixes, see `references/common-errors.md`:

- Indentation errors (tabs vs spaces)
- Quote mismatches
- Colon spacing issues
- Boolean value confusion
- Multiline string formatting
- Duplicate keys
- Special character handling

## Dependencies

Scripts require:
- Python 3.7+
- PyYAML: `pip install pyyaml`
- jsonschema: `pip install jsonschema` (for schema validation only)

## Exit Codes

All scripts use standard exit codes:
- `0`: Success (all files valid)
- `1`: Validation failed (syntax or schema errors)
- `2`: Missing dependencies or invalid arguments

Related Skills

terraform-validator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for validating, linting, testing, and automating Terraform configurations and HCL files. Use this skill when working with Terraform files (.tf, .tfvars), validating infrastructure-as-code, debugging Terraform configurations, performing dry-run testing with terraform plan, or working with custom providers and modules.

k8s-yaml-validator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for validating, linting, and testing Kubernetes YAML resources. Use this skill when validating Kubernetes manifests, debugging YAML syntax errors, performing dry-run tests on clusters, or working with Custom Resource Definitions (CRDs) that require documentation lookup.

k8s-yaml-generator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for generating, validating, and managing Kubernetes YAML resources. Use this skill when creating Kubernetes manifests (Deployments, Services, ConfigMaps, StatefulSets, etc.), working with Custom Resource Definitions (CRDs), or generating production-ready K8s configurations.

gitlab-ci-validator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for validating, linting, testing, and securing GitLab CI/CD pipeline configurations. Use this skill when working with GitLab CI/CD pipelines, validating pipeline syntax, debugging configuration issues, or implementing best practices.

citation-link-validator

16
from diegosouzapw/awesome-omni-skill

Validates footnote links in articles to prevent broken 404 URLs. Use when Claude needs to generate content with reference citations (research reports, technical documentation, academic articles). Supports two modes - (1) Real-time validation mode - validates each URL during content generation, ensuring zero broken links; (2) Post-validation mode - checks all footnotes in existing documents. Suitable for high-quality citation scenarios including web search data compilation, literature citation, and fact-checking tasks.

azure-pipelines-validator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for validating, linting, and securing Azure DevOps Pipeline configurations.

ascii-diagram-validator

16
from diegosouzapw/awesome-omni-skill

Validate ASCII diagram alignment in markdown. TRIGGERS - diagram alignment, ASCII art, box-drawing diagrams.

ansible-validator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for validating, linting, testing, and automating Ansible playbooks, roles, and collections. Use this skill when working with Ansible files (.yml, .yaml playbooks, roles, inventories), validating automation code, debugging playbook execution, performing dry-run testing with check mode, or working with custom modules and collections.

wcag-validator

16
from diegosouzapw/awesome-omni-skill

Automatically validate Moodle templates, JavaScript, and CSS for WCAG 2.1 Level AA accessibility compliance. Checks semantic HTML, ARIA patterns, keyboard navigation, color contrast, and screen reader compatibility. Activates when working with Mustache templates, AMD modules, or discussing accessibility, a11y, WCAG, screen readers, or keyboard navigation.

validator-workflow

16
from diegosouzapw/awesome-omni-skill

Phase-level validation workflow for validator agents. Handles loading project rules, reading phase files, running /code-review, conditional verification (unit tests + typecheck + E2E/DB tests based on phase type), determining verdict, and reporting to the orchestrator. Invoke this skill as your first action — not user-invocable.

paperproof-validator

16
from diegosouzapw/awesome-omni-skill

Formal Proof Visualization and Verification for Lean 4

Frontend Functional Validator (Detective)

16
from diegosouzapw/awesome-omni-skill

Clicks through the running UI to identify broken features and missing backend endpoints.