r-lifecycle
Guidance for managing R package lifecycle according to tidyverse principles using the lifecycle package.
Skill by Garrick Aden-Buie (@gadenbuie)
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/posit-dev-r-lifecycle
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: devops, writing, refactoring, documentation
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/r-lifecycle
What's inside
- Skill name
r-lifecycle- Description
- Guidance for managing R package lifecycle according to tidyverse principles using the lifecycle package. Use when: (1) Setting up lifecycle infrastructure in a package, (2) Deprecating functions or arguments, (3) Renaming functions or arguments, (4) Superseding functions, (5) Marking functions as experimental, (6) Understanding lifecycle stages (stable, experimental, deprecated, superseded), or (7) Writing deprecation helpers for complex scenarios.
- License
- MIT
- Metadata
- author: Garrick Aden-Buie (@gadenbuie) · version: 1.1
- Instructions
- 243 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- lifecycle-stages.md · references/
SKILL.md (first lines)
# R Package Lifecycle Management
Manage function and argument lifecycle using tidyverse conventions and the lifecycle package.
## Setup
Check if lifecycle is configured by looking for `lifecycle-*.svg` files in `man/figures/`.
If not configured, run:
```r
usethis::use_lifecycle()
```
This:
- Adds lifecycle to `Imports` in DESCRIPTION
- Adds `@importFrom lifecycle deprecated` to the package documentation file
- Copies badge SVGs to `man/figures/`
## Lifecycle Badges
Insert badges in roxygen2 documentation:
```r
#' @description
#' `r lifecycle::badge("experimental")`
#' `r lifecycle::badge("deprecated")`
#' `r lifecycle::badge("superseded")`
```
For arguments:
```r
#' @param old_arg `r lifecycle::badge("deprecated")` Use `new_arg` instead.
```
Only badge functions/arguments whose stage differs from the package's overall stage.
## Deprecating a Function
1. Add badge and explanation to `@description`:
```r
#' Do something
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `old_fun()` was deprecated in mypkg 1.0.0. Use [new_fun()] instead.
#' @keywords internal
```
2. Add `deprecate_warn()` as first line of function body:
```r
old_fun <- function(x) {
lifecycle::deprecate_warn("1.0.0", "old_fun()", "new_fun()")
new_fun(x)
}
```
3. Show migration in examples:
```r
#' @examples
#' old_fun(x)
#' # ->
#' new_fun(x)
```
## Deprecation Functions
| Function | When to Use |
| ------------------ | ------------------------------------------------------- |
| `deprecate_soft()` | First stage; warns only direct users and during tests |
| `deprecate_warn()` | Standard deprecation; warns once per 8 hours |
| `deprecate_stop()` | Final stage before removal; errors with helpful message |
**Deprecation workflow for major releases:**
1. Search `deprecate_stop()` - consider removing function entirely
2. Replace `deprecate_warn()` with `deprecate_stop()`
3. Replace `deprecate_soft()` with `deprecate_warn()`
## Renaming a Function
Move implementation to new name, call from old name with deprecation:
```r
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `add_two()` was renamed to `number_add()` for API consistency.
#' @keywords internal
#' @export
add_two <- function(x, y) {
lifecycle::deprecate_warn("1.0.0", "add_two()", "number_add()")
number_add(x, y)
}
#' Add two numbers
#' @export
number_add <- function(x, y) {
x + y
}
```
## Deprecating an Argument
Use `deprecated()` as default value with `is_present()` check:
```r
#' @param path `r lifecycle::badge("deprecated")` Use `file` instead.
write_file <- function(x, file, path = deprecated()) {
if (lifecycle::is_present(path)) {
lifecycle::deprecate_warn("1.4.0", "write_file(path)", "write_file(file)")
file <- pathFrom posit-dev/skills, MIT.
More from posit-dev/skills
- 0.815score
r-testthat
Garrick Aden-Buie (@gadenbuie)
Best practices for writing R package tests with testthat version 3+.
SkillAFreshness: A★ 547Claude Code +9 - 0.815score
shiny-py-optimize
Garrick Aden-Buie (@gadenbuie)
Diagnose and fix performance problems in Shiny for Python apps — slow startup, sluggish interactions, blocking operations, and apps that struggle beyond a…
SkillAFreshness: A★ 547Claude Code +9 - 0.815score
pr-create
Garrick Aden-Buie (@gadenbuie)
Creates a pull request from current changes, monitors GitHub CI, and debugs any failures until CI passes.
SkillAFreshness: A★ 547Claude Code +9 - 0.815score
r-cli
Garrick Aden-Buie (@gadenbuie)
Comprehensive R package for command-line interface styling, semantic messaging, and user communication.
SkillAFreshness: A★ 547Claude Code +9 - 0.815score
shiny-r-optimize
Garrick Aden-Buie (@gadenbuie)
Diagnose and fix performance problems in Shiny for R apps — slow startup, sluggish interactions, long-running blocking operations, and apps that struggle…
SkillAFreshness: A★ 547Claude Code +9 - 0.809score
r-cran-extrachecks
Garrick Aden-Buie (@gadenbuie)
Prepare R packages for CRAN submission by checking for common ad-hoc requirements not caught by devtools::check().
SkillAFreshness: A★ 547Claude Code +9 - 0.809score
critical-code-reviewer
Garrick Aden-Buie (@gadenbuie)
Rigorously review code or pull requests for correctness, security, accessibility, maintainability, tests, and edge cases.
SkillAFreshness: A★ 547Claude Code +9 - 0.809score
review-testing
Garrick Aden-Buie (@gadenbuie)
Review test code for quality, design, and completeness after implementing a feature or fixing a bug.
SkillAFreshness: A★ 547Claude Code +9 - 0.809score
r-mirai
Charlie Gao (@shikokuchuo)
Help users write correct R code for async, parallel, and distributed computing using mirai.
SkillAFreshness: A★ 547Claude Code +9 - 0.809score
r-cran-status
Garrick Aden-Buie (@gadenbuie)
Look up an R package's live status on cran.r-project.org - submission/review state (queue, human review, waiting, archived, past version's fate) or R CMD…
SkillAFreshness: A★ 547Claude Code +9 - 0.809score
describe-design
Garrick Aden-Buie (@gadenbuie)
Research a codebase and create architectural documentation describing how features or systems work.
SkillAFreshness: A★ 547Claude Code +9 - 0.806score
pr-threads-resolve
Barret Schloerke (@schloerke)
Bulk resolve unresolved PR review threads on the current branch’s PR — typically after threads have been addressed manually or via /pr-threads-address
SkillAFreshness: A★ 547Claude Code +9
Signals
- Stars
- 547
- Forks
- 57
- Open issues
- 6
- Last commit (this folder)
- Oct 6, 2026 (22 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.1
- License
- MIT
- Repository
- github.com/posit-dev/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Garrick Aden-Buie (@gadenbuie)
- 0.815score
r-testthat
Garrick Aden-Buie (@gadenbuie)
Best practices for writing R package tests with testthat version 3+.
SkillAFreshness: A★ 547Claude Code +9 - 0.815score
pr-create
Garrick Aden-Buie (@gadenbuie)
Creates a pull request from current changes, monitors GitHub CI, and debugs any failures until CI passes.
SkillAFreshness: A★ 547Claude Code +9 - 0.815score
shiny-r-optimize
Garrick Aden-Buie (@gadenbuie)
Diagnose and fix performance problems in Shiny for R apps — slow startup, sluggish interactions, long-running blocking operations, and apps that struggle…
SkillAFreshness: A★ 547Claude Code +9 - 0.815score
shiny-py-optimize
Garrick Aden-Buie (@gadenbuie)
Diagnose and fix performance problems in Shiny for Python apps — slow startup, sluggish interactions, blocking operations, and apps that struggle beyond a…
SkillAFreshness: A★ 547Claude Code +9 - 0.815score
r-cli
Garrick Aden-Buie (@gadenbuie)
Comprehensive R package for command-line interface styling, semantic messaging, and user communication.
SkillAFreshness: A★ 547Claude Code +9 - 0.809score
r-cran-extrachecks
Garrick Aden-Buie (@gadenbuie)
Prepare R packages for CRAN submission by checking for common ad-hoc requirements not caught by devtools::check().
SkillAFreshness: A★ 547Claude Code +9
Cite this page
r-lifecycle skill. Agent Mart. https://agentmart.dev/skills/posit-dev-r-lifecycle (last updated 2026-10-24)