一键导入
cran-package-maintainer
Use when working in this repository to add or modify functions, documentation, tests, or CI while maintaining CRAN readiness.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when working in this repository to add or modify functions, documentation, tests, or CI while maintaining CRAN readiness.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | cran-package-maintainer |
| description | Use when working in this repository to add or modify functions, documentation, tests, or CI while maintaining CRAN readiness. |
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.
Never accept an R CMD check failure as “CI-only.” Reproduce locally and fix.
When you add or change exported objects:
Update roxygen2 documentation.
Ensure examples run quickly and deterministically.
Add or update tests.
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:
Add a NEWS entry for user-visible changes.
Bump the version before a release.
CI conventions:
Use r-lib/actions v2 patterns for R checks.
Avoid legacy “comment-driven” PR automation unless explicitly requested.
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.
Add or modify functions in R/.
If exported, ensure @export is present and that documentation exists.
devtools::document().Use testthat edition 3 style.
Prefer small, fast unit tests.
Maintain accurate Title and Description.
Keep URLs and BugReports consistent.
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 it to Suggests.
Guard usage with requireNamespace().
Add tests that skip if the dependency is not installed.