From r-package-skills
Use when creating, editing, or validating R package skills (library(pkg), pkg::), or gathering R package documentation (CRAN, pkgdown, vignettes) to generate a skill
npx claudepluginhub arthurgailes/r-package-skills --plugin r-package-skillsThis skill uses the workspace's default tool permissions.
Generates a new `r-{package}` skill from an R package's documentation. Core loop: capture intent → gather docs → draft skill → run test cases (with-skill + baseline in parallel) → grade → iterate until pass_rate >= 90% and no improvement for 2 iterations → optimize description.
Use when code loads or uses btw (library(btw), btw::), providing R session context to LLMs, registering tools for ellmer chat, or copying R object descriptions to clipboard
Creates dynamic skills from Rust crate or std library documentation URLs. Supports third-party crates like tokio, serde, axum and std modules/traits.
Share bugs, ideas, or general feedback.
Generates a new r-{package} skill from an R package's documentation. Core loop: capture intent → gather docs → draft skill → run test cases (with-skill + baseline in parallel) → grade → iterate until pass_rate >= 90% and no improvement for 2 iterations → optimize description.
Always ask before creating files. No silent defaults. If the user already specified a path, use it. See references/installation-paths.md for the prompt and agent-specific paths.
{install-path}/r-{package}/
SKILL.md # <500 words
references/
API.md # REQUIRED: Complete CRAN reference manual
vignette-name.md # Include all CRAN vignettes
references/API.md is required for every package skill.references/{vignette}.md.references/API.md before writing code."(opt) optional, (adv) advanced. Never hide parameters that affect performance or output size (zoom levels, batch sizes, etc.).references/doc-gathering.md.references/API.md, and vignettes.benchmark.json. See references/testing.md.pass_rate < 90% or it's still improving, analyze failures, edit the skill, rerun. Remove guidance transcripts show agents ignoring (YAGNI). Stop when pass_rate >= 90% AND no improvement for 2 iterations.references/description-optimization.md.Descriptions MUST include library({pkg}) and {pkg}:: tokens plus file-extension and domain triggers. Without the package-name tokens, descriptions that read as action-oriented ("Use when creating interactive maps") miss user prompts that contain library(mapgl) or mapgl::.
# Good
description: Use when code loads or uses freestiler, working with .pmtiles files, or preparing tiles for mapgl/MapLibre in R
# Bad: no recognition tokens
description: Use when creating PMTiles vector tilesets from large spatial datasets
See references/description-optimization.md for the train/held-out test method.
Domain assertions call R validators in lib/r-validators/ at repo root via Rscript:
plot-validator.R -- ggplot2/mapgl visualizationsspatial-validator.R -- sf/spatial operationshtml-validator.R -- flextable/Shiny outputsnumerical-validator.R -- collapse/regression resultsEach returns JSON (valid, message, domain fields) for use as grading evidence.
Rscript -e "code" or mcptools MCP.temp_*.R or use tempfile(), clean up with on.exit(unlink(...)) or file.remove().| Mistake | Fix |
|---|---|
Missing references/API.md | REQUIRED. Extract from CRAN reference manual. |
| Missing vignettes | Include every CRAN vignette as references/*.md. |
| Quick Reference hides parameters | Show ALL params that affect performance/output. Mark optional with (opt). |
| Running with-skill first, baseline later | Spawn both in the same turn so timing is comparable. |
| Assertion schema drift | Use text / passed / evidence in grading.json, not name / met / details. |
| Description too generic | Include library({pkg}) and {pkg}:: tokens. |
| Skipping baseline | Without a baseline, you can't tell whether the skill helped. |
| Optimizing description before skill works | Fix functionality first; tune triggering last. |