- implements blueprint 028 - rewrite 290 cross-skill markdown links across 59 files to unchecked backtick-wrapped /skill-name prose (R-023), so skill content resolves under any install depth — symlinked, flat-copied, or whole-tree - add skills/productivity/conjure-a-skill/scripts/skill-ref-check — validates every /skill-name mention resolves to a real skill folder, the replacement coverage link-check lost on these references - add scripts/link-skills.sh, mirroring mattpocock/skills, symlinking every skill into ~/.claude/skills and ~/.agents/skills - docs(readme): point Install at link-skills.sh and npx skills@latest add for non-Claude-Code harnesses
3.0 KiB
3.0 KiB
name, description
| name | description |
|---|---|
| style-r | Project R coding standards — Tidyverse style, `box::use` for imports (no `library()` / `source()`), `purrr::chuck`/`pluck` instead of `$`/`[[`, `purrr::map`/`walk` instead of `for`, and `dtplyr` for large data.table work. Use when the user writes or edits R code, asks "is this R idiomatic", "review my R style", "use box", "use dtplyr", or opens an .R / .Rmd file and asks for help. |
style-r
When to use
- Writing or editing R (
.R/.Rmd) in a project that follows the Tidyverse style guide. - Reviewing R code for style / idiom.
- User says "use box", "use dtplyr", "make this tidyverse-y", "review my R style".
Top-level rules
- Imports go through
box::use. Nolibrary()calls in.Ror.Rmdfiles (top-of-Rmd setup chunks included). Nosource(). See box.md. - No
forloops where apurrrmapping fits. Prefermap/walk/map_chr/map_dfr/pmap. See tidyverse.md. - No raw
$or[[on named lists / S3 objects when the key could be missing. Usepurrr::chuck()(strict — errors on miss) orpurrr::pluck()(lenient —NULLon miss). See tidyverse.md. dtplyrfor large pipelines. When chaineddplyrverbs hitdata.table-class objects above ~1 M rows, wrap withdata.table::lazy_dt(df)and exit withas_tibble(). See dtplyr.md.- Native pipe
|>only. No%>%. Anonymous functions:\(x), notfunction(x). See tidyverse.md §5–6. snake_casefor names,SCREAMING_SNAKE_CASEfor constants. NocamelCase, nodot.separated. See tidyverse.md §7.- Roxygen2 on every exported function in a package
(
DESCRIPTIONpresent). See tidyverse.md §8.
Tooling, not enforcement
The skill states the rules; styler::style_pkg() and lintr enforce them.
Mention these when relevant; never invoke them as part of editing the
file under review.
Guardrails
- Never add
library()to fix an import — replace the underlying call withpkg::fn()or add abox::useline. - Never introduce a
forloop "just to keep the diff small". If the surrounding code is loop-based, flag it and ask before changing scope. - Never silently swap
$forchuck. They have different failure modes —chuckerrors loudly, which is the right default but a behaviour change. Confirm before flipping in legacy code. - Never wrap small frames with
lazy_dt. The overhead exceeds the saving. See dtplyr.md.
See also
/bdd—box::export()is the public-surface control mechanism./bdd— pure functions + DI compose with these style rules./diagnose— worked example #1 (in-place mutation) is the canonicaldtplyr/data.table::copy()failure mode./commit-atomic-jj— when a style refactor changes more than one file, it's an atomic commit of its own.