user-scope-skills/investigate/SKILL.md
Use when debugging complex, intermittent, or hard-to-reproduce bugs that resist simple fixes. Systematic hypothesis-driven investigation with scope lock and 3-strike escalation. Triggers: "/investigate", "investigate this", "deep debug", "조사해줘", "원인 분석", "간헐적 버그", "재현 안 돼", "intermittent bug", "race condition", "flaky", "hard to reproduce", "근본 원인"
npx skillsauth add onejaejae/skills investigateInstall 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.
Systematic hypothesis-driven root cause investigation for complex bugs.
NO FIXES DURING INVESTIGATION.
Investigation produces UNDERSTANDING, not code changes.
The only files you may write are: temp diagnostic logs (removed after), and the final report.
Violating the letter of this rule IS violating the spirit.
| Skill | Purpose | Pick when | |-------|---------|-----------| | /investigate | Hypothesis-driven understanding | Bug is intermittent, unclear root cause, resists simple debugging | | /bugfix | Diagnosis + automated fix | Bug is reproducible, error message is clear, need a fix applied | | /scope | Blast radius analysis | Need to understand what a change would affect |
Phase 0: Symptom Intake (IMMUTABLE after this phase)
↓
Phase 1: Pattern Matching (6 known patterns)
↓
Phase 2: Scope Lock Declaration
↓
Phase 3: Hypothesis Loop (max 3 strikes)
↓ ← CONFIRMED → Phase 4 (ROOT_CAUSE_FOUND)
↓ ← 3 REFUTED → Phase 4 (ESCALATED)
↓
Phase 4: Verdict + Report
↓
Phase 5: Handoff
Collect and record symptoms. This record is IMMUTABLE — never modified after this phase.
Required fields:
Output: Symptom Record block at top of investigation.
## Symptom Record (IMMUTABLE)
- Error: [verbatim error]
- Frequency: [X times per day/hour]
- Reproduction: [conditions]
- Already tried: [list]
- Reported by: [source]
Compare symptoms against 6 known bug patterns. Read references/known-patterns.md.
For each pattern, score match confidence (0-10):
| Pattern | Confidence | Evidence |
|---------|-----------|----------|
| Race Condition | 8/10 | "동시 요청에서만 발생" matches |
| Nil Propagation | 3/10 | NoneType 에러이지만 간헐적 |
| ... | | |
Select top 1-2 patterns as investigation starting points.
If no pattern matches above 3/10: Proceed to Phase 3 with open hypotheses (no pattern bias).
Based on symptom + pattern match, declare which modules are in scope for investigation.
## Scope Lock
- IN SCOPE: src/handlers/pull_request_handler.py, src/main.py
- OUT OF SCOPE: everything else
- REASON: Error trace points to request handling path
Scope Lock Rules:
Maximum 3 hypotheses. No exceptions.
For each hypothesis:
Quality gate — hypothesis MUST be:
### Hypothesis [N]: [specific statement]
- CONFIRM if: [observable evidence]
- REFUTE if: [observable evidence]
Reject vague hypotheses:
How to test this hypothesis:
Run the experiment. Capture evidence.
Strike 1 (REFUTED) → Form Hypothesis 2
Strike 2 (REFUTED) → Form Hypothesis 3
Strike 3 (REFUTED) → STOP. Phase 4 with ESCALATED. No more hypotheses.
No exceptions:
Save report to .dev/debug/{slug}-investigation.md:
# Investigation Report: {slug}
## Verdict: [ROOT_CAUSE_FOUND / ESCALATED / INCONCLUSIVE]
## Symptom Record
[from Phase 0, unchanged]
## Pattern Analysis
[from Phase 1]
## Scope Lock
[from Phase 2]
## Hypothesis Log
### Hypothesis 1: [statement]
- Evidence: [what was found]
- Result: CONFIRMED / REFUTED
### Hypothesis 2: [statement]
...
## Root Cause (if found)
[detailed explanation with evidence chain]
## Recommended Next Steps
- [ ] [action item]
Based on verdict:
/bugfix with the diagnosis context. Provide the exact root cause statement for the bugfix to use./discuss for brainstorming, or adding monitoring/logging to capture more data.Handoff rules:
/bugfix, never direct code change instructions/bugfix with diagnosis: [root cause statement]"| Excuse | Reality | |--------|---------| | "근본 원인이 명확하니 바로 고치겠습니다" | Investigation produces understanding. Fix goes through /bugfix. | | "관련 파일도 같이 수정하면 재발 방지됩니다" | Scope lock exists for a reason. Out of scope = out of scope. | | "한 번만 더 시도해보겠습니다" (4th hypothesis) | 3 strikes = escalation. No exceptions. | | "이건 간단한 수정이라 조사가 과합니다" | Then use /bugfix, not /investigate. | | "증거가 scope 밖을 가리키네요, 범위를 넓히겠습니다" | INCONCLUSIVE → report → user decides scope expansion. | | "아마 ~일 것 같습니다" (vague hypothesis) | Hypothesis must be falsifiable and specific. Rewrite. | | "테스트를 이렇게 고치면 됩니다" (fix in recommendations) | Recommendations are for the USER, not code instructions. Hand off to /bugfix. | | "간단한 건데 굳이 /bugfix를 거칠 필요 없잖아요" | Iron Law has no size exception. All fixes go through /bugfix. |
testing
CLAUDE.md 기반 환경 안전 체크. 작업 시작 전에 프로젝트의 안전 규칙, 컨벤션, 환경 설정을 자동 검증하여 CLEAR/WARNING/BLOCKED 상태를 보고한다. /check가 "변경 후 검증"이라면, /pre-flight는 "작업 전 환경 검증"이다. Use PROACTIVELY before starting work, especially after switching branches, pulling changes, or resuming a session. Also use when explicitly asked: "/pre-flight", "프리플라이트", "환경 체크", "작업 전 점검", "안전 체크", "environment check", "pre-flight check", "시작해도 돼?", "환경 괜찮아?", "safety check", "DB 확인", "설정 확인", "config check".
tools
PR 리뷰 워크플로우와 체크리스트를 제공하는 스킬. "PR 리뷰해줘", "코드 리뷰 해줘", "이 PR 봐줘", "review this PR" 등 PR 리뷰 요청 시 사용. GitHub/GitLab PR URL 또는 로컬 브랜치 diff를 기반으로 체계적이고 일관된 리뷰를 수행. 코드 품질, 안정성/보안, 성능, 테스트, 문서화 관점에서 건설적인 피드백 제공.
documentation
PR review comments를 체계적으로 처리하는 skill. Use when: (1) PR에 동료의 리뷰가 달렸을 때, (2) 여러 리뷰를 한 번에 처리하고 싶을 때, (3) 수정 후 commit 링크가 포함된 reply를 자동으로 추가하고 싶을 때
tools
PR diff를 받아 코드 리뷰 자동 요약을 생성하는 스킬. 핵심 변경점을 3줄로 요약하고, 변경 파일별로 what changed / why it matters / risk level을 정리. Use when: "PR 요약", "diff 요약", "PR 변경점 정리", "코드 변경 요약", "summarize PR", "PR summary", "diff summary", "what changed in this PR", "변경점 요약해줘", "PR 핵심 정리", "리뷰 요약"