agentleFS
pobstetapobsteta/aigora/.claude/skills/r-session/SKILL.md

r-session

Skill0 starsChanged 45 days agoMITView on GitHub

Work with the user's live R session in RStudio through the r-session MCP server (Posit's btw package) - inspect data frames and objects in memory, read help pages of installed packages, check session info and CRAN. Use when the user mentions "mes données", "ma session R", "l'objet X", a data frame by name, an R package, or asks for analysis on data already loaded in RStudio.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If several R sessions are open, use the session-selection tools the server offers and confirm with the user which one to use.

    line 28
  2. Very specific:

    Default: docs, pkg, env, sessioninfo, cran (read-only, no code execution in the session).

    line 33
  3. Distinctive:

    Never print large objects: summarize (dimensions, column types, a few rows).

    line 40
  4. Very specific:

    Prefer writing a script in R/ or a .qmd the user runs themselves.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Live R session (RStudio)

The r-session MCP server runs btw::btw_mcp_server() (Posit, CRAN). It connects to the interactive RStudio session that called btw::btw_mcp_session() (done automatically by the project .Rprofile when AIGORA_R_MCP=1). Its tools are prefixed mcp__r-session__.

When to use it

  • The user refers to an object that lives in their R session ("le data frame ventes", "mon modèle", "ce que j'ai chargé") -> describe it with the env tools before writing code.
  • Questions about a package or function -> read the installed help page (docs tools), so the answer matches the version the user has, not memory.
  • Writing code for the user -> check sessioninfo (R version, loaded packages) first.

Setup (if the tools are missing)

  1. aigora_verifier() in the R console: the "Paquet R btw" line must be "ok". Otherwise: aigora_installer_r_mcp() (installs btw + mcptools from CRAN).
  2. aigora_r_mcp(TRUE): writes AIGORA_R_MCP=1 to .env, makes the session visible, registers the server in Claude Code (scope local).
  3. Restart Claude Code in the Terminal (/exit, then claude).
  4. If several R sessions are open, use the session-selection tools the server offers and confirm with the user which one to use.

Tool groups

Default: docs, pkg, env, sessioninfo, cran (read-only, no code execution in the session). AIGORA_R_MCP_TOOLS in .env changes the list. Adding run lets you execute R code inside the user's live session (it can modify or delete their objects): propose it only if the user asks, explain the risk, and re-register with aigora_mcp(simulation = FALSE).

Rules

  • Never print large objects: summarize (dimensions, column types, a few rows).
  • Data can be personal or confidential: do not copy it into memory files, logs or kChat.
  • Prefer writing a script in R/ or a .qmd the user runs themselves; with run, show the code and get a yes before executing anything that changes the session.
  • Without the MCP server you can still run Rscript in the terminal, but that is a separate, empty session: say so if the user expects their in-memory objects.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.