From agent-almanac
Complete procedure for submitting an R package to CRAN, including pre-submission checks (local, win-builder, R-hub), cran-comments.md preparation, URL and spell checking, and the submission itself. Covers first submissions and updates. Use when a package is ready for initial CRAN release, when submitting an updated version of an existing CRAN package, or when re-submitting after receiving CRAN reviewer feedback.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-almanac:submit-to-cranThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Execute the full CRAN submission workflow from pre-flight checks through submission.
Execute the full CRAN submission workflow from pre-flight checks through submission.
R CMD check with 0 errors and 0 warningsVerify DESCRIPTION has the correct version:
desc::desc_get_version()
Verify NEWS.md has an entry for this version. The entry should summarize user-facing changes.
Expected: Version follows semantic versioning. NEWS.md has a matching entry for this version.
On failure: Update version with usethis::use_version() (choose "major", "minor", or "patch"). Add a NEWS.md entry summarizing user-facing changes.
devtools::check()
Expected: 0 errors, 0 warnings, 0 notes (1 note acceptable for new submissions: "New submission").
On failure: Fix all errors and warnings before proceeding. Read the check log at <pkg>.Rcheck/00check.log for details. Notes should be explained in cran-comments.md.
devtools::spell_check()
Add legitimate words to inst/WORDLIST (one word per line, sorted alphabetically).
Expected: No unexpected misspellings. All flagged words are either corrected or added to inst/WORDLIST.
On failure: Fix genuine misspellings. For legitimate technical terms, add them to inst/WORDLIST (one word per line, alphabetically sorted).
urlchecker::url_check()
Expected: All URLs return HTTP 200. No broken or redirected links.
On failure: Replace broken URLs. Use \doi{} for DOI links instead of raw URLs. Remove links to resources that no longer exist.
devtools::check_win_devel()
devtools::check_win_release()
Wait for email results (usually 15-30 minutes).
Expected: 0 errors, 0 warnings on both Win-builder release and devel. Results arrive by email within 15-30 minutes.
On failure: Address platform-specific issues. Common causes: different compiler warnings, missing system dependencies, path separator differences. Fix locally and re-submit to Win-builder.
rhub::rhub_check()
This checks on multiple platforms (Ubuntu, Windows, macOS).
Expected: All platforms pass with 0 errors and 0 warnings.
On failure: If a specific platform fails, check the R-hub build log for platform-specific errors. Use testthat::skip_on_os() or conditional code for platform-dependent behavior.
Create or update cran-comments.md in the package root:
## R CMD check results
0 errors | 0 warnings | 1 note
* This is a new release.
## Test environments
* local: Windows 11, R 4.5.0
* win-builder: R-release, R-devel
* R-hub: ubuntu-latest (R-release), windows-latest (R-release), macos-latest (R-release)
## Downstream dependencies
There are currently no downstream dependencies for this package.
For updates, include:
Expected: cran-comments.md accurately summarizes check results across all test environments and explains any notes.
On failure: If check results differ across platforms, document all variations. CRAN reviewers will check these claims against their own tests.
# One last check
devtools::check()
# Verify the built tarball
devtools::build()
Expected: Final devtools::check() passes cleanly. A .tar.gz tarball is built in the parent directory.
On failure: If a last-minute issue appears, fix it and re-run all checks from Step 2. Do not submit with known failures.
devtools::release()
This runs interactive checks and submits. Answer all questions honestly.
Alternatively, submit manually at https://cran.r-project.org/submit.html by uploading the tarball.
Expected: Confirmation email from CRAN arrives within minutes. Click the confirmation link to finalize the submission.
On failure: Check email for rejection reasons. Common issues: examples too slow, missing \value tags, non-portable code. Fix the issues and re-submit, noting in cran-comments.md what changed.
After acceptance:
# Tag the release
usethis::use_github_release()
# Bump to development version
usethis::use_dev_version()
Expected: GitHub release is created with the accepted version tag. DESCRIPTION is bumped to the development version (x.y.z.9000).
On failure: If the GitHub release fails, create it manually with gh release create. If CRAN acceptance is delayed, wait for the confirmation email before tagging.
R CMD check returns 0 errors, 0 warnings on local machinecran-comments.md accurately describes check results\donttest{}. CRAN enforces time limits..Rbuildignore)\value in docs: All exported functions need a @return tag.Renvironrevdepcheck::revdep_check()# Full pre-submission workflow
devtools::spell_check()
urlchecker::url_check()
devtools::check()
devtools::check_win_devel()
rhub::rhub_check()
# Wait for results...
devtools::release()
release-package-version - version bumping and git taggingwrite-roxygen-docs - ensure documentation meets CRAN standardssetup-github-actions-ci - CI checks that mirror CRAN expectationsbuild-pkgdown-site - documentation site for accepted packagesnpx claudepluginhub pjt222/agent-almanacScaffolds a new R package with DESCRIPTION, NAMESPACE, testthat, roxygen2, renv, Git, and GitHub Actions CI. Follows usethis conventions. For starting packages from scratch or converting scripts.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.