Repository navigation
Description
Fix order: 2 of 7 · Severity: P0 · Related: #173
Symptom
python3 scripts/validate-skill-yaml.py prints:
[skills] SKILL.md files: 80 — parse OK: 80
[.pi/skills] SKILL.md files: 80 — parse OK: 80
PASS: all SKILL.md YAML frontmatter valid (sources + .pi/skills)
pi 1.5.0 then rejects 10 of those exact files with Map keys must be unique. The gate that exists specifically to prevent "pi drops skills" reports green while the regression ships.
Root cause
-
scripts/validate-skill-yaml.py:41usesyaml.safe_load(PyYAML), falling back toscripts/lib/simple_yaml.py. Both accept duplicate keys silently, last-wins:PyYAML: {'<!-- story': 'e45s18', 'name': 'audit-code', 'model': 'haiku', 'effort': 'standard', 'description': '…'}pi uses the
yamlnpm package whereuniqueKeys: trueis the default and throws. -
The docstring at
scripts/validate-skill-yaml.py:8-11permits the buggy form: "Story tags (# story:/<!-- story: -->) must live INSIDE the frontmatter block as YAML comments".<!--is not a YAML comment. That sentence is the defect. -
No test compares the validator verdict against the parser the hosts actually use, so the two diverged silently across 39 files.
Fix direction
- R4: reject
<!--at the start of any line inside the frontmatter block. - Duplicate detection: walk
yaml.compose()nodes (or aBaseLoaderkey count) instead ofsafe_load, so a repeated key is a hard failure. - R5: restrict frontmatter to known keys plus
metadata:— the Agent Skills spec sanctionsmetadatafor vendor extensions (pidocs/skills.md:69-81);# story:comments are invisible to every parser anyway. - Golden test: pipe every
SKILL.mdthroughrequire("yaml").parsefrom the pi install so a validator/host divergence fails CI. Wire intonpm run complianceandscripts/run-verification-gates.sh. - Correct the docstring.
Verify
python3 scripts/validate-skill-yaml.py # MUST fail while #173 is open (proves the gate works)
# after #173 lands:
python3 scripts/validate-skill-yaml.py # passes
node -e 'parse each SKILL.md with the yaml package' # zero throwsEvidence
- pi 1.5.0
src/utils/frontmatter.tscallsparse()fromyaml;src/core/skills.ts:280-300drops the skill when it throws. - Regression history: pi claims some skills don't have a description #108 →
BUG-2026-08-06-pi-drops-skills-frontmatter→ pi: frontmatter story tags converted to HTML comments break YAML parsing — 10 skills dropped as "Map keys must be unique" (since 2.88.12) #173. The validator passed through both. scripts/lib/skill-common.sh:53,84explicitly skips comment lines when parsing frontmatter in bash, which hides the problem from the other half of the toolchain.
Activity
fix(skills): YAML comments for frontmatter story tags, and a gate tha…
chore(release): 2.93.4 [skip ci]
github-actions commentedon Nov 6, 2026
🎉 This issue has been resolved in version 2.93.4 🎉
The release is available on:
Your semantic-release bot 📦🚀