create-r-package
정보
이 Claude Skill은 usethis 규약과 tidyverse 스타일을 따라 완전한 프로덕션 준비가 된 R 패키지 구조를 처음부터 스캐폴딩합니다. DESCRIPTION, 문서화, 테스트, 의존성 관리(renv), 버전 관리, GitHub Actions를 통한 CI/CD를 위한 필수 파일을 자동으로 생성합니다. 새로운 패키지를 초기화하거나, 분리된 스크립트를 구조화된 프로젝트로 변환하거나, 협업용 패키지 골격을 생성할 때 사용하세요.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/create-r-packageClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Create R Package
Scaffold fully configured R package with modern tooling and best practices.
When Use
- Starting new R package from scratch
- Converting loose R scripts into package
- Setting up package skeleton for collaborative development
Inputs
- Required: Package name (lowercase, no special chars except
.) - Required: One-line description of package purpose
- Optional: License type (default: MIT)
- Optional: Author info (name, email, ORCID)
- Optional: Whether to init renv (default: yes)
Steps
Step 1: Create Package Skeleton
usethis::create_package("packagename")
setwd("packagename")
Got: Directory created with DESCRIPTION, NAMESPACE, R/, man/ subdirectories.
If fail: Confirm usethis installed (install.packages("usethis")). Check directory does not already exist.
Step 2: Configure DESCRIPTION
Edit DESCRIPTION with accurate metadata:
Package: packagename
Title: What the Package Does (Title Case)
Version: 0.1.0
Authors@R:
person("First", "Last", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0000-0000-0000"))
Description: One paragraph describing what the package does. Must be more
than one sentence. Avoid starting with "This package".
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
URL: https://github.com/username/packagename
BugReports: https://github.com/username/packagename/issues
Got: Valid DESCRIPTION passing R CMD check with no metadata warnings.
If fail: R CMD check warns about DESCRIPTION fields? Verify Title in Title Case, Description more than one sentence, Authors@R uses valid person() syntax.
Step 3: Set Up Infrastructure
usethis::use_mit_license()
usethis::use_readme_md()
usethis::use_news_md()
usethis::use_testthat(edition = 3)
usethis::use_git()
usethis::use_github_action("check-standard")
Got: LICENSE, README.md, NEWS.md, tests/ directory, .git/ initialized, .github/workflows/ created.
If fail: Any usethis::use_*() function fails? Install missing dependency, rerun. .git/ already exists? use_git() skips init.
Step 4: Create Development Configuration
Create .Rprofile:
if (file.exists("renv/activate.R")) {
source("renv/activate.R")
}
if (requireNamespace("mcptools", quietly = TRUE)) {
mcptools::mcp_session()
}
Create .Renviron.example:
RSTUDIO_PANDOC="C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools"
# GITHUB_PAT=your_github_token_here
Create .Rbuildignore entries:
^\.Rprofile$
^\.Renviron$
^\.Renviron\.example$
^renv$
^renv\.lock$
^CLAUDE\.md$
^\.github$
^.*\.Rproj$
Got: .Rprofile, .Renviron.example, .Rbuildignore created. Development files dropped from built package.
If fail: .Rprofile causes startup errors? Check syntax. Confirm requireNamespace() guards stop failures when optional packages missing.
Step 5: Initialize renv
renv::init()
Got: renv/ directory and renv.lock created. Project-local library active.
If fail: Install renv with install.packages("renv"). renv hangs during init? Check network. Set options(timeout = 600).
Step 6: Create Package Documentation File
Create R/packagename-package.R:
#' @keywords internal
"_PACKAGE"
## usethis namespace: start
## usethis namespace: end
NULL
Got: R/packagename-package.R exists with "_PACKAGE" sentinel. Running devtools::document() generates package-level help.
If fail: Confirm filename matches pattern R/<packagename>-package.R. "_PACKAGE" string must be standalone expression, not inside function.
Step 7: Create CLAUDE.md
Create CLAUDE.md in project root with project-specific instructions for AI assistants.
Got: CLAUDE.md exists in project root with project-specific editing conventions, build commands, architecture notes.
If fail: Unsure what to include? Start with package name, one-line description, common dev commands (devtools::check(), devtools::test()), any non-obvious conventions.
Checks
-
devtools::check()returns 0 errors, 0 warnings - Package structure matches expected layout
-
.Rprofileloads without errors -
renv::status()shows no issues - Git repo initialized with right
.gitignore - GitHub Actions workflow file present
Pitfalls
- Package name conflicts: Check CRAN with
available::available("packagename")before committing to a name - Missing .Rbuildignore entries: Development files (
.Rprofile,.Renviron,renv/) must drop from built package - Forgetting Encoding: Always include
Encoding: UTF-8in DESCRIPTION - RoxygenNote mismatch: Version in DESCRIPTION must match installed roxygen2
Examples
# Minimal creation
usethis::create_package("myanalysis")
# Full setup in one session
usethis::create_package("myanalysis")
usethis::use_mit_license()
usethis::use_testthat(edition = 3)
usethis::use_readme_md()
usethis::use_git()
usethis::use_github_action("check-standard")
renv::init()
See Also
write-roxygen-docs- document functions you createwrite-testthat-tests- add tests for packagesetup-github-actions-ci- detailed CI/CD configurationmanage-renv-dependencies- manage package dependencieswrite-claude-md- create effective AI assistant instructions
GitHub 저장소
연관 스킬
content-collections
메타이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.
polymarket
메타이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.
creating-opencode-plugins
메타이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.
sglang
메타SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.
