/r-package-skills:r-btwfrom r-package-skills
Provides R session context to LLMs via the btw package: describes R objects, fetches documentation, and registers tools for ellmer chat sessions.
Ships in r-package-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
btw connects R's context to LLMs. Provides tools that describe R objects, fetch documentation, and expose R information to chat sessions.
btw vs mcptools: btw gives tools TO ellmer (R → LLM). mcptools lets agents INTO R (LLM → R).
Install: install.packages("btw")
Read references/API.md before writing code.
references/API.md - Complete function referencereferences/package-docs.md - Tool registration and usage patternsprint() or str())library(btw)
# Copy description to clipboard
btw(mtcars) # Describe data frame
btw("ggplot2") # Package documentation
btw_this(model) # For LLM consumption
# Register tools with ellmer
library(ellmer)
chat <- chat_openai()
chat$set_tools(btw_tools())
# Now chat can call R documentation
chat$chat("What functions does dplyr have?")
# Project context
use_btw_md() # Create btw.md
edit_btw_md() # Edit context file
| Issue | Solution |
|---|---|
| btw vs mcptools confusion | btw = tools TO chat; mcptools = agent INTO R |
| Tools not registered | Must call chat$set_tools(btw_tools()) |
| Using in scripts vs console | btw() for clipboard works in console |
| Expecting code execution | btw describes, doesn't execute (use mcptools) |
Description:
btw(): Generate plain-text descriptions (copies to clipboard)btw_this(): Create LLM-optimized descriptionsIntegration:
btw_tools(): Register with ellmerbtw_client(): btw-enhanced ellmer chatbtw_app(): btw-enhanced ellmer appProject Context:
use_btw_md(): Create project context fileedit_btw_md(): Modify context fileSkills:
btw_agent_tool(): Create agent tool from markdown filebtw_task_create_skill(): Create a new skill via taskbtw_skill_install_github(): Install skill from GitHubbtw_skill_install_package(): Install skill from R packageSee references/ for:
With ellmer: chat$set_tools(btw_tools())
Cross-package patterns: See r-ai meta-skill
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub arthurgailes/r-package-skills --plugin r-package-skills14 skills in this plugin
/r-aiUse when code loads ellmer, btw, mcptools, ragnar, or vitals, building LLM-powered R applications, implementing RAG workflows, or choosing between R AI packages (meta-skill for ellmer/btw/mcptools/ragnar/vitals)/r-collapseUse when code loads or uses collapse (library(collapse), collapse::), performing fast grouped or weighted statistics in R, or seeking faster alternatives to dplyr aggregation/r-duckplyrUse when code loads or uses duckplyr (library(duckplyr), duckplyr::), processing large datasets with dplyr syntax, working with Parquet files in R, or needing lazy evaluation for bigger-than-memory data/r-duckspatialUse when code loads or uses duckspatial (library(duckspatial), duckspatial::), performing spatial joins or areal interpolation on large vector datasets in R, or needing faster spatial operations than sf/r-ellmerUse when code loads or uses ellmer (library(ellmer), chat_openai, chat_claude, chat_ollama), chatting with LLMs from R, building chatbots, or extracting structured data from text with LLMs/r-flextableUse when code loads or uses flextable (library(flextable), flextable::), creating formatted tables for Word (.docx), PowerPoint (.pptx), HTML, or PDF in R, or needing merged cells and conditional formattingOther plugins' skills for the same job