r-package-development
Skill2 starsChanged 6 months agoMITView on GitHub
R package development with devtools, testthat, and roxygen2. Use when the user is working on an R package, running tests, writing documentation, or building package infrastructure.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ab604/claude-code-r-skillstheir own version, first seen Sep 17, 2026
- GiulSposito/r-claude-skillstheir own version, first seen Apr 14, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ab604/claude-code-r-skills★ 202same name
- GiulSposito/r-claude-skills★ 17same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- alt-textSkill
- brand-ymlSkill
- cliSkill
- cran-extrachecksSkill
- create-release-checklistSkill
- critical-code-reviewerSkill
- describe-designSkill
- ggsqlSkill
- implementSkill
- maintainer-declineSkill
- miraiSkill
- pr-createSkill
- pr-threads-addressSkill
- pr-threads-resolveSkill
- quarto-authoringSkill
- r-cli-appSkill
- release-postSkill
- review-testingSkill
- shiny-bslibSkill
- shiny-bslib-themingSkill
- testing-r-packagesSkill
- working-onSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Always run air format . after generating code.
- Very specific: line 45
Use the base pipe operator (|>) not the magrittr pipe (%>%).
- Very specific: line 46
Use \() ... for single-line anonymous functions.
- Distinctive: line 51
All new code should have an accompanying test.
- Distinctive: line 52
If there are existing tests, place new tests next to similar existing tests.
- Very specific: line 54
Avoid expect_true() and expect_false() in favour of a specific expectation which will give a better failure message.
- Very specific: line 55
When testing errors and warnings, don't use expect_error() or expect_warning().
- Distinctive: line 59
Every user-facing function should be exported and have roxygen2 documentation.
- Distinctive: line 63
Always re-document the package after changing a roxygen2 comment.
- Very specific: line 64
Use pkgdown::check_pkgdown() to check that all topics are included in the reference index.
- Very specific: line 68
Every user-facing change should be given a bullet in NEWS.md.
- Distinctive: line 70
If the change is related to a function, put the name of the function early in the bullet.
- Very specific: line 71
If the bullet is related to a GitHub issue or pull request, reference it by number in parentheses before the final period: (#123)..
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
R package development
Key commands
# Run code in the package
Rscript -e "devtools::load_all(); code"
# Run all tests
Rscript -e "devtools::test()"
# Run all tests for files starting with {name}
Rscript -e "devtools::test(filter = '^{name}')"
# Run all tests for R/{name}.R
Rscript -e "devtools::test_active_file('R/{name}.R')"
# Run a single test "blah" for R/{name}.R
Rscript -e "devtools::test_active_file('R/{name}.R', desc = 'blah')"
# Redocument the package
Rscript -e "devtools::document()"
# Check pkgdown documentation
Rscript -e "pkgdown::check_pkgdown()"
# Check the package with R CMD check
Rscript -e "devtools::check()"
# Format code
air format .Coding
- Always run
air format .after generating code. - Use the base pipe operator (
|>) not the magrittr pipe (%>%). - Use
\() ...for single-line anonymous functions. For all other cases, usefunction() {...}.
Testing
- Tests for
R/{name}.Rgo intests/testthat/test-{name}.R. - All new code should have an accompanying test.
- If there are existing tests, place new tests next to similar existing tests.
- Strive to keep tests minimal with few comments.
- Avoid
expect_true()andexpect_false()in favour of a specific expectation which will give a better failure message. - When testing errors and warnings, don't use
expect_error()orexpect_warning(). Instead, useexpect_snapshot(error = TRUE)for errors andexpect_snapshot()for warnings because these allow the user to review the full text of the output.
Documentation
- Every user-facing function should be exported and have roxygen2 documentation.
- Wrap roxygen comments at 80 characters.
- Internal functions should not have roxygen documentation.
- Whenever you add a new (non-internal) documentation topic, also add the topic to
_pkgdown.yml. - Always re-document the package after changing a roxygen2 comment.
- Use
pkgdown::check_pkgdown()to check that all topics are included in the reference index.
NEWS.md
- Every user-facing change should be given a bullet in
NEWS.md. Do not add bullets for small documentation changes or internal refactorings. - Each bullet should briefly describe the change to the end user.
- If the change is related to a function, put the name of the function early in the bullet.
- If the bullet is related to a GitHub issue or pull request, reference it by number in parentheses before the final period:
(#123).. - Order bullets alphabetically by function name. Put all bullets that don't mention function names at the beginning.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

