Agent skill

R Tidyverse Style

by posit-dev in posit-dev/skills

A skill your agent uses when the user asks to review or clean up R code for tidyverse style, standardize formatting or names, remove redundant comments or wrappers, or make a behavior-preserving…

MITAuto-check passed

Install R Tidyverse Style

skills CLI
$ npx skills add posit-dev/skills --skill r-tidyverse-style -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install posit-dev/skills r-tidyverse-style --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/posit-dev/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/r-lib/r-tidyverse-style .claude/skills/r-tidyverse-style && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
r-tidyverse-style
GitHub stars
533
Token cost
~2.4k tokens
SKILL.md length
1,160 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when the user asks to review or clean up R code for tidyverse style, standardize formatting or names, remove redundant comments or wrappers, or make a behavior-preserving…

  • Works in 5 steps: Set scope and mode. For a review,… → Protect interfaces. Before renaming or… → Triage observations. Distinguish style,… → …
  • The user asks to review
  • SKILL.md covers Work through the task, Style rules, Optional tools and Examples
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

R Tidyverse Style is an agent skill from posit-dev/skills. Use when the user asks to review or clean up R code for tidyverse style, standardize formatting or names, remove redundant comments or wrappers, or make a behavior-preserving style pass. Also use when writing substantial new R package code if the user requests tidyverse style or the package already follows it. Not for routine small edits or general correctness, security, or test-quality reviews.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A collection of Claude Skills from Posit. The licence is MIT.

When your agent uses it

  • The user asks to review
  • Clean up R code for tidyverse style
  • Standardize formatting
  • Remove redundant comments

Example prompts

  • “/r-tidyverse-style”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Set scope and mode. For a review, inspect the requested files or diff without editing. For cleanup, change only the agreed scope. When…
  2. Protect interfaces. Before renaming or reorganizing code, check exports, roxygen/NAMESPACE, S3/S4 methods, callers, tests, and…
  3. Triage observations. Distinguish style, maintainability, and possible bugs. For generated-looking code, investigate comments that restate…
  4. Change in risk order. Format scoped files first. Then simplify only verified redundancy, retaining comments about intent or constraints…
  5. Verify and report. Inspect the diff; run relevant focused tests and broader package checks when warranted. For review-only work, give…

What it can do on your machine

Read from SKILL.md and the folder at commit e20b71b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • style.tidyverse.org
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

R Tidyverse Style loads about 2.4k tokens when it runs. Until then it costs about 104 tokens; SKILL.md has 1,160 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~104
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from posit-dev/skills at commit e20b71b, republished under its MIT licence (© posit-dev). 1,160 words, ~2,361 tokens.

Download SKILL.mdSave it as .claude/skills/r-tidyverse-style/SKILL.md (or your agent's skills folder).
name
r-tidyverse-style
description
Use when the user asks to review or clean up R code for tidyverse style, standardize formatting or names, remove redundant comments or wrappers, or make a behavior-preserving style pass. Also use when writing substantial new R package code if the user requests tidyverse style or the package already follows it. Not for routine small edits or general correctness, security, or test-quality reviews.
metadata.author
Garrick Aden-Buie (@gadenbuie)
metadata.version
1.0
license
MIT

Tidyverse style for R package code

Prefer the package's established conventions over the tidyverse guide unless the user requests a migration. Style is not proof of correctness; keep public behavior unchanged during cleanup.

Work through the task

  1. Set scope and mode. For a review, inspect the requested files or diff without editing. For cleanup, change only the agreed scope. When writing new code, inspect neighboring R/ files, tests, and style configuration before choosing conventions. Check DESCRIPTION for supported R versions and dependencies when relevant.
  2. Protect interfaces. Before renaming or reorganizing code, check exports, roxygen/NAMESPACE, S3/S4 methods, callers, tests, and user-visible conditions. Don't treat a public rename, changed default, error, return value, dependency, or supported R version as cosmetic.
  3. Triage observations. Distinguish style, maintainability, and possible bugs. For generated-looking code, investigate comments that restate code, duplicate checks or helpers, pointless wrappers, speculative tryCatch() fallbacks, and docs or tests that contradict behavior. Confirm against callers and tests before removing anything; code provenance alone proves nothing. These are review heuristics, not tidyverse rules.
  4. Change in risk order. Format scoped files first. Then simplify only verified redundancy, retaining comments about intent or constraints. Propose behavior-sensitive changes (pipe conversions, evaluation order, control flow, public names, error text) separately; make them only if the user has authorized that scope, with focused tests. Don't turn a style pass into an unrequested refactor.
  5. Verify and report. Inspect the diff; run relevant focused tests and broader package checks when warranted. For review-only work, give prioritized findings with file/line references and suggested edits, without modifying files. For edits, state what changed, what was deferred, and which checks actually ran. Don't claim a style pass is a correctness or security review.

Style rules

The rules below selectively paraphrase the tidyverse style guide (source, consulted at commit 2aed77e); this is not an official tidyverse skill. The links are citations, not required reading. Open a relevant chapter only when a rule needs clarification or the user requests verification, never all chapters by default.

Syntax and names

Source: Syntax.

  • Prefer descriptive snake_case names: nouns for values, verbs for functions. Dots can obscure S3 method names. Check compatibility before renaming names used outside a file or package.
  • Use two-space indentation, no tabs. Put spaces after commas, around ordinary infix operators, and around = in named arguments; not just inside parentheses or around $, ::, :, ^, or unary -. Tidy-evaluation operators have exceptions. Prefer syntax-aware formatting to regex edits.
  • Use <- for assignment and = for named arguments; avoid semicolons and multiple statements on a line.
  • Put opening braces at line ends, closing braces at line starts, and else beside the preceding }. Use braces for multiline branches and loops. Don't replace if with vectorized ifelse() or change &/| to &&/|| without checking semantics.
  • Put arguments of a long call on separate, consistently indented lines. Aim for readable line lengths (80 characters is a target, not a hard limit).
  • Group related statements into visual paragraphs; use a single empty line to separate distinct thoughts, functions, or pipelines, not every statement. Avoid empty lines at the start or end of functions. A blank line before a comment block can tie its explanation to the code below.
  • Prefer double quotes unless single quotes reduce escaping; spell logical constants TRUE and FALSE. Prefix comments with # . Keep comments explaining decisions or constraints; remove narration only after checking its purpose.
  • Name arguments that control computation or override defaults, but don't require names for every conventional first data argument. Avoid partial matching.
Functions and pipes

Sources: Functions, Pipes.

  • Use function(...) { ... } for named functions. Short single-expression anonymous functions can use \(x) ...; use function() for longer ones. Don't introduce formula lambdas or wrappers merely for style.
  • Put long function definitions on multiple lines with consistent indentation. Use return() chiefly for early exits, on its own line; otherwise rely on the last expression. Side-effect functions may invisibly return their input, but changing an existing return value isn't cosmetic.
  • Use pipes for transformations of one primary object; name intermediates when several objects participate or an intermediate has meaning. In multiline pipes, put the pipe at line end and indent steps by two spaces. Short pipes and several assignment layouts are acceptable.
  • The guide favors |>, but don't mass-convert %>%: check the minimum R version, placeholders, pronouns, magrittr operators, and evaluation behavior. Treat migration as separate, tested work.
Show full SKILL.md (446 more words)Show less
Package files

Sources: Files, Package files, Tests.

  • Use descriptive lowercase .R filenames with consistent - or _ separators. Name a single-function file after its function; give a file of related functions a concise, evocative name. The guide uses deprec- for deprecated-function files.
  • Put documented public functions before private helpers. If functions share a roxygen documentation block, place them immediately after it. Use section comments when helpful. Check collate order, registration, generated files, and load-time effects before moving code.
  • Match tests/testthat/test-<name>.R to R/<name>.R when organizing tests. The book specifies test-file organization, not test design or coverage goals.
  • In scripts, group library() calls near the top. Don't add library() calls inside package code or infer package dependency policy from this script guidance.
Documentation and diagnostics

Sources: Documentation, Error messages.

  • Put roxygen comments next to code. Use concise sentence-case titles without final periods; explicit @description for longer descriptions. Prefix lines with #' , indent wrapped tags consistently, write complete parameter/return sentences, and use @inheritParams for shared text.
  • Use backticks for R code, argument names, and values, not package names merely because they're packages. Add @seealso, @family, and links where useful. Use @noRd for internal functions documented with roxygen; don't add roxygen to every helper.
  • Lead errors with a clear problem and useful location/details. Use “must” for a clear requirement and “Can't” when the failed operation is more natural. Use bullets or hints only when warranted; don't invent a diagnosis. The guide illustrates cli conventions, but adding a dependency is a separate decision.
  • Check docs against actual signatures, defaults, return values, and examples. Error wording may be user-visible or snapshotted; changing validation rules, condition classes, or error timing isn't style cleanup.
ggplot2 (when relevant)

Source: ggplot2. Put + at line ends, indent subsequent layers, and prefer transforming data before calling ggplot() rather than inside its data argument. Verify any plot restructuring against existing behavior.

Optional tools

Use air format R/file.R for scoped formatting (or air format --check R/file.R to check without writing). If installed, jarl check . provides lint findings and ry check flags possible type errors. Honor project configuration; investigate diagnostics rather than automatically applying fixes. None of these tools is required or proves behavior unchanged. Report unavailable tools or failing pre-existing tests.

Examples

  • Reviewing R/import.R: flag a comment that merely narrates the next line as style noise. Treat tryCatch(..., error = function(e) NULL) as a possible bug to investigate, not something to delete during a review.
  • Cleaning a package that supports R 4.0: format the requested file, but leave %>% and exported names alone. Propose any base-pipe migration or public rename separately, with compatibility analysis and tests.

Use r-testthat for test design and r-package-development for package infrastructure rather than expanding this style pass into either task.

© posit-dev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in r-lib/r-tidyverse-style of posit-dev/skills.

Open the folder on GitHubat commit e20b71b

Compare with similar skills

R Tidyverse Style next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

R Tidyverse Style compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
R Tidyverse Style this skillposit-dev/skills533—~2.4kAutomated safety check: PassMIT
Android Clean Architectureaffaan-m/ECC276k4 repos~2.2kAutomated safety check: PassMIT
Cleanbergside/awesome-design-skills3.1k1 repos~918Automated safety check: PassMIT
Data Cleaningbrycewang-stanford/Auto-Empirical-Research-Skills4.5k—~2.9kAutomated safety check: PassCustom licence
Data Cleanbrycewang-stanford/Auto-Empirical-Research-Skills4.5k—~1.1kAutomated safety check: PassCustom licence
Cleancatlog22/Claude-Code-Workflow2.1k—~3.2kAutomated safety check: PassMIT

Similar skills

  • Applies Clean Architecture to Android and Kotlin Multiplatform projects: module layout, dependency rules, UseCases, Repositories and data layer patterns.

    276k GitHub starsUsed in 4 repos~2.2k tokens
    DevelopmentAuto-check passed
  • Clean

    bergside/awesome-design-skills

    Simplicity-focused design with ample whitespace, legible typography, and a limited color palette to reduce visual clutter.

    3.1k GitHub starsUsed in 1 repo~918 tokens
    Frontend & DesignAuto-check passed
  • Data Cleaning

    brycewang-stanford/Auto-Empirical-Research-Skills

    Clean and transform messy data for analysis in Python, R, or Stata

    4.5k GitHub stars~2.9k tokensUpdated 4 days ago
    Data & AnalyticsAuto-check passed
  • Data Clean

    brycewang-stanford/Auto-Empirical-Research-Skills

    Produce documented data cleaning scripts that log every transformation with N before/after each step, generate a CONSORT-style exclusion flow diagram, create decision log entries for every…

    4.5k GitHub stars~1.1k tokensUpdated 4 days ago
    Data & AnalyticsAuto-check passed
  • Clean

    catlog22/Claude-Code-Workflow

    Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution.

    2.1k GitHub stars~3.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Clean Up Comments

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing templates, rendered HTML, or shared components related to Remove comments and debug code in production.

    74k GitHub stars~435 tokensUpdated 3 days ago
    Auto-check passed

More from posit-dev/skills

All 17 skills in this repo
  • R CLI App

    posit-dev/skills

    Build command-line apps in R using the Rapp package. An agent skill from posit-dev/skills.

    533 GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check passed
  • R Lifecycle

    posit-dev/skills

    Guidance for managing R package lifecycle according to tidyverse principles using the lifecycle package.

    533 GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • PR Create

    posit-dev/skills

    Creates a pull request from current changes, monitors GitHub CI, and debugs any failures until CI passes.

    533 GitHub stars~4.3k tokensUpdated 2 days ago
    Auto-check: warnings
  • Shiny Bslib

    posit-dev/skills

    Build modern Shiny dashboards and applications using bslib (Bootstrap 5).

    533 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Shiny Bslib Theming

    posit-dev/skills

    Advanced theming for Shiny apps using bslib and Bootstrap 5.

    533 GitHub stars~3.6k tokensUpdated 2 days ago
    Auto-check passed
  • Critical Code Reviewer

    posit-dev/skills

    Rigorously review code or pull requests for correctness, security, accessibility, maintainability, tests, and edge cases.

    533 GitHub stars~3.9k tokensUpdated 2 days ago
    Auto-check passed

Questions about R Tidyverse Style

What does R Tidyverse Style do?

A skill your agent uses when the user asks to review or clean up R code for tidyverse style, standardize formatting or names, remove redundant comments or wrappers, or make a behavior-preserving…. R Tidyverse Style is an agent skill from posit-dev/skills. Use when the user asks to review or clean up R code for tidyverse style, standardize formatting or names, remove redundant comments or wrappers, or make a behavior-preserving style pass.

When should I use R Tidyverse Style?

R Tidyverse Style fits situations like: the user asks to review; clean up R code for tidyverse style; standardize formatting; remove redundant comments.

How do I install R Tidyverse Style in Claude Code?

Run `npx skills add posit-dev/skills --skill r-tidyverse-style -a claude-code`. Or copy the skill folder (r-lib/r-tidyverse-style in posit-dev/skills) into .claude/skills/r-tidyverse-style in your project. Claude Code loads it when a task matches its description.

How do I install R Tidyverse Style in Codex?

Run `npx skills add posit-dev/skills --skill r-tidyverse-style -a codex`. Or copy the skill folder (r-lib/r-tidyverse-style in posit-dev/skills) into .agents/skills/r-tidyverse-style in your project. Codex loads it when a task matches its description.

Can I use R Tidyverse Style in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add posit-dev/skills --skill r-tidyverse-style -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/r-tidyverse-style, .gemini/skills/r-tidyverse-style, .github/skills/r-tidyverse-style and .opencode/skills/r-tidyverse-style in your project.

What does R Tidyverse Style need to run?

SKILL.md names no scripts, command-line tools or credentials: R Tidyverse Style is instructions for the agent only.

Does R Tidyverse Style access the network?

SKILL.md names 2 domains. As links in the text: style.tidyverse.org and github.com. This is read from the text; nothing was executed.

Is R Tidyverse Style safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does R Tidyverse Style use?

R Tidyverse Style is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does R Tidyverse Style use?

About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to R Tidyverse Style?

Skills that share tags, products or a category with R Tidyverse Style: Android Clean Architecture (affaan-m/ECC, 276k stars), Clean (bergside/awesome-design-skills, 3.1k stars), Data Cleaning (brycewang-stanford/Auto-Empirical-Research-Skills, 4.5k stars) and Data Clean (brycewang-stanford/Auto-Empirical-Research-Skills, 4.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains R Tidyverse Style?

posit-dev (a GitHub organization) maintains it in posit-dev/skills, which has 533 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: posit-dev/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.