Skip to content

skill-creator: lazy-load PyYAML in frontmatter parsing#12080

Merged
xl-openai merged 1 commit intomainfrom
xl/skill-create
Feb 19, 2026
Merged

skill-creator: lazy-load PyYAML in frontmatter parsing#12080
xl-openai merged 1 commit intomainfrom
xl/skill-create

Conversation

@xl-openai
Copy link
Collaborator

@xl-openai xl-openai commented Feb 18, 2026

init-skill should work even without PyYAML

Copy link
Contributor

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

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: 39300075d3

ℹ️ 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 on lines 77 to 80
match = _KEY_PATTERN.match(stripped)
if not match:
raise YAMLError(
f"line {line_no}: unsupported YAML syntax: {raw_line.strip()}"
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Support YAML block sequences in shim parser

_parse_yaml_mapping_shim only accepts key: ... lines, so valid YAML list syntax (- item) is always rejected. quick_validate.py explicitly permits allowed-tools, which is commonly written as a block list; in shim mode this now fails with unsupported YAML syntax even for valid frontmatter, so skill-creator does not reliably work without PyYAML.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@codex fix this for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

Summary

Testing

  • python3 -m py_compile codex-rs/core/src/skills/assets/samples/skill-creator/scripts/yaml_compat.py codex-rs/core/src/skills/assets/samples/skill-creator/scripts/quick_validate.py
  • python3 - <<'PY' (inline assertions validating block-list parsing and rejecting invalid nested indentation) PY
  • tmpdir=$(mktemp -d) ... python3 codex-rs/core/src/skills/assets/samples/skill-creator/scripts/quick_validate.py "$tmpdir" ... (valid frontmatter with block list)
  • tmpdir=$(mktemp -d) ... python3 codex-rs/core/src/skills/assets/samples/skill-creator/scripts/quick_validate.py "$tmpdir" ... (malformed indentation correctly rejected; command asserts failure)
  • ⚠️ cargo test -p codex-core (fails in this environment: missing libcap via pkg-config required by codex-linux-sandbox build script)
  • ⚠️ cargo test -p codex-core --lib (same environment limitation: missing libcap)
  • ⚠️ cargo test --all-features (same environment limitation: missing libcap)
  • ⚠️ apt-get update && apt-get install -y libcap-dev (unable to install dependency due repository/proxy 403 responses in this environment)

View task →

Comment on lines 86 to 90
while len(stack) > 1 and indent <= stack[-1][0]:
stack.pop()

parent = stack[-1][1]
if value_text == "":
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Reject invalid nested indentation in shim loader

The shim never checks whether deeper indentation is legal for the current parent. After a scalar key (name: foo), an over-indented line ( description: bar) should be a YAML error, but this code silently writes description at the root and returns a dict. quick_validate.py can therefore accept malformed frontmatter that real YAML parsers reject.

Useful? React with 👍 / 👎.

@xl-openai xl-openai changed the title add yaml shim fallback for skill-creator skill-creator: lazy-load PyYAML in frontmatter parsing Feb 19, 2026
@xl-openai
Copy link
Collaborator Author

@codex review again

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Bravo.

ℹ️ 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".

@xl-openai xl-openai merged commit e445684 into main Feb 19, 2026
37 of 39 checks passed
@xl-openai xl-openai deleted the xl/skill-create branch February 19, 2026 23:09
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 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