Skip to content

[codex] Repair invalid skill frontmatter scalars#28628

Merged
charlesgong-openai merged 2 commits into
mainfrom
dev/charlesgong/fix-skill-description-colon-yaml
Jun 17, 2026
Merged

[codex] Repair invalid skill frontmatter scalars#28628
charlesgong-openai merged 2 commits into
mainfrom
dev/charlesgong/fix-skill-description-colon-yaml

Conversation

@charlesgong-openai

@charlesgong-openai charlesgong-openai commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Why

The community marketplace audit found many skill frontmatter parse failures where values were intended as prose, but were not valid YAML. Common examples include unquoted scalar values with : , such as description: Build for AWS: ECS or argument-hint: <duration: e.g. 7d>, and flow-looking values such as tags: [next,@supabase/ssr].

serde_yaml does not expose a permissive mode for this. The parser fails before unknown frontmatter fields can be ignored, so a compatibility repair has to happen before retrying YAML parsing.

What changed

Skill frontmatter loading still uses serde_yaml as the primary parser. If that parse fails, the loader performs a line-oriented repair of scalar frontmatter field values, then retries parsing.

The fallback now:

  • applies to any frontmatter mapping field, not just description / short-description
  • quotes unquoted scalar values that contain a YAML colon separator such as :
  • quotes invalid flow-looking scalar values that start with [, {, @, or backtick
  • preserves already quoted values
  • skips | / > block scalar bodies so multiline descriptions are not rewritten
  • returns the original YAML error if the repaired frontmatter still cannot parse

Examples

This previously failed because the second : was parsed as YAML structure:

description: AWS deployment patterns: ECS Fargate, Lambda, and S3

The fallback now parses it as if it had been written explicitly as:

description: 'AWS deployment patterns: ECS Fargate, Lambda, and S3'

The same repair now applies to ignored frontmatter fields that still need to be valid YAML for the parser to get through the document:

argument-hint: <duration: e.g. 7d, 2w>
tags: [next,@supabase/ssr]

Valid YAML multiline descriptions continue to work through normal parsing without repair:

description: |-
  Build for AWS: ECS
  and Lambda

Validation

  • Added loader coverage for unquoted description values containing : .
  • Added loader coverage for unquoted metadata.short-description values containing : and an apostrophe.
  • Added loader coverage for unrecognized frontmatter fields that need quoting, including argument-hint and tags.
  • Added block-scalar coverage to ensure multiline description bodies are preserved while other fields are repaired.
  • just test -p codex-core-skills (106 passed)
  • just fix -p codex-core-skills

@charlesgong-openai charlesgong-openai changed the title [codex] Handle colons in skill descriptions [codex] Repair invalid skill frontmatter scalars Jun 17, 2026
@charlesgong-openai
charlesgong-openai marked this pull request as ready for review June 17, 2026 00:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e13ee371f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core-skills/src/loader.rs Outdated
Comment thread codex-rs/core-skills/src/loader.rs Outdated
Comment thread codex-rs/core-skills/src/loader.rs Outdated
@charlesgong-openai
charlesgong-openai merged commit 0065c3a into main Jun 17, 2026
31 checks passed
@charlesgong-openai
charlesgong-openai deleted the dev/charlesgong/fix-skill-description-colon-yaml branch June 17, 2026 17:37
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants