mcpbeat Sign in

R Package Development Agent Skill

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.

716 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
453
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/posit-dev/skills --skill r-package-development

The instruction itself

6 sections, as written by the author

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, use function() {...}.

Testing

  • Tests for R/{name}.R go in tests/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() and expect_false() in favour of a specific expectation which will give a better failure message.
  • When testing errors and warnings, don't use expect_error() or expect_warning(). Instead, use expect_snapshot(error = TRUE) for errors and expect_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.

Other skills for the same job

different authors, same section of the catalogue
Pyhealth
by christophacham
×3

Comprehensive healthcare AI toolkit for developing, testing, and deploying machine learning models with clinical data. This skill should be used when working with electronic health records (EHR), clinical prediction tasks (mortality, readmission, drug recommendation), medical coding systems (ICD, NDC, ATC), physiological signals (EEG, ECG), healthcare datasets (MIMIC-III/IV, eICU, OMOP), or implementing deep learning models for healthcare applications (RETAIN, SafeDrug, Transformer, GNN).

22k tokens
Pyhealth
by ComeOnOliver
×3

Comprehensive healthcare AI toolkit for developing, testing, and deploying machine learning models with clinical data. This skill should be used when working with electronic health records (EHR), clinical prediction tasks (mortality, readmission, drug recommendation), medical coding systems (ICD, NDC, ATC), physiological signals (EEG, ECG), healthcare datasets (MIMIC-III/IV, eICU, OMOP), or implementing deep learning models for healthcare applications (RETAIN, SafeDrug, Transformer, GNN).

39k tokens
Performance Engineer
by ComeOnOliver
×2

Expert performance engineer specializing in modern observability, application optimization, and scalable system performance. Masters OpenTelemetry, distributed tracing, load testing, multi-tier caching, Core Web Vitals, and performance monitoring. Handles end-to-end optimization, real user monitoring, and scalability patterns. Use PROACTIVELY for performance optimization, observability, or scalability challenges.

5k tokens
Test Automator
by ComeOnOliver
×2

Master AI-powered test automation with modern frameworks, self-healing tests, and comprehensive quality engineering. Build scalable testing strategies with advanced CI/CD integration. Use PROACTIVELY for testing automation or quality assurance.

5k tokens
Genlayer Intelligent Contracts
by internet-court
×1

Internet Court adapter for GenLayer Intelligent Contract supervision. Use to specify agent-performance rubrics, evidence schemas, decision outputs, and ERC-7710 connector expectations, while delegating actual GenLayer contract writing, linting, testing, deployment, and CLI interaction to the official GenLayer skills at https://skills.genlayer.com/.

2k tokens
Mtp Hot Reload
by microsoft
vendor ×1

> Suggests using Microsoft Testing Platform (MTP) hot reload to iterate fixes on failing tests without rebuilding. Use when user says "hot reload tests", "iterate on test fix", "run tests without rebuilding", "speed up test loop", "fix test faster", or needs to set up MTP hot reload to rapidly iterate on test failures. Covers setup (NuGet package, environment variable, launchSettings.json) and the iterative workflow for fixing tests. normally with dotnet test (use run-tests), applying test filters, producing TRX reports, CI/CD pipeline configuration, or Visual Studio Test Explorer hot reload (which is a different feature).

2k tokens
Airflow Dag Patterns
by lingxling
×1

Build production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.

4k tokens
Azure Cosmos DB Py
by lingxling
×1

Build production-grade Azure Cosmos DB NoSQL services following clean code, security best practices, and TDD principles.

2k tokens

How to use it

Copy the folder

Take posit-dev/r-package-development from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.