Contributor docs assert things about the repository that stop being true, and nothing notices.
Most of this issue has been overtaken. #1518 shipped scripts/check-agent-instructions.ts, which already covers the agent-file half — including a dangling check for an @ reference resolving to nothing. It deliberately scopes itself to "directories holding markdown addressed to an agent rather than to a reader", so docs/contributor/** is untouched by it.
Of the five instances that motivated this issue, zero remain: four were fixed by #1472, and the .agent/workflows/ reference was fixed by #1518. The two surviving scripts/codex-setup.sh references in dockerless-postgres.mdx belong to #1503, which deletes both the script and the guide.
So this is now purely preventive, and it should be an extension rather than a new script.
Scope
Extend scripts/check-agent-instructions.ts to a second file set — docs/contributor/**, *.md at the repo root — applying only the checks that make sense for prose addressed to a reader:
- a backtick-quoted string that looks like a repo-relative path must resolve
- a backtick-quoted string that looks like an npm package name must be declared in some
package.json
Reuse the existing markdown scanner. #1518's PR notes that its scanner had three parsing bugs its tests did not catch, because the tests covered the rules and not the parsing underneath — so add cases at the parsing layer, not only at the rule layer.
Do not extend into prose linting. Paths and package names only: checkable without judgement, and the only thing that actually broke.
Sequencing
After #1503, which removes the two remaining live instances. Starting before that means writing an allowlist entry you delete a week later.
Done when
pnpm run check fails when a contributor doc names a file or package that does not exist
- the check lives in the existing gate, not a second script
- the allowlist is short and every entry says why
Contributor docs assert things about the repository that stop being true, and nothing notices.
Most of this issue has been overtaken. #1518 shipped
scripts/check-agent-instructions.ts, which already covers the agent-file half — including adanglingcheck for an@reference resolving to nothing. It deliberately scopes itself to "directories holding markdown addressed to an agent rather than to a reader", sodocs/contributor/**is untouched by it.Of the five instances that motivated this issue, zero remain: four were fixed by #1472, and the
.agent/workflows/reference was fixed by #1518. The two survivingscripts/codex-setup.shreferences indockerless-postgres.mdxbelong to #1503, which deletes both the script and the guide.So this is now purely preventive, and it should be an extension rather than a new script.
Scope
Extend
scripts/check-agent-instructions.tsto a second file set —docs/contributor/**,*.mdat the repo root — applying only the checks that make sense for prose addressed to a reader:package.jsonReuse the existing markdown scanner. #1518's PR notes that its scanner had three parsing bugs its tests did not catch, because the tests covered the rules and not the parsing underneath — so add cases at the parsing layer, not only at the rule layer.
Do not extend into prose linting. Paths and package names only: checkable without judgement, and the only thing that actually broke.
Sequencing
After #1503, which removes the two remaining live instances. Starting before that means writing an allowlist entry you delete a week later.
Done when
pnpm run checkfails when a contributor doc names a file or package that does not exist