Help us improve
Share bugs, ideas, or general feedback.
From rust-agents
Validates, formats, lints, and converts YAML/JSON files using fast-yaml (fy) CLI tool with YAML 1.2.2 compliance, bidirectional conversion, and parallel batch processing for directories.
npx claudepluginhub bug-ops/claude-plugins --plugin rust-agentsHow this skill is triggered — by the user, by Claude, or both
Slash command
/rust-agents:fast-yamlThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Professional YAML validation, formatting, and conversion tool with YAML 1.2.2 spec compliance and parallel processing capabilities.
Validates YAML syntax, normalizes formatting, schema-checks for Kubernetes/GitHub Actions/Docker Compose. Outputs minimal patches, issues, and validation commands.
Queries, filters, and transforms YAML with yq CLI tool. Use for processing Kubernetes manifests, GitHub Actions workflows, Helm values, and config files.
Processes JSON with jq and YAML/TOML with yq to filter, transform, and query data from configs like Docker Compose, Kubernetes manifests, GitHub Actions workflows, and package.json.
Share bugs, ideas, or general feedback.
Professional YAML validation, formatting, and conversion tool with YAML 1.2.2 spec compliance and parallel processing capabilities.
[!IMPORTANT] fast-yaml follows YAML 1.2.2 specification, which differs from PyYAML (1.1). Notable differences:
yes/no/on/offare strings (not booleans), octal numbers use0oprefix.
| Operation | Command | Description |
|---|---|---|
| Validate | fy parse config.yaml | Check YAML syntax |
| Format | fy format -i config.yaml | Format file in-place |
| Lint | fy lint config.yaml | Validate with diagnostics |
| YAML → JSON | fy convert json config.yaml | Convert YAML to JSON |
| JSON → YAML | fy convert yaml config.json | Convert JSON to YAML |
| Batch format | fy format -i src/ | Format entire directory |
| Parallel | fy format -i -j 8 project/ | Use 8 parallel workers |
# Rust (recommended for CLI)
cargo install fast-yaml-cli
# Verify installation
fy --version
# Python bindings
pip install fastyaml-rs
# Verify installation
python -c "import fast_yaml; print(fast_yaml.__version__)"
# Node.js bindings
npm install fastyaml-rs
# Verify installation
node -e "const fy = require('fastyaml-rs'); console.log('OK')"
[!NOTE] Requires Rust 1.88+, Python 3.10+, or Node.js 20+ depending on the installation method.
# Validate syntax only
fy parse config.yaml
# Validate with detailed diagnostics
fy lint config.yaml
# Format and save
fy format -i config.yaml
# Format all YAML files in directory
fy format -i src/
# Use glob patterns
fy format -i "**/*.yaml"
# Parallel processing (8 workers)
fy format -i -j 8 project/
# Lint with exclusions
fy lint --exclude "tests/**" .
[!TIP] Use parallel processing (
-jflag) for large codebases. Batch mode provides 6-15x speedup on multi-file operations.
# Convert to JSON (pretty-printed)
fy convert json config.yaml
# Compact JSON (no whitespace)
fy convert json --pretty false config.yaml
# Save to file
fy convert json config.yaml > config.json
# Convert to YAML
fy convert yaml config.json
# Convert and save
fy convert yaml config.json > config.yaml
# In-place conversion
fy convert yaml -i config.json
[!TIP] Bidirectional conversion is seamless. Use
fy convert yamlfor JSON → YAML andfy convert jsonfor YAML → JSON.
For programmatic YAML processing in Python:
import fast_yaml
# Load YAML
data = fast_yaml.safe_load(yaml_string)
# Dump YAML with formatting
yaml_str = fast_yaml.safe_dump(data, indent=2, width=80)
# Lint with diagnostics
from fast_yaml._core.lint import lint
diagnostics = lint(yaml_string)
for diag in diagnostics:
print(f"{diag.severity}: {diag.message} at line {diag.span.start.line}")
See references/python-api.md for complete Python API reference.
For TypeScript/JavaScript projects:
import { safeLoad, safeDump } from 'fastyaml-rs';
const data = safeLoad(`name: fast-yaml`);
const yamlStr = safeDump(data);
See references/nodejs-api.md for complete Node.js API reference.
[!WARNING] fast-yaml uses YAML 1.2.2 spec, which differs from PyYAML (1.1). Review references/yaml-spec.md for migration guide.
Key differences from PyYAML (1.1):
| Value | PyYAML (1.1) | fast-yaml (1.2.2) |
|---|---|---|
yes/no | Boolean | String |
on/off | Boolean | String |
014 | 12 (octal) | 14 (decimal) |
0o14 | Error | 12 (octal) |
[!CAUTION] Process startup overhead (~15ms Python, ~20-25ms Node.js) affects single-file benchmarks. Use persistent servers or batch mode for best performance.
Use fast-yaml when you need to:
# Format all k8s manifests in parallel
fy format -i -j 4 k8s/
# Verify no syntax errors
fy lint k8s/
# Validate all YAML in repository
fy lint --exclude "node_modules/**" --exclude ".git/**" .
# Format check (exit code 1 if changes needed)
fy format --check .
import fast_yaml
from fast_yaml._core.lint import lint
# Load and validate config
config_yaml = open("config.yaml").read()
diagnostics = lint(config_yaml)
if diagnostics:
for diag in diagnostics:
print(f"Error at line {diag.span.start.line}: {diag.message}")
exit(1)
config = fast_yaml.safe_load(config_yaml)
fast-yaml follows YAML 1.2.2, where yes/no/on/off are strings. Use explicit true/false:
# Old (YAML 1.1 - PyYAML)
enabled: yes
# New (YAML 1.2.2 - fast-yaml)
enabled: true
See references/yaml-spec.md for complete migration guide.
Ensure you're using directory paths or glob patterns to activate batch mode:
# ❌ Sequential (slow)
for f in *.yaml; do fy format -i "$f"; done
# ✅ Batch mode (fast)
fy format -i .