codex icon indicating copy to clipboard operation
codex copied to clipboard

skill-creator: name validation diverges from Agent Skills Unicode and directory-match rules

Open deepstorm1-maker opened this issue 3 days ago • 0 comments

Summary

The bundled Skill Creator validator does not fully enforce the Agent Skills name field rules: it rejects valid Unicode lowercase names, accepts names that do not match the skill directory, and silently trims surrounding whitespace before validation. The initializer also normalizes non-ASCII letters away.

Specification

The Agent Skills specification says that name:

  • is 1–64 characters;
  • uses Unicode lowercase alphanumeric characters and hyphens;
  • does not start/end with a hyphen or contain consecutive hyphens;
  • must match the parent directory name.

Source: Agent Skills specification — name field.

Affected source

Current openai/codex main was inspected at 9baf9789e1b0db1d12080020017b73311950723e.

The validator uses the ASCII-only expression ^[a-z0-9-]+$, strips the value before checking it, and never compares it with the directory name. The initializer replaces every non-ASCII character with a hyphen before collapsing separators.

Reproduction

Valid Unicode name rejected

Create directory café/ with:

---
name: café
description: A valid skill description.
---
Instructions.

Run quick_validate.py café.

Actual: exit 1, Name 'café' should be hyphen-case (lowercase letters, digits, and hyphens only).

Expected: accepted under the specification's Unicode lowercase alphanumeric rule.

Directory mismatch accepted

Create directory other-skill/ with:

---
name: paper-trail
description: A valid skill description.
---
Instructions.

Actual: exit 0, Skill is valid!.

Expected: reject because the frontmatter name does not match the parent directory.

Surrounding whitespace accepted

Create directory paper-trail/ with:

---
name: " paper-trail "
description: A valid skill description.
---
Instructions.

Actual: exit 0 because the validator strips the name before checking it.

Expected: reject the nonconforming raw value rather than silently normalize it.

Initializer changes a Unicode name

Run:

python3 codex-rs/skills/src/assets/samples/skill-creator/scripts/init_skill.py café --path "$TMP"

The current normalizer turns café into caf, rather than preserving the valid Unicode slug.

Expected behaviour

The validator and initializer should implement the same documented name contract. Valid Unicode lowercase alphanumeric names should be preserved and accepted; names that violate the character rules or do not match the skill directory should be rejected.

The specification does not define a Unicode normalization policy for canonically equivalent spellings. Any normalization policy should be explicit and tested rather than silently assumed.

Validation

The three validator cases and the initializer normalization case were reproduced against the current source snapshot in temporary directories. The current validator rejected the Unicode case, accepted the directory mismatch, and accepted the padded name. The initializer normalized café to caf.

The tests used Python 3.13.5 and PyYAML 6.0.3. No repository or installed skill files were modified. Full Codex build and CI were not run.

Related reports

  • #64757 covers YAML scalar quoting for otherwise valid ASCII slugs such as yes, 123, and null; it is a separate serialization defect.
  • #44187 covers empty required metadata.

deepstorm1-maker avatar Nov 30 '26 16:11 deepstorm1-maker