release-package-version
Release a new version of an R package including version bumping, NEWS.md updates, git tagging, GitHub release creation, and post-release development version setup. Use when a package is ready for a new patch, minor, or major release, after CRAN acceptance to create the corresponding GitHub release, or when setting up the development version bump immediately after a release.
Best use case
release-package-version is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Release a new version of an R package including version bumping, NEWS.md updates, git tagging, GitHub release creation, and post-release development version setup. Use when a package is ready for a new patch, minor, or major release, after CRAN acceptance to create the corresponding GitHub release, or when setting up the development version bump immediately after a release.
Teams using release-package-version should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/release-package-version/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How release-package-version Compares
| Feature / Agent | release-package-version | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Release a new version of an R package including version bumping, NEWS.md updates, git tagging, GitHub release creation, and post-release development version setup. Use when a package is ready for a new patch, minor, or major release, after CRAN acceptance to create the corresponding GitHub release, or when setting up the development version bump immediately after a release.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Release Package Version
Execute the full version release cycle for an R package.
## When to Use
- Ready to release a new version (bug fix, feature, or breaking change)
- After CRAN acceptance, creating a corresponding GitHub release
- Setting up post-release development version
## Inputs
- **Required**: Package with changes ready for release
- **Required**: Release type: patch (0.1.0 -> 0.1.1), minor (0.1.0 -> 0.2.0), or major (0.1.0 -> 1.0.0)
- **Optional**: Whether to submit to CRAN (default: no, use `submit-to-cran` skill separately)
## Procedure
### Step 1: Determine Version Bump
Follow semantic versioning:
| Change Type | Version Bump | Example |
|-------------|-------------|---------|
| Bug fixes only | Patch | 0.1.0 -> 0.1.1 |
| New features (backward compatible) | Minor | 0.1.0 -> 0.2.0 |
| Breaking changes | Major | 0.1.0 -> 1.0.0 |
**Got:** The correct bump type (patch, minor, or major) is determined based on the nature of changes since the last release.
**If fail:** If unsure, review `git log` since the last tag and classify each change. Any breaking API change requires a major bump.
### Step 2: Update Version
```r
usethis::use_version("minor") # or "patch" or "major"
```
This updates the `Version` field in DESCRIPTION and adds a heading to NEWS.md.
**Got:** DESCRIPTION version updated. NEWS.md has a new section header for the release version.
**If fail:** If `usethis::use_version()` is not available, manually update the `Version` field in DESCRIPTION and add a `# packagename x.y.z` heading to NEWS.md.
### Step 3: Update NEWS.md
Fill in the release notes under the new version heading:
```markdown
# packagename 0.2.0
## New Features
- Added `new_function()` for processing data (#42)
- Support for custom themes in `plot_results()` (#45)
## Bug Fixes
- Fixed crash when input contains all NAs (#38)
- Corrected off-by-one error in `window_calc()` (#41)
## Minor Improvements
- Improved error messages for invalid input types
- Updated documentation examples
```
Use issue/PR numbers for traceability.
**Got:** NEWS.md contains a complete summary of user-facing changes organized by category, with issue/PR numbers for traceability.
**If fail:** If changes are hard to reconstruct, use `git log --oneline v<previous>..HEAD` to list all commits since the last release and categorize them.
### Step 4: Final Checks
```r
devtools::check()
devtools::spell_check()
urlchecker::url_check()
```
**Got:** `devtools::check()` returns 0 errors, 0 warnings, and 0 notes. Spell check and URL check find no issues.
**If fail:** Fix all errors and warnings before releasing. Add false-positive words to `inst/WORDLIST` for the spell checker. Replace broken URLs.
### Step 5: Commit Release
```bash
git add DESCRIPTION NEWS.md
git commit -m "Release packagename v0.2.0"
```
**Got:** A single commit containing the version bump in DESCRIPTION and the updated NEWS.md.
**If fail:** If other uncommitted changes are present, stage only DESCRIPTION and NEWS.md. Release commits should contain only version-related changes.
### Step 6: Tag the Release
```bash
git tag -a v0.2.0 -m "Release v0.2.0"
git push origin main --tags
```
**Got:** Annotated tag `v0.2.0` created and pushed to the remote. `git tag -l` shows the tag locally; `git ls-remote --tags origin` confirms it on the remote.
**If fail:** If push fails, check that you have write access. If the tag already exists, verify it points to the correct commit with `git show v0.2.0`.
### Step 7: Create GitHub Release
```bash
gh release create v0.2.0 \
--title "packagename v0.2.0" \
--notes-file NEWS.md
```
Or use:
```r
usethis::use_github_release()
```
**Got:** GitHub release created with release notes visible on the repository's Releases page.
**If fail:** If `gh release create` fails, ensure the `gh` CLI is authenticated (`gh auth status`). If `usethis::use_github_release()` fails, create the release manually on GitHub.
### Step 8: Set Development Version
After release, bump to development version:
```r
usethis::use_dev_version()
```
This changes version to `0.2.0.9000` indicating development.
```bash
git add DESCRIPTION NEWS.md
git commit -m "Begin development for next version"
git push
```
**Got:** DESCRIPTION version is now `0.2.0.9000` (development version). NEWS.md has a new heading for the development version. Changes are pushed to the remote.
**If fail:** If `usethis::use_dev_version()` is not available, manually change the version to `x.y.z.9000` in DESCRIPTION and add a `# packagename (development version)` heading to NEWS.md.
## Validation
- [ ] Version in DESCRIPTION matches intended release
- [ ] NEWS.md has complete, accurate release notes
- [ ] `R CMD check` passes
- [ ] Git tag matches version (e.g., `v0.2.0`)
- [ ] GitHub release exists with release notes
- [ ] Post-release development version set (x.y.z.9000)
## Pitfalls
- **Forgetting to push tags**: `git push` alone doesn't push tags. Use `--tags` or `git push origin v0.2.0`
- **NEWS.md format**: Use markdown headers matching the pkgdown/CRAN expected format
- **Tagging wrong commit**: Always tag after the version-bump commit, not before
- **CRAN version already exists**: CRAN won't accept a version that's already been published. Always increment.
- **Development version in release**: Never submit a `.9000` version to CRAN
## Related Skills
- `submit-to-cran` - CRAN submission after version release
- `create-github-release` - general GitHub release creation
- `setup-github-actions-ci` - triggers pkgdown rebuild on release
- `build-pkgdown-site` - documentation site reflects new versionRelated Skills
version-ml-data
Version machine learning datasets using DVC (Data Version Control) with remote storage backends, build reproducible data pipelines with dependency tracking, integrate with Git workflows, and ensure data lineage for model reproducibility. Use when versioning large datasets that do not fit in Git, tracking data changes alongside code changes, ensuring ML experiment reproducibility, sharing datasets across team members, or auditing data lineage for compliance requirements.
plan-release-cycle
Plan a software release cycle with milestones, feature freezes, release candidates, and go/no-go criteria. Covers calendar-based and feature-based release strategies. Use when starting planning for a major or minor version release, transitioning from ad-hoc to structured release cadence, coordinating a release across multiple teams or components, defining quality gates for a regulated project, or planning the first public release (v1.0.0) of a project.
monitor-binary-version-baselines
Establish and maintain longitudinal baselines of CLI binary contents across versions. Covers marker selection by category (API / identity / config / telemetry / flag / function), weighted scoring, threshold-based system-presence detection, and per-version baseline records. Use when tracking a feature's lifecycle across releases, when probing for dark-launched or removed capabilities, or when verifying that a scanning tool still catches known-good markers on old binaries.
create-r-package
Scaffold a new R package with complete structure including DESCRIPTION, NAMESPACE, testthat, roxygen2, renv, Git, GitHub Actions CI, and development configuration files (.Rprofile, .Renviron.example, CLAUDE.md). Follows usethis conventions and tidyverse style. Use when starting a new R package from scratch, converting loose R scripts into a structured package, or setting up a package skeleton for collaborative development.
create-github-release
Create a GitHub release with proper tagging, release notes, and optional build artifacts. Covers semantic versioning, changelog generation, and GitHub CLI usage. Use when marking a stable version of software for distribution, publishing a new library or application version, creating release notes for stakeholders, or distributing build artifacts (binaries, tarballs).
audit-dependency-versions
Audit project dependencies for version staleness, security vulnerabilities, and compatibility issues. Covers lock file analysis, upgrade path planning, and breaking change assessment. Use before a release to ensure dependencies are current and secure, during periodic maintenance reviews, after receiving a security advisory, when upgrading to a new language version, before submitting to CRAN or npm, or when inheriting a project to assess its dependency health.
apply-semantic-versioning
Apply semantic versioning (SemVer 2.0.0) to determine the correct version bump based on change analysis. Covers major/minor/patch classification, pre-release identifiers, build metadata, and breaking change detection. Use when preparing a new release to determine the correct version number, after merging changes before tagging, evaluating whether a change constitutes a breaking change, adding pre-release identifiers, or resolving disagreement about what version bump is appropriate.
skill-name-here
One to three sentences describing what this skill accomplishes, followed by key activation triggers. This field is the primary mechanism agents use to decide whether to activate the skill — it is read during discovery before the full body is loaded. Start with a verb. Include the most important "when to use" conditions inline. Max 1024 characters.
write-vignette
Create R package vignettes using R Markdown or Quarto. Covers vignette setup, YAML configuration, code chunk options, building and testing, and CRAN requirements for vignettes. Use when adding a Getting Started tutorial, documenting complex workflows spanning multiple functions, creating domain-specific guides, or when CRAN submission requires user-facing documentation beyond function help pages.
write-validation-documentation
Write IQ/OQ/PQ validation documentation for computerized systems in regulated environments. Covers protocols, reports, test scripts, deviation handling, and approval workflows. Use when validating R or other software for regulated use, preparing for a regulatory audit, documenting qualification of computing environments, or creating and updating validation protocols and reports for new or re-qualified systems.
write-testthat-tests
Write comprehensive testthat (edition 3) tests for R package functions. Covers test organization, expectations, fixtures, mocking, snapshot tests, parameterized tests, and achieving high coverage. Use when adding tests for new package functions, increasing test coverage for existing code, writing regression tests for bug fixes, or setting up test infrastructure for a package that lacks it.
write-standard-operating-procedure
Write a GxP-compliant Standard Operating Procedure (SOP). Covers regulatory SOP template structure (purpose, scope, definitions, responsibilities, procedure, references, revision history), approval workflow design, periodic review scheduling, and operational procedures for system use. Use when a new validated system requires operational procedures, when existing informal procedures need formalisation, when an audit finding cites missing procedures, when a change control triggers SOP updates, or when periodic review identifies outdated procedural content.