Repository navigation
ci(docs-gate): link-check every tracked markdown file - #359
Conversation
scripts/check-docs.mjs checked relative links only in a hardcoded list (AGENTS.md, README.md, docs/README.md, .memory/README.md, tests/e2e/README.md, the four docs categories, and .github/prompts/), so a dead link in .agents/skills/, .github/ISSUE_TEMPLATE/, .knowledge/, docs/metrics/, docs/security/, or any other Markdown file left the Docs integrity gate green — even though AGENTS.md promised the gate covered the docs tree. The link set is now derived from the tree walk the symlink check already does (hoisted ahead of section 2 with its SKIP_DIRS): every real-blob *.md is checked; symlinked Markdown stays out of the denominator (aliases are not docs and carry no cross-link obligations, ADR-0012; their content is checked at its canonical path, and a relative link cannot resolve from both the canonical path and the alias path); TEMPLATE.md files are skipped for their placeholder links; a symlinked directory is recorded and not descended, so .claude/skills does not double-count .agents/skills. Link regex, fenced-code stripping, Superseded-ADR handling, and external/anchor skips are unchanged. The walked set matches `git ls-files '*.md'` exactly: 52 tracked, minus 7 alias symlinks and 4 TEMPLATE.md = 41. That surfaced two dead links this newly covers, both to frostyard/core ADRs that have no counterpart in updex's docs/adr/ (the local equivalent is ADR-0012): .agents/skills/frostyard-acmm-conformance/SKILL.md (core ADR-0029) and .agents/skills/frostyard-repo-docs/SKILL.md (core ADR-0025) now use the absolute https://github.com/frostyard/core/blob/main/docs/adr/... URLs AGENTS.md and docs/org-adrs.md already use. .agents/skills/ is synced from core (core ADR-0026), so the same fix belongs upstream — it landed in frostyard/std the same way in std#29; until core takes it, a sync PR that reintroduces the relative links will go red here, which is the signal working. docs/README.md's gate bullet and AGENTS.md's docs-integrity-gate paragraph now state the wider scope instead of naming AGENTS.md/README.md/docs/. before: checked: 19 docs, 241 links, 9 symlinks after: checked: 19 docs, 261 links, 9 symlinks Negative control: appending [broken](./nope.md) to docs/metrics/README.md -> FAIL link: docs/metrics/README.md -> ./nope.md does not resolve, exit 1 (green on origin/main); file restored, git status clean. .coverage-thresholds.json and docs/adr/ untouched; make ci green. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR widens the docs-gate CI link-integrity check to cover Markdown across the whole repository checkout (not just a curated subset under docs/ and a few hand-picked files), so dead relative links in auxiliary documentation (skills, prompts, templates, etc.) can’t slip through undetected.
Changes:
- Refactors
scripts/check-docs.mjsto build the link-check set from a single repo tree walk shared with the symlink check. - Updates documentation to reflect the expanded link-check scope.
- Fixes two
.agents/skills/*/SKILL.mdlinks to use stable absolute URLs to frostyard/core ADRs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/check-docs.mjs | Hoists/combines the tree walk and uses it to drive link integrity checks across Markdown files. |
| docs/README.md | Documents that the docs gate’s link check covers Markdown beyond docs/. |
| AGENTS.md | Updates the docs-integrity gate description to match the expanded check scope. |
| .agents/skills/frostyard-repo-docs/SKILL.md | Replaces a core-relative ADR link with an absolute GitHub URL. |
| .agents/skills/frostyard-acmm-conformance/SKILL.md | Replaces a core-relative ADR link with an absolute GitHub URL. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
scripts/check-docs.mjs:38
- The tree-walk comment says these skipped directories are "not part of the tracked tree", but the implementation walks the working tree and does not restrict to git-tracked paths. That means untracked Markdown files (or symlinked dirs like a symlinked node_modules) can still be picked up and make local runs of the docs gate fail unexpectedly, and it also doesn’t strictly match the PR description’s "git ls-files" equivalence.
// completions/ and manpages/ are generated output; .worktrees/ and .codex/ are
// not part of the repository checkout. A symlinked directory is recorded as a
// symlink and not descended, so aliased trees are never double-counted.
What changed
scripts/check-docs.mjsbuilt its link-check file set from a hardcodedliteral (
AGENTS.md,README.md,docs/README.md,.memory/README.md,tests/e2e/README.md) plus loops over the fourdocs/categories and.github/prompts/. Anything else —.agents/skills/,.github/ISSUE_TEMPLATE/,.knowledge/,docs/metrics/,docs/security/,docs/patterns.md,docs/risk-tiers.md,docs/org-adrs.md,skills/README.md— could carry a deadrelative link and the
docs-gatejob stayed green, even though AGENTS.mdpromised the gate covered the docs tree.
The file set now comes from the tree walk the symlink check already did,
hoisted (with its
SKIP_DIRS) ahead of the link section:*.mdis checked;carry no cross-link obligations (ADR-0012),
their content is already checked at the canonical path, and a relative link
cannot resolve from both the canonical path and the alias path;
TEMPLATE.mdfiles are skipped for their deliberate placeholder links;.claude/skillsdoes not double-count.agents/skills.Link regex, fenced-code stripping, Superseded-ADR handling, and
external/anchor skips are unchanged.
frostyard/std's script afterfrostyard/std#29 is the model.
The walked set matches
git ls-files '*.md'exactly: 52 tracked Markdown files,minus the 7 alias symlinks (
CLAUDE.md,GEMINI.md,CONTRIBUTING.md,.github/copilot-instructions.md,docs/metrics.md,docs/quality.md,docs/review-rubric.md) and the 4TEMPLATE.mdfiles = 41 files.Dead links the wider set surfaced
Two, both in
.agents/skills/, both pointing at frostyard/core ADRs that haveno counterpart in updex's
docs/adr/(the local equivalent is ADR-0012):They are core-relative paths: correct inside frostyard/core, dangling in every
repo that syncs the skill. Both now use the absolute
https://github.com/frostyard/core/blob/main/docs/adr/…URLs that AGENTS.md anddocs/org-adrs.mdalready use.Evidence
node scripts/check-docs.mjs:Negative control —
[broken](./nope.md)appended todocs/metrics/README.md:The file was restored with
git checkout --before pushing;git status --porcelain docs/metrics/README.mdis empty.make ci→==> CI gate passed.git diff origin/main -- .coverage-thresholds.json docs/adr/is empty.Docs
docs/README.md's gate bullet and AGENTS.md's docs-integrity gateparagraph now state the wider scope instead of naming
AGENTS.md/README.md/docs/.Risk tier
Low — CI gate scope widening plus two link-only doc repairs. No product code
changes; the gate can only newly fail, never newly pass, and it is green on this
branch with the negative control proving the signal.