openai/codex · error · SkillParseError

invalid

Error message

invalid {field}: {reason}

What it means

Validation error for a frontmatter field (e.g. name or description): the value failed field-specific validation rules; `reason` explains which constraint was broken.

Solutions

  1. Adjust the field value to satisfy the documented constraint (e.g. allowed characters or length)
  2. Surface the validation reason to the skill author
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/skills/src/parser.rs:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/7a27d29894786032. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/skills/src/parser.rs:39

/// Validated metadata parsed from a `SKILL.md` frontmatter block.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ParsedSkillFrontmatter {
    pub name: String,
    pub description: String,
    pub short_description: Option<String>,
}

/// Error produced while parsing or validating `SKILL.md` metadata.
#[derive(Debug, Error)]
pub enum SkillParseError {
    #[error("missing YAML frontmatter delimited by ---")]
    MissingFrontmatter,
    #[error("invalid YAML: {0}")]
    InvalidYaml(#[source] serde_yaml::Error),
    #[error("missing field `{0}`")]
    MissingField(&'static str),
    #[error("invalid {field}: {reason}")]
    InvalidField { field: &'static str, reason: String },
}

/// Parses and validates the metadata frontmatter from `SKILL.md` contents.
pub fn parse_skill_frontmatter_metadata(
    contents: &str,
    default_name: impl FnOnce() -> String,
) -> Result<ParsedSkillFrontmatter, SkillParseError> {
    let frontmatter = extract_frontmatter(contents).ok_or(SkillParseError::MissingFrontmatter)?;

    let parsed: SkillFrontmatter = match serde_yaml::from_str(&frontmatter) {
        Ok(parsed) => Ok(parsed),
        Err(original_error) => match repair_frontmatter_scalar_fields(&frontmatter) {
            // Some third-party skills use prose like `description: Build for AWS: ECS`
            // or `argument-hint: <duration: e.g. 7d>`. Keep the repair line-oriented
            // so unrelated invalid YAML still surfaces.
            Some(repaired_frontmatter) => {
                serde_yaml::from_str(&repaired_frontmatter).map_err(|_| original_error)

View on GitHub (pinned to 339751715c)