codex icon indicating copy to clipboard operation
codex copied to clipboard

Skill Creator quick validator rejects standard compatibility frontmatter

Open oaris-dev opened this issue 1 month ago • 4 comments

What issue are you seeing?

The bundled skill-creator/scripts/quick_validate.py rejects the standard optional compatibility frontmatter field as an unknown key, even when PyYAML is already available.

Observed diagnostic (exit code 1):

Unexpected key(s) in SKILL.md frontmatter: compatibility. Allowed properties are: allowed-tools, description, license, metadata, name

This is a defect in the helper's validation rules. It does not establish that the runtime skill loader rejects the field or that metadata has been removed.

What steps can reproduce the bug?

At upstream revision 67f0994b532b8740f14b5b738af7b7b2a915b1d6, create example-skill/SKILL.md:

---
name: example-skill
description: An example skill for validating environment requirements.
compatibility: Requires Python and an MCP connection.
---
Follow the requested workflow.

Using an existing Python environment with PyYAML:

python -B codex-rs/skills/src/assets/samples/skill-creator/scripts/quick_validate.py example-skill

The validator reports the unknown-key error above. The same failure was reproduced on four unchanged real skill files containing environment-requirement strings of 110 or 365 characters; two control skills without this field passed.

What is the expected behavior?

The Agent Skills specification permits optional compatibility metadata with 1–500 characters when supplied. OpenAI's skill documentation identifies the open Agent Skills standard.

The helper should accept a valid string, reject non-string/empty/over-length values, and preserve the existing validation rules. Useful MCP, plugin and other environment requirements should not need to be deleted to pass validation.

Additional information

Source identity: Pinned validator source.

  • Git blob: e27023ece4bd259ef36560e19995eec7b6a345bf
  • SHA256: ee6dba90f44d37171c5a6edb8095979c54919ff6822c1a907afca2e78c48738c
  • Local validation environment: macOS, Python 3.13.18, existing PyYAML 6.0.3. The helper has no independent semantic version.

Root cause: the explicit allowed_properties set omits compatibility. A narrow correction is to include that key and validate its supplied value as a string of 1–500 characters, without trimming, truncation or coercion. This does not require changing the runtime loader.

Local verification: an isolated, unpublished source correction passed 12 focused regression tests and validation of all six unchanged real skill inputs. Coverage includes omission, empty/1/500/501-character values, Unicode lengths, wrong YAML types, malformed/unsafe YAML, unknown keys and existing name/description/placeholder checks. The managed validator and all six original skill files remained unchanged; only the two files in the isolated source checkout were modified.

Changed-file formatting passed with local Ruff 0.16.1, which satisfies the declared range but differs from frozen CI 0.15.13. Supplemental lint retains the same two baseline findings (EXE001 and ISC004); the new test file has none. Full repository/hosted CI was not run. These are helper-level results, not runtime qualification or a released fix.

Related reports checked: #36245 and #24195 concern missing PyYAML; #43509 concerns Python-environment conventions; #44187 concerns empty required metadata and other preflight behavior. Their reviewed discussions do not cover this specific optional-field rejection. The empty-name/description behavior remains outside this report.

This is a bug report and root-cause analysis under the repository's contribution policy. No code was pushed, no external code PR was opened, and no patch was installed.

oaris-dev avatar Oct 31 '26 12:10 oaris-dev

I'm interested in working on this — please assign it to me.

akhil9tiet avatar Oct 31 '26 12:10 akhil9tiet

I dug into this and can confirm the root cause in the validator source. In codex-rs/skills/src/assets/samples/skill-creator/scripts/quick_validate.py, allowed_properties (line 40) is {"name", "description", "license", "allowed-tools", "metadata"} — compatibility is not in the set, so any SKILL.md frontmatter using the optional compatibility field (per the Agent Skills spec, 1–500 characters) hits the unexpected_keys branch and the helper exits 1 with 'Unexpected key(s) in SKILL.md frontmatter: compatibility'. I also checked main: the same omission is still present at the same line.

Proposed fix (sample script only, no runtime-loader change):

  • Add "compatibility" to allowed_properties.
  • When the key is present, validate its value as a non-empty string of 1–500 characters (reject non-string, empty, and over-length values), matching the spec's allowed range.

Happy to put up a PR once assigned.

akhil9tiet avatar Oct 31 '26 12:10 akhil9tiet

I can confirm this with codex-cli 0.171.0 on macOS (arm64). With PyYAML installed, a minimal skill that sets compatibility: Requires Python 3.11 or later. fails with:

Unexpected key(s) in SKILL.md frontmatter: compatibility. Allowed properties are: allowed-tools, description, license, metadata, name

The current main (afe555b) still has the same allowed_properties set at line 40 of quick_validate.py. For comparison, the Agent Skills specification lists compatibility as optional (1–500 characters), and the anthropics/skills copy of this validator already accepts it with a 500-character check. Bringing that change across would probably be a small fix.

ithinkihaveacat avatar Nov 27 '26 09:11 ithinkihaveacat

Related follow-up from the same current-source review: the validator also accepts invalid YAML types for optional fields that are already in its allowlist. Reproduced cases include numeric license, list-valued allowed-tools, scalar metadata, and non-string metadata values; all return exit 0 and “Skill is valid!” despite the Agent Skills field definitions.

I isolated these type/shape checks in #64761 so this issue can remain focused on the separate omission of the compatibility key.

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