Agent skill

R Lifecycle

by posit-dev in posit-dev/skills

Guidance for managing R package lifecycle according to tidyverse principles using the lifecycle package.

MITAuto-check passed

Install R Lifecycle

skills CLI
$ npx skills add posit-dev/skills --skill r-lifecycle -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install posit-dev/skills r-lifecycle --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/posit-dev/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/r-lib/r-lifecycle .claude/skills/r-lifecycle && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
r-lifecycle
GitHub stars
529
Token cost
~1.5k tokens
SKILL.md length
271 words
Files
2 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Guidance for managing R package lifecycle according to tidyverse principles using the lifecycle package.

  • Works in 3 steps: Add badge and explanation to @description → Add deprecate_warn() as first line of… → Show migration in examples
  • Setting up lifecycle infrastructure in a package
  • SKILL.md covers Setup, Lifecycle Badges, Deprecating a Function and Deprecation Functions, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

R Lifecycle is an agent skill from posit-dev/skills. 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.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/lifecycle-stages.md`).

The repository describes itself as: A collection of Claude Skills from Posit. The licence is MIT.

When your agent uses it

  • Setting up lifecycle infrastructure in a package
  • Deprecating functions
  • Renaming functions
  • Superseding functions

Example prompts

  • “/r-lifecycle”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Add badge and explanation to @description
  2. Add deprecate_warn() as first line of function body
  3. Show migration in examples

What it can do on your machine

Read from SKILL.md and the folder at commit 0300946. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are r).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

R Lifecycle loads about 1.5k tokens when it runs, and up to ~2k if it reads all its reference files. Until then it costs about 116 tokens; SKILL.md has 271 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~116
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from posit-dev/skills at commit 0300946, republished under its MIT licence (© posit-dev). 271 words, ~1,488 tokens.

Download SKILL.mdSave it as .claude/skills/r-lifecycle/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
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.
metadata.author
Garrick Aden-Buie (@gadenbuie)
metadata.version
1.1
license
MIT

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
  1. 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)
}
  1. Show migration in examples:
r
#' @examples
#' old_fun(x)
#' # ->
#' new_fun(x)

Deprecation Functions

FunctionWhen 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 <- path
  }
  # ... rest of function
}

Renaming an Argument

r
add_two <- function(x, y, na_rm = TRUE, na.rm = deprecated()) {
  if (lifecycle::is_present(na.rm)) {
    lifecycle::deprecate_warn("1.0.0", "add_two(na.rm)", "add_two(na_rm)")
    na_rm <- na.rm
  }
  sum(x, y, na.rm = na_rm)
}

Superseding a Function

For functions with better alternatives that shouldn't be removed:

r
#' Gather columns into key-value pairs
#'
#' @description
#' `r lifecycle::badge("superseded")`
#'
#' Development on `gather()` is complete. For new code, use [pivot_longer()].
#'
#' `df %>% gather("key", "value", x, y, z)` is equivalent to
#' `df %>% pivot_longer(c(x, y, z), names_to = "key", values_to = "value")`.

No warning needed - just document the preferred alternative.

Marking as Experimental

r
#' @description
#' `r lifecycle::badge("experimental")`
cool_function <- function() {
  lifecycle::signal_stage("experimental", "cool_function()")
  # ...
}

Testing Deprecations

Test that deprecated functions work and warn appropriately:

r
test_that("old_fun is deprecated", {
  expect_snapshot({
    x <- old_fun(1)
    expect_equal(x, expected_value)
  })
})

Suppress warnings in existing tests:

r
test_that("old_fun returns correct value", {
  withr::local_options(lifecycle_verbosity = "quiet")
  expect_equal(old_fun(1), expected_value)
})

Deprecation Helpers

For deprecations affecting many functions (e.g., removing a common argument), create an internal helper:

r
warn_for_verbose <- function(
  verbose = TRUE,
  env = rlang::caller_env(),
  user_env = rlang::caller_env(2)
) {
  if (!lifecycle::is_present(verbose) || isTRUE(verbose)) {
    return(invisible())
  }

  lifecycle::deprecate_warn(
    when = "2.0.0",
    what = I("The `verbose` argument"),
    details = c(
      "Set `options(mypkg_quiet = TRUE)` to suppress messages.",
      "The `verbose` argument will be removed in a future release."
    ),
    user_env = user_env
  )

  invisible()
}

Then use in affected functions:

r
my_function <- function(..., verbose = deprecated()) {
  warn_for_verbose(verbose)
  # ...
}

Custom Deprecation Messages

For non-standard deprecations, use I() to wrap custom text:

r
lifecycle::deprecate_warn(
  when = "1.0.0",
  what = I('Setting option "pkg.opt" to "foo"'),
  with = I('"pkg.new_opt"')
)

The what fragment must work with "was deprecated in..." appended.

Reference

See references/lifecycle-stages.md for detailed stage definitions and transitions.

© posit-dev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in r-lib/r-lifecycle of posit-dev/skills.

  • SKILL.md
  • references/lifecycle-stages.md

Open the folder on GitHubat commit 0300946

Compare with similar skills

R Lifecycle next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

R Lifecycle compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
R Lifecycle this skillposit-dev/skills529—~1.5kAutomated safety check: PassMIT
Secrets Managementdavila7/claude-code-templates32k11 repos~2kAutomated safety check: PassMIT
Project ManagerRightNow-AI/openfang18k—~960Automated safety check: PassApache-2.0
Content Management Systemsgithub/awesome-copilot40k1 repos~1.3kAutomated safety check: PassMIT
Principle Redesign From First Principlescursor/plugins10k8 repos~211Automated safety check: PassNone
Secrets Vault Manageralirezarezvani/claude-skills28k1 repos~3.6kAutomated safety check: NotesMIT

Similar skills

  • Secrets Management

    davila7/claude-code-templates

    Secure secrets management practices for CI/CD pipelines using Vault, AWS Secrets Manager, and other tools.

    32k GitHub starsUsed in 11 repos~2k tokens
    DevOps & CloudAuto-check passed
  • Project Manager

    RightNow-AI/openfang

    Project management expert for Agile, estimation, risk management, and stakeholder communication

    18k GitHub stars~960 tokensUpdated 3 mo ago
    Product & Project ManagementAuto-check passed
  • Content Management Systems

    github/awesome-copilot

    Official

    Workflow for building and modifying content management systems across WordPress, Shopify, Wix, Squarespace, Drupal, WooCommerce, Joomla, HubSpot CMS Hub, Webflow, Adobe Experience Manager, and…

    40k GitHub starsUsed in 1 repo~1.3k tokens
    Sales & SupportAuto-check passed
  • Secrets Vault Manager

    alirezarezvani/claude-skills

    A skill your agent uses when the user asks to set up secret management infrastructure, integrate HashiCorp Vault, configure cloud secret stores (AWS Secrets Manager, Azure Key Vault, GCP Secret…

    28k GitHub starsUsed in 1 repo~3.6k tokens
    DevOps & CloudAuto-check: notes
  • Robius State Management

    sickn33/agentic-awesome-skills

    CRITICAL: Use for Robius state management patterns. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3.3k tokens
    Frontend & DesignAuto-check passed

More from posit-dev/skills

All 17 skills in this repo
  • R CLI App

    posit-dev/skills

    Build command-line apps in R using the Rapp package. An agent skill from posit-dev/skills.

    529 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • PR Create

    posit-dev/skills

    Creates a pull request from current changes, monitors GitHub CI, and debugs any failures until CI passes.

    529 GitHub stars~4.3k tokensUpdated today
    Auto-check: warnings
  • Shiny Bslib

    posit-dev/skills

    Build modern Shiny dashboards and applications using bslib (Bootstrap 5).

    529 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Shiny Bslib Theming

    posit-dev/skills

    Advanced theming for Shiny apps using bslib and Bootstrap 5.

    529 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Critical Code Reviewer

    posit-dev/skills

    Rigorously review code or pull requests for correctness, security, accessibility, maintainability, tests, and edge cases.

    529 GitHub stars~3.9k tokensUpdated today
    Auto-check passed
  • Deploy To Connect

    posit-dev/skills

    Deploy or publish Python and R content to a Posit Connect server using rsconnect-python or the R rsconnect package.

    529 GitHub stars~5k tokensUpdated today
    Auto-check: notes

Questions about R Lifecycle

What does R Lifecycle do?

Guidance for managing R package lifecycle according to tidyverse principles using the lifecycle package. R Lifecycle is an agent skill from posit-dev/skills. Guidance for managing R package lifecycle according to tidyverse principles using the lifecycle package.

When should I use R Lifecycle?

R Lifecycle fits situations like: setting up lifecycle infrastructure in a package; deprecating functions; renaming functions; superseding functions.

How do I install R Lifecycle in Claude Code?

Run `npx skills add posit-dev/skills --skill r-lifecycle -a claude-code`. Or copy the skill folder (r-lib/r-lifecycle in posit-dev/skills) into .claude/skills/r-lifecycle in your project. Claude Code loads it when a task matches its description.

How do I install R Lifecycle in Codex?

Run `npx skills add posit-dev/skills --skill r-lifecycle -a codex`. Or copy the skill folder (r-lib/r-lifecycle in posit-dev/skills) into .agents/skills/r-lifecycle in your project. Codex loads it when a task matches its description.

Can I use R Lifecycle in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add posit-dev/skills --skill r-lifecycle -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/r-lifecycle, .gemini/skills/r-lifecycle, .github/skills/r-lifecycle and .opencode/skills/r-lifecycle in your project.

What does R Lifecycle need to run?

SKILL.md names no scripts, command-line tools or credentials: R Lifecycle is instructions for the agent only.

Does R Lifecycle access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is R Lifecycle safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does R Lifecycle use?

R Lifecycle is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does R Lifecycle use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 560 tokens, read only when the agent opens those files.

What are the alternatives to R Lifecycle?

Skills that share tags, products or a category with R Lifecycle: Secrets Management (davila7/claude-code-templates, 32k stars), Project Manager (RightNow-AI/openfang, 18k stars), Content Management Systems (github/awesome-copilot, 40k stars) and Principle Redesign From First Principles (cursor/plugins, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains R Lifecycle?

posit-dev (a GitHub organization) maintains it in posit-dev/skills, which has 529 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 6, 2026.

Source: posit-dev/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.