Skip to content

Add the "reprexes" skill (.claude/skills/reprexes)#239

Open
d-morrison wants to merge 7 commits into
mainfrom
add-reprexes-skill
Open

Add the "reprexes" skill (.claude/skills/reprexes)#239
d-morrison wants to merge 7 commits into
mainfrom
add-reprexes-skill

Conversation

@d-morrison
Copy link
Copy Markdown
Member

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 reprex package 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 @claude CI bot in this repo (previously it lived only in a personal user-level config).

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 27, 2026 02:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a repository-level Claude Code skill definition for creating “reprexes” (minimal reproducible examples) to support faster, cleaner debugging workflows in this repo.

Changes:

  • Introduces .claude/skills/reprexes/SKILL.md describing when/how to build a minimal reproducible example and iterate fixes outside full-context runs.
  • Includes R/Quarto-specific guidance for using the {reprex} package and clean-session execution patterns.

Comment thread .claude/skills/reprexes/SKILL.md Outdated
Comment thread .claude/skills/reprexes/SKILL.md Outdated
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 27, 2026

Claude finished @d-morrison's task in 1m 30s —— View job


Code Review — PR #239: Add the "reprexes" skill

  • Gather context and read changed files
  • Review SKILL.md content
  • Post review findings

Overall

This is a well-crafted, high-signal skill. The structure is clear, the procedure is actionable, and the R/Quarto specifics are accurate and genuinely useful. The supporting changes (.Rbuildignore, NEWS.md) are correct.

Two issues worth fixing, one structural note, and a handful of minor nits below.


Issues

1. tidyverse_update() is a side-effectful tool, not a diagnostic (medium)

[.claude/skills/reprexes/SKILL.md lines 130–134]

If you suspect *stale* packages are the cause,
`tidyverse::tidyverse_update()` outside the reprex can rule that out — but it
updates packages, it doesn't record versions, so don't put it in the reprex
itself.

The SKILL.md does correctly note this shouldn't go in the reprex, but suggesting it to "rule out stale packages" is still misleading. It installs the latest tidyverse packages — a side-effectful operation that changes the environment being debugged. It also covers only tidyverse packages, not the broader set of dependencies.

Better alternatives for version diagnostics:

  • packageVersion("pkg") — check a specific package
  • sessioninfo::session_info() — full snapshot of all installed packages

Suggested replacement:

When the bug might be **version-dependent**, capture versions via
`sessioninfo::session_info()` (or `session_info = TRUE` above). To check a
specific package's installed version: `packageVersion("pkg")`.

Fix this →


2. session_info = TRUE appends sessioninfo::session_info(), not sessionInfo() (minor)

[.claude/skills/reprexes/SKILL.md line ~116]

  - `session_info = TRUE` — append `sessionInfo()` / `sessioninfo::session_info()`,

The slash notation implies both are used. In reality, the reprex package uses sessioninfo::session_info() exclusively (via its dependency on the sessioninfo package). The base-R sessionInfo() is not involved here. Minor but could cause confusion.

Suggested: append \sessioninfo::session_info()` output`


Copilot's first comment — no action needed

Copilot flagged a reference to .lintr vs .lintr.R, but the current SKILL.md only says "Respect the repo's lint config" (no specific filename). This was likely flagged from an earlier revision. The current text is correct as-is.


Structural note

The reprex_invert() companion helper description is accurate (reprex_invert() recovers input code from a rendered reprex), but a small caveat would help: this helper is less commonly known and is primarily useful when working with rendered reprexes from others. Not blocking, just worth considering if the skill is used by less experienced contributors.


Minor nits

  • tempfile(fileext = ".R") / tempdir() for non-Unix machines is mentioned in two separate places (step 2 of Procedure, and the reprex(input = ...) note). Slight repetition but not harmful.
  • The "Validation bonus" label is informal but appropriate for the skill's tone — no change needed.

Verdict

The skill is ready to merge after addressing the tidyverse_update() wording (issue 1). Issue 2 is a minor fix that could go in alongside it. Everything else — structure, accuracy, procedure, reprex argument documentation, .Rbuildignore, NEWS.md — is solid.
Branch: add-reprexes-skill

@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

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

Copilot AI review requested due to automatic review settings May 27, 2026 04:27
@github-actions github-actions Bot review requested due to automatic review settings May 27, 2026 04:28
@d-morrison
Copy link
Copy Markdown
Member Author

@claude fix failing workflows; use .rbuildignore

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 27, 2026

Claude finished @d-morrison's task in 6m 8s —— View job


Fixing failing workflows — done

All four failing checks diagnosed and fixed in commit 525375d.

  • R-CMD-checkcheck-r-package runs with error-on: "note", and the new top-level .claude/ directory triggers a NOTE. Added ^\.claude$ to .Rbuildignore so it's excluded from the build tarball.
  • Version increment check — branch and main were both 0.0.0.9054. Bumped DESCRIPTION0.0.0.9055.
  • Check NEWS.md Changelog — the PR didn't touch NEWS.md. Added a changelog entry for the skill.
  • Spellcheck — failed on UCD / SeRG from NEWS.md:39 (a pre-existing line, not the skill). Added both to inst/WORDLIST.

Notes:

  • The spellcheck action scans package files (NEWS.md, R/, vignettes, etc.) but not .claude/, so SKILL.md itself wasn't the cause there.
  • The working-tree showed .claude/skills/reprexes/SKILL.md as deleted (the CI-environment artifact called out in the earlier review). I left that deletion unstaged, so the committed SKILL.md is untouched — the commit changes only .Rbuildignore, DESCRIPTION, NEWS.md, and inst/WORDLIST.

These changes should clear all four workflows on the next run. I can't re-run CI myself, but the new commit will trigger it.
Branch: add-reprexes-skill

github-actions Bot and others added 2 commits May 27, 2026 07:31
Add ^\.claude$ to .Rbuildignore so R CMD check (error-on note) no
longer flags the skills directory. Bump dev version for the
version-increment gate, add a NEWS.md entry for the changelog check,
and add UCD/SeRG to inst/WORDLIST to clear the pre-existing spellcheck
failure on NEWS.md.

Co-authored-by: Douglas Ezra Morrison <d-morrison@users.noreply.github.com>
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.

2 participants