submit-to-cran
About
This skill automates the complete workflow for submitting an R package to CRAN, including pre-submission checks (local, win-builder, R-hub), preparing the cran-comments.md file, and handling the submission process. It supports initial releases, updates to existing packages, and re-submissions after reviewer feedback. Use it when your package passes local `R CMD check` and is ready for official CRAN submission.
Quick Install
Claude Code
Recommendednpx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/submit-to-cranCopy and paste this command in Claude Code to install this skill
Documentation
投於 CRAN
行 CRAN 投之全流——自前察至投。
用時
- 包備為 CRAN 之初發乃用
- 投既存 CRAN 包之新版乃用
- 接 CRAN 審者之回饋而再投乃用
入
- 必要:本機
R CMD check過 0 誤 0 警之 R 包 - 必要:DESCRIPTION 中已新之版號
- 必要:NEWS.md 已新此版之變
- 可選:先 CRAN 審者之言(為再投)
法
第一步:察版與 NEWS
驗 DESCRIPTION 有正版:
desc::desc_get_version()
驗 NEWS.md 有此版之條。條當總用者所見之變。
得:版合語意之則。NEWS.md 有合此版之條。
敗則:以 usethis::use_version() 更版(擇 "major"、"minor"、"patch")。加 NEWS.md 條總用者所見之變。
第二步:本機 R CMD check
devtools::check()
得:0 誤、0 警、0 注(新投可有 1 注:「New submission」)。
敗則:續前修諸誤與警。閱察日於 <pkg>.Rcheck/00check.log。注當於 cran-comments.md 釋之。
第三步:拼寫之察
devtools::spell_check()
加正當之詞於 inst/WORDLIST(每詞一行,依字母序)。
得:無誤拼。諸警之詞或修或加於 inst/WORDLIST。
敗則:修真誤拼。正當之技術詞,加於 inst/WORDLIST(每詞一行,依字母序)。
第四步:URL 之察
urlchecker::url_check()
得:諸 URL 返 HTTP 200。無斷或重定向之鏈。
敗則:替斷之 URL。DOI 用 \doi{} 而非裸 URL。除已不存之資源之鏈。
第五步:Win-Builder 之察
devtools::check_win_devel()
devtools::check_win_release()
候郵之果(常 15-30 分)。
得:Win-builder release 與 devel 皆 0 誤 0 警。果於 15-30 分由郵至。
敗則:解臺特之患。常因:異編譯器之警、缺系依、路分隔之異。本機修而再投 Win-builder。
第六步:R-hub 之察
rhub::rhub_check()
此察於多臺(Ubuntu、Windows、macOS)。
得:諸臺皆過,0 誤 0 警。
敗則:某臺敗,察 R-hub 之建日為臺特之誤。用 testthat::skip_on_os() 或條件碼為臺依之行。
第七步:備 cran-comments.md
於包根立或新 cran-comments.md:
## 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.
更時含:
- 何變(簡)
- 對前審者言之回應
- 反向依察之果(若適)
得:cran-comments.md 正總諸臺之察果而釋諸注。
敗則:若察果於諸臺異,書諸異。CRAN 審者將以己試驗此言。
第八步:終前察
# One last check
devtools::check()
# Verify the built tarball
devtools::build()
得:終 devtools::check() 過淨。.tar.gz 之 tarball 建於父目。
敗則:若末刻有患,修之而自第二步重察。勿以已知敗投之。
第九步:投
devtools::release()
此行交互之察而投。誠答諸問。
或於 https://cran.r-project.org/submit.html 手投,傳 tarball。
得:CRAN 之確認郵於分內至。點確認鏈以終投。
敗則:察郵以知拒因。常患:例太緩、缺 \value、不可移之碼。修而再投,於 cran-comments.md 注其變。
第十步:投後
接受後:
# Tag the release
usethis::use_github_release()
# Bump to development version
usethis::use_dev_version()
得:GitHub 發以接之版標立。DESCRIPTION 升至開發之版(x.y.z.9000)。
敗則:若 GitHub 發敗,以 gh release create 手立。若 CRAN 接遲,候確認郵而後標。
驗
-
R CMD check本機返 0 誤 0 警 - Win-builder 過(release + devel)
- R-hub 過諸試臺
-
cran-comments.md正述察果 - 諸 URL 有效
- 無拼誤
- 版號正而已增
- NEWS.md 為新
- DESCRIPTION 之資全而正
陷
- 例太緩:以
\donttest{}包貴例。CRAN 限時。 - 非標之文件名:避致 CRAN 注之文件(察
.Rbuildignore) - 文檔缺
\value:諸出函須@return標 - vignette 建敗:確 vignettes 於淨境(無爾
.Renviron)建之 - DESCRIPTION Title 之格:必標題式,末無句號,無「A Package for...」
- 忘反向依之察:更時行
revdepcheck::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— 版升與 git 標write-roxygen-docs— 確文檔合 CRAN 之標setup-github-actions-ci— 鏡 CRAN 期之 CI 察build-pkgdown-site— 接受之包之文站
GitHub Repository
Related Skills
content-collections
MetaThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
polymarket
MetaThis skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.
creating-opencode-plugins
MetaThis skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
