developing-r-packages

Enforce roxygen2 documentation and R CMD check quality gates for R package development.

5|1|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/wolf5996/agentic-skills --skill developing-r-packages
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: developing-r-packages
Source: https://github.com/wolf5996/agentic-skills/tree/main/developing-r-packages
Command: npx skills add https://github.com/wolf5996/agentic-skills --skill developing-r-packages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents broken or inconsistent R package development by enforcing a repeatable edit-document-check-commit workflow and strong conventions for dependencies, versioning, documentation, and releases.

Core Features & Use Cases

  • Edit → Document → Check discipline: Regenerate roxygen2 outputs with devtools::document() and require devtools::check() to pass with 0 errors and 0 warnings before committing.
  • Correct NAMESPACE and roxygen2 practices: Use @export and roxygen tags (e.g., @param, @return, @examples) while letting roxygen2 generate NAMESPACE.
  • Dependency and versioning rules: Use pkg::fn() for imports and follow strict semantic versioning with a 3-part x.y.z format; manage Imports vs Suggests correctly via usethis::use_package().
  • Release and CI workflow: Follow a structured release sequence (build readme, check, tag, GitHub release) and rely on GitHub Actions for pkgdown.

Quick Start

Use the developing-r-packages skill to update an R package by running the edit-document-check cycle with roxygen2, enforcing dependency/versioning rules, and producing a release that passes R CMD check before tagging and publishing.

Frequently Asked Questions about developing-r-packages

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pass R CMD check with zero warnings and errors before release?

To pass R CMD check, run devtools::document() to regenerate roxygen2 outputs and NAMESPACE, then run devtools::check() to enforce zero warnings and zero errors before committing or releasing.

How do I manage R package dependencies using usethis?

Manage R package dependencies by calling usethis::use_package() to correctly add packages to Imports or Suggests, and use the pkg::fn() syntax for all function calls to maintain strict dependency separation.

What is the correct workflow for roxygen2 documentation and NAMESPACE generation?

The correct roxygen2 documentation workflow involves adding @export and roxygen tags like @param and @return to code, then letting roxygen2 generate the NAMESPACE automatically via devtools::document() instead of manual editing.

How do I enforce semantic versioning in R package releases?

Enforce semantic versioning by maintaining a strict 3-component x.y.z format in the DESCRIPTION file, then follow a structured release sequence of checking, tagging, and publishing via GitHub releases.

What is the best way to set up GitHub Actions CI pipelines for R package development?

The best way to set up CI pipelines for R package development is relying on GitHub Actions to automate pkgdown builds and enforce the edit-document-check cycle with devtools::check() on every commit.

Why does R CMD check fail when I modify NAMESPACE manually?

R CMD check fails because NAMESPACE generation must be handled automatically by roxygen2 using @export tags, ensuring manual edits do not break dependency declarations or package imports during the check cycle.