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.
npx skills add LeoLin990405/r-analytics-skill --skill testthatgit clone --depth 1 https://github.com/LeoLin990405/r-analytics-skillWrote 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.
[](https://agentmods.dev/skills/leolin990405/r-analytics-skill/testthat)<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/testthat"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/testthat/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.
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/testthat"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/testthat.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00022 | $0.00615 |
| Opus 5 | $0.00011 | $0.00308 |
| Sonnet 5 | $0.00004 | $0.00123 |
| Haiku 4.5 | $0.00002 | $0.00061 |
Grade A, and why
testthat 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.
How it starts
The opening of the file, as written. The whole thing — 141 lines — stays where its author put it; the contents beside it link to each section on GitHub.
testthat
Unit testing for R.
Setup
library(testthat)
# In package development
usethis::use_testthat()
# Creates tests/testthat/ directory
Basic Tests
test_that("description of test", {
expect_equal(1 + 1, 2)
expect_true(is.numeric(1))
expect_false(is.character(1))
})
Expectations
# Equality
expect_equal(x, y) # Near equality
expect_identical(x, y) # Exact equality
# Comparison
expect_lt(x, y) # Less than
expect_lte(x, y) # Less than or equal
expect_gt(x, y) # Greater than
expect_gte(x, y) # Greater than or equal
# Type
expect_type(x, "double")
expect_s3_class(x, "data.frame")
expect_s4_class(x, "Matrix")
# Length/dimension
expect_length(x, 10)
# NULL
expect_null(x)
# Output
expect_output(print(x), "pattern")
expect_message(f(), "message")
expect_warning(f(), "warning")
expect_error(f(), "error")
expect_silent(f())
# Matching
expect_match(x, "regex")
Test Files
# tests/testthat/test-myfunction.R
test_that("myfunction works", {
result <- myfunction(1, 2)
expect_equal(result, 3)
})
test_that("myfunction handles errors", {
expect_error(myfunction("a", "b"))
})
Running Tests
# Run all tests
devtools::test()
# Run specific file
test_file("tests/testthat/test-myfunction.R")
# Run interactively
test_that("quick test", {
expect_equal(1, 1)
})
Fixtures
# Setup/teardown
test_that("test with setup", {
# Setup
tmp <- tempfile()
write.csv(mtcars, tmp)
# Test
data <- read.csv(tmp)
expect_equal(nrow(data), 32)
# Cleanup (automatic with withr)
})
# Using withr
test_that("test with withr", {
withr::local_tempfile(tmp)
# tmp is cleaned up automatically
})
Skipping
test_that("conditional test", {
skip_on_cran()
skip_on_ci()
skip_if_not_installed("pkg")
skip_if(condition, "reason")
# Test code
})
Snapshots
test_that("output matches snapshot", {
expect_snapshot(print(summary(lm(mpg ~ wt, mtcars))))
})
# Update snapshots
snapshot_accept()
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.
- 8d ago First seen · 141 lines · 22 tokens per session scan A 66b806d1b4b5
testthat is a skill published in the GitHub repository LeoLin990405/r-analytics-skill (5 stars, last pushed 6mo ago), licensed MIT. It adds 22 tokens to every session and 615 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.
Other skills, from other repositories
bio-applied-testing-cicd
Write pytest tests/fixtures for bio functions and GitHub Actions CI with pytest-cov, ruff, black, mypy. Use when adding tests to a bio tool, writing conftest.py fixtures, or building tests.yml/lint.yml CI workflows.
cloudflare-workers-testing
Comprehensive testing guide for Cloudflare Workers using Vitest and @cloudflare/vitest-pool-workers. Use for test setup, binding mocks (D1/KV/R2/DO), integration tests, or encountering test failures, mock errors, coverage issues.
bun-test-lifecycle
Use for test lifecycle hooks: beforeAll, afterAll, beforeEach, afterEach, fixtures, preload.
bun-test-mocking
Use for mock functions in Bun tests, spyOn, mock.module, implementations, and test doubles.
bun-test-basics
Use for bun:test syntax, assertions, describe/it, test.skip/only/each, and basic patterns.
bun-test-coverage
Use for test coverage with Bun, --coverage flag, lcov reports, thresholds, and CI integration.