Manage R function changes with AI
Plan a transition for an R function or argument. Keep the replacement, documentation, warnings and tests consistent with the lifecycle stage you choose.
Manage R function changes with AI when an improvement to the interface would otherwise surprise people who upgrade. A clearer argument name is easy to introduce in a new example. The harder case is a report written last year that still passes the original name.
The r-lifecycle skill helps a package maintainer choose how to handle that old call. A superseded function can continue working while the documentation points to a better option. A planned removal calls for a staged deprecation and a message that tells the reader what to use instead.
What it does
- Introduce a replacement for a function or argument
- Preserve an older spelling while guiding users to the new one
- Add a lifecycle badge to function documentation
- Draft a warning that identifies a usable alternative
- Test the behaviour and wording of a deprecation
Install and use
- Install the skill in a compatible agent with an editable R package and lifecycle. The documented initial setup uses usethis. Use the project's normal documentation and test tools to verify changes.
- Ask, “Rename the output argument without breaking existing scripts immediately. Show the old call, the recommended replacement and the warning we should test.”
- Read the documentation as an existing user would. Try both forms in the project tests and check that the suggested replacement produces the intended result.
FAQ
Source
Made by Garrick Aden-Buie. Original skill: r-lifecycle, published on GitHub under the MIT licence.
View on GitHub