workflow: read a repo's canonical contributor doc before starting work - #1389
Conversation
UCD-SERG/serocalculator#661 (2026-08-10): serocalculator's CLAUDE.md names .github/copilot-instructions.md as the source of truth and calls itself a short orientation, but a session read only the short file before starting work. A docs-only PR shipped with no DESCRIPTION dev-version bump, and version-check.yaml caught it, costing a second commit. The rule already existed almost verbatim in memories/preferences.md, but memories/ files are not auto-loaded into a session's context the way CLAUDE.md and its @shared/... fragments are, so it went unconsulted. Add shared/workflow/read-canonical-doc-before-starting.md, wire it into CLAUDE.md, and point preferences.md's existing (more detailed, R-package-specific) bullet at it. Also fix a stale citation in that bullet: it named "tools.md" for the R-package PR CI gates section, which actually lives in memories/r-quarto.md.
Adding the @shared/workflow/read-canonical-doc-before-starting.md import in the prior commit bumped CLAUDE.md's anchored-import count from 79 to 80, per test_check_context_closure.py's own documented remedy for exactly this failure.
|
Claude finished review — View run Code Review: PR #1389 — "workflow: read a repo's canonical contributor doc before starting work"Scope note: This PR modifies the What changed
Verification performed
FindingsNo blocking issues. One optional, non-blocking observation (not tied to a specific enforceable rule, so not posted as a blocking finding): in
VerdictVerdictReady for merge |
…ypo (#1390) Record two learnings from UCD-SERG/serocalculator#661's ai-config follow-up (#1389): - memories/github.md: a session's egress proxy can block GraphQL entirely (403, "only the pinned set of PR-review operations is served") even while gh api user / gh api repos/<o>/<r> both return 200 over REST --- a second, distinct root cause for the check-pr-fully-clean.py failure already tracked in #1330, alongside the pre-existing GraphQL rate-limit case. - memories/github-mcp-tools.md: issue_write's method enum only accepts "create" or "update" --- guessing "add_comment" fails loudly and safely (no data touched), distinct from the already-documented silent clobbering when method: "update" is called with just a comment string as body. Claude-Session: https://claude.ai/code/session_01NbqvD8bSKpeTjDwYpQSHeR Co-authored-by: Claude <noreply@anthropic.com>
Incident
UCD-SERG/serocalculator#661(2026-08-10):serocalculator/CLAUDE.mdopens by naming.github/copilot-instructions.md"the source of truth for repository-specific style and workflow" and calling itself "a short orientation." A session read only the short file before starting work on that PR. A docs-only change shipped with noDESCRIPTIONdev-version bump, andversion-check.yamlcaught it ---copilot-instructions.mdline 645 states the requirement outright: "ALWAYS increment dev version number to be one ahead of main branch before requesting PR review." A second commit fixed the CI failure that a first read would have avoided.Why the rule was invisible
The rule already existed, word for word, at
memories/preferences.md's "Before opening a PR, read the repo's own agent/contributor instructions" bullet. It went unconsulted becausememories/files are not auto-loaded into a session's context the wayCLAUDE.mdand its@shared/...fragments are --- a session has to take the extra step of grepping/reading a memory file on demand, and nothing prompted that here.What this PR does
shared/workflow/read-canonical-doc-before-starting.md: read a repo's fuller canonical doc before starting work, not just before pushing --- distinct fromardi.md's pre-push self-review, which assumes the conventions are already known. Includes the incident above as its case record.CLAUDE.mdwith a new section between "Claim a GitHub PR/issue before working on it" and "Open a PR immediately after claiming an issue," percheck-purpose-before-reusing.md's guidance to place new fragments deliberately rather than force them into an oversized file (ardi.mdis already 1521 lines, well over the 1200-line advisory threshold, so the new content is not added there).memories/preferences.md's existing (more detailed, R-package-specific) bullet at the new fragment, and fixes a stale citation on the same line: it namedtools.mdfor the "R-package PR CI gates" section, which actually lives inmemories/r-quarto.md.test_check_context_closure.py's pinned anchored-import count from 79 to 80, per that test's own documented remedy for an@-import addition toCLAUDE.md.Verification
check-context-closure.py: exits 0; the new@shared/workflow/read-canonical-doc-before-starting.mdimport resolves.check-links.py: 1352 relative links across 474 files, none broken.check-memory-file-size.py: no memory file exceeds 1200 lines (preferences.mdis 1017).markdownlint-cli2: 0 issues in 500 files.check-new-line-breaks(real script from ad-morrison/ghacheckout): no lines missing semantic breaks.scripts/test_*.pysuite: all green except two suites (test_ai_session,test_compare_shell_forms) that are pre-existing failures onorigin/mainitself, unrelated to this diff, and already tracked in Two script test suites fail on a cleanmain: test_ai_session (4 cases) and test_compare_shell_forms (1 case) #1382.Placement decision
Considered adding the rule directly into
ardi.md's existing "Self-review against the project's own stated conventions before every push" section, since that's the nearest existing fragment on this topic. Rejected: that section is about self-reviewing a diff against already-known conventions before a push; this rule is about the moment before anything is known, at the start of work, andardi.mdis already oversized. A new, small, focused fragment (shared/workflow/check-open-prs-before-duplicating.md-sized) was the better fit.Closes nothing --- no existing tracking issue covers this; this PR is the tracking record and the fix in one, consistent with
CLAUDE.md's "Encoding reusable feedback into ai-config" section.Generated by Claude Code