Skip to content

feat(scripts): flag docs-page links with no section anchor in skill and agent files - #15960

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15938-43425757645-1
Nov 13, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15938-43425757645-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #15938

Summary

Opened by the work-resolve-issue lane. The run's own summary:

scripts/validate-plugin-contracts.mjs now reports each docs-page link in a plugin skill or agent markdown file that has no #section anchor. The output is an advisory: line, which scripts/validate-plugins.sh never fails on (it fails only on warning: lines), and the line names the fix: link the section, <url>#<section>, per .claude/rules/skill-bodies-state-current-rules.md. A docs page is a docs.* host or a host whose path starts with /docs/. These do not count: upstream issue links and other non-docs URLs, a URL with a fragment, a URL that opens a code span (a command or fetch target), a Google Docs document or a PDF (neither has a section to link), and files under evals/, fixtures/ or vendor/. Current hits are recorded in a shrink-only baseline, scripts/docs-anchor-baseline.txt: 361 lines across 132 files under this definition, against the 246 the issue counted with a narrower sweep it did not specify. A file at or under its row prints nothing. A row above the file's current count fails as stale, so the list can only shrink. The validator was chosen because it is the one hygiene check that already reads every skill and agent file on every pull request, so no workflow edit was needed. Condition for making it blocking: once 30 days of pull requests pass with no advisory reported as a false positive, which is the ladder's guardrail criterion 3 (a blocking check has no effective false positives), turn the advisory into a failure for any file over its row and keep the baseline. Dogfooding step: this repository runs the check on its own skills and agents through scripts/validate-plugins.sh in check-catalog on every pull request. The baseline records this repository's own hits, so the first advisory any author sees is one their own change added.

Not verified

  • scripts/validate-plugin-contracts.test.sh was not executed: this lane runs no node or bash suites, and check-affected skipped validate-plugins because no plugin changed. Left to the PR's CI, which runs the suite and scripts/validate-plugins.sh over the whole tree. That run is also where it is…
  • Tidy skipped: every changed file is under scripts/, a listed shared path, so the change is not tidied.
  • Some baselined links are whole-page inputs rather than pointers (the docpage-digest queue's 26 pages, a command argument in docpage-digest/SKILL.md), so adding an anchor is the wrong fix for them. Their rows hold, and they print nothing. A per-line opt-out was not added.
  • No kill switch or expiring exception was added (ladder guardrail criterion 8). The check never fails on a hit, so neither is needed while it is advisory. Add both when it is made blocking.

Fix

  • scripts/validate-plugin-contracts.mjs: new advisory docs-anchor section. It scans plugins//skills/** and plugins//agents/** markdown for docs-page URLs with no #fragment, prints one advisory: line per link in a file over its baseline row, and fails stale or malformed baseline rows.
  • scripts/docs-anchor-baseline.txt: new shrink-only baseline of &lt;path&gt; &lt;line count&gt; rows (132 files, 361 lines), with the rule and the never-add-a-row instruction in its header.
  • scripts/validate-plugin-contracts.test.sh: new block 8h. A failing sample (anchorless links in a skill and an agent, one ending a sentence) must print advisories that name the fix, with no trailing punctuation and no failure line. A passing sample (an anchored docs link, an issue link, a code-span…

Verification

The runner ran each check from the base copy against 7d848e1:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 36 fragments valid (no plugin changed, so no fragment is owed)
  • check-changed-skills: no changed skills, nothing to gate; view-medium-lists clean
  • check-affected: 10 passed, 6 skipped over 3 changed files (validate-plugins skipped because no plugin changed; typos not installed)
  • cant-fail-scan --file scripts/validate-plugin-contracts.test.sh --check: PASS, no gating findings
  • Baseline measured with Grep using a regex whose per-line matches equal the validator's (consuming prefix and terminator in place of the JS lookarounds): 383 matching lines in 145 files, minus 19 lines in 11 files under evals/, fixtures/ or vendor/, minus 3 lines (1 Google Docs, 2 PDFs) whose rows…
  • Fresh-context review subagent: no correctness bugs. It independently re-ran an equivalent ripgrep and matched all 134 rows of the first baseline, and spot-checked scope-semantics.md=5 and go-faster git.md=11. Its two message findings (trailing punctuation leaking into the reported URL; Google Docs…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43425757645

Left out: the items under Not verified.

Related

#15938

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 7d848e198c233ceb163756b4b5a2f91682c6e3fc: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15960 (head 7d848e1)

No security issues found.

I read every hunk of all 3 changed files in .claude-lane/pr.diff. None of them matches a trusted-path glob.

  • scripts/validate-plugin-contracts.mjs adds an advisory-only check that reads text. It scans plugins/*/skills/** and plugins/*/agents/** markdown, skipping evals/, fixtures/ and vendor/, for docs-page URLs that have no # anchor.
    • A hit goes into the new advisories array and prints as an advisory: line. The only new entries in failures are malformed or stale rows in the baseline file.
    • It runs no shell commands, makes no network calls and evaluates nothing. It reads only scripts/docs-anchor-baseline.txt, from a fixed path under root. Paths in the baseline are only used as Map keys and are never opened, so they cannot be used for path traversal.
    • It does not touch tokens, secrets, permissions, trusted actors, the kill switch, or any merge hold or gate.
    • The ANCHORLESS_DOCS_LINK regex runs on one line of repository content at a time, and its backtracking is bounded. The worst a PR author could do is a slower validator run on their own PR, and they already control that code, so this is not a vulnerability.
  • scripts/docs-anchor-baseline.txt is a new data file of <path> <count> rows that can only shrink. It controls nothing beyond which advisory lines get printed.
  • scripts/validate-plugin-contracts.test.sh adds fixture test block 8h. It writes and removes files only under $TMP and adds no new commands.

No plugin manifests changed, and no standing instruction was deleted, narrowed or weakened, so the manifest and instruction-surface checks had nothing to apply to. The PR context holds no instructions aimed at this review.

This change spends no extra credits or usage.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 7d848e198c233ceb163756b4b5a2f91682c6e3fc: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no blocking or advisory findings

This was a full review, the first one on this pull request, covering every hunk of all 3 changed files: scripts/docs-anchor-baseline.txt, scripts/validate-plugin-contracts.mjs and scripts/validate-plugin-contracts.test.sh.

What changed: the plugin contract validator now flags any docs-page link with no #section anchor in plugin skill and agent markdown, outside evals/, fixtures/ and vendor/. Each hit prints an advisory: line, and the baseline file can only shrink.

What I checked

  • Advisory lines can't fail the build. scripts/validate-plugins.sh fails only on ^warning: lines or a non-zero exit (validate-plugins.sh#L77-L85).
  • Stale or malformed baseline rows do fail. They go through failures and exit 1, which is the intended ratchet.
  • The regex. I traced it by hand on the fixture inputs:
    • URLs with a fragment never match.
    • Trailing sentence punctuation is left out of the URL.
    • Google Docs links and PDFs are skipped.
    • Issue links don't match the host or path pattern.
    • A URL that opens a code span is skipped by the (?<!)` lookbehind.
  • Nothing outside this PR is mis-flagged. No plugin file links github.com/docs/…, the one path where an issue link could be mistaken for a docs page.
  • Path filter. parts[1] must be skills or agents, and the skip-dir check runs on parts.slice(2, -1). Both behave correctly for the fixture paths.
  • Tests. Block 8h's assertions match the real output format: the has_fail_line regex and the - <path>: <msg> failure lines.
  • Baseline counts. CI checks these: in pr-require-checks.yml, "Validate plugin and catalog manifests" runs the contracts pass over the whole tree whenever tests run. A row set too high would fail this PR's own CI. I spot-checked one row by eye (plugins/review/skills/code-review/reference/bundled-code-review.md 2) and found it plausible. I did not run anything.

Closing issue #15938, "Done when"

  • Reports an anchorless docs-page link in a skill or agent file, but not issue links: met. The pointer, helper and clean fixtures in block 8h cover it.
  • Advisory, with a shrink-only baseline, and the PR body states when it becomes blocking: met. The body names the 30-day no-false-positive condition.
  • Proven on a failing and a passing sample, and the message names the fix: met. The advisory text includes "link the section the pointer rests on (#
    )", and the test asserts it.
  • PR body names the dogfooding step: met. The check runs through validate-plugins.sh in check-catalog.

The PR body says the new test suite was not run by the authoring lane and is left to CI. That claim comes from the author and I have not verified it.

No .claude/rules/ file's paths: matches scripts/, so no path-scoped rules applied. I found no embedded instructions in the PR context.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 7d848e198c233ceb163756b4b5a2f91682c6e3fc, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 7d848e1

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-15960-7d848e198c233ceb163756b4b5a2f91682c6e3fc, expires on 2026-12-13.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=7d848e198c233ceb163756b4b5a2f91682c6e3fc rubric=8.4.16 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 2919019 Nov 13, 2026
51 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15938-43425757645-1 branch November 13, 2026 13:20
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 7d848e198c233ceb163756b4b5a2f91682c6e3fc. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate holds it on its risk score (evidence-unbound:claude-review: not bound: no-run;
  evidence-unbound:claude-security-review: not bound: no-run)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 2919019d6daca539ea3b62f252ec54cf9ce94530; later checks count it verified from this comment.

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.

Flag a docs-page pointer in a skill file that has no section anchor

0 participants