r-project-scaffold

Scaffolds a new non-Shiny R project with canonical directory layout, renv, and configuration files.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/chris-prener/dev-kit --skill r-project-scaffold-chris-prener
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: r-project-scaffold
Source: https://github.com/chris-prener/dev-kit/tree/main/dev-kit/skills/r-project-scaffold
Command: npx skills add https://github.com/chris-prener/dev-kit --skill r-project-scaffold-chris-prener

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up a new R project involves repetitive decisions about directory structure, dependency management, and configuration files, and inconsistent setups make projects harder to maintain and onboard contributors into. ## Core Features & Use Cases - Canonical Directory Layout: Creates the standard structure with R/, tests/, data-raw/, docs/, .github/, DESCRIPTION, NAMESPACE, and .Rproj files. - renv Initialization: Sets up reproducible dependency management with renv.lock, including conventions for what to commit and what to gitignore. - Configuration Files: Generates .gitignore, .lintr, and DESCRIPTION following project conventions, with optional targets pipeline and database connectivity stubs. - Use Case: You are starting a new R analysis project and want the standard layout, renv lockfile, test infrastructure, and linting configured in one pass instead of assembling each file by hand. ## Quick Start Ask Claude to scaffold a new R project named my-analysis with the canonical layout and renv initialized.

Frequently Asked Questions about r-project-scaffold

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a new R project with renv?▼

Provide a project name and the skill creates the canonical directory layout, then runs renv::init(bare = TRUE) followed by installing packages and renv::snapshot(). Commit renv.lock, renv/activate.R, and renv/.gitignore, but never renv/library/.

What directory structure should an R project use?▼

The canonical layout includes R/functions/ and R/scripts/ for source code, tests/testthat/ for tests, data-raw/ and data/ for data, docs/, .github/workflows/, plus DESCRIPTION, NAMESPACE, .Rproj, .gitignore, and .lintr files.

Can I use this for a CRAN package or Shiny app?▼

No. This scaffold covers non-Shiny, non-package R projects only. CRAN-style packages with vignettes/ and inst/ belong to r-package-structure, and Shiny-specific structure like www/ and mod_* files is out of scope.

Does the scaffold support targets pipeline projects?▼

Yes, as an optional input it adds a _targets.R pipeline definition stub and a gitignored _targets/ cache directory. Full pipeline definition patterns are handled separately by r-pipeline-patterns.

How do I verify the R project scaffold worked?▼

Run renv::restore() which should complete without errors, open the .Rproj in RStudio, run testthat::test_dir("tests/testthat/"), and confirm lintr::lint_dir("R/") returns zero findings on the scaffolded code.