Back to Skills

tidy-deprecate-function

Guide for deprecating R functions/arguments. Use when a user asks to deprecate a function or parameter, including adding lifecycle warnings, updating documentation, adding NEWS entries, and updating tests.

504stars187forksUpdated 2/17/2026

Security Assessment

Safe(100/100)
Security Score100/100

About tidy-deprecate-function

The 'tidy-deprecate-function' skill guides users through the process of deprecating R functions and function arguments. It provides a systematic approach to introducing deprecation warnings, ensuring that deprecated features are properly handled in both the codebase and documentation. This skill is essential when a function or parameter is being phased out in favor of a newer alternative, ensuring that users are informed about the change and can transition smoothly to the updated functionality. By following the outlined steps, developers can avoid breaking changes while maintaining clear communication with users about deprecations and replacements.

FAQ

How do I specify the version for deprecation?

The deprecation version is calculated based on the current version. It follows the format 'MAJOR.MINOR.PATCH.9000' for development. The deprecation version will be the next minor release, for example, if the current version is '2.5.1.9000', the deprecation version will be '2.6.0'.

How do I silence deprecation warnings in tests?

You can silence lifecycle warnings in tests by adding 'withr::local_options(lifecycle_verbosity = "quiet")' at the beginning of the test block that uses the deprecated feature.

What should I do if the function documentation doesn't have a description?

If the documentation doesn't already contain a description, you should add it. For function deprecation, include a line that uses 'lifecycle::badge("deprecated")' to indicate that the function is deprecated, along with a suggestion for the replacement.

How do I update examples in the documentation?

Update the examples section by replacing old usage with new usage, clearly indicating the transition with comments like '# Old:' and '# New:'. Provide 2-3 practical examples to demonstrate how the syntax has changed.

Where should I add the NEWS entry for deprecation?

Add a bullet point to the top of the '# dbplyr (development version)' section in the NEWS.md file. This entry should highlight the deprecated function and its replacement.

Install tidy-deprecate-function

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill