Repository navigation
Add AGENTS.md, the always-load docs and the docs check - #2
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Makes
AGENTS.mdthe single entrypoint, withCLAUDE.mdas a symlink to it. It is also the only routing: the README now just points to it.docs/project-brief.md,docs/architecture.md,docs/project-structure.md,docs/testing-strategy.mdanddocs/quality-gates.md. WithAGENTS.mdthat is 3,367 of 4,000 words;AGENTS.mdalone is 983 of 1,000.docs-checklane, Go indevtools/internal/checks/docs.goanddocrefs.go. It enforces:CLAUDE.mdsymlink;design/file paths, in docs or code.design/is ephemeral and exempt, anddocs/quality-gates.mdsays so.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
./dev test(every required lane)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.Rulings
Ruling (risk: low): the docs check is a
dev check docssubcommand indevtools/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 releaseasksgh pr viewfor the PR's state whengit branch -drefuses. 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
AGENTS.mdas its checklist. Round 1: CHANGES_REQUESTED, with 7 gate holes, 2 false positives and 4 inaccuracies, all fixed. Round 2: CHANGES_REQUESTED:worktree releasecould delete commits made after a merged PR, so it now deletes only at the PR's merged head. Round 3: APPROVED.issue:42(colon, no#) is not caught. Catching it would also flag prose like "issues: 3".issue:#42,issue 42andissue #42are caught.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
docs-checkfailing: its new comment cited adesign/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