metaprogramming-rlang
Skill2 starsChanged 10 months agoMITView on GitHub
Tidy evaluation and programmatic tidyverse patterns using rlang. Use this skill when writing functions that accept column names as arguments, building tidyverse-compatible APIs, or working with data-masking and injection operators. Covers embracing with {{}}, injection (!! and !!!), dynamic dots, .data/.env pronouns, name injection with glue syntax, bridge patterns between selection and data-masking, and package development with rlang.
- Reads credentials
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Use {{}} to forward function arguments to data-masking functions.
- Distinctive: line 40
No special syntax needed for dots forwarding.
- Very specific: line 44
Use .data pronoun for programmatic column access.
- Distinctive: line 50
Create symbols from strings, inject values to avoid name collisions.
- Distinctive: line 64
Use glue syntax for dynamic column naming.
- Very specific: line 97
Don't use {{ }} on non-arguments
- Distinctive: line 98
Don't mix injection styles unnecessarily
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Metaprogramming rlang
This skill covers modern rlang patterns for data-masking, tidy evaluation, and building programmatic tidyverse functions.
Core Concepts
Data-masking allows R expressions to refer to data frame columns as if they were variables in the environment. rlang provides the metaprogramming framework that powers tidyverse data-masking.
Key rlang Tools
- Embracing
{{}}- Forward function arguments to data-masking functions - Injection
!!- Inject single expressions or values - Splicing
!!!- Inject multiple arguments from a list - Dynamic dots - Programmable
...with injection support - Pronouns
.data/.env- Explicit disambiguation between data and environment variables
When to Use Each Operator
| Operator | Use Case | Example |
{{ }} | Forward function arguments | summarise(mean = mean({{ var }})) |
!! | Inject single expression/value | summarise(mean = mean(!!sym(var))) |
!!! | Inject multiple arguments | group_by(!!!syms(vars)) |
.data[[]] | Access columns by name | mean(.data[[var]]) |
Function Argument Patterns
Forwarding with {{}}
Use {{}} to forward function arguments to data-masking functions. See embrace-examples.md.
Forwarding ...
No special syntax needed for dots forwarding. See dots-forwarding.md.
Names Patterns with .data
Use .data pronoun for programmatic column access. See data-pronoun-examples.md.
Injection Operators
Advanced Injection with !!
Create symbols from strings, inject values to avoid name collisions. See injection-examples.md.
Splicing with !!!
Inject multiple symbols from character vectors, splice lists of arguments. See splicing-examples.md.
Dynamic Dots Patterns
Using list2() for Dynamic Dots Support
Enables splicing, name injection, and trailing commas. See dynamic-dots-examples.md.
Name Injection with Glue Syntax
Use glue syntax for dynamic column naming. See name-injection-examples.md.
Pronouns for Disambiguation
.data and .env Best Practices
Explicit disambiguation prevents masking issues. See pronouns-examples.md.
Programming Patterns
Bridge Patterns
Converting between data-masking and tidy selection behaviors:
across()as selection-to-data-mask bridgeacross(all_of())as names-to-data-mask bridge
See bridge-patterns.md.
Transformation Patterns
Transform single arguments by wrapping, transform dots with across(). See transformation-patterns.md.
Error-Prone Patterns to Avoid
Deprecated/Dangerous Patterns
- String parsing with
eval(parse(text = ...))- Security risk get()in data mask - Name collision prone
See avoid-patterns.md.
Common Mistakes
- Don't use
{{ }}on non-arguments - Don't mix injection styles unnecessarily
Package Development with rlang
Import Strategy
# In DESCRIPTION:
Imports: rlang
# In NAMESPACE, import specific functions:
importFrom(rlang, enquo, enquos, expr, !!!, :=)Documentation Tags
#' @param var <[`data-masked`][dplyr::dplyr_data_masking]> Column to summarize
#' @param ... <[`dynamic-dots`][rlang::dyn-dots]> Additional grouping variables
#' @param cols <[`tidy-select`][dplyr::dplyr_tidy_select]> Columns to selectTesting rlang Functions
See testing-examples.md for testing data-masking and injection behavior.
source: Sarah Johnson's gist https://gist.github.com/sj-io/3828d64d0969f2a0f05297e59e6c15ad
Other versions1 project uses a version of this.
Word for word · 1
- jeremy-allen/claude-skills★ 63100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository38 other files it gives its agents.
- Data Engineering Cloud InfrastructureSkill
- data-eng-data-qualitySkill
- data-eng-streaming-patternsSkill
- data-eng-testing-patternsSkill
- data-eng-warehouse-patternsSkill
- DevOps CI/CD PatternsSkill
- devops-docker-patternsSkill
- devops-monitoring-observabilitySkill
- devops-terraform-patternsSkill
- git-advanced-operationsSkill
- git-workflow-patternsSkill
- modern-python-patternsSkill
- python-api-developmentSkill
- python-async-patternsSkill
- python-data-pipelinesSkill
- python-data-wranglingSkill
- python-devops-automationSkill
- python-error-handlingSkill
- python-package-developmentSkill
- python-performanceSkill
- python-testingSkill
- customizing-vectors-rSkill
- designing-oop-rSkill
- developing-packages-rSkill
- optimizing-rSkill
- writing-tidyverse-rSkill
- sql-advanced-featuresSkill
- sql-analytics-patternsSkill
- sql-data-modelingSkill
- SQL Integration PatternsSkill
- sql-query-fundamentalsSkill
- sql-query-optimizationSkill
- sql-transformationsSkill
- API DesignSkill
- webdev-html-css-patternsSkill
- webdev-javascript-fundamentalsSkill
- webdev-react-patternsSkill
- webdev-typescript-patternsSkill
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
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.

