Skip to content

bug(ci): validate-skill-yaml.py cannot detect the frontmatter form that drops skills in pi #207

Closed

Description

@danielvm-git

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

  1. scripts/validate-skill-yaml.py:41 uses yaml.safe_load (PyYAML), falling back to scripts/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 yaml npm package where uniqueKeys: true is the default and throws.

  2. The docstring at scripts/validate-skill-yaml.py:8-11 permits 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.

  3. 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 a BaseLoader key count) instead of safe_load, so a repeated key is a hard failure.
  • R5: restrict frontmatter to known keys plus metadata: — the Agent Skills spec sanctions metadata for vendor extensions (pi docs/skills.md:69-81); # story: comments are invisible to every parser anyway.
  • Golden test: pipe every SKILL.md through require("yaml").parse from the pi install so a validator/host divergence fails CI. Wire into npm run compliance and scripts/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 throws

Evidence

Activity

  1. added
    bug
    quality
    on Nov 6, 2026
  2. added a commit that references this issue on Nov 6, 2026
  3. github-actions commented on Nov 6, 2026

    @github-actions

    🎉 This issue has been resolved in version 2.93.4 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugqualityreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions