Skip to content

feat(r-lib): add r-tidyverse-style skill - #89

Merged
gadenbuie merged 3 commits into
mainfrom
skill/tidy-style
Oct 6, 2026
Merged

gadenbuie merged 3 commits into
mainfrom
skill/tidy-style

Conversation

@gadenbuie

@gadenbuie gadenbuie commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Adds a new r-tidyverse-style skill under r-lib/ for reviewing and cleaning up R package code against the tidyverse style guide, with a focus on code largely written by LLMs. It separates mechanical formatting from behavior-sensitive refactors: formatting scoped files comes first, while pipe conversions, evaluation-order tweaks, public renames, or error-text changes are proposed separately and only applied when the user has authorized that scope. It also defers to the package's established conventions over the tidyverse guide unless a migration is requested.

Use cases

  • Review-only style passes on R package code, returning prioritized findings with file/line references
  • Behavior-preserving cleanup of formatting, names, redundant comments, and pointless wrappers
  • Writing substantial new R package code in tidyverse style when requested or when the package already follows it

Testing

  • ./count-skill-tokens.py r-lib/r-tidyverse-style passes with no warnings (full output below)
  • Structure verified against the repo conventions: valid frontmatter, kebab-case name matching the directory, no per-skill README, registered in marketplace.json and both READMEs
  • Note: count-skill-tokens.py was updated in this PR to exclude SKILL.md frontmatter (author/version/license metadata) from the line and token counts, since the description is already reported separately

Dependencies

No required dependencies. The skill documents optional tooling: Air for scoped formatting, and jarl and ry as optional lint and type checks.

Documentation

SKILL.md is written for Claude with a task workflow and selectively paraphrased style rules from the tidyverse style guide (chapter links act as citations, not required reading). The skill is registered in .claude-plugin/marketplace.json, the root README.md, and r-lib/README.md.

Token count

r-tidyverse-style (71 lines, ~1,855 tokens)

Skill description: ~77 tokens

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.

File Lines ~Tokens
SKILL.md 71 1,855

Add a skill for reviewing and cleaning up R package code against the
tidyverse style guide, separating mechanical formatting from
behavior-sensitive refactors and deferring to the package's existing
conventions.
@gadenbuie
gadenbuie marked this pull request as ready for review October 6, 2026 20:16
Frontmatter (name, description, author/version/license metadata) is
administrative and the description is reported separately, so it should
not count toward the skill budget. Strip only the frontmatter block with
a regex; python-frontmatter's .content also drops the leading blank line
and trailing newline, which skewed line counts by 2.
@gadenbuie
gadenbuie merged commit 82f1424 into main Oct 6, 2026
1 check passed
@gadenbuie
gadenbuie deleted the skill/tidy-style branch October 6, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant