Skip to content

ci(docs-gate): link-check every tracked markdown file - #359

Merged
bketelsen merged 4 commits into
mainfrom
ci/docs-gate-link-every-markdown
Aug 19, 2026
Merged

bketelsen merged 4 commits into
mainfrom
ci/docs-gate-link-every-markdown

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

What changed

scripts/check-docs.mjs built its link-check file set from a hardcoded
literal (AGENTS.md, README.md, docs/README.md, .memory/README.md,
tests/e2e/README.md) plus loops over the four docs/ 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 dead
relative link and the docs-gate job stayed green, even though AGENTS.md
promised 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:

  • 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 already checked at the canonical path, and a relative link
    cannot resolve from both the canonical path and the alias path;
  • TEMPLATE.md files are skipped for their deliberate placeholder links;
  • a symlinked directory is recorded as a symlink 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. frostyard/std's script after
frostyard/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 4 TEMPLATE.md files = 41 files.

Dead links the wider set surfaced

Two, both in .agents/skills/, both pointing at frostyard/core ADRs that have
no counterpart in updex's docs/adr/ (the local equivalent is ADR-0012):

FAIL link: .agents/skills/frostyard-acmm-conformance/SKILL.md -> ../../../docs/adr/0029-acmm-conformance-via-canonical-aliases.md does not resolve
FAIL link: .agents/skills/frostyard-repo-docs/SKILL.md -> ../../../docs/adr/0025-consolidate-repository-docs-into-docs.md does not resolve

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 and
docs/org-adrs.md already use.

.agents/skills/ is synced from core (core ADR-0026), so the same repair
belongs upstream in frostyard/core
. It landed in frostyard/std the same way
(frostyard/std#29). Until core takes it, a core sync PR that reintroduces the
relative links will turn this gate red here — which is the signal working, not
a regression.

Evidence

node scripts/check-docs.mjs:

before (origin/main @ bf64924): checked: 19 docs, 241 links, 9 symlinks   exit 0
after  (this branch):           checked: 19 docs, 261 links, 9 symlinks   exit 0

Negative control — [broken](./nope.md) appended to docs/metrics/README.md:

FAIL link: docs/metrics/README.md -> ./nope.md does not resolve
ok   docs_index_coverage: 1.000 (required 1)
FAIL link_integrity: 0.996 (required 1)
ok   symlink_resolution: 1.000 (required 1)
checked: 19 docs, 262 links, 9 symlinks
EXIT=1

The file was restored with git checkout -- before pushing; git status --porcelain docs/metrics/README.md is 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 gate
paragraph 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.

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]>
@github-actions
github-actions Bot requested a lite review from Copilot August 19, 2026 14:15
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 19, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mjs to 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.md links 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.

Comment thread scripts/check-docs.mjs Resolved
Comment thread docs/README.md Resolved
Comment thread AGENTS.md Resolved
@github-actions
github-actions Bot requested a lite review from Copilot August 19, 2026 14:19
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bketelsen
bketelsen merged commit 968f6db into main Aug 19, 2026
16 checks passed
@bketelsen
bketelsen deleted the ci/docs-gate-link-every-markdown branch August 19, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants