YAML 1.2 · Human-Readable Data & Frontmatter Guide

Complete YAML & Frontmatter Guide

YAML (YAML Ain't Markup Language) is a human-friendly data format that represents structured key-value settings, lists, and nested objects using clean 2-space indentation instead of JSON's curly braces and trailing commas. Every valid YAML document compiles directly into standard JSON/object data that software and AI agents read automatically.

1. DevOps & App Configs (.yaml / .yml)

Powers Docker Compose, GitHub Actions CI workflows, Kubernetes manifests, OpenAPI specs, and application settings where clean comments and readability matter.

2. AI Agent Skill Frontmatter (.md)

Placed between --- lines at line 1 of SKILL.md or Markdown docs to declare structured metadata (name, description, tags) while the body stays Markdown.

3. Live Validation & Formatting in Readme

Open any .yaml file in /app for a live Structured Tree preview, instant syntax error checking, 1-click Format YAML, and Copy as JSON.

Important: Pure .yaml File vs. Markdown File (.md) with YAML Frontmatter
config.yaml / docker-compose.yml

Contains ONLY YAML data (keys, lists, nested objects). Lines starting with # are treated as comments, NOT Markdown headings.

SKILL.md / guide.md (Markdown + Frontmatter)

Starts with a --- ... --- YAML header at line 1, followed by regular Markdown (# Heading, links, tables). Must use a .md extension to render as rich Markdown + a Properties card.

1.Key-Value Pairs & Scalars

config.yaml
Strings, numbers, booleans, and null
Raw YAML
app_name: Readme Studio
version: 2.1
max_files: 30
public_mode: true
deprecated: false
custom_banner: null
Output
app_name:Readme Studio
version:2.1
max_files:30
public_mode:true
deprecated:false
custom_banner:null
Tip: Always leave one space after the colon (:). Never use tabs for indentation - YAML strictly requires spaces (2 spaces per level is the universal standard).

2.Quoting & Special Characters

settings.yaml
When strings must be wrapped in quotes
Raw YAML
# Double quotes allow escape sequences (\n, \")
title: "Readme: Fast Markdown Studio"
trigger: "Use when the user asks to audit a SKILL.md file."

# Keep version strings & codes from becoming numbers/booleans
version_tag: "1.0"
country_code: "NO"

# Single quotes keep backslashes literal
windows_path: 'C:\Users\dev\skills'
Output
title: Readme: Fast Markdown Studio
trigger: Use when the user asks to audit a SKILL.md file.
version_tag:"1.0" (string)
country_code:"NO" (string)
windows_path: C:\Users\dev\skills
Tip: Always quote a string if it contains ': ' (colon + space), starts with #, @, *, &, !, %, {, [, or looks like yes/no/true/false/1.0.

3.Lists (Arrays / Sequences)

config.yaml
Block hyphen lists vs inline flow arrays
Raw YAML
# Block style (most readable for multi-item lists)
supported_formats:
  - markdown
  - yaml
  - json
  - csv

# Inline flow style (great for short lists)
diagram_exports: ["png", "svg", "jpg", "webp"]
Output
supported_formats:
markdown yaml json csv
diagram_exports:
png svg jpg webp

4.Nested Objects & Lists of Objects

server.yaml
Structured config trees and endpoint tables
Raw YAML
server:
  domain: readme.scribenovo.com
  tls: true
  limits:
    max_files: 30
    session_ttl_hours: 24

endpoints:
  - path: /mcp
    method: POST
    auth: optional
  - path: /app
    method: GET
    auth: none
Output
server
domain: readme.scribenovo.com
tls: true
limits: max_files=30, session_ttl_hours=24
endpoints (2 items)
[0] POST /mcp (auth: optional)
[1] GET /app (auth: none)

5.Multiline Strings (| vs >)

pipeline.yaml
Preserve line breaks (|) vs fold paragraphs (>)
Raw YAML
# Literal block (|) keeps every newline exactly as typed
build_commands: |
  cd frontend
  npx tsc --noEmit
  npm test

# Folded block (>) joins wrapped lines into one paragraph
summary: >
  Audits multi-file agent skills for broken references,
  token budgets, and frontmatter compliance.
Output
build_commands (| keeps newlines):
cd frontend
npx tsc --noEmit
npm test
summary (> folded into one line):

Audits multi-file agent skills for broken references, token budgets, and frontmatter compliance.

Tip: Use '|-' or '>-' (with a trailing hyphen) to strip the final trailing newline character.

6.Comments, Anchors & Aliases (& / *)

deploy.yaml
Document configs and reuse shared blocks cleanly
Raw YAML
# Shared defaults anchored with &default_env
defaults: &default_env
  timeout_sec: 15
  retries: 3

staging:
  <<: *default_env
  host: staging.scribenovo.com

production:
  <<: *default_env
  host: readme.scribenovo.com
Output
staging
timeout_sec: 15 · retries: 3 · host: staging.scribenovo.com
production
timeout_sec: 15 · retries: 3 · host: readme.scribenovo.com
Tip: In pure .yaml files, anything starting with # is a comment ignored by the YAML parser.

7.Real-World Example: GitHub Actions (.yml)

.github/workflows/ci.yml
Complete production CI workflow config
Raw YAML
name: Verify Build
on:
  push:
    branches: ["main"]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Frontend Tests
        working-directory: ./frontend
        run: |
          npm ci
          npx tsc --noEmit
          npm test
Output
Workflow: Verify Build (on push -> main)
Job: test (ubuntu-latest)
1. actions/checkout@v4
2. Run Frontend Tests (./frontend)

8.YAML Frontmatter Inside Markdown (.md / SKILL.md)

SKILL.md (must be .md!)
Use inside a .md file, NOT inside a .yaml file
Raw YAML
---
name: deploy-pipeline
description: "Guides safe production deployments to Vercel and Render. Use when the user asks to deploy, configure DNS, or verify release health. Do NOT use for local UI styling."
---

# Deploy Pipeline

Follow [Pre-Flight Checks](workflows/preflight.md) before shipping.
Output
Properties Card (From YAML Header)
name: deploy-pipeline
description: Guides safe production deployments...
Deploy Pipeline

Follow Pre-Flight Checks before shipping.

Tip: Save this as SKILL.md (not config.yaml!). Only SKILL.md / .mdc entry files require name + description frontmatter; helper files in references/ or workflows/ do not need it.

9.Common YAML Pitfalls & Validation Rules

troubleshooting.yaml
Avoid the 4 bugs that break YAML parsers
Raw YAML
# BAD: unquoted colon inside value breaks parsing
# summary: Step 1: Install deps

# GOOD: wrap value in double quotes
summary: "Step 1: Install deps"

# BAD: mixing tabs with spaces causes a syntax error
# GOOD: always use 2 spaces per indentation level
retries: 3
node_version: "22.0"
Output
1. No Tabs: Always indent with 2 spaces.
2. Quote Colons: Wrap prose containing : in quotes.
3. Quote Versions: Write "22.0" so it doesn't become float 22.
4. Match Extension: Pure configs use .yaml; Markdown + frontmatter uses .md.