A curated collection of Claude Code configurations for modern R use. These skills, rules, commands, and agents help Claude Code understand R best practices and generate idiomatic, high-quality R code.
> /plugin marketplace add ab604/claude-code-r-skills
Repo: ab604/claude-code-r-skills
What's inside
Version 1.2.5 | Last updated: 2026-09-17
A curated collection of Claude Code configurations for modern R use. These skills, rules, commands, and agents help Claude Code understand R best practices and generate idiomatic, high-quality R code. Additionally the rules and commands help with efficient token usage and enforce constraints, and agents can perform specific tasks. Obviously you can fork and adapt any of these to your case-use.
I use Positron, but if you are a VSCode user there is also a plugin for R language server for code intelligence.
To try and pre-empt some of the issues with LLMs being reinforced to please the user, I've added a scientific reasoning principle to CLAUDE.md: we test hypotheses; we never prove them. Claude is instructed to reason from evidence, maintain healthy scepticism, quantify uncertainty explicitly (preferring Bayesian framing), and never tell the user what it thinks the user wants to hear at the expense of accuracy. This doesn't seem to prevent the "telling you what it thinks you want to hear" problem entirely, but is hopefully better than nothing.
This project uses and builds on the work of:
Sarah Johnson's Modern R Development Guide - Original guide that formed the foundation for the R skills in this repository
Jeremy Allen's Claude Skills Repo - Jeremy's Claude Skills mostly derived from Sarah's guide
Affaan Mustafa's Everything Claude Code - Framework structure, rules, commands, and agents adapted for R development from Affan's Hackathon winning code
Posit's testing-r-packages Skill - testthat Edition 3 patterns, test design principles, and comprehensive expectations reference incorporated into the tdd-workflow skill
statzhero's tidy-r-skill - Join quality control patterns (relationship, na_matches, tidylog), NA-safe filtering with filter_out(), when_any()/when_all(), replace_when() for in-place conditional updates, and cli::cli_abort() structured error messages incorporated into the tidyverse-patterns and r-style-guide skills
As an aside, I use Quarto in my workflow and use Posit's Quarto plugin which you can add with: /plugin marketplace add posit-dev/skills and then /plugin install quarto@posit-dev-skills.
This repository provides Claude Code configurations specifically for R users, combining:
Claude Code uses five official feature types to customise its behaviour for R development, plus a custom convention (Contexts) built on the CLI's --system-prompt flag. Each serves a distinct purpose in the development workflow.
What they are: Markdown documents containing domain knowledge, best practices, and coding patterns that Claude references when writing code. Skills are passive knowledge resources loaded into Claude's context when relevant.
When to use: Claude automatically activates skills based on the code you're working on. For example, when you're writing tidyverse code, the tidyverse-patterns skill provides guidance on modern pipes, joins, and grouping.
How they work: Skills live in .claude/skills/ and contain detailed guidance, anti-patterns to avoid, and code examples. Claude consults these when making implementation decisions.
How to use:
# Skills are automatically activated - no manual invocation needed
# You can also explicitly request skill usage in your prompts:
"Write a function using tidyverse-patterns to summarize data by group"
What they are: User-invocable shortcuts (prefixed with /) that trigger specific workflows or behaviours. Commands are active - you call them explicitly to perform actions.
When to use: Use commands when you want Claude to follow a specific workflow, such as planning before implementation (/plan) or conducting a code review (/code-review).
How they work: Commands are defined in the commands/ directory and can trigger agents, enforce specific behaviours, or structure Claude's responses in particular ways.
How to use:
# In your Claude Code conversation:
/plan Add bootstrap confidence intervals to model output
# After seeing the plan, respond:
yes # or "proceed" to start implementation
# Review code before committing:
/code-review
What they are: Mandatory constraints and requirements that Claude must follow. Rules enforce project standards like test coverage thresholds, security practices, and git workflows.
When to use: Rules are always active - Claude automatically enforces them throughout the session. They're particularly important for maintaining code quality, security, and testing standards.
How they work: Rules are markdown files in the rules/ directory that define requirements (e.g., "80% test coverage required") and constraints (e.g., "never commit credentials"). Claude validates actions against these rules.
How to use:
# Rules are automatically enforced - no manual invocation needed
# Claude will:
# - Require 80% test coverage (from testing.md)
# - Validate credential handling (from security.md)
# - Format commits correctly (from git-workflow.md)
# You can reference rules explicitly:
"Make sure this follows our testing rules"
What they are: Specialized sub-agents with specific roles, expertise, and limited tool access. Agents are focused workers that handle particular types of tasks.
When to use: Agents are invoked by commands or automatically by Claude when specialised expertise is needed. The planner agent creates implementation plans, while the code-reviewer agent analyses code for issues.
How they work: Agents are defined in the agents/ directory with specific tools and prompts. They receive a task, complete it with their specialised knowledge, and return results to the main conversation.
How to use:
# Agents are typically invoked via commands:
/plan Feature description # Activates the planner agent
/code-review # Activates the code-reviewer agent
# Claude may also invoke agents automatically when appropriate
What they are: Event-driven JavaScript scripts that execute automatically at specific points in Claude's workflow (e.g., before editing files, on session start/end, before context compaction).
When to use: Hooks run automatically in response to events - you don't invoke them directly. They're useful for context management, state persistence, and workflow optimisations.
How they work: Hooks are configured only in hooks/hooks.json, which ships with the plugin. Matchers use simple tool names ("Bash", "Write", "Edit|Write", "*"). Every hook is a script referenced by absolute path via ${CLAUDE_PLUGIN_ROOT}/.claude/hooks/scripts/. Don't add hooks to .claude/settings.json with relative paths: Claude Code runs hook commands from your home directory, not the project root, so relative paths fail.
How to use:
# Hooks run automatically. Configured hooks in this repo:
# - suggest-compact: Suggests /compact after 50 tool uses
# - pre-compact: Saves session state before compaction
# - session-start: Reports available history on startup
# - session-end: Persists session state for continuity
# - doc-blocker: Warns about creating random .md files
# - git-push-warn: Warns before any git push
# Hooks are transparent - you'll see their output in the session:
[StrategicCompact] 50 tool calls reached - consider /compact if transitioning phases
[Hook] WARNING: About to run: git push origin main
[Hook] Confirm this push is intentional before proceeding.
What they are: Dynamic system prompt injection contexts — markdown files containing scenario-specific instructions passed to Claude at session start via the --system-prompt CLI flag.
When to use: Use a context alias when starting a session with a specific focus. Your .claude/rules/ files handle baseline project rules; contexts layer scenario-specific behaviour on top.
How they work: Shell aliases inject context files as system prompts when launching Claude — no tool call overhead, system-level authority.
How to use:
# Add to ~/.bashrc or ~/.zshrc
alias claude-dev='claude --system-prompt "$(cat ~/.claude/contexts/dev.md)"'
alias claude-review='claude --system-prompt "$(cat ~/.claude/contexts/review.md)"'
alias claude-research='claude --system-prompt "$(cat ~/.claude/contexts/research.md)"'
# Launch Claude in the mode you need:
claude-research # Exploration mode
claude-dev # Implementation mode
claude-review # Code quality/security review
Note: For most workflows the difference between placing context in
.claude/rules/and using the CLI--system-promptapproach is marginal. The CLI approach is faster (no tool call), more reliable (system-level authority), and slightly more token-efficient — but requires shell setup and may not be worth the overhead for everyone.
Recommended workflow sequence:
claude-research → /plan → claude-dev → /tdd → implement → /verify → claude-review → commit
| Skill | Description |
|---|---|
| tidyverse-patterns | Modern pipes, joins, grouping, purrr, stringr |
| rlang-patterns | Data-masking, injection operators, dynamic dots |
| r-performance | Profiling, benchmarking, vctrs, optimisation |
| r-style-guide | Naming, spacing, function design |
| r-oop | S7, S3, S4, vctrs decision guide |
| r-package-development | Dependencies, API design, testing |
| r-bayes | brms, DAG validation, multilevel models, marginaleffects |
| tdd-workflow | Test-driven development with testthat |
Local-only (not in public repo):
| Skill | Description |
|---|---|
| r-machine-learning | XGBoost, LightGBM, CatBoost, Elastic Net, ExtraTrees, ridge stacking, stratified CV — updated 2026-02-20 |
| Command | Description |
FAQ
r-skills is a Claude Code plugin with 8 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes r-bayes, r-oop, r-package-development. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it