Skip to content

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

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

Add the "reprexes" skill (.claude/skills/reprexes)#239
d-morrison wants to merge 8 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

claude Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

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


Code Review — PR #239

  • Read changed files and gather context
  • Review SKILL.md content
  • Check issues flagged by prior reviewers
  • Post review feedback

Summary

This PR adds a well-structured Claude Code skill for building minimal reproducible examples ("reprexes"), updates .Rbuildignore to exclude .claude/ from the R package build, and adds a NEWS.md entry. The CI failures from the initial submission were fixed in 525375d. The overall quality is high — the skill is clear, practical, and R-aware. A few small issues worth noting:


.Rbuildignore

The regex ^\.claude$ is correct. No issues.


NEWS.md

Entry is concise and accurate. No issues.


.claude/skills/reprexes/SKILL.md

Strengths:

  • Clear frontmatter (user-invocable: true, correct allowed-tools)
  • Good scoping of when to use vs. skip the workflow ("Don't bother for a one-line obvious fix...")
  • Cross-platform path guidance (tempfile(fileext = ".R") / tempdir() for non-Unix)
  • The tidyverse_update() concern from the Copilot review is handled correctly: the text explicitly says to run it outside the reprex and not include it inside, which is the right advice.
  • The .lintr concern from the Copilot review no longer applies — the current text says "Respect the repo's lint config" without naming a specific file.

Issues:

  1. Namespace inconsistency (line ~94)
    The paragraph introduces reprex::reprex() (qualified), but the same sentence immediately drops to reprex(input = ...) (unqualified). This is a small inconsistency in documentation style:

    Copy the code and call `reprex::reprex()` (reads the clipboard by default),
    or point it at a file with `reprex(input = "/tmp/reprex.R")`
    

    Either qualify both or neither. Fix this →

  2. reprex_invert() — worth verifying (line ~111)
    The skill lists reprex_invert() as a companion helper "exported in reprex 2.x" and describes it as "the inverse of reprex() — recover the input code from a rendered reprex." This function does not appear in the current CRAN reprex reference (2.1.x). reprex_clean() and reprex_rescue() are real, but reprex_invert() may not be. If it doesn't exist, the description should be removed or corrected. Fix this →

  3. Working-tree note (non-blocking)
    SKILL.md shows as an unstaged deletion in the working tree (a known CI-environment artifact noted in the prior bot comment). The committed file is intact; this does not affect the PR.


Verdict

Ready to merge pending the two minor fixes above (namespace consistency and verifying reprex_invert()). Both are low-risk documentation-only changes if they need addressing.
Branch: add-reprexes-skill

@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

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 removed the request for review from Copilot May 27, 2026 04:28
@d-morrison

Copy link
Copy Markdown
Member Author

@claude fix failing workflows; use .rbuildignore

@claude

claude Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

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 3 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>
@d-morrison

Copy link
Copy Markdown
Member Author

@claude review

@claude

claude Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

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


Review — PR #239 (Add the "reprexes" skill)

Verdict: Looks good to merge. The skill content is accurate, the CI-fix commit (525375d) correctly addresses all four failing checks, and both Copilot reviewer concerns appear to have been addressed in subsequent commits (0cc8e3e, 265edad).


What I checked

CI-fix commit (525375d) verified end-to-end:

  • .Rbuildignore: ^\.claude$ appended in the existing dir-name style (^\.github$, ^\.devcontainer$, ^\.quarto$). ✓
  • DESCRIPTION: bumped to 0.0.0.9055. ✓
  • NEWS.md: changelog entry added at the top of the dev version section. ✓
  • inst/WORDLIST: contains UCD (line 20, 73) and SeRG (line 18, 72). ✓

Copilot reviewer comments — both already addressed in later commits:

  1. ".lintr vs .lintr.R may mislead readers" — the current SKILL.md does not name either file. The R/Quarto section just says "Respect the repo's lint config if the reprex code will be ported back" (SKILL.md:98). The earlier commit 265edad corrected this. For reference, this repo's .Rbuildignore ignores both ^\.lintr$ and ^\.lintr\.R$, and only .lintr.R exists on disk.

  2. "tidyverse_update() is an update helper, not a way to record versions" — the current text (SKILL.md:126–130) already makes that distinction explicit:

    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.

    And the doc separately recommends session_info = TRUE for version-dependent bugs (SKILL.md:113–115, SKILL.md:124) — which is exactly what the reviewer asked for.

Content spot-check (R/Quarto specifics):

  • reprex::reprex() runs in a fresh session via callr since 2.0 ✓
  • venue options (gh, so, ds, slack, r, html, rtf) ✓
  • session_info, std_out_err, wd arguments ✓
  • Companion helpers reprex_clean(), reprex_rescue(), reprex_invert() ✓ (all exported in reprex 2.x)
  • Rscript /tmp/reprex.R, quarto render … --to html, tempfile(fileext = ".R")
  • dput() for inline-serializing minimal data slices ✓

Nits (optional — not blocking)

  • SKILL.md:124 says "Capture sessionInfo() (or set session_info = TRUE above)" — minor point, but session_info = TRUE actually emits sessioninfo::session_info() output when the sessioninfo package is installed, falling back to base sessionInfo() otherwise. The doc already notes both upstream at SKILL.md:113, so this is fine as-is.
  • .Rbuildignore pattern ^\.claude$ is consistent with how the file ignores other top-level directories (e.g. ^\.github$). Works because R CMD build skips the whole subtree under a matching directory entry — no need for a trailing /.

Re: the working-tree deletion of SKILL.md

git status on the PR-bot's fresh checkout shows .claude/skills/reprexes/SKILL.md as unstaged-deleted — this is the CI-environment artifact already noted in the prior @claude comment. The committed file on add-reprexes-skill is intact (git show HEAD:.claude/skills/reprexes/SKILL.md returns the full 148-line skill). Nothing to fix on the PR.


Todo

  • Read changed files
  • Check repo conventions (.lintr.R, .Rbuildignore style, no root CLAUDE.md)
  • Verify CI-fix claims (DESCRIPTION bump, WORDLIST entries, NEWS entry)
  • Cross-check Copilot reviewer's concerns
  • Post review
    Branch

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