r-cursorrules-prompt-file-best-practices

r-cursorrules-prompt-file-best-practices is a cursor rule for coding agents from PatrickJS/awesome-cursorrules. It costs 1,873 tokens per session, scanned A, original, CC0-1.0.

A set of Cursor coding rules for R projects, a language and environment commonly used for statistics and data analysis. It covers project structure, reproducible reports, dependencies, data handling, and Git.

In plain words
What is it for?
Use it when structuring R scripts and data, writing RMarkdown or Quarto reports, managing packages with renv, and organizing outputs and documentation.
Why use it?
It helps keep analysis projects reproducible and organized while protecting raw data and making dependencies easier to restore.

Cursor rule

About the project

PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.

PatrickJS/awesome-cursorrules · 40,726 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/r-cursorrules-prompt-file-best-practices
Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for r-cursorrules-prompt-file-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/r-cursorrules-prompt-file-best-practices.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/r-cursorrules-prompt-file-best-practices)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/r-cursorrules-prompt-file-best-practices"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/r-cursorrules-prompt-file-best-practices.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,873 This file is loaded in full into every session.
When invoked 1,873 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01873 $0.01873
Opus 5 $0.00937 $0.00937
Sonnet 5 $0.00375 $0.00375
Haiku 4.5 $0.00187 $0.00187

Measured yesterday against content hash 8c513ffb3e17, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

r-cursorrules-prompt-file-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/r-cursorrules-prompt-file-best-practices.mdc · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an R programming assistant, make sure to use the best practices when programming in R:

Project Structure and File Organization

  • Organize projects into clear directories: 'R/' (scripts), 'data/' (raw and processed), 'output/' (results, plots), 'docs/' (reports). For R packages, use 'inst/' for external files; for non-packages, consider 'assets/'.
  • Use an 'Rproj' file for each project to manage working directories and settings.
  • Create reusable functions and keep them in separate script files under the 'R/' folder.
  • Use RMarkdown or Quarto for reproducible reports combining code and results. Prefer Quarto if available and installed.
  • Keep raw data immutable; only work with processed data in 'data/processed/'.
  • Use 'renv' for dependency management and reproducibility. All the dependencies must be installed, synchronized, and locked.
  • Version control all projects with Git and use clear commit messages.
  • Give a snake_case consistent naming for the file names. The file names should not be too long.
  • Avoid using unnecessary dependencies. If a task can be achieved relatively easily using base R, use base R and import other packages only when necessary (e.g., measurably faster, more robust, or fewer lines of code).

Package Structure

  • If the R project is an R package, make sure to mention the dependencies used inside the package within the 'DESCRIPTION' file. All dependencies must have their version number mentioned (e.g: R6 (>= 2.6.1))
  • If the R project is an R package, make sure a 'LICENSE' file is available.
  • If the R project is an R package, make sure a 'NEWS.md' file is available which should track the package's development changes.
  • If the R project is an R package, make sure that each external file used inside the package is saved within the 'inst' folder. Reading the file should be done using the 'system.file' function.
  • If the R project is an R package, Always use 'devtools::load_all' before testing the new functions.
  • If the R project is an R package, run 'devtools::check()' to ensure the package has no issues. Notes are okay; avoid warnings and errors.
  • If the R project is an R package, document functions using roxygen2. Use 'devtools::document()' to generate the required documentation (.Rd files) and 'NAMESPACE' file.

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 113 lines · 1,873 tokens per session scan A 8c513ffb3e17

Subscribe to this mod's changes

r-cursorrules-prompt-file-best-practices is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,726 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 1,873 tokens to every session, about $0.0094 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.