Add the "reprexes" skill (.claude/skills/reprexes)#282
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a repository-local Claude Code skill (reprexes) documenting a workflow for isolating bugs into minimal reproducible examples (reprexes), with specific guidance for R and Quarto debugging.
Changes:
- Added a new
.claudeskill definition and documentation for creating and iterating on reprexes. - Included R/Quarto-specific recommendations, including use of the
{reprex}package and targetedquarto renderworkflows.
| payoff is real: ~80% of the time, the act of building a thorough reprex | ||
| surfaces the cause on its own — the noise you strip away was hiding it. |
| - When the bug might be **version-dependent**, capture `sessionInfo()` (or | ||
| run `tidyverse_update()`) in the reprex so versions are part of the record. |
|
…ate/lintr accuracy fixes)
…ording, tempfile note)
| `Rscript /tmp/reprex.R` (a fresh process — no stale `globalenv()` state | ||
| masking or faking the bug). For a Quarto page, render just that file: | ||
| `quarto render /tmp/reprex.qmd --to html`, not the whole site. |
| Copy the code and call `reprex::reprex()` (reads the clipboard by default), | ||
| or point it at a file with `reprex(input = "/tmp/reprex.R")` — handy from a | ||
| non-interactive CLI session where there's no clipboard. Useful arguments: |
| - When the bug might be **version-dependent**, capture `sessionInfo()` (or set | ||
| `session_info = TRUE` above) in the reprex so versions are part of the |
|
@claude review |
|
Claude finished @d-morrison's task in 1m 18s —— View job Code Review
Overall: This is a well-structured, accurate, and practical skill document. The workflow is sound, the R-specific details are correct, and the guidance is actionable. Two issues from the existing Copilot review comments remain unaddressed and are worth fixing before merge. Issues to fix1. Namespace inconsistency — The file introduces the function as reprex(input = "/tmp/reprex.R")This will fail unless the package is explicitly attached with reprex::reprex(input = "/tmp/reprex.R")2. Rscript /tmp/reprex.R
Rscript --vanilla /tmp/reprex.Rwould be more consistent with that goal. ( Already addressed
Minor observations (no action required)
|
|
Claude Code CLI (local session) is working on this — paws off until I'm done. |
|
@claude review |
- Use reprex::reprex(input = ...) instead of bare reprex() for copy/paste reliability without an explicit library(reprex). - Use Rscript --vanilla in the clean-session step so .Rprofile/.Renviron don't silently affect reproducibility. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Addressed both remaining findings from the latest review:
The earlier inline notes (the @claude review |
|
Claude finished @d-morrison's task in 1m 17s —— View job Code Review
Overall: The file is in good shape. Both issues flagged in the prior reviews (Copilot and previous Claude pass) have been resolved. No blocking issues remain. Previously reported issues — now fixed✅ ✅ ✅ ✅ Unsourced statistic — the "~80% of the time" claim is gone. Minor observations (no action required)
This is ready to merge from a content-accuracy standpoint. |
|
Claude finished @d-morrison's task in 1m 7s —— View job Code Review
Overall: Both claimed fixes are confirmed and correctly applied. The document is accurate, actionable, and ready to merge. No blocking issues remain. Fixes verified1. Namespace consistency — confirmed Both calls are now correctly namespaced: reprex::reprex() # line ~98, clipboard variant
reprex::reprex(input = "/tmp/reprex.R") # line ~99, file variantNo bare 2. Clean-session flag — confirmed Step 3 now reads: Rscript --vanilla /tmp/reprex.RAnd correctly explains: " Minor observations (no action required)
This PR looks good to merge. |
| portable path). Put in it, in order: | ||
| - the package loads (`library(...)`), | ||
| - the minimal data (see tactics below), | ||
| - the minimal code that triggers the phenomenon, with a comment marking | ||
| where it goes wrong. |
| formats a reprex for sharing: it runs your code in a clean, separate R | ||
| session (via `callr` since reprex 2.0) and emits code **plus actual | ||
| output**. |
| output is destined for a PR comment or an upstream issue. Useful arguments: | ||
| - `venue =` — output format: | ||
| - `"gh"` — GitHub-flavored Markdown (default) | ||
| - `"so"` / `"ds"` — Stack Overflow / Discourse | ||
| - `"slack"` — Slack message | ||
| - `"r"` — runnable R script with commented output | ||
| - `"html"` — HTML | ||
| - `"rtf"` — rich text for presentations |
|
Claude Code CLI (local session) is working on this — paws off until I'm done. |
Qualify reprex_clean(), reprex_rescue(), reprex_invert(), and the remaining bare reprex() reference with reprex::, matching the already- namespaced reprex::reprex() calls. They're code-formatted function references, so the namespace reads naturally. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Addressed the minor observation. Namespaced the companion helpers: @claude review |
|
Claude finished @d-morrison's task in 2m 43s —— View job Code Review
Overall: The claimed namespace fixes are confirmed. Three minor issues from the most recent Copilot pass (2026-06-03T22:22:05Z) remain unaddressed — two are trivial blank-line fixes, one is a factual accuracy question. Claimed fix verified — ✅All three companion helpers are now correctly namespaced: The two other bare Remaining issues (new Copilot comments, not yet addressed)1. Missing blank line before the nested bullet list in step 2 (line ~62) The sub-list after "Put in it, in order:" has no blank line separator: portable path). Put in it, in order:
- the package loads (`library(...)`), ← no blank line before thisStandard CommonMark / GitHub Markdown requires a blank line before a list inside a numbered list item for consistent rendering. Fix: add a blank line after Fix this →.%20Put%20in%20it%2C%20in%20order%3A%22%20add%20a%20blank%20line%20before%20the%20%22-%20the%20package%20loads%22%20nested%20bullet%20list%20to%20match%20the%20repo%E2%80%99s%20%22blank%20line%20before%20lists%22%20markdown%20formatting%20rule.&repo=UCD-SERG%2Flab-manual) 2. "since reprex 2.0" qualifier is likely inaccurate (line 97) session (via `callr` since reprex 2.0) and emits code **plus actualThe 3. Missing blank line before "Useful arguments:" and before the output is destined for a PR comment or an upstream issue. Useful arguments:
- `venue =` — output format:
- `"gh"` — GitHub-flavored Markdown (default) ← no blank line before nested listTwo spots need blank lines: before the Previously verified (no action needed)All fixes from earlier review rounds are intact: The blank-line issues are cosmetic/render-safety; the |
|
Claude Code CLI (local session) is working on this — paws off until I'm done. |
…0' qualifier Address latest Copilot review: - Add blank line before the nested bullet list in step 2 and before the 'Useful arguments' / nested venue lists, per the repo's blank-line-before- lists markdown convention. - callr-backed clean-session execution dates to reprex 0.1.0 (2017), not 2.0, so drop the inaccurate '(via callr since reprex 2.0)' version qualifier. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Addressed the 3 remaining items from the latest Copilot pass (commit f296acd):
@claude review |
|
Claude finished @d-morrison's task in 53s —— View job Code Review
Overall: All three claimed fixes are confirmed and correctly applied. The document is accurate, clean, and ready to merge. No blocking or minor issues remain. Fixes verified — ✅ all three1. Blank line before nested list in step 2 portable path). Put in it, in order:
- the package loads (`library(...)`),Blank line is present. ✅ 2. Blank lines before "Useful arguments:" list and nested output is destined for a PR comment or an upstream issue. Useful arguments:
- `venue =` — output format:
- `"gh"` — GitHub-flavored Markdown (default)Both blank lines are present. ✅ 3. "since reprex 2.0" qualifier dropped The line now reads: session (via `callr`) and emits code **plus actual output**.Version qualifier is gone. ✅ Full document check (no action needed)
This PR is ready to merge. |
|
Done with my local session — unclaiming. (Re-triggered @claude review on the latest commit.) |
|
Claude finished @d-morrison's task in 1m 15s —— View job Code Review
Overall: All previously reported fixes are confirmed in place. The latest Copilot pass (2026-06-03T22:58:09Z) had no new comments. No blocking or minor issues remain — this PR is ready to merge. All fixes verified — ✅Namespace consistency
Clean-session flag
Blank lines before nested lists
Unsourced statistic — the "~80% of the time" claim is gone ✅ Full document check (no action needed)
This PR is ready to merge. |
|
Claude Code CLI (local session) is working on this — paws off until I'm done. |
Summary
Adds a project-level Claude Code skill at
.claude/skills/reprexes/SKILL.md.reprexes captures a debugging workflow: when a technical problem is hard to pin down, isolate it into a minimal reproducible example ("reprex") and iterate candidate fixes on that fast, clean loop instead of inside the full application — then port the fix back. Includes the R/Quarto
reprexpackage workflow (reprex::reprex(),venue/session_info/std_out_err).References: https://r4ds.hadley.nz/workflow-help.html#making-a-reprex, https://reprex.tidyverse.org/.
Vendoring it here makes it available to collaborators and the
@claudeCI bot in this repo (previously it lived only in a personal user-level config).🤖 Generated with Claude Code