A skill for fixing malformed YAML syntax in configuration files and markdown frontmatter
This skill helps you identify and fix malformed YAML syntax in configuration files, markdown frontmatter, and other YAML documents. It's particularly useful when dealing with parsing errors caused by unclosed brackets, improper indentation, or invalid syntax.
This skill provides step-by-step guidance for diagnosing and fixing YAML syntax errors, including:
When fixing malformed YAML:
1. **Identify the Error**: Locate the exact line and character position of the syntax error. Look for:
- Unclosed brackets `[` or braces `{`
- Missing closing quotes for strings
- Improper indentation (YAML requires consistent spaces, no tabs)
- Missing colons after keys
2. **Validate Structure**: Check that:
- All keys are followed by colons
- List items use hyphens with proper spacing
- Multi-line strings use proper block scalar indicators (`|` or `>`)
- Nested structures maintain consistent indentation
3. **Fix Common Issues**:
- Close all opened brackets, braces, and quotes
- Quote strings containing special characters: `[]{}:,&*#?|-<>=!%@\`
- Use consistent spacing (2 or 4 spaces, never tabs)
- Remove trailing spaces
4. **Validate the Result**: After fixing, validate the YAML using a parser or linter to ensure it's well-formed.
```yaml
name: [invalid yaml with unclosed bracket
description: This YAML is malformed
name: "Invalid YAML Fixed"
description: "This YAML is now properly formatted"
```
```yaml
title: My Skill: A Guide
command: echo $HOME
title: "My Skill: A Guide"
command: "echo $HOME"
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/malformed-yaml-fixer/raw