Skip to content

Add AGENTS.md, the always-load docs and the docs check - #2

Merged
dinoderek merged 5 commits into
mainfrom
docs/agents-entrypoint
Oct 20, 2026
Merged

dinoderek merged 5 commits into
mainfrom
docs/agents-entrypoint

Conversation

@dinoderek

@dinoderek dinoderek commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Objective

Makes AGENTS.md the single entrypoint, with CLAUDE.md as a symlink to it. It is also the only routing: the README now just points to it.

  • Always-load set: docs/project-brief.md, docs/architecture.md, docs/project-structure.md, docs/testing-strategy.md and docs/quality-gates.md. With AGENTS.md that is 3,367 of 4,000 words; AGENTS.md alone is 983 of 1,000.
  • Load on demand: the existing docs are now rows in its table.
  • New docs-check lane, Go in devtools/internal/checks/docs.go and docrefs.go. It enforces:
    • word budgets per doc and for the always-load set;
    • links resolve and cited paths exist;
    • the one-line Owns/Not here header;
    • index completeness, and the CLAUDE.md symlink;
    • real lane citations;
    • no tracker references or design/ file paths, in docs or code.
  • design/ is ephemeral and exempt, and docs/quality-gates.md says so.
  • Guideline fixes in docs/project-context.md: AGENTS.md's sections, what a persistent doc is, the entrypoint exemption, budget scope, what the check verifies, the tracker patterns, and the ephemeral directory.

Gates

Lane Result Evidence
./dev test (every required lane) PASS all 9 lanes PASS locally, coverage above 93% of statements; CI run below
  • New or changed tests:
    • devtools/internal/checks/docs_test.go: a passing tree, plus one failing case per rule: budgets, sets, the index, the header, links in four forms, line citations, lanes, tracker patterns (including in .github/) and relative ephemeral paths. It also proves the false-positive guards: host:port, module paths, placeholders and ignored outputs.
    • devtools/internal/dev/worktree_test.go: a squash-merged branch is deleted on release.
  • Not run, with reason: none.

Rulings

Ruling (risk: low): the docs check is a dev check docs subcommand in devtools/internal/checks, not its own package.
Why: it uses the same Env, runner and report helpers as the other lanes, and the import rules stay unchanged.
If wrong: move two files into a new package and add an import rule.

Ruling (risk: low): the entrypoints that skip the index (AGENTS.md, README.md) are fixed in code, not registry rows.
Why: a registry row would let one line switch the index rule off for any doc.
If wrong: one constant in docs.go.

Ruling (risk: low): ./dev worktree release asks gh pr view for the PR's state when git branch -d refuses. On MERGED it force-deletes the local branch and deletes the remote one.
Why: a squash merge looks unmerged to git once GitHub deletes the remote branch, and the workflow's cleanup step should be one verb.
It deletes only when the branch tip equals the PR's headRefOid, and deletes the remote branch with a lease on that same commit, so no later commit is lost.
If wrong: devtools/internal/dev/worktree.go.

Review

  • Fresh reviewer: a Claude Code subagent (Claude Opus 5.5), with AGENTS.md as its checklist. Round 1: CHANGES_REQUESTED, with 7 gate holes, 2 false positives and 4 inaccuracies, all fixed. Round 2: CHANGES_REQUESTED: worktree release could delete commits made after a merged PR, so it now deletes only at the PR's merged head. Round 3: APPROVED.
  • Declined findings:
    • Indented code blocks are checked as prose. The docs use fences only, and four-space detection would misread nested-list continuation lines as code, so they would silently stop being checked.
    • A branch name in a code span whose first segment exists reads as a missing path. The docs write branches as placeholders. A guard loose enough to skip them would also skip real missing directories, and that fails open.
    • A digit-only hex colour reads as an issue number. The repo has no CSS, and this error fails closed.
    • issue:42 (colon, no #) is not caught. Catching it would also flag prose like "issues: 3". issue:#42, issue 42 and issue #42 are caught.
  • Review hard: devtools/internal/checks/docrefs.go, where the path and tracker heuristics are, and fail-open matters most. AGENTS.md: are the rules inline and complete?

Deviations

  • 10fe53c was pushed with docs-check failing: its new comment cited a design/ path, and my check of the gate result swallowed the exit code. The next commit rewords the comment; the head is green locally and in CI. Both commits change only comments since the approved review.

🤖 Generated with Claude Code

dinoderek and others added 5 commits October 20, 2026 18:32
AGENTS.md is the single entrypoint (CLAUDE.md links to it) and the only
routing: the README points to it. The always-load set is the project
brief, architecture, project structure, testing strategy and quality
gates. The docs-check lane enforces word budgets, links and cited paths,
the Owns/Not here header, index completeness, real lane citations, and no
tracker or ephemeral references in docs or code. design/ is exempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scan .github/ for tracker references, catch relative paths into design/,
word-prefixed and relative-URL issue references, titled, angle-bracket,
reference and href links, and drop the unindexed row type so only the two
entrypoints skip the index. host:port and module paths no longer read as
paths. worktree release deletes a branch whose PR merged, and AGENTS.md
names what the check leaves to the reviewer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
worktree release deletes a branch only when it still points at the
commit its PR merged, and deletes the remote branch only at that same
commit. Also catch dir/../design/ paths and single-quoted hrefs, and
stop reading "issues: 3" as an issue reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinoderek
dinoderek merged commit 42ae89f into main Oct 20, 2026
1 check passed
@dinoderek
dinoderek deleted the docs/agents-entrypoint branch October 20, 2026 17:54
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.

1 participant