skill-creator: initializer emits YAML-ambiguous skill names without quoting
Summary
The bundled Skill Creator initializer writes the generated name value into YAML without quoting it. Some names accepted by the initializer are therefore parsed by PyYAML as booleans, integers, or null rather than strings. The initializer succeeds, but the completed skill fails the bundled validator and the metadata generator.
Affected source
Current openai/codex main was inspected at 9baf9789e1b0db1d12080020017b73311950723e.
The template currently contains:
name: {skill_name}
The normalizer permits lowercase alphanumeric slugs, including yes, 123, and null.
Reproduction
Run each case in a fresh temporary directory:
python3 codex-rs/skills/src/assets/samples/skill-creator/scripts/init_skill.py yes --path "$TMP"
The initializer exits 0 and writes:
name: yes
Complete the generated scaffold by replacing the description TODO with ordinary text and removing the body TODO, then run:
python3 codex-rs/skills/src/assets/samples/skill-creator/scripts/quick_validate.py "$TMP/yes"
Observed result with PyYAML 6.0.3:
Name must be a string, got bool
The same integration failure occurs for:
123→Name must be a string, got intnull→Name must be a string, got NoneType
A control name such as paper-trail initializes and validates successfully.
Running generate_openai_yaml.py <skill-directory> without an explicit --name also fails for the generated yes skill because its frontmatter name is parsed as a non-string.
Root cause
normalize_skill_name() accepts these values as valid hyphen-case names. SKILL_TEMPLATE interpolates the value directly into a plain YAML scalar. PyYAML's scalar resolution interprets values such as yes, 123, and null as non-string types. The validator correctly rejects those types, exposing the initializer's serialization defect.
This is not a request to coerce invalid user-authored YAML into strings. The producer should serialize its already-validated Python string as a YAML string.
Expected behaviour
Every name accepted by the initializer should round-trip through the generated SKILL.md as a string and remain valid when the user completes the scaffold.
A narrow correction is to quote or otherwise safely serialize the generated name value. The allowed name alphabet is already restricted, so quoting the generated slug is sufficient for the demonstrated cases.
Related reports
- #37052 reported the earlier unquoted description placeholder. The current template now quotes the description, but the generated name remains unquoted.
- #64748, now closed as a duplicate of #44187, concerns empty required metadata and is a separate validator defect.
Validation boundary
The reproduction was run with Python 3.13.5 and PyYAML 6.0.3 against the current source snapshot. It used temporary directories and did not modify installed skills or the repository. Full Codex build and CI were not run.
I'm interested in working on this — please assign it to me.
Root cause (verified on main): the skill-creator initializer writes the generated name into YAML unquoted. SKILL_TEMPLATE in codex-rs/skills/src/assets/samples/skill-creator/scripts/init_skill.py:26-29 has name: {skill_name}, and normalize_skill_name() (lines 93-99) accepts lowercase alphanumeric slugs including yes, 123, and null. PyYAML then parses those as bool/int/null, so the generated skill fails the bundled validator — quick_validate.py:56-58 rejects a non-string name. Proposed fix: quote the name in the template (name: "{skill_name}"), so YAML-ambiguous slugs stay strings; optionally also reject YAML 1.1 boolean/null-like names in the normalizer.