Skip to content

Code review guidelines: add item 14, don't reinvent the wheel - #265

Merged
d-morrison merged 3 commits into
mainfrom
claude/dont-reinvent-wheel-principle-dv8r2h
Jul 18, 2026
Merged

d-morrison merged 3 commits into
mainfrom
claude/dont-reinvent-wheel-principle-dv8r2h

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Closes #264. Companion to d-morrison/ai-config#603.

Adds ### 14. Don't reinvent the wheel to CLAUDE.md's Code review guidelines: when a diff adds a new function or feature, check whether the functionality already exists — in one of the lab's own repos or in a trustworthy external source (base R, r-lib, tidyverse, a well-maintained CRAN package, the Actions marketplace) — and flag hand-rolled equivalents, preferring depending on, forking, or contributing to the existing implementation over re-building from scratch, with the standard escape hatches (unfit API, unmaintained, license-incompatible, heavy dependency for a one-liner).

Follows the existing pattern of items 3–13 (global standing rules cited from the d-morrison/ai-config corpus), using the hedged "proposed in ai-config#603 — once merged, the fragment lives at shared/principles/dont-reinvent-wheel.md" convention while the companion PR is open; the already-published shared/coding/prefer-packaged-functions.md (the R-function case) is cited in present tense.

No changelog.d/ fragment, per #247/#249 precedent for CLAUDE.md-only guideline changes. Verified clean against lint-markdown's bundled default config (MD013 is disabled there; the blanket 80-char default that flags pre-existing lines is not what CI runs).


Generated by Claude Code

…264)

Companion to Morrison-Lab/ai-config#603, which enshrines DRW as a dev and
review principle and starts a central big-picture-principles catalog.
Follows the hedged proposed-in-ai-config#N citation convention while
that PR is open. Per #247/#249 precedent, a CLAUDE.md-only guidelines
change takes no changelog.d fragment.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V5v5mUjURB2YW1nJW2Ai9S
Copilot AI review requested due to automatic review settings July 18, 2026 00:44
@github-actions
github-actions Bot removed the request for review from Copilot July 18, 2026 00:45
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread CLAUDE.md Resolved
@claude

claude Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Code review

Reviewed the new ### 14. Don't reinvent the wheel section added to CLAUDE.md's Code review guidelines. Verified the external citations: shared/coding/prefer-packaged-functions.md genuinely exists and covers the R-function case, and d-morrison/ai-config#603 genuinely is an open PR that adds shared/principles/dont-reinvent-wheel.md -- the "once merged" hedge is accurate. Numbering (item 14 following item 13), markdown/link syntax, and the no-changelog.d/-fragment precedent (#247/#249) all check out.

One finding, posted inline: the phrase ask for a "checked, nothing fit" note when it's missing introduces an undefined artifact -- this repo has no other reference to such a note, and unlike the changelog.d/ fragment convention it specifies no location or format. This is exactly the kind of ambiguity CLAUDE.md's own item 3 asks reviewers to flag.

Verdict

Needs minor tweaks -- the citation content and structure of the PR are otherwise sound; only the one inline wording clarification is outstanding before merge.

Comment thread CLAUDE.md Resolved
Copilot AI review requested due to automatic review settings July 18, 2026 00:52
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


The review is complete. Summary of what I found and posted on PR #265:

Verified accurate: the new item 14's citations to d-morrison/ai-config's shared/coding/prefer-packaged-functions.md (exists, covers the R-function case) and the still-open d-morrison/ai-config#603 (genuinely adds shared/principles/dont-reinvent-wheel.md) — the "once merged" hedge phrasing is accurate. Numbering, markdown/link syntax, and the no-changelog-fragment precedent (#247/#249) all check out.

One finding posted inline (#265 (comment), CLAUDE.md lines 709-712): the phrase ask for a "checked, nothing fit" note when it's missing introduces an undefined artifact — no location or format is specified, unlike the repo's changelog.d/ convention, and this exact wording appears nowhere else in the repo. This is the kind of ambiguity CLAUDE.md's own item 3 asks reviewers to flag; the source ai-config fragment does define it, but that detail wasn't carried into CLAUDE.md's condensed text.

A second candidate finding (citation-sentence structure differing from item 6's pattern) was checked and invalidated as a subjective stylistic preference, not a rule violation — it was not posted.

Top-level summary comment: #265 (comment)

Verdict

Needs minor tweaks — one inline wording clarification outstanding; otherwise ready for merge.

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $4.8452 (review) — run

@github-actions
github-actions Bot removed the request for review from Copilot July 18, 2026 00:53

Copy link
Copy Markdown
Collaborator Author

ARD summary for review round 1 (048eb38):

  1. Addressed — the "checked, nothing fit" note now specifies its location and wording: "ask for a note in the PR description or a code comment — 'checked existing options, nothing fit' — when it's missing", carrying over the detail from the cited ai-config fragment.

The same finding was posted in two duplicate inline threads; both are replied to and resolved. The push has already triggered the next review round.


Generated by Claude Code

Comment thread CLAUDE.md Resolved
@claude

claude Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Code review

Round-2 review. Confirming the prior review's sole finding is resolved, and posting one new finding.

Prior finding resolved: the ambiguous "checked, nothing fit" note (flagged inline on the round-1 diff) now specifies both where the note goes and its wording: "ask for a note in the PR description or a code comment — 'checked existing options, nothing fit' — when it's missing" (CLAUDE.md line ~712 on the current head). This carries over the location detail from the cited d-morrison/ai-config#603 fragment that the round-1 draft omitted. The prior verdict's "needs minor tweaks" is now addressed.

New finding, posted inline (CLAUDE.md:705): item 14's "trustworthy external source" examples — base R, r-lib, tidyverse, a focused well-maintained CRAN package, the GitHub Actions marketplace — aren't parallel. Every other entry is either the language itself, a named/curated org, or carries an explicit quality qualifier; "the GitHub Actions marketplace" names an open, unvetted registry with no such qualifier. This repo's own CLAUDE.md (line 180) points at README.md's ### Pinning third-party actions section, which requires every third-party action to be SHA-pinned and vetted precisely because the marketplace isn't uniformly trustworthy — so a literal reading of the new sentence could be taken as blanket-endorsing "just use a marketplace action," at odds with that documented posture. Suggested a one-line wording fix (qualify it as "a vetted, well-maintained ... marketplace action").

Also re-verified both external citations (shared/coding/prefer-packaged-functions.md and d-morrison/ai-config#603) directly — both still check out as accurate, and numbering/link/citation style still match items 1–13's conventions.

Verdict

Needs minor tweaks — one new, non-blocking wording suggestion outstanding (the marketplace-qualifier finding above); the round-1 finding is resolved and everything else checks out.

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Code review summary — #265

PR: "Code review guidelines: add item 14, don't reinvent the wheel" — adds a single new ### 14. Don't reinvent the wheel section (26 lines) to CLAUDE.md.

Round-1 finding, now resolved: the prior round flagged the "checked, nothing fit" note as ambiguous (no specified location/format). The author's follow-up commit (048eb38) fixed this — the current text now reads "ask for a note in the PR description or a code comment — 'checked existing options, nothing fit' — when it's missing," which specifies both. Verified via git diff and both CLAUDE.md-compliance agents.

New finding (posted inline, non-blocking): CLAUDE.md:705 — the "trustworthy external source" list (base R, r-lib, tidyverse, a focused well-maintained CRAN package, the GitHub Actions marketplace) isn't parallel: every other entry carries an implicit or explicit trust qualifier, but "the GitHub Actions marketplace" doesn't, even though this repo's own docs (README.md's "Pinning third-party actions" section, referenced from CLAUDE.md itself) require vetting/SHA-pinning every third-party action. A literal reading could be taken as endorsing "just use a marketplace action." Independently validated by an Opus agent before posting; included a small suggested wording fix.

Both external citations (shared/coding/prefer-packaged-functions.md, d-morrison/ai-config#603) were re-verified as accurate; numbering, link style, and structural conventions all check out against items 1–13.

Posted: 1 inline comment + 1 top-level summary comment referencing the prior review.

Verdict

Needs minor tweaks — one new, non-blocking wording suggestion outstanding; the round-1 finding is resolved and everything else checks out.

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $4.5409 (review) — run

Copilot AI review requested due to automatic review settings July 18, 2026 01:01

Copy link
Copy Markdown
Collaborator Author

ARD summary for review round 2 (bdd7547):

  1. Addressed — the marketplace entry now reads "a vetted, well-maintained GitHub Actions marketplace action — SHA-pinned per README.md's 'Pinning third-party actions' subsection", matching its siblings' trust qualifiers and the repo's documented pinning posture.

Round 1's finding was confirmed resolved by the round-2 review. All inline threads are resolved; the push has triggered round 3.


Generated by Claude Code

@github-actions
github-actions Bot removed the request for review from Copilot July 18, 2026 01:02
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Code Review — PR #265 (round 3)

I reviewed the current head commit (bdd7547d789fba0a4f5132ee7a4cc6ab49987220, merged into 1f9de94), which contains only commit 3 of the PR: the round-2 fix to the marketplace-qualifier wording.

Round-2 finding resolved. The previous review (comment, posted 2026-07-18T01:01:17Z) flagged that "the GitHub Actions marketplace" lacked a quality qualifier, unlike its sibling list entries. The current text now reads:

"...a focused, well-maintained CRAN package, a vetted, well-maintained GitHub Actions marketplace action — SHA-pinned per README.md's "Pinning third-party actions" subsection)."

This matches the round-2 suggestion and goes further, tying the requirement back to README.md's actual ### Pinning third-party actions subsection. I confirmed that subsection exists at README.md:317 and does require every third-party action be pinned to a full commit SHA — so the citation is accurate, not just plausible-sounding.

Round-1 finding remains resolved (verified again): the "checked existing options, nothing fit" note still specifies its location — "a note in the PR description or a code comment."

Re-verified both external citations directly (per this document's own item 4, fact-check external sources):

  • shared/coding/prefer-packaged-functions.md exists in d-morrison/ai-config and matches the R-function case described.
  • d-morrison/ai-config#603 is still open (not merged), and does add shared/principles/dont-reinvent-wheel.md as claimed — so the "once merged, the fragment lives at..." hedge remains accurate.

No new issues found in this round's diff. I checked for scope creep beyond the round-2 fix (none), numbering/link syntax (consistent with items 1–13), and AI-authorship tells (em-dash usage is heavy but consistent with the rest of the document's established style, not a new tell introduced by this diff).

Verdict

Ready for merge — both prior rounds' findings are resolved, external citations re-verified as accurate, and no new issues surfaced in this round's diff.

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $1.6366 (review) — run

@d-morrison
d-morrison merged commit bd8ecbc into main Jul 18, 2026
24 checks passed
@d-morrison
d-morrison deleted the claude/dont-reinvent-wheel-principle-dv8r2h branch July 18, 2026 01:24
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.

Code review guidelines: add "Don't reinvent the wheel" (DRW) item

2 participants