This skill should be used when the user asks to "audit for CRAN", "check CRAN readiness", "prepare for CRAN submission", "CRAN check", "is my package CRAN ready", "submit to CRAN", or mentions CRAN submission compliance. It audits an R package against CRAN Repository Policy and submission requirements, producing a structured gap report with actionable fixes.
From pub-pipelinenpx claudepluginhub queelius/claude-anvil --plugin pub-pipelineThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
Audit an R package against CRAN Repository Policy requirements and produce a structured gap report. This skill evaluates package structure, DESCRIPTION metadata, documentation, code quality, and test coverage against the full CRAN checklist.
Identify the R package to audit. Look for DESCRIPTION file in the current working directory or a specified path. If no R package is found, ask the user which package to audit.
Read .claude/pub-pipeline.local.md if it exists (Read tool). Extract author metadata and package context from YAML frontmatter. If the file is missing, inform the user and offer to create one from the template at ${CLAUDE_PLUGIN_ROOT}/docs/user-config-template.md.
Before running the full audit, check that all dependencies are available on CRAN (Bash tool):
Imports, Depends, and LinkingTo fields from DESCRIPTIONRscript -e 'ap <- available.packages(); cat("PKG_NAME" %in% rownames(ap))'
pkg (>= 2.0)), verify the requirement is satisfiable:Rscript -e 'ap <- available.packages(); cat(ap["PKG_NAME", "Version"])'
Compare the available version against the minimum required version.
If any dependency is not on CRAN, flag it as a hard blocker in the gap report and stop here — the package cannot pass R CMD check --as-cran until all dependencies are available. Recommend the user publish the missing dependency first or switch to a CRAN-available alternative.
Run these checks in parallel where possible:
Regenerate documentation (Bash tool):
Run Rscript -e 'devtools::document()' to ensure NAMESPACE and man/ files are current before auditing them. This prevents false negatives from stale roxygen output.
Package metadata (Read tool):
DESCRIPTION — check all required fieldsNAMESPACE — verify auto-generation by roxygen2LICENSE or LICENSE.md — verify OSI-approved licenseNEWS.md, cran-comments.md, README.mdCode quality (Grep/Glob tools):
q() calls in R code.Internal(), ::: accessing base internalstempdir() / tools::R_user_dir()if (requireNamespace(...)))options() or par() calls that don't restore state via on.exit() or withrurlchecker::url_check() to verify all URLs are valid and HTTPSDocumentation (Grep/Glob tools):
@returns roxygen tag@examples roxygen tagman/ directory exists with .Rd filesR CMD check (Bash tool):
cd /path/to/package && Rscript -e 'devtools::check(args = "--as-cran")'
Test coverage (Bash tool):
cd /path/to/package && Rscript -e 'covr::package_coverage()'
Score each item from the CRAN checklist as PASS, FAIL, or WARN. Consult the full checklist in ${CLAUDE_PLUGIN_ROOT}/docs/cran-reference.md for detailed requirements.
Key categories to evaluate:
| Category | Key Checks |
|---|---|
| DESCRIPTION | Title case, no period, informative Description, Authors@R with roles, valid License |
| Dependencies | Imports from CRAN/Bioconductor only, conditional Suggests usage |
| Code behavior | No q(), no .Internal, no writing outside tempdir, no global env modification |
| Documentation | All exports have @returns and @examples, vignettes build |
| Examples | \dontrun{} only for truly non-runnable code; prefer \donttest{} for slow examples |
| Side effects | options()/par() restored via on.exit() or withr; no persistent state changes |
| Size | Tarball <10MB, data+docs <5MB, examples run in seconds |
| Cross-platform | Portable code, no OS-specific assumptions |
| Testing | R CMD check clean (0E/0W), notes explained |
| URLs | All URLs valid and using HTTPS |
Format the report as:
# CRAN Audit Report: {package name} v{version}
## Summary
- **Status**: READY / NEEDS WORK / NOT READY
- **Score**: X/Y checks passed
- **Blockers**: N critical issues
## Critical (Must Fix)
1. [Issue description] — [file:line] — [how to fix]
## Warnings (Should Fix)
1. [Issue description] — [file:line] — [recommendation]
## Passed
- [Check name] ✓
## R CMD Check Results
[Paste relevant output]
## Recommended Next Steps
1. [Ordered list of actions]
After presenting the report, offer to fix issues that can be automated:
@returns tagscran-comments.md if missingrequireNamespace() checksNEWS.md if missing\dontrun{} with \donttest{} where appropriateFor the complete CRAN policy checklist and submission workflow, consult:
${CLAUDE_PLUGIN_ROOT}/docs/cran-reference.md — Full CRAN Repository Policy reference with pre-submission checklist, submission workflow, and common rejection reasonsdevtools::document() after any roxygen changes.R CMD check --as-cran is the gold standard. If it passes with 0E/0W/0N, the package is very likely to be accepted.