r-dev-testing

r-dev-testing is a skill for Claude Code, Codex from LeoLin990405/r-analytics-skill. It costs 26 tokens per session (548 once invoked), scanned A, original, MIT.

A toolkit for testing R code with unit tests, coverage reports, and mocked dependencies. Unit tests check small parts of a program separately; coverage shows which code tests exercise.

In plain words
What is it for?
Use it to write testthat tests, check expected results and failures, measure coverage, and replace dependencies during tests.
Why use it?
It helps catch incorrect behavior, edge cases, errors, warnings, and untested code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write testthat tests, check expected results and failures, measure coverage, and replace dependencies during tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leolin990405/r-analytics-skill/r-dev-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LeoLin990405/r-analytics-skill --skill r-dev-testing
Clone the repo
git clone --depth 1 https://github.com/LeoLin990405/r-analytics-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for r-dev-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/r-dev-testing/github.svg)](https://agentmods.dev/skills/leolin990405/r-analytics-skill/r-dev-testing)
Your own site
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/r-dev-testing"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/r-dev-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for r-dev-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/r-dev-testing"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/r-dev-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 548 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.00548
Opus 5 $0.00013 $0.00274
Sonnet 5 $0.00005 $0.00110
Haiku 4.5 $0.00003 $0.00055

Measured 8d ago against content hash de4aa292d6e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

r-dev-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sub-skills/r-dev/r-dev-testing/SKILL.md · 117 lines

What it actually says

R Testing

Unit testing and coverage.

testthat

library(testthat)

# Basic tests
test_that("addition works", {
  expect_equal(1 + 1, 2)
  expect_identical(1L + 1L, 2L)
})

# Expectations
expect_equal(x, y)           # Equal with tolerance
expect_identical(x, y)       # Exactly identical
expect_true(x)
expect_false(x)
expect_null(x)
expect_length(x, n)
expect_named(x, c("a", "b"))
expect_type(x, "double")
expect_s3_class(x, "data.frame")
expect_s4_class(x, "Matrix")

# Errors/warnings
expect_error(f(), "message")
expect_warning(f())
expect_message(f())
expect_silent(f())
expect_condition(f())

# Output
expect_output(print(x), "pattern")
expect_snapshot(f())
expect_snapshot_output(print(x))

# Comparisons
expect_gt(x, y)
expect_gte(x, y)
expect_lt(x, y)
expect_lte(x, y)
expect_match(x, "regex")

Test Organization

# tests/testthat/test-myfunction.R
test_that("myfunction handles basic input", {
  result <- myfunction(1, 2)
  expect_equal(result, 3)
})

test_that("myfunction handles edge cases", {
  expect_error(myfunction(NULL))
  expect_equal(myfunction(0, 0), 0)
})

# Setup/teardown
setup({
  # runs before each test
})

teardown({
  # runs after each test
})

# Skip tests
skip_on_cran()
skip_on_ci()
skip_if_not_installed("pkg")
skip_if(condition, "reason")

covr (Coverage)

library(covr)

# Package coverage
cov <- package_coverage()
report(cov)
percent_coverage(cov)

# File coverage
file_coverage("R/file.R", "tests/testthat/test-file.R")

# Codecov
codecov(token = "TOKEN")

mockery

library(mockery)

# Mock function
m <- mock(10, 20, 30)
m()  # Returns 10
m()  # Returns 20

# Stub
stub(my_function, "other_function", 42)

# Verify calls
expect_called(m, 2)
expect_args(m, 1, arg1, arg2)
Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 117 lines · 26 tokens per session scan A de4aa292d6e9

Subscribe to this mod's changes

r-dev-testing is a skill published in the GitHub repository LeoLin990405/r-analytics-skill (5 stars, last pushed 5mo ago), licensed MIT. It adds 26 tokens to every session and 548 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.