zed-industries/zed · error

Invalid YAML frontmatter

Error message

Invalid YAML frontmatter

What it means

None of the candidate frontmatter delimiters produced a prefix that deserializes into SkillMetadata, so the skill file's YAML frontmatter is invalid or the closer heuristic cut the YAML mid-scalar. The last deserialization error is reported.

Source

Thrown at crates/agent_skills/agent_skills.rs:413

    // first document deserializes into `SkillMetadata`, that candidate is the
    // real closer. Otherwise an earlier candidate may have cut the YAML in the
    // middle of a scalar / quoted string; try the next one.
    let mut last_error: Option<anyhow::Error> = None;
    for end in candidates {
        let prefix = &content[..end];
        let mut docs = serde_yaml_ng::Deserializer::from_str(prefix);
        let Some(first_doc) = docs.next() else {
            continue;
        };
        match SkillMetadata::deserialize(first_doc) {
            Ok(metadata) => return Ok((metadata, &content[end..])),
            Err(e) => last_error = Some(anyhow::Error::new(e)),
        }
    }

    Err(last_error
        .unwrap_or_else(|| anyhow::anyhow!("could not parse YAML frontmatter"))
        .context("Invalid YAML frontmatter"))
}

/// Maximum length for a valid skill name. Mirrors the upper bound enforced
/// by [`validate_name`].
pub const MAX_SKILL_NAME_LEN: usize = 64;

/// Maximum recommended length (in Unicode scalar values) for a skill description. The
/// create-skill UI enforces this as a hard limit, while the loader emits a
/// warning and still loads longer descriptions.
pub const MAX_SKILL_DESCRIPTION_LEN: usize = 1024;

/// Convert an arbitrary human-readable string into a valid skill name, or
/// return `None` if no valid name can be produced (e.g. the input contains
/// no ASCII alphanumeric characters at all).
///
/// The transformation:
///
/// 1. Replaces each `&` with the word `and` (with separators on either

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Fix the skill's frontmatter so it is valid YAML with the required metadata fields
  2. Ensure the closing --- delimiter is present and not embedded inside a quoted scalar
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/agent_skills/agent_skills.rs:412 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/0cb555c10b585e57. Report an issue: GitHub.