Claude Code R Skills plugin
A Claude Code plugin for modern R: eight skills, commands, agents and hooks for tidyverse, rlang, S7, brms and testing
- 213 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Hooks run scripts on every `Edit`, `Write` and `Bash` call and write session files to `~/.claude/sessions/`
Install
- Works in
Manual install
/plugin marketplace add ab604/claude-code-r-skillsThen `/plugin install r-skills@r-skills`. For the language server `/plugin install r-lsp@r-skills`.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Hooks run scripts on every `Edit`, `Write` and `Bash` call and write session files to `~/.claude/sessions/`
This is third-party code. Review the repository files before installing.
What it does
The plugin bundles Claude Code settings for R development. Eight skills cover tidyverse patterns, rlang patterns, performance, code style, choosing between S7, S3 and S4, package development, Bayesian models with brms and TDD with `testthat`. `CLAUDE.md` adds a scientific reasoning principle: hypotheses are tested and never proven. Four commands: `/plan`, `/tdd`, `/code-review` and `/verify` for a full pre-commit check through build, lint, coverage and review. The package ships `planner`, `tdd-guide` and `code-reviewer` agents, rules on security, testing and git, and three contexts: `dev`, `research` and `review`. Six hooks watch context size and housekeeping: they suggest `/compact` after 50 tool calls, write a session file and warn about stray markdown files and before `git push`. Hooks can be disabled through environment variables or `state.json`.
Who it is for. Data analysts and R package developers working in Claude Code who want the agent to write idiomatic code with pipes and tests and without outdated habits.
Good fit when
- The agent writes R in an old style and you need modern pipes, joins and `purrr`
- You are building an R package that needs `testthat` tests and a check before commit
- You have to choose between S7, S3 and S4 for a new class
- You build a Bayesian model in `brms` with DAG validation and `marginaleffects` interpretation
Not a fit when
- The project is Python or JavaScript: skills and rules are all about R
- You need machine learning models: the author keeps `r-machine-learning` local only
- You do not want hooks: some fire on every `Edit`, `Write` and `Bash` call
Example request
Rewrite this function in modern tidyverse style and add testthat testsLimitations
- The public repository has eight skills, and the ninth skill on machine learning stays local with the author.
- Hooks run scripts on every `Edit`, `Write` and `Bash` call. `doc-blocker` and `git-push-warn` only warn: the call goes ahead.
- The `r-lsp` plugin needs the R packages `languageserver`, `lintr` and `styler`, while Positron does not.
- Rules, commands and agents are adapted from the Everything Claude Code project and follow the author's approach, so read `CLAUDE.md` before using them.
How to disable. Run `/plugin uninstall r-skills@r-skills`. A manual install is undone by deleting the copied folders. Individual hooks are turned off with `CLAUDE_DISABLE_HOOKS` or the `state.json` file.
FAQ
How do I install the R skills in Claude Code?
Use `/plugin marketplace add ab604/claude-code-r-skills` and `/plugin install r-skills@r-skills`. Copying into a project or `~/.claude` also works.
Which skills are included?
Eight: `tidyverse-patterns`, `rlang-patterns`, `r-performance`, `r-style-guide`, `r-oop`, `r-package-development`, `r-bayes` and `tdd-workflow`.
What do the hooks do?
They suggest `/compact` after 50 calls, write a session summary to `~/.claude/sessions/` and warn about stray markdown files and before `git push`. They cannot block calls.
Do I need the R language server?
Only for hints in VS Code or the terminal. It needs `r-lsp` and the `languageserver`, `lintr` and `styler` packages. Positron has its own server.
What are the dev, research and review contexts?
Three system prompt variants attached when launching Claude through an alias: a focus on implementation, on reading code or on an audit rated by severity.
Discussion
No questions or reviews yet.
Related
PluginsStatsClaw assembles nine Claude Code agents to build statistical packages from a paper or formulas with isolated pipelines.
MCP server that connects Claude Code and Codex to an open R or Python session in RStudio and Positron, where your data lives
16 Claude Code skills for data engineers: source profiling, failure investigation, change review and documentation as web pages.
26 skills and four reviewer agents for science in Claude Code: figure and statistics review, literature search, work handoff.
Claude Code skills for empirical economics: code and replication audit, bibliography checks, PDF reading and slide decks.
A Claude Code agent for protein design: target research, antibody and nanobody generation, screening and candidate ranking.
README in short
The README lists the Claude Code feature types and shows how they are set up for R: eight skills, four commands, three agents, rules, six hooks and three contexts. It follows with three install routes, a cheat sheet of modern patterns and anti-patterns, the directory layout, principles, requirements and token savings.
README badge
Original SKILL.md
--- name: tidyverse-patterns description: Modern tidyverse patterns for R including pipes, joins, grouping, purrr, and stringr. Use when writing tidyverse R code. --- # Modern Tidyverse Patterns *Best practices for modern tidyverse development with dplyr 1.1+ and R 4.3+* ## Core Principles 1. **Use modern tidyverse patterns** - Prioritize dplyr 1.1+ features, native pipe, and current APIs 2. **Profile before optimizing** - Use profvis and bench to identify real bottlenecks 3. **Write readable code first** - Optimize only when necessary and after profiling 4. **Follow tidyverse style guide** - Consistent naming, spacing, and structure ## Pipe Usage (`|>` not `%>%`) - **Always use native pipe `|>` instead of magrittr `%>%`** - R 4.3+ provides all needed features ```r # Good - Modern native pipe data |> filter(year >= 2020) |> summarise(mean_value = mean(value)) # Avoid - Legacy magrittr pipe data %>% filter(year >= 2020) %>% summarise(mean_value = mean(value)) ``` ## Join Syntax (dplyr 1.1+) - **Use `join_by()` instead of character vectors for joins** - **Support for inequality, rolling, and overlap joins** ```r # Good - Modern join syntax transactions |> inner_join(companies, by = join_by(company == id)) # Good - Inequality joins transactions |>