src/dot-agents/skills/r-expert/SKILL.md
Core R programming skill for all R code, package development, and data science workflows. Use when writing R functions, building packages, using tidyverse (dplyr, ggplot2, purrr), creating Shiny apps, working with R Markdown/Quarto, or doing data analysis—e.g., "write an R function", "refactor this R code", "create a Shiny dashboard", "set up package tests", "debug R errors".
npx skillsauth add jjjermiah/dotagents r-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
YOU MUST apply this skill for ALL R code, package development, and data science workflows. This skill provides production-grade R guidance and enforces modern best practices. No exceptions.
IMMEDIATELY use Context7 for package-specific APIs—outdated documentation causes bugs. Every time.
When loading any complementary skill, YOU MUST announce: "Loading [skill-name] with r-expert"
Load these additional skills IN COMBINATION with r-expert when applicable:
NEVER skip complementary skills when the task requires them. Skipping specialized guidance = substandard results. Every time.
FOLLOW THIS SEQUENCE. No deviations.
Package documentation without Context7 verification = stale information. Every time.
YOU MUST use Context7 for ALL package-specific documentation. Hard-coded knowledge becomes outdated. No exceptions.
Standard library IDs:
# Tidyverse core
/tidyverse/dplyr # Data manipulation
/tidyverse/ggplot2 # Visualization
/tidyverse/tidyr # Data reshaping
/tidyverse/purrr # Functional programming
/tidyverse/readr # Data import
# Development
/r-lib/devtools # Package development
/r-lib/usethis # Project setup
/r-lib/testthat # Testing
# ALWAYS check references/r-context7-mappings.md for the complete list
R code written without Context7 lookup = latent bugs. Every production R workflow uses Context7 verification.
YOU MUST follow these standards. No exceptions.
package::function() for clarity—implicit imports cause namespace conflictsCode deviating from these standards = rework required. Every time.
data <- raw_data |>
dplyr::filter(year >= 2020) |>
dplyr::mutate(
total = price * quantity,
category = forcats::fct_lump(category, n = 5)
) |>
dplyr::group_by(region) |>
dplyr::summarise(
revenue = sum(total, na.rm = TRUE),
.groups = "drop"
)
# Use withr for temporary state
withr::with_tempfile("tmp", {
readr::write_csv(data, tmp)
processed <- readr::read_csv(tmp, show_col_types = FALSE)
})
```text
### Package Structure
```text
my-package/
├── DESCRIPTION # Package metadata
├── NAMESPACE # Auto-generated exports
├── R/ # Source code
│ ├── utils.R # Internal helpers
│ └── main-feature.R # Main functionality
├── tests/
│ └── testthat/ # Tests
├── man/ # Documentation (auto)
└── README.Rmd # Package README
Context7 queries without the mappings reference = incorrect library IDs. Always check the reference first.
development
Guides creation, validation, and packaging of AI agent skills with token-efficient design, progressive disclosure patterns, and YAML frontmatter best practices. Use when building new skills, updating existing skills, validating skill structure against standards, or packaging for distribution—e.g., "create skill", "validate SKILL.md", "package skill for sharing", "check description format".
tools
Investigate and integrate weakly documented SDK/library modules (especially Azure SDKs) into code. Use when asked to "investigate module", "SDK", "client class", or when docs are missing/weak and you need to discover APIs, models, or usage patterns to implement integration.
tools
Write production-ready one-off scripts and automation utilities with proper error handling and safety patterns. Use when developing bash automation, Python CLI tools, shell scripts, system administration scripts, or command-line batch processing—e.g., "write a script to process files", "python one-liner for data conversion", "bash automation for backups", "shell script with error handling".
development
R package testing with testthat 3rd edition. Use when writing R tests, fixing failing tests, debugging errors, or reviewing coverage—e.g., "write testthat tests", "fix failing R tests", "snapshot testing", "test coverage".