r-package-conventions

Enforce R package development conventions for structure, documentation, testing, and CRAN submission.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/kyleGrealis/claude --skill r-package-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-package-conventions
Source: https://github.com/kyleGrealis/claude/tree/main/claude/.claude/skills/r-package-conventions
Command: npx skills add https://github.com/kyleGrealis/claude --skill r-package-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive set of guidelines and best practices for developing R packages, ensuring consistency, quality, and adherence to community standards.

Core Features & Use Cases

  • Standardized Structure: Defines required files and directory layouts for R packages.
  • Documentation Standards: Enforces roxygen2 documentation best practices for functions and package-level information.
  • Testing Frameworks: Outlines strategies for using testthat to ensure code robustness.
  • CRAN Compliance: Guides users on meeting CRAN submission requirements.
  • Use Case: When starting a new R package or refactoring an existing one, consult this Skill to ensure all necessary components, documentation, and testing are in place according to established conventions.

Quick Start

Apply the r-package-conventions skill to ensure the current R package project adheres to best practices.

Frequently Asked Questions about r-package-conventions

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

FAQPage Schema
What are the standard R package structure and development conventions for CRAN submission?

Standard R package development conventions require specific directory layouts, roxygen2 documentation standards, and testthat testing frameworks to meet CRAN submission requirements. Following the usethis workflow ensures package structure, documentation, and testing adhere to community best practices.

How do I use usethis and roxygen2 to set up a new R package properly?

To set up an R package properly, use the usethis workflow to establish the required directory structure and configuration files. Apply roxygen2 documentation standards to functions and package-level information, ensuring code robustness through testthat testing strategies throughout the creation process.

Do I need devtools and testthat to maintain R package quality and CRAN compliance?

Yes, maintaining R package quality and CRAN compliance requires understanding of development tools like devtools, usethis, roxygen2, testthat, and pkgdown. These tools enforce structure standards, documentation best practices, and testing frameworks essential for robust package maintenance.

What's the best way to enforce roxygen2 documentation standards across an existing R package?

The best way to enforce roxygen2 documentation standards is to apply established R package conventions during package refactoring. Ensure all functions and package-level information follow roxygen2 best practices, maintaining consistency and quality aligned with community standards for CRAN submission.

Why does my R package fail CRAN requirements despite having valid directory structure?

R packages can fail CRAN requirements if they lack proper roxygen2 documentation standards or adequate testthat testing frameworks. Meeting CRAN submission requirements involves adhering to comprehensive conventions for structure, documentation, and testing, not just basic directory layout compliance.