Communitygithub.com

healthcare-eval-harness

환자 안전 평가 도구: 의료 애플리케이션 배포를 위한 자동화된 테스트 스위트. CDSS 정확도, PHI 노출, 임상 워크플로우 무결성, 통합 규정 준수를 테스트합니다. 안전 실패 시 배포를 차단합니다.

healthcare-eval-harness란 무엇인가요?

Healthcare Eval Harness는 의료 애플리케이션 배포 시 환자 안전을 보장하기 위한 자동화된 평가 시스템입니다. CDSS(임상 의사 결정 지원) 정확도, PHI(보호 건강 정보) 노출, 데이터 무결성, 임상 워크플로우, 통합 규정 준수의 다섯 가지 테스트 카테고리를 실행하며, 첫 세 가지는 100% 통과율을 요구하는 CRITICAL 게이트로 단 하나의 실패도 배포를 차단합니다. 나머지 두 카테고리는 95% 이상의 통과율이 필요한 HIGH 게이트로 경고 후 검토를 통해 배포를 허용할 수 있습니다. GitHub Actions 등 CI/CD 파이프라인과 쉽게 통합되며, Jest를 기본 테스트 러너로 사용하지만 Vitest, pytest 등 다른 프레임워크로도 적용할 수 있도록 설계되었습니다. 환자 생명과 직결된 의료 소프트웨어에서 안전 실패를 사전에 방지하고 규제 준수를 강화하는 데 필수적인 도구입니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/healthcare-eval-harness

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Healthcare Eval Harness — 환자 안전 검증

의료 애플리케이션 배포를 위한 자동화된 검증 시스템입니다. 단 하나의 CRITICAL 실패가 배포를 차단합니다. 환자 안전은 타협할 수 없습니다.

참고: 예제는 Jest를 기준 테스트 러너로 사용합니다. 명령어를 사용 중인 프레임워크(Vitest, pytest, PHPUnit 등)에 맞게 조정하세요. 테스트 카테고리와 통과 임계값은 프레임워크에 종속되지 않습니다.

사용 시점

  • EMR/EHR 애플리케이션 배포 전
  • CDSS 로직(약물 상호작용, 용량 검증, 점수 계산)을 수정한 후
  • 환자 데이터를 다루는 데이터베이스 스키마를 변경한 후
  • 인증 또는 접근 제어를 수정한 후
  • 의료 앱 CI/CD 파이프라인을 구성하는 중
  • 임상 모듈에서 병합 충돌을 해결한 후

작동 방식

평가 도구는 다섯 가지 테스트 카테고리를 순서대로 실행합니다. 첫 세 가지(CDSS 정확도, PHI 노출, 데이터 무결성)는 100% 통과율이 필요한 CRITICAL 게이트로, 단 하나의 실패도 배포를 차단합니다. 나머지 두 가지(임상 워크플로우, 통합)는 95% 이상 통과율이 필요한 HIGH 게이트입니다.

각 카테고리는 Jest 테스트 경로 패턴에 매핑됩니다. CI 파이프라인은 CRITICAL 게이트를 --bail(첫 실패에서 중단)과 함께 실행하고, --coverage --coverageThreshold로 커버리지 임계값을 적용합니다.

평가 카테고리

1. CDSS 정확도 (CRITICAL — 100% 필요)

모든 임상 의사 결정 지원 로직을 테스트합니다: 양방향 약물 상호작용 쌍, 용량 검증 규칙, 공개된 사양 대비 임상 점수, 거짓 음성 없음, 무음 실패 없음.

npx jest --testPathPattern='tests/cdss' --bail --ci --coverage

2. PHI 노출 (CRITICAL — 100% 필요)

보호 건강 정보 유출을 테스트합니다: API 오류 응답, 콘솔 출력, URL 매개변수, 브라우저 저장소, 시설 간 격리, 인증되지 않은 접근, 서비스 역할 키 부재.

npx jest --testPathPattern='tests/security/phi' --bail --ci

3. 데이터 무결성 (CRITICAL — 100% 필요)

임상 데이터 안전성을 테스트합니다: 잠긴 진료 기록, 감사 추적 항목, 계단식 삭제 보호, 동시 편집 처리, 고아 레코드 없음.

npx jest --testPathPattern='tests/data-integrity' --bail --ci

4. 임상 워크플로우 (HIGH — 95%+ 필요)

종단간 흐름을 테스트합니다: 진료 기록 생애주기, 템플릿 렌더링, 약물 세트, 약물/진단 검색, 처방 PDF, 위험 플래그 알림.

tmp_json=$(mktemp)
npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$tmp_json" || true
total=$(jq '.numTotalTests // 0' "$tmp_json")
passed=$(jq '.numPassedTests // 0' "$tmp_json")
if [ "$total" -eq 0 ]; then
  echo "No clinical tests found" >&2
  exit 1
fi
rate=$(echo "scale=2; $passed * 100 / $total" | bc)
echo "Clinical pass rate: ${rate}% ($passed/$total)"

5. 통합 규정 준수 (HIGH — 95%+ 필요)

외부 시스템을 테스트합니다: HL7 메시지 파싱(v2.x), FHIR 검증, 실험실 결과 매핑, 비정상 메시지 처리.

tmp_json=$(mktemp)
npx jest --testPathPattern='tests/integration' --ci --json --outputFile="$tmp_json" || true
total=$(jq '.numTotalTests // 0' "$tmp_json")
passed=$(jq '.numPassedTests // 0' "$tmp_json")
if [ "$total" -eq 0 ]; then
  echo "No integration tests found" >&2
  exit 1
fi
rate=$(echo "scale=2; $passed * 100 / $total" | bc)
echo "Integration pass rate: ${rate}% ($passed/$total)"

통과/실패 매트릭스

카테고리임계값실패 시 조치
CDSS 정확도100%배포 차단
PHI 노출100%배포 차단
데이터 무결성100%배포 차단
임상 워크플로우95%+경고, 검토 후 허용
통합 규정 준수95%+경고, 검토 후 허용

CI/CD 통합

name: Healthcare Safety Gate
on: [push, pull_request]

jobs:
  safety-gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci

      # CRITICAL gates — 100% required, bail on first failure
      - name: CDSS Accuracy
        run: npx jest --testPathPattern='tests/cdss' --bail --ci --coverage --coverageThreshold='{"global":{"branches":80,"functions":80,"lines":80}}'

      - name: PHI Exposure Check
        run: npx jest --testPathPattern='tests/security/phi' --bail --ci

      - name: Data Integrity
        run: npx jest --testPathPattern='tests/data-integrity' --bail --ci

      # HIGH gates — 95%+ required, custom threshold check
      - name: Clinical Workflows
        run: |
          TMP_JSON=$(mktemp)
          npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$TMP_JSON" || true
          TOTAL=$(jq '.numTotalTests // 0' "$TMP_JSON")
          PASSED=$(jq '.numPassedTests // 0' "$TMP_JSON")
          if [ "$TOTAL" -eq 0 ]; then
            echo "::error::No clinical tests found"; exit 1
          fi
          RATE=$(echo "scale=2; $PASSED * 100 / $TOTAL" | bc)
          echo "Pass rate: ${RATE}% ($PASSED/$TOTAL)"
          if (( $(echo "$RATE < 95" | bc -l) )); then
            echo "::warning::Clinical pass rate ${RATE}% below 95%"
          fi

      - name: Integration Compliance
        run: |
          TMP_JSON=$(mktemp)
          npx jest --testPathPattern='tests/integration' --ci --json --outputFile="$TMP_JSON" || true
          TOTAL=$(jq '.numTotalTests // 0' "$TMP_JSON")
          PASSED=$(jq '.numPassedTests // 0' "$TMP_JSON")
          if [ "$TOTAL" -eq 0 ]; then
            echo "::error::No integration tests found"; exit 1
          fi
          RATE=$(echo "scale=2; $PASSED * 100 / $TOTAL" | bc)
          echo "Pass rate: ${RATE}% ($PASSED/$TOTAL)"
          if (( $(echo "$RATE < 95" | bc -l) )); then
            echo "::warning::Integration pass rate ${RATE}% below 95%"
          fi

안티 패턴

  • "이전에 통과했으니까"라며 CDSS 테스트를 건너뛰기
  • CRITICAL 임계값을 100% 미만으로 설정
  • CRITICAL 테스트 스위트에서 --no-bail 사용
  • 통합 테스트에서 CDSS 엔진 모킹(실제 로직을 테스트해야 함)
  • 안전 게이트가 빨간색일 때 배포 허용
  • CDSS 스위트에서 --coverage 없이 테스트 실행

예제

예제 1: 모든 CRITICAL 게이트를 로컬에서 실행

npx jest --testPathPattern='tests/cdss' --bail --ci --coverage && \
npx jest --testPathPattern='tests/security/phi' --bail --ci && \
npx jest --testPathPattern='tests/data-integrity' --bail --ci

예제 2: HIGH 게이트 통과율 확인

tmp_json=$(mktemp)
npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$tmp_json" || true
jq '{
  passed: (.numPassedTests // 0),
  total: (.numTotalTests // 0),
  rate: (if (.numTotalTests // 0) == 0 then 0 else ((.numPassedTests // 0) / (.numTotalTests // 1) * 100) end)
}' "$tmp_json"
# Expected: { "passed": 21, "total": 22, "rate": 95.45 }

예제 3: 평가 보고서

## Healthcare Eval: 2026-03-27 [commit abc1234]

### Patient Safety: PASS

| Category | Tests | Pass | Fail | Status |
|----------|-------|------|------|--------|
| CDSS Accuracy | 39 | 39 | 0 | PASS |
| PHI Exposure | 8 | 8 | 0 | PASS |
| Data Integrity | 12 | 12 | 0 | PASS |
| Clinical Workflow | 22 | 21 | 1 | 95.5% PASS |
| Integration | 6 | 6 | 0 | PASS |

### Coverage: 84% (target: 80%+)
### Verdict: SAFE TO DEPLOY

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

관련 스킬