r-cran-extrachecks
БесплатноБез исполняемых скриптовНе проверенPrepare R packages for CRAN submission by checking for common ad-hoc requirements not caught by devtools::check(). Use when: (1) Preparing a package for first…
от posit-dev★ 578 звёзд на GitHubОб этом скилле
CRAN Extra Checks
Help R package developers prepare packages for CRAN submission by systematically checking for common ad-hoc requirements that CRAN reviewers enforce but devtools::check() doesn't catch.
Workflow
- Initial Assessment: Ask user if this is first submission or resubmission
- Run Standard Checklist: Work through each item systematically (see below)
- Identify Issues: As you review files, note specific problems
- Propose Fixes: Suggest specific changes for each issue found
- Implement Changes: Make edits only when user approves
- Verify: Confirm all changes are complete
Standard CRAN Preparation Checklist
Work through these items systematically:
- Create NEWS.md: Run
usethis::use_news_md()if not already present - Create cran-comments.md: Run
usethis::use_cran_comments()if not already present - Review README:
- Ensure it includes install instructions that will be valid when the package is accepted to CRAN (usually
install.packages("pkgname")). - Check that it does not contain relative links. This works on GitHub but will be flagged by CRAN. Use full URLs to package documentation or remove the links.
- Does the README clearly explain the package purpose and functionality?
- Important: If README.Rmd exists, edit ONLY README.Rmd (README.md will be overwritten), then run
devtools::build_readme()to re-render README.md
- Ensure it includes install instructions that will be valid when the package is accepted to CRAN (usually
- Proofread DESCRIPTION: Carefully review
Title:andDescription:fields (see detailed guidance below) - Check function documentation: Verify all exported functions have
@returnand@examples(see detailed guidance below). Note the exemption for S3 methods documented only with#' @export: they produce no.Rdfile and are not required to have either tag - Verify copyright holder: Check that
Authors@R:includes a copyright holder with role[cph] - Review bundled file licensing: Check licensing of any included third-party files
- Run URL checks: Use
urlchecker::url_check()and fix any issues
Detailed CRAN Checks
Documentation Requirements
Return Value Documentation (Strictly Enforced)
CRAN now strictly requires @return documentation for all exported functions. Use the roxygen2 tag @return to document what the function returns.
- Required even for functions marked
@keywords internal - Required even if function returns nothing - document as
@return Noneor similar - Must be present for every exported function
These rules apply only to functions with an .Rd file. Roxygen2 creates an .Rd file only when a block contains documentation content (a title or description). A block that contains nothing but #' @export adds the function to the NAMESPACE without generating an .Rd file, so there is nothing for CRAN's documentation checks to inspect. This is the conventional pattern for S3 methods:
#' @export
print.my_class <- function(x, ...) {
cat("my_class object\n")
invisible(x)
}
Such methods do not need @return or @examples, and R CMD check does not flag them as undocumented (registered S3 methods are excluded from the undocumented-objects check).
- The exemption holds only while the block contains nothing but
@export(or@exportS3Method). Adding a title,@param,@rdname,@describeIn, or any other documentation makes roxygen2 generate an.Rdfile, and the function must then satisfy all documentation rules including@return. - Do not confuse these with the S3 generic itself (e.g.,
my_print <- function(x, ...) UseMethod("my_print")). A newly exported generic is an ordinary exported function with documentation, so it still needs@returnand@examples. - Methods sharing a page with their generic via
@rdnameor@describeInfollow the same rules as the generic: the combined.Rdneeds the required tags once, not once per method.
Example:
# Missing @return - WILL BE REJECTED
#' Calculate sum
#' @export
my_sum <- function(x, y) {
x + y
}
# Correct - includes @return
#' Calculate sum
#' @param x First number
#' @param y Second number
#' @return A numeric value
#' @export
my_sum <- function(x, y) {
x + y
}
# For functions with no return value
#' Print message
#' @param msg Message to print
#' @return None, called for side effects
#' @export
print_msg <- function(msg) {
cat(msg, "\n")
}
Examples for Exported Functions
If your exported function has a meaningful return value, it will almost definitely require an @examples section. Use the roxygen2 tag @examples.
- Required even for functions marked
@keywords internal - Exceptions exist for functions used purely for side effects (e.g., creating directories)
- Examples must be executable
- S3 methods with
@export-only roxygen blocks have no.Rdfile and need no examples (see above)
Un-exported Functions with Examples
If you write roxygen examples for un-exported functions, you must either:
- Call them with
Установить r-cran-extrachecks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл r-cran-extrachecks?
Prepare R packages for CRAN submission by checking for common ad-hoc requirements not caught by devtools::check(). Use when: (1) Preparing a package for first CRAN release, (2) Preparing a package update for CRAN resubmission, (3) Reviewing a package to ensure CRAN compliance, (4) Responding to CRAN reviewer feedback. Covers documentation requirements, DESCRIPTION field standards, URL validation, examples, and administrative requirements.
Как установить скилл r-cran-extrachecks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл r-cran-extrachecks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic