user-scope-skills/bugfix/SKILL.md
Root cause based one-shot bug fix. debugger diagnosis → spec.json generation → /execute. /bugfix "error description" Adaptive mode: auto-routes by debugger's Severity assessment (SIMPLE/COMPLEX).
npx skillsauth add onejaejae/skills bugfixInstall 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.
Root cause based one-shot bug fix. Diagnose → generate spec.json → delegate to /execute for fix, verification, and commit.
| Skill | Purpose | When to pick | |-------|---------|-------------| | /bugfix | Root-cause diagnosis + spec generation + /execute delegation | Bug report — need investigation before fix | | /ralph | DoD-based iterative loop with independent verification | Known fix needed, want verified-done loop | | /execute | Spec-driven orchestrator from existing spec.json | Already have a spec.json, no diagnosis needed | | /scope | Fast parallel change-scope analyzer | Need to understand blast radius before fixing |
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
No completion claims without evidence
Must stop after 3 failed attempts
/bugfix "error description"
Phase 1: DIAGNOSE ─────────────────────────────────
debugger + verification-planner (always parallel)
+ gap-analyzer (COMPLEX only)
→ User confirmation
Phase 2: SPEC GENERATION ──────────────────────────
Diagnosis results → spec.json (hoyeon-cli spec init + merge)
Phase 3: EXECUTE ──────────────────────────────────
Skill("execute", args=spec_path)
→ Success: Phase 5
→ HALT: Phase 4
Phase 4: RESULT HANDLING (if HALT) ────────────────
SIMPLE: retry (max 3) with stagnation detection → Phase 3
COMPLEX: escalate immediately (execute already retried)
Circuit breaker → .dev/debug/{slug}.md → suggest /specify
Phase 5: CLEANUP & REPORT ─────────────────────────
Save .dev/debug/{slug}.md → final summary
Mode is never asked from the user. Auto-routes based on debugger's Severity assessment:
| Severity | spec depth | Phase 1 | Phase 3 (execute) | Retry | |----------|-----------|---------|-------------------|-------| | SIMPLE | quick | debugger + verification-planner | worker → commit → final verify | bugfix-managed (max 3) | | COMPLEX | standard | + gap-analyzer | worker → verify → commit → code review → requirements | execute-internal (max 2), then escalate |
Extract from user input:
Initialize Debug State:
SESSION_ID = [from hook — $CLAUDE_SESSION_ID]
slug = convert bug description to kebab-case (e.g. "null-pointer-in-auth")
DEBUG_STATE = "$HOME/.hoyeon/$SESSION_ID/debug-state.md"
hoyeon-cli session set --sid $SESSION_ID --skill bugfix --debug "$DEBUG_STATE"
Write(DEBUG_STATE):
# Debug: {bug description}
status: investigating
severity: pending
attempt: 0
slug: {slug}
## Symptoms (IMMUTABLE after Phase 1)
- expected: {from user input}
- actual: {from user input}
- error: {from user input}
## Diagnosis
root_cause: pending
spec_path: pending
## Attempts
Always dispatch 2 agents in parallel:
Task(debugger):
"Bug Description: {user input}
Error Output: {error logs, if available}
Context: {related files/recent changes, if available}
Investigate this bug following your Investigation Protocol.
Classify Bug Type, trace backward to root cause, assess Severity."
Task(verification-planner):
"User's Goal: Fix the bug described below
Current Understanding: {user input}
Work Breakdown:
- Reproduce bug with test
- Apply minimal fix at root cause
- Verify fix resolves the issue
Focus on Auto items only (what commands prove the fix works).
Keep it minimal — this is a bug fix, not a feature.
Note: /bugfix uses Tier 1-3 (Auto items) only. Do not inline VERIFICATION.md.
Tier 4 (sandbox items) are not needed. Mark sandbox section as 'bugfix mode — Tier 1-3 only'."
After receiving debugger results, update debug-state.md:
Update DEBUG_STATE:
severity: {SIMPLE/COMPLEX}
## Diagnosis section:
root_cause: {debugger's Root Cause — 1 line}
bug_type: {classification}
proposed_fix: {proposed fix — 1 line}
Check Severity from debugger results:
Task(gap-analyzer):
"User's Goal: Fix the bug below
Current Understanding: {debugger's full Bug Analysis Report}
Intent Type: Bug Fix
Focus on:
- Whether root cause vs symptom distinction is correct
- Whether proposed fix could break other areas
- Whether similar bugs exist with the same pattern"
Present debugger results summary for user confirmation:
AskUserQuestion:
header: "Root Cause"
question: "Is the debugger's Root Cause analysis correct?"
Display:
- Bug Type: [classification]
- Root Cause: [file:line + 1-line description]
- Proposed Fix: [change description — 1 line]
- Severity: [SIMPLE/COMPLEX]
- Verification: [verification commands from verification-planner]
- Assumptions: [debugger's Assumptions section]
[COMPLEX only] Key warnings from Gap Analysis
options:
- "Correct, proceed" → Phase 2
- "Root cause is different" → Re-run Step 1.2 with user's additional info
- "Not sure" → Suggest "/discuss to explore first", then exit
Convert diagnosis results into spec.json v5 format. spec.json is the standard format consumed by /execute, and serves as escalation context for /specify on failure.
SPEC_DIR = "$HOME/.hoyeon/$SESSION_ID"
SPEC_PATH = "$SPEC_DIR/spec.json"
depth = "quick" for SIMPLE, "standard" for COMPLEX
hoyeon-cli spec init fix-{slug} \
--goal "Fix: {bug description}" \
--type dev \
--depth {depth} \
--interaction autopilot \
${SPEC_PATH}
Use hoyeon-cli spec merge to populate the spec from diagnosis results. Single merge call.
What to include:
non_goals (no refactoring, no unrelated features), deliverables (debug report path)request (original bug description), research (debugger analysis summary), assumptions (from debugger), decisions (root cause location + rationale)action: debugger's proposed fixfile_scope: affected files from debuggersteps: write regression test (RED) → apply minimal fix (GREEN) → verifymust_not_do: minimal diff (<5%), no refactoring, no unrelated changes, no git commands, fix root cause not symptomacceptance_criteria.scenarios: list of scenario IDs from requirements[].scenarios[].id (verification-planner's Auto items map to machine scenarios)acceptance_criteria.checks: automated static/build/lint checks if applicabledepends_on: [T1]) to fix those locations — T2 must include all required task fields: type: "work", status: "pending", must_not_do, and acceptance_criteriaverified_by: agent){
"id": "R1",
"priority": 1,
"behavior": "{what should work — from debugger's expected behavior}",
"scenarios": [{
"id": "R1-S1",
"given": "{precondition from debugger's reproduction steps}",
"when": "{trigger action that caused the bug}",
"then": "{expected outcome after fix}",
"verified_by": "machine",
"verify": {
"type": "command",
"run": "{test command from verification-planner's Auto items}",
"expect": {"exit_code": 0}
}
}]
}
verify.run commandshoyeon-cli spec validate ${SPEC_PATH}
hoyeon-cli session set --sid $SESSION_ID --spec "$SPEC_PATH"
If validation fails, fix the JSON and retry once.
Update debug-state.md with spec_path: ${SPEC_PATH}.
Hand off spec.json to /execute. Execute routes by meta.type: dev and follows the dev.md pipeline.
Skill("execute", args="${SPEC_PATH}")
What execute handles:
Result judgment:
IF execute completed successfully (all tasks done, report output):
→ Phase 5
IF execute HALTED:
→ Phase 4
When execute HALTs. Handling differs by severity.
# Extract failure reason from execute's HALT output
# or read from context dir's audit.md, issues.md
CONTEXT_DIR = ".dev/specs/fix-{slug}/context"
failure_reason = {execute HALT output or last triage result from audit.md}
IF severity == "COMPLEX":
# Execute standard mode already retried internally (max 2)
# No further retries — go straight to Circuit Breaker
→ Step 4.5 (Circuit Breaker)
IF severity == "SIMPLE":
→ Step 4.3 (Retry)
# Read current attempt from debug-state.md
attempt = debug_state.attempt + 1
MAX_ATTEMPTS = 3
IF attempt >= MAX_ATTEMPTS:
→ Step 4.5 (Circuit Breaker)
Stagnation Detection (attempt >= 2):
# Compare with previous attempt failure info
previous = debug_state.Attempts[-1]
current_reason = failure_reason
SPINNING: same file/component fails consecutively
OSCILLATION: A fails → B fails → A fails (circular)
NO_PROGRESS: different failures each time, previous fixes cause regressions
Pattern-specific retry_hint:
SPINNING → "Different root cause likely. Consider: previous root cause
was wrong — trace further back from the symptom."
OSCILLATION → "Circular dependency. Fix both sides simultaneously."
NO_PROGRESS → "Fundamental misunderstanding. Re-read error output.
Consider: multiple independent bugs? Missing dependency?"
(no pattern) → "Different approach needed. Do NOT repeat previous attempt."
# 1. Record attempt in debug-state.md
Append to DEBUG_STATE ## Attempts section:
### Attempt {attempt}
result: FAIL
reason: {failure_reason}
pattern: {detected pattern or "none"}
hint: {retry_hint}
# 2. Update attempt counter
Update DEBUG_STATE: attempt: {attempt}
# 3. Add failure context to spec.json
hoyeon-cli spec merge ${SPEC_PATH} --json '{
"context": {
"known_gaps": [
{"gap": "Attempt {attempt} failed: {failure_reason}", "severity": "high", "mitigation": "{retry_hint}"}
]
}
}'
# 4. Reset task status
hoyeon-cli spec task T1 --status pending ${SPEC_PATH}
{IF T2 exists AND T2 not done:}
hoyeon-cli spec task T2 --status pending ${SPEC_PATH}
# 5. Re-invoke execute
→ Phase 3
Execute handles resume naturally:
known_gaps carry failure context and retry_hint for the workerMax attempts exceeded or COMPLEX mode HALT. Present escalation options to user.
First, save attempt records:
Bash: mkdir -p .dev/debug
Write to .dev/debug/{slug}.md:
# Bugfix Report: {description}
Date: {timestamp}
Status: ESCALATED
Severity: {SIMPLE/COMPLEX}
Attempts: {attempt count}
Spec: {SPEC_PATH}
## Debugger Analysis
{debugger's full Bug Analysis Report}
## Attempt History
{full ## Attempts section from debug-state.md}
## Assessment
{SIMPLE: "{attempt} attempts failed. Likely not a simple bug."}
{COMPLEX: "Execute standard mode failed including internal retries. Architecture-level issue."}
Update DEBUG_STATE:
status: escalated
AskUserQuestion:
header: "Circuit Breaker"
question: "Fix attempts have failed. This may be an architecture-level issue."
options:
- "Switch to /specify (full planning)"
→ "spec.json and debug report are available:
Spec: {SPEC_PATH}
Report: .dev/debug/{slug}.md
/specify can reference this context for deeper analysis."
- "Try once more"
→ attempt += 1, go to Phase 3 (no circuit breaker reset)
- "Stop"
After execute completes successfully.
Bash: mkdir -p .dev/debug
Write to .dev/debug/{slug}.md:
# Bugfix Report: {description}
Date: {timestamp}
Status: RESOLVED
Severity: {SIMPLE/COMPLEX}
Attempts: {attempt count + 1}
Spec: {SPEC_PATH}
## Root Cause
{debugger's Root Cause analysis}
## Fix
{spec.json T1.action + result summary}
## Verification
{verification results from execute's final report}
Update DEBUG_STATE:
status: resolved
print("""
## Bugfix Complete
**Bug**: {description}
**Root Cause**: {file:line — 1-line description}
**Severity**: {SIMPLE/COMPLEX}
**Attempts**: {count}
**Spec**: {SPEC_PATH}
**Report**: .dev/debug/{slug}.md
""")
/bugfix (diagnose + spec.json + execute)
↓ circuit breaker (SIMPLE: 3 failures, COMPLEX: execute HALT)
↓ spec.json + .dev/debug/{slug}.md saved
/specify (spec.json enrichment, leveraging existing diagnosis context)
↓
/execute (enriched spec execution)
Since spec.json is the standard format, /specify can read and enrich the existing spec on escalation. All diagnosis context (context.research, context.assumptions, context.known_gaps) is preserved.
| Phase | Agent | Status | Condition | Role | |-------|-------|--------|-----------|------| | 1 | debugger | existing | always | Root cause analysis, Bug Type classification, Severity assessment | | 1 | verification-planner | existing | always | Generate Auto items list (verification commands) | | 1 | gap-analyzer | existing | COMPLEX only | Check for missed factors, risk assessment | | 3 | /execute (Skill) | existing | always | spec.json-based execution (worker, verify, commit, review) |
Phase 2 (SPEC GENERATION) and Phase 4 (RESULT HANDLING) are handled directly by bugfix without agents (hoyeon-cli calls + judgment logic).
This skill combines core patterns from 3 proven open-source projects:
| Principle | Source | Application | |-----------|--------|-------------| | Root cause before fix | superpowers (systematic-debugging) | Entire Phase 1 | | Backward call stack tracing | superpowers (root-cause-tracing) | debugger's Step 3 | | Defense-in-depth after fix | superpowers (defense-in-depth) | Optional worker application | | Anti-pattern rationalizations | superpowers (common rationalizations) | debugger's checklist | | Bug Type → Tool routing | oh-my-opencode (Metis intent classification) | debugger's tool table | | Adaptive severity | oh-my-opencode (Momus "80% is good enough") | SIMPLE/COMPLEX auto-routing | | Minimal diff (<5%) | oh-my-claudecode (executor/build-fixer) | spec constraint C1 | | Circuit breaker (3 attempts) | oh-my-claudecode (debugger) + superpowers | Phase 4 | | spec.json as universal format | internal (specify/execute unification) | Phase 2 | | Execute reuse | internal (single execution engine) | Phase 3 |
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 핵심 정리", "리뷰 요약"