MCP HubMCP Hub
스킬 목록으로 돌아가기

setup-gxp-r-project

pjt222
업데이트됨 2 days ago
2 조회
17
2
17
GitHub에서 보기
디자인general

정보

이 스킬은 21 CFR Part 11과 같은 GxP 규정을 준수하는 R 프로젝트 구조를 설정하며, 검증된 환경과 변경 관리 문서를 포함합니다. 전자 기록이 감사 기준을 충족해야 하는 규제 대상 제약 또는 임상 시험 환경에서 R 분석을 시작할 때 사용하세요. 이는 제출용 규정 준수 컴퓨팅 구현을 위한 기반 프레임워크를 제공합니다.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/setup-gxp-r-project

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Set Up GxP R Project

R project structure → GxP reg validated computing reqs.

Use When

  • R analysis in regulated env (pharma, biotech, med devices)
  • R for clinical trial analysis
  • Validated compute env for regulatory submissions
  • Impl 21 CFR Part 11|EU Annex 11

In

  • Required: Project scope + reg framework (FDA|EMA|both)
  • Required: R ver + pkg vers to validate
  • Required: Validation strategy (risk-based)
  • Optional: Existing SOPs for computerized systems
  • Optional: QMS integration reqs

Do

Step 1: Validated Project Structure

gxp-project/
├── R/                          # Analysis scripts
│   ├── 01_data_import.R
│   ├── 02_data_processing.R
│   └── 03_analysis.R
├── validation/                 # Validation documentation
│   ├── validation_plan.md      # VP: scope, strategy, roles
│   ├── risk_assessment.md      # Risk categorization
│   ├── iq/                     # Installation Qualification
│   │   ├── iq_protocol.md
│   │   └── iq_report.md
│   ├── oq/                     # Operational Qualification
│   │   ├── oq_protocol.md
│   │   └── oq_report.md
│   ├── pq/                     # Performance Qualification
│   │   ├── pq_protocol.md
│   │   └── pq_report.md
│   └── traceability_matrix.md  # Requirements to tests mapping
├── tests/                      # Automated test suite
│   ├── testthat.R
│   └── testthat/
│       ├── test-data_import.R
│       └── test-analysis.R
├── data/                       # Input data (controlled)
│   ├── raw/                    # Immutable raw data
│   └── derived/                # Processed datasets
├── output/                     # Analysis outputs
├── docs/                       # Supporting documentation
│   ├── sop_references.md       # Links to relevant SOPs
│   └── change_log.md           # Manual change documentation
├── renv.lock                   # Locked dependencies
├── DESCRIPTION                 # Project metadata
├── .Rprofile                   # Session configuration
└── CLAUDE.md                   # AI assistant instructions

→ Complete dir structure exists w/ all listed dirs.

If err: missing → mkdir -p. Verify in correct project root. Existing → create only missing, don't overwrite.

Step 2: Validation Plan

validation/validation_plan.md:

# Validation Plan

## 1. Purpose
This plan defines the validation strategy for [Project Name] using R [version].

## 2. Scope
- R version: 4.5.0
- Packages: [list with versions]
- Analysis: [description]
- Regulatory framework: 21 CFR Part 11 / EU Annex 11

## 3. Risk Assessment Approach
Using GAMP 5 risk-based categories:
- Category 3: Non-configured products (R base)
- Category 4: Configured products (R packages with default settings)
- Category 5: Custom applications (custom R scripts)

## 4. Validation Activities
| Activity | Category 3 | Category 4 | Category 5 |
|----------|-----------|-----------|-----------|
| IQ | Required | Required | Required |
| OQ | Reduced | Standard | Enhanced |
| PQ | N/A | Standard | Enhanced |

## 5. Roles and Responsibilities
- Validation Lead: [Name]
- Developer: [Name]
- QA Reviewer: [Name]
- Approver: [Name]

## 6. Acceptance Criteria
All tests must pass with documented evidence.

→ Plan complete w/ scope, GAMP 5 risk categories, validation activities matrix, roles, acceptance criteria. References specific R ver + reg framework.

If err: framework unclear → consult QA dept for SOPs. Don't proceed validation activities until plan reviewed+approved.

Step 3: Lock Deps w/ renv

# Initialize renv with exact versions
renv::init()

# Install specific validated versions
renv::install("[email protected]")
renv::install("[email protected]")

# Snapshot
renv::snapshot()

renv.lock = controlled pkg inventory.

renv.lock exists w/ exact vers all pkgs. renv::status() reports no issues. Every ver pinned ([email protected]), not floating.

If err: renv::install() fails specific ver → check exists CRAN archives. Use renv::install("package@version", repos = "https://packagemanager.posit.co/cran/latest") for archived.

Step 4: Version Control

git init
git add .
git commit -m "Initial validated project structure"

# Use signed commits for traceability
git config user.signingkey YOUR_GPG_KEY
git config commit.gpgsign true

→ Project under git w/ signed commits. Initial commit has validated structure + renv.lock.

If err: GPG signing fails → verify GPG key (gpg --list-secret-keys). Envs w/o GPG → document deviation + unsigned + manual audit trail in docs/change_log.md.

Step 5: IQ Protocol

validation/iq/iq_protocol.md:

# Installation Qualification Protocol

## Objective
Verify that R and required packages are correctly installed.

## Test Cases

### IQ-001: R Version Verification
- **Requirement**: R 4.5.0 installed
- **Procedure**: Execute `R.version.string`
- **Expected:** "R version 4.5.0 (date)"
- **Result**: [ PASS / FAIL ]

### IQ-002: Package Installation Verification
- **Requirement**: All packages in renv.lock installed
- **Procedure**: Execute `renv::status()`
- **Expected:** "No issues found"
- **Result**: [ PASS / FAIL ]

### IQ-003: Package Version Verification
- **Procedure**: Execute `installed.packages()[, c("Package", "Version")]`
- **Expected:** Versions match renv.lock exactly
- **Result**: [ PASS / FAIL ]

→ IQ protocol has test cases (R ver, pkg install, pkg ver verifications) w/ clear expected + pass/fail.

If err: protocol template ≠ org SOP reqs → adapt format keeping required fields (req, procedure, expected, actual, pass/fail). Consult QA for approved templates.

Step 6: Automated OQ/PQ Tests

# tests/testthat/test-analysis.R
test_that("primary analysis produces validated results", {
  # Known input -> known output (double programming validation)
  test_data <- read.csv(test_path("fixtures", "validation_dataset.csv"))

  result <- primary_analysis(test_data)

  # Compare against independently calculated expected values
  expect_equal(result$estimate, 2.345, tolerance = 1e-3)
  expect_equal(result$p_value, 0.012, tolerance = 1e-3)
  expect_equal(result$ci_lower, 1.234, tolerance = 1e-3)
})

→ Test files exist in tests/testthat/ covering OQ (op verification each fn) + PQ (e2e validation vs independent ref). Use explicit numeric tolerances.

If err: ref vals not yet from independent calc (SAS) → placeholder w/ skip("Awaiting independent reference values") + document in traceability.

Step 7: Traceability Matrix

# Traceability Matrix

| Req ID | Requirement | Test ID | Test Description | Status |
|--------|-------------|---------|------------------|--------|
| REQ-001 | Import CSV data correctly | OQ-001 | Verify data dimensions and types | PASS |
| REQ-002 | Calculate primary endpoint | PQ-001 | Compare against reference results | PASS |
| REQ-003 | Generate report output | PQ-002 | Verify report contains all sections | PASS |

→ Matrix links every req to ≥1 test, every test to req. No orphans.

If err: untested reqs → create tests or document risk-based exclusion. Tests w/o req → link or remove out-of-scope.

Check

  • Structure follows template
  • renv.lock has all deps w/ exact vers
  • Validation plan complete + approved
  • IQ protocol executes
  • OQ covers all configured fns
  • PQ validates vs independent results
  • Traceability matrix links reqs↔tests
  • Change control process documented

Traps

  • install.packages() w/o pinning: Always renv w/ locked vers
  • No audit trail: Every change documented. Git signed commits.
  • Over-validating: Risk-based. Not every CRAN pkg needs Cat 5.
  • Forget system-level QA: OS + R install need IQ too
  • No independent verify: PQ → compare vs results from independent (SAS, manual)

  • write-validation-documentation — detailed validation docs
  • implement-audit-trail — electronic records + audit trails
  • validate-statistical-output — double programming + output validation
  • manage-renv-dependencies — dep locking for validated envs

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman-ultra/skills/setup-gxp-r-project
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

executing-plans

디자인

executing-plans 스킬은 검토 체크포인트가 포함된 통제된 배치로 실행할 완전한 구현 계획이 있을 때 사용합니다. 이 스킬은 계획을 불러와 비판적으로 검토한 후, 소규모 배치(기본값 3개 작업)로 작업을 실행하면서 각 배치 사이에 진행 상황을 아키텍트 검토를 위해 보고합니다. 이를 통해 내재된 품질 관리 체크포인트를 갖춘 체계적인 구현이 보장됩니다.

스킬 보기

requesting-code-review

디자인

이 스킬은 코드 변경 사항을 요구 사항에 따라 분석하기 위해 코드 리뷰어 하위 에이전트를 호출합니다. 작업 완료 후, 주요 기능 구현 후, 또는 메인 브랜치에 병합하기 전에 사용해야 합니다. 이 리뷰는 현재 구현체와 원래 계획을 비교하여 문제를 조기에 발견하는 데 도움이 됩니다.

스킬 보기

connect-mcp-server

디자인

이 스킬은 개발자들이 HTTP, stdio 또는 SSE 전송 방식을 통해 MCP 서버를 Claude Code에 연결하는 포괄적인 가이드를 제공합니다. GitHub, Notion 및 사용자 정의 API와 같은 외부 서비스를 통합하기 위한 설치, 구성, 인증 및 보안을 다룹니다. MCP 통합 설정, 외부 도구 구성 또는 Claude의 모델 컨텍스트 프로토콜 작업 시 활용하세요.

스킬 보기

web-cli-teleport

디자인

이 스킬은 작업 분석을 기반으로 개발자가 Claude Code 웹 인터페이스와 CLI 인터페이스 중 선택할 수 있도록 돕고, 두 환경 간 원활한 세션 텔레포트를 가능하게 합니다. 웹, CLI 또는 모바일 환경 전환 시 세션 상태와 컨텍스트를 관리하여 워크플로를 최적화합니다. 다양한 단계에서 서로 다른 도구가 필요한 복잡한 프로젝트에 사용하세요.

스킬 보기