Analyzes R package code coverage with covr, audits tests for tautological assertions, and drafts missing test cases to improve coverage and correctness.
Ships in bioc-r-packages. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Measure an R package's test coverage with covr, audit the existing tests for assertions that add line coverage without verifying behaviour (pseudo-coverage), and draft tests for the gaps in the package's own testing framework.
covr and its testing framework installed. The framework determines where tests live:
testthat: tests/testthat/ (runner tests/testthat.R)tinytest: inst/tinytest/ (runner tests/tinytest.R)RUnit: inst/unitTests/ (runner tests/runTests.R)covr::package_coverage(). When the user names specific files, restrict the report and the later steps to those files (covr::file_coverage() is an alternative).R/ and src/.covr::report(); otherwise give them the command.src/ is unexpectedly zero, tell the user that compiled-code coverage depends on the compiler flags.Before treating covered lines as tested, read the existing test files and flag these patterns:
expected by re-implementing or copying the function's own formula or algorithm.expect_no_error() or !is.null(x) with no assertion on the result). A class-only check (expect_s4_class()) is valid for an external or remote contract, but vacuous when the contract is data accuracy or slot contents.Recommend refactoring each flagged test with an independent ground-truth check (Step 5).
Summarize for the user:
R/ and src/ that have no coverage or rely on vacuous testsFor each uncovered or pseudo-covered region, classify the missing tests:
NA handling, empty inputs (e.g. a 0-row DataFrame or GRanges), boundary values, extreme but valid inputs.expect_error() or the framework's equivalent).expected by re-running the function's internal logic. Use independent ground truth: benchmarks, hand-calculated values, reference outputs, or mathematical invariants. Assert on contents and dimensions, not on object existence.Present the drafted tests and refactors. Write them into the package's test directory only if the user asks, then suggest re-running Step 1 to confirm the improvement.
User: "Check my code coverage and help me write missing tests."
covr::package_coverage() reports high line coverage for R/normalize.R, but its tests compute expected values with the same formula as the function and assert only expect_true(!is.null(result)). The summary reports that file as pseudo-covered, and reports that no test exercises NA inputs or 0-length count vectors. The drafted tests replace the mirrored expectations with hand-calculated values (Correctness of Results) and add the NA and 0-length cases (Edge Cases).
What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/analyze-r-packageAnalyze R/Bioconductor package structure to extract key information about its purpose, exports, and characteristics/bioc-howtoA consolidated index of Bioconductor how-to skills covering genomics, sequencing, and omics data analysis tasks/bioc-pkg-devGuide an R package or a set of analysis scripts through Bioconductor submission: the pre-submission gate, the Contributions tracker, and post-acceptance maintenance/bioc-pkg-finderFind the R / Bioconductor packages best suited to a task or workflow/bioc-r-packages:improve-code-coveragefrom bioc-r-packages
npx claudepluginhub bioconductor/ai-agent-skills --plugin bioc-r-packagesOther plugins' skills for the same job