Run the full R package release gate — regenerate docs, run the test suite, run R CMD check --as-cran, and triage every ERROR / WARNING / NOTE against CRAN policy before a release or submission. Use when the user says "check my R package", "R CMD check", "is this package CRAN-ready", "run devtools::check", "prepare for CRAN submission", or points at a directory containing a DESCRIPTION file. Produces a check report + CRAN-submission checklist in `quality_reports/`.
npx skills add https://github.com/pedrohcgs/claude-code-my-workflow --skill r-package-check
/r-package-check — R Package Release GateRun the document → test → check → triage pipeline that decides whether an R package is releasable, then review the source for the issues R CMD check cannot see.
Input: $ARGUMENTS — the package root (a directory containing DESCRIPTION). If blank, autodetect by searching upward/within the working directory for DESCRIPTION.
.claude/rules/r-package-conventions.md — the CRAN-readiness bar (0 errors, 0 warnings, explained notes) is the gate.man/ and NAMESPACE as generated — regenerate with devtools::document(); never hand-edit them.r-package-reviewer agent on the source before declaring the package releasable.## Pre-Flight Report — R Package Check
**Package:** [name + version from DESCRIPTION]
**Root:** [path]
**Exported functions:** [from NAMESPACE / `@export` count]
**Dependencies:** Imports [list] · Suggests [list] · Depends [list]
**Toolchain available:** devtools [✓/✗], roxygen2 [✓/✗], testthat [✓/✗], R CMD [✓/✗], covr [✓/✗]
**Plan:** document → test → check --as-cran → triage → review
Detect the toolchain with a quick probe; if devtools/R CMD is missing, stop and tell the user what to install.
Rscript -e 'cat("devtools:", requireNamespace("devtools", quietly=TRUE),
"roxygen2:", requireNamespace("roxygen2", quietly=TRUE),
"testthat:", requireNamespace("testthat", quietly=TRUE),
"covr:", requireNamespace("covr", quietly=TRUE), "\n")'
Regenerate man/ + NAMESPACE and detect drift (generated docs that were not committed):
Rscript -e 'devtools::document("[pkg]")'
git -C "[pkg]" status --short man/ NAMESPACE # any diff = generated docs were stale
If git status shows changes, flag: the committed man//NAMESPACE were out of sync with the roxygen blocks.
Rscript -e 'devtools::test("[pkg]")'
Report failures and (if covr is available, Phase 4) coverage of exported functions.
--as-cran)Run the full check. This is slow (minutes) — background-launch and stream with the Monitor tool rather than blocking:
Rscript -e 'devtools::check("[pkg]", args = "--as-cran")'
# or: R CMD build [pkg] && R CMD check --as-cran [pkg]_*.tar.gz
Then triage every result into a table:
| Result | Tier | CRAN-policy meaning | Action |
|---|---|---|---|
| … | ERROR / WARNING / NOTE | … | fix / justify |
cran-comments.md (e.g., "New submission", "Found the following (possibly) invalid URLs … the URL is correct and reachable").Rscript -e 'covr::package_coverage("[pkg]")'
Report per-function coverage; flag exported functions with 0% coverage.
Delegate to the r-package-reviewer agent:
"Review the package source at [pkg]"
Address Critical (CRAN-policy violations) and High (check WARNINGs) findings.
Save a report to quality_reports/[package]_package_check.md and present a verdict:
## Release Gate — [package] [version]
- R CMD check --as-cran: E errors, W warnings, N notes
- Tests: P passed, F failed
- Coverage: X% of exported functions
- r-package-reviewer: C critical, H high
- **Verdict:** RELEASABLE / FIX-FIRST / POLICY-VIOLATION
### CRAN-submission checklist
[ ] 0 errors, 0 warnings; each note justified in cran-comments.md
[ ] Version bumped + NEWS.md updated
[ ] devtools::check_win_devel() / R-hub on other platforms (note: run separately)
[ ] Reverse-dependency check if this is an update (revdepcheck)
--as-cran or it doesn't count. A plain R CMD check misses the policy checks that actually gate submission.devtools::document(), not editing .Rd.devtools::release() are the maintainer's call.R CMD check --as-cran and covr can run for several minutes. Background-launch via Bash with run_in_background: true, capture the bash_id, and use the Monitor tool to stream progress (e.g. the checking … lines or process exit) instead of polling. See data-analysis/SKILL.md for the pattern.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Use when implementing any feature or bugfix, before writing implementation code
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Take pedrohcgs/r-package-check from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.