| name | cran-package-maintainer |
| description | Use when working in this repository to add or modify functions, documentation, tests, or CI while maintaining CRAN readiness. |
CRAN Package Maintainer
Purpose
This skill defines a conservative, CRAN-oriented workflow for modifying this R package repository.
The primary objective is to keep R CMD check --as-cran clean (no ERRORs, no WARNINGs, and no significant NOTEs) while the package evolves.
Operating rules
-
Never accept an R CMD check failure as “CI-only.” Reproduce locally and fix.
-
When you add or change exported objects:
-
When you add dependencies:
-
Add the package to Imports or Suggests in DESCRIPTION, based on whether it is needed at runtime.
-
If you import functions into the namespace, ensure NAMESPACE reflects that.
-
Keep NEWS and versioning consistent:
-
CI conventions:
Standard commands
Run these locally before pushing:
-
devtools::document()
-
devtools::test()
-
devtools::check()
Before a CRAN submission, run R CMD build and R CMD check --as-cran on the resulting tarball.
What to do when you touch common areas
R/ code
man/ docs
- If you change roxygen comments, regenerate man pages via
devtools::document().
tests/
DESCRIPTION
Examples
Add a new exported function
-
Create R/new-feature.R.
-
Write the function with roxygen2 comments including @export and minimal examples.
-
Add tests under tests/testthat/test-new-feature.R.
-
Run devtools::document(), devtools::test(), devtools::check().
Add a Suggests dependency for an optional feature
-
Add it to Suggests.
-
Guard usage with requireNamespace().
-
Add tests that skip if the dependency is not installed.