An LLM skill for the targets R package using targets >= 1.12.0 and tarchetypes >= 0.14.1.
When you ask an LLM to write a _targets.R file, it draws on training data that mixes drake idioms, pre-1.10 targets patterns, and current best practice. This skill gives the model a structured reference for the current API so it produces pipelines that match the 1.11-era defaults and uses the modern tarchetypes factories.
The skill covers: tar_target() and option setup, storage formats (including format = "auto"), dynamic and static branching, debugging with tar_workspace() and tar_igraph(), scoped tar_make() / tar_invalidate() / tar_destroy() for safe reruns, cloud and CAS repositories, Quarto and R Markdown integration with tar_quarto() / tar_render(), Typst/LaTeX compilation patterns, and anti-patterns specific to targets.
Clone directly into your skills directory:
git clone https://github.com/statzhero/targets-r-skill.git ~/.claude/skills/targets-rThat's it. The skill is available immediately as /targets-r in any Claude Code session.
If you prefer not to use the terminal, you can add skills from the Claude desktop app:
- Download the repository as a ZIP from GitHub.
- Open the Claude desktop app and switch to the Code tab.
- Click Customize in the left sidebar, then select Skills.
- Click the + button, choose Upload a skill, and select the ZIP file.
Clone into your user skills directory (available across all projects):
git clone https://github.com/statzhero/targets-r-skill.git ~/.codex/skills/targets-rIf you prefer not to use the terminal, download the ZIP, unzip it, and move the folder to ~/.codex/skills/targets-r/ or .codex/skills/targets-r/ inside your project.
After installing, try this prompt in your CLI:
/targets-r Write a _targets.R that reads data/raw.csv, cleans it, and fits a linear model.
The skill should produce a pipeline using tar_file_read() and tar_option_set(format = "qs").
Will Landau's targets manual and NEWS files are the authoritative source for most of what this skill encodes. The structure borrows from the tidy-r-skill template.
| Topic | Source |
|---|---|
| targets user manual | https://books.ropensci.org/targets/ |
| targets reference | https://docs.ropensci.org/targets/ |
| tarchetypes reference | https://docs.ropensci.org/tarchetypes/ |
| NEWS (targets) | https://github.com/ropensci/targets/blob/main/NEWS.md |
| NEWS (tarchetypes) | https://github.com/ropensci/tarchetypes/blob/main/NEWS.md |
MIT • Ulrich Atz (ulrichatz)