Giverny

R Testthat

Best practices for writing R package tests with testthat version 3+.

by Posit★ 576WritingOfficial

What R Testthat does

Best practices for writing R package tests with testthat version 3+. Use this skill when writing or organizing tests for an R package or when improving existing tests that use testthat. It covers test structure and expectations, self-sufficient test design, proper cleanup with withr, fixtures, mocking external dependencies, snapshot testing, and BDD-style describe/it patterns.

How to install R Testthat in Claude Code

Giverny gives you a ready prompt with the exact install command from posit-dev/skills. Sign in with GitHub, copy the prompt and paste it into Claude Code; Claude installs the skill and confirms it loaded. To install by hand, clone posit-dev/skills and copy the r-lib/r-testthat folder into ~/.claude/skills/.

How to use it

Once installed, Claude loads R Testthat on its own whenever your request matches what the skill does. You can also ask for it by name, for example: “Use the r-testthat skill on my current project.”

More Claude skills for writing