mirror of
https://github.com/addyosmani/agent-skills.git
synced 2026-10-26 15:05:04 +00:00
ci: add a gate for references/ links in skills
The path fix has no regression guard: nothing in CI resolves references/ links, so all 18 were broken while CI stayed green. validate-artifact- paths.js is scoped to spec/plan/todo artifacts and says in its own header that it is not a general markdown path linter. Add validate-reference-links.js, which resolves every `references/*.md` link in skills/*/SKILL.md against that skill's own directory. This accepts both conventions in CLAUDE.md: shared checklists reached via ../../references/, and a skill's own colocated references/ directory. Scope stays narrow on purpose. Skills legitimately name paths that do not exist yet -- tasks/todo.md, PERF.md, docs/ideas/[idea-name].md -- and a general markdown linter would fail the build on them. A test pins that. Proven against the pre-fix tree: 18 error(s), exit 1, matching the 18 links fixed in the previous commit. After the fix: 0 error(s), exit 0. 7 unit tests cover the regression itself, colocated references/, markdown-link syntax, a renamed target, multiple violations in one skill, and the non-reference paths that must be ignored. Wired into the validate-skills job, alongside the other skill-content checks. Known limitation: fenced code blocks are not stripped, so a SKILL.md that documents the anti-pattern inside a fence would be flagged. Nothing does today. Sharing stripFencedCodeBlocks looks right once #444 lands. Refs #468 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
91d4d07522
commit
b293c02481
3 files changed
+262
No files matched your search
@@ -34,6 +34,12 @@ jobs:
|
||||
- name: Run skill evals (trigger + routing)
|
||||
run: node scripts/run-evals.js --min-rank1 80
|
||||
|
||||
- name: Validate references/ links in skills
|
||||
run: node scripts/validate-reference-links.js
|
||||
|
||||
- name: Test reference-link validator
|
||||
run: node --test scripts/validate-reference-links-test.js
|
||||
|
||||
validate-commands:
|
||||
name: Validate command parity and description sync
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in new issue
Block a user