manage-renv-dependencies
정보
이 스킬은 개발자가 renv를 사용하여 재현 가능한 환경을 구축하며 R 패키지 의존성을 관리하는 데 도움을 줍니다. 프로젝트 초기화, 의존성 스냅샷 생성 및 복원, 문제 해결, CI/CD 통합을 다룹니다. 새로운 R 프로젝트 설정, 패키지 추가/업데이트, 또는 다른 시스템 간 환경 복원 시 활용하세요.
빠른 설치
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/manage-renv-dependenciesClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Manage renv Dependencies
Set up and maintain reproducible R package environments using renv.
When Use
- Initializing dependency management for new R project
- Adding or updating package dependencies
- Restoring project environment on new machine
- Troubleshooting renv restore failures
- Integrating renv with CI/CD pipelines
Inputs
- Required: R project directory
- Optional: Existing
renv.lockfile (for restore) - Optional: GitHub PAT for private packages
Steps
Step 1: Initialize renv
renv::init()
This creates:
renv/directory (library, settings, activation script)renv.lock(dependency snapshot)- Updates
.Rprofileto activate renv on load
Got: Project-local library created. renv/ directory and renv.lock present. .Rprofile updated with activation script.
If fail: Hangs? Check network connectivity. Fails on specific package? Install that package manually first with install.packages() then rerun renv::init().
Step 2: Add Dependencies
Install packages as usual:
install.packages("dplyr")
renv::install("github-user/private-pkg")
Then snapshot to record state:
renv::snapshot()
Got: renv.lock updated with new packages and versions. renv::status() shows no out-of-sync packages.
If fail: renv::snapshot() reports validation errors? Run renv::dependencies() to check which packages actually used, then renv::snapshot(force = TRUE) to bypass validation.
Step 3: Restore on Another Machine
renv::restore()
Got: All packages installed at exact versions in renv.lock.
If fail: Common issues: GitHub packages fail (set GITHUB_PAT in .Renviron), system dependencies missing (install with apt-get on Linux), timeouts on large packages (set options(timeout = 600) before restore), binaries not available (renv compiles from source. Ensure build tools installed).
Step 4: Update Dependencies
# Update a specific package
renv::update("dplyr")
# Update all packages
renv::update()
# Snapshot after updates
renv::snapshot()
Got: Target packages updated to latest compatible versions. renv.lock reflects new versions after snapshot.
If fail: renv::update() fails for specific package? Try installing directly with renv::install("package@version") then snapshot.
Step 5: Check Status
renv::status()
Got: "No issues found" or clear list of out-of-sync packages with actionable guidance.
If fail: Status reports packages used but not recorded? Run renv::snapshot(). Packages recorded but not installed? Run renv::restore().
Step 6: Configure .Rprofile for Conditional Activation
if (file.exists("renv/activate.R")) {
source("renv/activate.R")
}
Ensures project works even if renv isn't installed (CI environments, collaborators).
Got: R sessions activate renv automatically when starting in project directory. Sessions without renv installed still start without errors.
If fail: .Rprofile causes errors? Ensure file.exists() guard present. Never call source("renv/activate.R") unconditionally.
Step 7: Git Configuration
Track these files:
renv.lock # Always commit
renv/activate.R # Always commit
renv/settings.json # Always commit
.Rprofile # Commit (contains renv activation)
Ignore these (already in renv's .gitignore):
renv/library/ # Machine-specific
renv/staging/ # Temporary
renv/cache/ # Machine-specific cache
Got: renv.lock, renv/activate.R, renv/settings.json tracked by Git. Machine-specific directories (renv/library/, renv/cache/) ignored.
If fail: renv/library/ accidentally gets committed? Remove with git rm -r --cached renv/library/ and add to .gitignore.
Step 8: CI/CD Integration
In GitHub Actions, use renv cache action:
- uses: r-lib/actions/setup-renv@v2
Automatically restores from renv.lock with caching.
Got: CI pipeline restores packages from renv.lock with caching enabled. Subsequent runs faster due to cached packages.
If fail: CI restore fails? Check renv.lock is committed and up to date. For private GitHub packages, ensure GITHUB_PAT set as repository secret.
Checks
-
renv::status()reports no issues -
renv.lockcommitted to version control -
renv::restore()works on clean checkout -
.Rprofileconditionally activates renv - CI/CD uses
renv.lockfor dependency resolution
Pitfalls
- Running
renv::init()in wrong directory: Always verifygetwd()first - Mixing renv and system library: After
renv::init(), only use project library - Forgetting to snapshot: After installing packages, always run
renv::snapshot() --vanillaflag:Rscript --vanillaskips.Rprofile, so renv won't activate- Large lock files in diffs: Normal —
renv.lockdesigned to be diffable JSON - Bioconductor packages: Use
renv::install("bioc::PackageName")and ensure BiocManager configured
See Also
create-r-package- includes renv initializationsetup-github-actions-ci- CI integration with renvsubmit-to-cran- dependency management for CRAN packages
GitHub 저장소
연관 스킬
llamaguard
기타LlamaGuard는 폭력 및 혐오 발언 등 6가지 안전 범주에서 LLM 입력과 출력을 조정하기 위한 Meta의 70-80억 파라미터 모델입니다. 94-95% 정확도를 제공하며 vLLM, Hugging Face 또는 Amazon SageMaker를 사용해 배포할 수 있습니다. 이 기술을 사용하여 AI 애플리케이션에 콘텐츠 필터링 및 안전 가드레일을 손쉽게 통합하세요.
cost-optimization
기타이 Claude Skill은 리소스 적정화, 태깅 전략, 지출 분석을 통해 개발자들이 클라우드 비용을 최적화할 수 있도록 지원합니다. AWS, Azure, GCP에서 클라우드 비용을 절감하고 비용 거버넌스를 구현하기 위한 프레임워크를 제공합니다. 인프라 비용을 분석하거나, 리소스를 적정화하거나, 예산 제약을 충족해야 할 때 사용하세요.
quantizing-models-bitsandbytes
기타이 스킬은 bitsandbytes를 사용하여 LLM을 8비트 또는 4비트 정밀도로 양자화하며, 최소한의 정확도 손실로 50-75%의 메모리 감소를 달성합니다. 제한된 GPU 메모리에서 더 큰 모델을 실행하거나 추론을 가속화하는 데 이상적이며, INT8, NF4, FP4와 같은 형식을 지원합니다. 이 스킬은 HuggingFace Transformers와 통합되어 QLoRA 학습 및 8비트 옵티마이저를 가능하게 합니다.
dispatching-parallel-agents
기타이 Claude Skill은 3개 이상의 독립적인 문제를 동시에 조사하고 해결하기 위해 다중 에이전트를 배치합니다. 공유 상태나 의존성 없이 해결 가능한 무관련 장애 시나리오에 맞게 설계되었습니다. 핵심 기능은 병렬 문제 해결로, 각 독립 문제 영역마다 하나의 에이전트를 할당하여 효율성을 극대화합니다.
