Skip to content

fix(validator): per-file checks and check-placeholders.sh skip every skill since skills/ became symlinks #1490

Closed

Description

@dpol1

What

Since #1208 every skills/<name> entry is a symlink into plugins/magpie-<family>/skills/<alias>. Two linters walk skills/ without following those symlinks, so neither of them sees a single skill file:

Linter How it walks skills/ Files it finds there
skill-and-tool-validator, collect_files_to_check() (tools/skill-and-tool-validator/src/skill_and_tool_validator/__init__.py:1744-1749) base.rglob("*.md") 1 (skills/.pytest_cache/README.md)
tools/dev/check-placeholders.sh, SCAN_PATHS=("skills" "tools") (line 118), greps at lines 171 and 176 grep -r 0

Path.rglob() does not descend into symlinked directories, and grep -r only follows symlinks named on the command line, not the ones it meets while recursing. grep -R finds all 78 SKILL.md.

So everything run_validation() does inside its for path in files: loop is skipped for every skill: validate_frontmatter, validate_name_convention, validate_injection_guard, validate_principle_compliance, validate_privacy_patterns, validate_trigger_preservation, validate_asf_coupling, validate_skill_line_limit, and for all skill files validate_links, validate_placeholders, validate_security_patterns, validate_gh_list_limit, validate_lowercase_f_field, validate_branch_name_confidentiality. The repo-wide checks that go through collect_skill_dirs() (iterdir() + is_dir(), which does follow symlinks) still run.

Why it matters

CI and the pre-commit hook stay green while the per-file checks look at no skill at all; only the repo-wide checks still see them. test_real_repo_passes (tests/test_validator.py:879) says it "exercises every SKILL.md, every supporting file, and every internal link"; it passes because the collector hands it no skill file. Both copies of the placeholder check are blind at the same time, so the hardcoded-value class #1139 fixed can come back without any linter noticing.

With a collector that follows the symlinks, the per-file loop goes from 1 file to 251 and finds 77 violations on top of the 23 (all SOFT) the suite reports today. Three are HARD:

  • skills/release-prepare/SKILL.md: description + when_to_use is 1599 chars; Claude Code truncates past 1536.
  • skills/security-tracker-stats-dashboard/SKILL.md: missing injection-guard callout (Pattern 4), although the skill reads gh issue view.
  • skills/pr-management-triage/backport-check.md:15: anchor #backports not found in plugins/magpie-setup/templates/pr-management-config.md.

The other 74 are SOFT (39 trigger-preservation, 13 skill-line-limit, 11 principle-compliance, 8 ASF-coupling, 2 gh-list-limit, 1 privacy).

Suggested fix

  1. Make collect_files_to_check() follow the skills/<name> symlinks: iterate the skill directories, rglob("*.md") inside each resolved one, and de-duplicate on the resolved path. (rglob(..., recurse_symlinks=True) would be shorter, but it needs Python 3.13 and the tool declares >=3.11.)
  2. Switch the two greps in check-placeholders.sh from -r to -R. The reported paths stay skills/<name>/..., so the existing ALLOWLIST_PATHS entries keep matching.
  3. Fix the three HARD findings above in the same PR, otherwise test_real_repo_passes goes red as soon as the collector works.
  4. Add a test whose fixture lays skills out the way the repo does, real directories under plugins/*/skills/ and symlinks under skills/, so the collector cannot drop to zero files again without a failing test.

Found via

An architecture pass over the validator: collect_files_to_check() returned one file on a clean checkout of main (37670575).

Related

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions