Skip to content

checks: enforce skill link hygiene in check_skills.py - #225

Merged
sreejithraman merged 2 commits into
skills/cleanup-app-store-connect-linksfrom
checks/enforce-skill-link-hygiene
Nov 22, 2026
Merged

sreejithraman merged 2 commits into
skills/cleanup-app-store-connect-linksfrom
checks/enforce-skill-link-hygiene

Conversation

@sreejithraman

@sreejithraman sreejithraman commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Layer 4 of Stack #226 (on top of #224): locks skill link hygiene into deterministic CI checks in scripts/check_skills.py with TDD unit tests in scripts/test_check_skills.py.

  • scripts/check_skills.py: for Markdown files under skills/<name>/, parsed local hyperlinks (excluding images, external URLs, and root-relative paths) now fail CI on:
    1. Same-file links (including #anchor jump-links and self-path links).
    2. Back-links to the skill's own SKILL.md (catching ../SKILL.md, ../../SKILL.md, SKILL.md#section, etc., while permitting cross-skill links to other skills' SKILL.md).
    3. Duplicate local link targets in one file (normalizing resolved path, decoded ?query, and decoded #fragment so distinct section anchors or query strings into one target remain allowed).
    • Skips hygiene classification after missing-target errors so broken paths and symlink loops report missing link target cleanly without crashing or double-reporting.
    • Updates module docstring and summary output to document the enforced rules.
  • scripts/test_check_skills.py: adds 5 unit tests covering same-file links (including nested references/*.md), own-SKILL.md vs cross-skill links, duplicate links (path normalization and percent-encoded anchors) vs allowed exceptions (distinct section anchors, distinct query strings, duplicate external URLs, duplicate image embeds), missing targets and symlink loops, and unrestricted root docs (README.md).

Evidence

  • TDD red -> green cycle verified on scripts/test_check_skills.py (14/14 tests passing).
  • python3 scripts/check.py passes across all 63 skills (Checked 63 skills, local Markdown paths/anchors, and skill link hygiene. Ran 557 tests across 25 files).
  • Independent review-fix-loop (sreestack-link-hygiene-gate, 3 passes, Wave 2 Adversarial probed edge cases in scratch repo, Pass 3 Final Primary APPROVE) stamped on 6420bcc1.

Merge Danger

Low and reversible (checker and test files only). Enforces rules only inside skills/<name>/ Markdown files; root documentation (README.md, SOURCES.md, AGENTS.md) keeps unrestricted #anchor and duplicate link behavior.

@sreejithraman
sreejithraman added this pull request to stack #226 November 22, 2026 04:39
@sreejithraman sreejithraman changed the title checks/enforce skill link hygiene checks: enforce skill link hygiene in check_skills.py Nov 22, 2026
@sreejithraman
sreejithraman merged commit c26b3d3 into main Nov 22, 2026
2 of 3 checks passed
@sreejithraman
sreejithraman deleted the checks/enforce-skill-link-hygiene branch November 22, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant