.claude/skills/harness/SKILL.md
3-Agent harness orchestrator (Planner → Generator → Evaluator loop). Auto-select execution mode based on task complexity. Reuse existing verify-*/review-* skills as Evaluator infrastructure. Trigger on "하네스", "/harness", "harness mode", or when starting non-trivial multi-file implementation tasks.
npx skillsauth add junnv93/equipment_management_system harnessInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
OpenAI "Harness Engineering" 패턴 적용. 기존 verify-, review- 스킬을 Evaluator로 재사용하며, 자동 반복 루프로 품질 보장.
.claude/exec-plans/에 버전 관리. 외부 채팅/문서에 있는 컨텍스트는 에이전트가 볼 수 없음model: "opus", Evaluator(기계적 검증)는 model: "sonnet". Generator는 메인 컨텍스트(opus)에서 직접 실행. 비용 절감과 품질을 동시에 달성에이전트 간 통신은 파일 기반. 포맷 상세: references/handoff-formats.md
Slug 규칙: 작업 시작 시 kebab-case slug를 결정 (예: loading-tsx, monitoring-cache-stats).
이 slug를 contract와 evaluation-report 파일명에 사용하여 다중 세션 동시 실행 시 충돌 방지.
| File | Path | Producer → Consumer |
|------|------|---------------------|
| exec-plan | .claude/exec-plans/active/YYYY-MM-DD-{slug}.md | Planner → Generator |
| contract | .claude/contracts/{slug}.md | Planner/Harness → Evaluator |
| evaluation-report | .claude/evaluations/{slug}.md | Evaluator → Generator/User |
완료된 계획: active/ → completed/로 이동 (Step 7).
기술 부채 추적: .claude/exec-plans/tech-debt-tracker.md (누적 관리).
Use explicit mode if user specifies (mode0, mode1, mode2). Otherwise, analyze request and auto-select.
| Mode | Condition | Execution | |------|-----------|-----------| | 0 (Direct) | ≤3 files, no logic change (i18n, config, typo, docs) | Bypass harness | | 1 (Lightweight) | 4~15 files, single domain, existing patterns | Generator → Evaluator loop | | 2 (Full) | 15+ files, DB change, new module, multi-domain | Planner → Generator → Evaluator |
Report determination to user in one line and confirm before proceeding. Mode 0 exits this skill immediately.
Mode 1 → skip to Step 3.
Launch Planner Agent with model: "opus" (전략적 설계 판단 — advisor 역할).
Directives:
.claude/exec-plans/active/YYYY-MM-DD-{slug}.md — Phase-based plan with files and verification commands. docs/exec-plans/ 디렉토리가 없으면 자동 생성..claude/contracts/{slug}.md — MUST/SHOULD criteria with domain-specific success criteriaRead references/handoff-formats.md for contract.md schema.
Mode 1 default MUST criteria: tsc --noEmit + build + verify-implementation PASS + backend test PASS.
Save to .claude/contracts/{slug}.md. Create .claude/contracts/ directory if it doesn't exist.
Implement code per exec-plan (Mode 2) or user request (Mode 1).
Generator constraints:
tsc --noEmit, basic buildProceed to Step 5 when implementation is complete.
CRITICAL: Launch as independent Agent with model: "sonnet". Do NOT self-evaluate.
Evaluator는 기계적 검증(grep 패턴, tsc, 빌드, 체크리스트 대조)이 주 업무이므로 sonnet이 적합하다. verify-* 스킬은 Grep 기반 패턴 매칭이고, MUST/SHOULD 판정은 바이너리 결과이므로 opus 수준의 판단력이 불필요하다.
Evaluator Agent prompt must include these directives:
You are a skeptical QA agent. Your job is to find problems, not to approve work.
IMPORTANT CALIBRATION:
- When you identify a legitimate issue, do NOT rationalize it away
- Do NOT say "this is minor" or "this is acceptable" for genuine failures
- If a contract criterion fails, mark it FAIL regardless of surrounding quality
- Grade against hard thresholds — partial credit does not exist for MUST criteria
Steps:
1. Read .claude/contracts/{slug}.md for success criteria
2. Run build verification (tsc, build, test as applicable)
3. Run verify-implementation workflow (existing 13 verify-* skills)
4. Run review-architecture (Mode 2 only)
5. [Frontend changes] Run playwright-e2e for runtime browser verification
- 변경된 라우트의 렌더링, 인터랙션, 에러 상태를 브라우저에서 직접 확인
- 정적 검증(tsc)이 잡지 못하는 런타임 동작 검증
6. Compare each MUST criterion against results → PASS/FAIL
7. Track "이전 반복 대비 변화" to detect repeated failures
8. Write .claude/evaluations/{slug}.md per handoff format
Do NOT modify any code. Report only.
Read references/handoff-formats.md for evaluations/{slug}.md schema.
| Result | Action | |--------|--------| | All MUST PASS | → Step 7 (final report) | | FAIL + iteration < 3 | → Step 6 (fix loop) | | FAIL + same issue 2x consecutive | → Step 7 with "design-level issue, manual intervention needed" | | FAIL + iteration ≥ 3 | → Step 7 with "max iterations reached, manual intervention needed" |
SHOULD 기준 실패는 루프 차단하지 않는다. evaluations/{slug}.md에 기록하고 Step 7에서 후속 작업으로 분류.
Track iteration count. Detect same-issue recurrence by comparing current FAIL issues against previous evaluations/{slug}.md entries (match by file path + issue description).
# active → completed 이동
mv .claude/exec-plans/active/YYYY-MM-DD-{slug}.md \
.claude/exec-plans/completed/YYYY-MM-DD-{slug}.md
# SHOULD 실패 항목이 있으면 tech-debt-tracker.md에 추가
# 형식: - [ ] {이슈} — {파일:라인} — {날짜}
Mode 1은 plan 파일 없으므로 생략.
PASS → /git-commit → PR 생성 → 에이전트 리뷰어 할당 권장
PR 생성 후 에이전트 리뷰가 가능한 경우(review-architecture, review-design 등):
에이전트 리뷰어가 모두 통과할 때까지 /harness 루프를 재진입하지 않고 리뷰 피드백만 처리.
판단이 필요한 경우에만 사용자에게 에스컬레이션.
## Harness Result
| Item | Result |
|------|--------|
| Mode | Mode {N} |
| Iterations | {N} |
| Verdict | PASS / FAIL (manual intervention) |
| Changed | {N} files, +{X}/-{Y} lines |
### Contract Status
| Criterion | Verdict |
|-----------|---------|
### Post-merge Actions
- PASS → /git-commit 실행 후 PR 생성
- SHOULD 실패 항목 → tech-debt-tracker.md 확인
- FAIL → evaluations/{slug}.md 검토 후 수동 수정
- 엔트로피 점검 권장: `/harness entropy` (3회 이상 반복된 경우)
/harness entropy)코드베이스 엔트로피는 에이전트 처리량에 비례해 증가한다. 가비지 컬렉션처럼 조금씩 자주 정리하는 것이 한꺼번에 갚는 것보다 훨씬 낫다.
에이전트가 코드를 생성할 때 반복적으로 위반하는 패턴을 주기적으로 점검:
verify-ssot)verify-hardcoding)review-architecture)references/ 파일로 분리 권장active/에 30일 이상 완료되지 않은 계획이 있는가?/harness entropy 호출 시:
tech-debt-tracker.md에 기록3회 이상 harness를 실행했다면 주기적 entropy 점검을 권장한다.
/schedule 스킬로 자동화 가능: 예) 매주 월요일 /harness entropy
/harness load-bearing)Quarterly recommended.
harness (this skill — orchestrator, runs in main context as opus)
│
├── [Step 2] Planner Agent (model: opus) — 전략적 설계 판단
├── [Step 4] Generator — 메인 컨텍스트에서 직접 실행 (opus)
├── [Step 5] Evaluator Agent (model: sonnet) — 기계적 검증
│ ├── verify-implementation → 13 verify-* skills
│ ├── review-architecture (Mode 2)
│ ├── review-design (frontend changes)
│ └── playwright-e2e (frontend runtime verification)
└── [Step 7] git-commit (post-success)
| Role | Model | 근거 |
|------|-------|------|
| Planner | opus | 아키텍처 결정, 파일 구조 설계, 트레이드오프 판단 — 최고 지능 필요 |
| Generator | opus (main) | 코드 작성 품질이 루프 반복 횟수를 결정 — 한 번에 맞추는 게 경제적 |
| Evaluator | sonnet | Grep 패턴 매칭, tsc/빌드 실행, 체크리스트 대조 — 바이너리 판정에 opus 불필요 |
testing
Verifies Zod validation pattern compliance — ZodValidationPipe usage (no class-validator), versionedSchema inclusion in state-change DTOs, controller pipe application, query DTO consistency. Run after adding/modifying DTOs or controller endpoints.
testing
Verifies cross-feature workflow E2E test coverage against critical-workflows.md checklist. Checks WF-01~WF-35 coverage, step completeness, role correctness, side-effect verification, and status transition assertions. Run after adding workflow tests or before PR.
testing
SSOT(Single Source of Truth) 임포트 소스를 검증합니다. 타입/enum/상수가 올바른 패키지에서 임포트되는지 확인. 타입/enum 추가/수정 후 사용.
development
Verifies SQL safety — LIKE wildcard escaping, N+1 query pattern detection, COUNT(DISTINCT) for fan-out JOINs, RBAC INNER JOIN enforcement. Run after adding/modifying search or list API endpoints.