team-attention/hoyeon/bugfix

Claude Code and agent skill by team-attention/hoyeon

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Root cause based one-shot bug fix. debugger diagnosis → requirements.md generation → /execute. /bugfix "error description" Full investigation pipeline: debugger + gap-analyzer + standard verify. QA suggestion after successful fix.

Install

npx vskill@latest install team-attention/hoyeon/bugfix

SKILL.md

/bugfix Skill

Root cause based one-shot bug fix. Diagnose → generate requirements.md → delegate to /execute for fix, verification, and commit.

The Iron Law

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
No completion claims without evidence
Must stop after 3 failed attempts

Architecture

/bugfix "error description"
Phase 1: DIAGNOSE ─────────────────────────────────
debugger + verification-planner + gap-analyzer (all parallel)
→ Blast-radius grep scan + Triage recommendation
→ User confirmation (includes triage hint)
Phase 2: REQUIREMENTS GENERATION ──────────────────
Diagnosis results → requirements.md (hoyeon-cli req init + Write)
Phase 3: EXECUTE ──────────────────────────────────
Skill("execute", args=spec_dir)
→ Success: Phase 5
→ HALT: Phase 4
Phase 4: RESULT HANDLING (if HALT) ────────────────
Retry (max 3) with stagnation detection → Phase 3
Circuit breaker → .hoyeon/debug/{slug}.md → suggest /specify
Phase 5: CLEANUP & REPORT ─────────────────────────
Save .hoyeon/debug/{slug}.md → final summary

Execution Mode

Always runs the full investigation + execution pipeline. No SIMPLE/COMPLEX branching.

Phase 1Retry
debugger + verification-planner + gap-analyzerbugfix-managed (max 3)

/execute will prompt for dispatch/work/verify via AskUserQuestion when invoked — bugfix does not pre-select these modes.


Phase 1: DIAGNOSE

Step 1.1: Parse Input

Extract from user input:

  • Bug description: error message, symptoms, reproduction steps
  • Error output: stack trace, test failure logs (if available)
  • Context: related files, recent changes (if available)

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 --json '{"skill":"bugfix","debug":"'"$DEBUG_STATE"'"}'
Write(DEBUG_STATE):
# Debug: {bug description}
status: investigating
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_dir: pending
## Attempts
Step 1.2: Parallel Investigation

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:
## Diagnosis section:
root_cause: {debugger's Root Cause — 1 line}
bug_type: {classification}
proposed_fix: {proposed fix — 1 line}
Step 1.3: Gap Analysis

Always run gap-analyzer after 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"
Step 1.3b: Blast-radius Quick Scan

After debugger identifies root_cause.location (e.g. src/auth/token.ts:42), extract the function/module name and run grep-based structural scan. Always use wc -l so the LLM compares integers, not raw grep output.

bash
# Extract from debugger's Root Cause section:
# fn = function or symbol name at the root cause (e.g. "parseToken")
# mod = module path without extension (e.g. "src/auth/token")
# If the function name cannot be reliably extracted, set fn="" and skip caller_count.
total_files=$(git ls-files | wc -l | tr -d ' ')
callers=$(git grep -l -F "$fn" 2>/dev/null | wc -l | tr -d ' ')
importers=$(git grep -l -F "$mod" 2>/dev/null | wc -l | tr -d ' ')
test_refs=$(git grep -l -F "$fn" -- '**/*test*' '**/*spec*' 2>/dev/null | wc -l | tr -d ' ')
hot_path=$(git grep -l -F "$fn" -- 'migrations/**' 'auth/**' 'payment/**' 'billing/**' 'schema/**' 2>/dev/null | wc -l | tr -d ' ')

Use -F (fixed string) to avoid regex injection from extracted symbols. Empty or malformed symbols → skip that signal, do NOT fail the phase.

Store the scan in DEBUG_STATE:

Update DEBUG_STATE:
## Diagnosis:
blast:
total_files: {total_files}
callers: {callers}
importers: {importers}
tests: {test_refs}
hot_path: {hot_path}

Blind-spot note: grep misses dynamic dispatch, reflection, and non-JS/Python import forms. Low counts = no data, not safety.

Step 1.3c: Triage Recommendation

Compute a routing hint from the scan. This is advisory only — actual routing decision happens at Step 1.4 with user input.

Rules (first match wins):

ConditionHint
hot_path > 0/specify recommended — touches critical path (auth/payment/migration/schema)
debugger.severity == COMPLEX AND callers > 10 AND callers > total_files × 0.05/specify recommended — wide blast radius ({callers} callers, >5% of repo)
debugger.assumptions section non-empty AND root cause text contains uncertainty markers (?, 추정, possibly, may, unclear)/discuss recommended — root cause unclear
none of the abovebugfix appropriate

Store the hint in DEBUG_STATE:

Update DEBUG_STATE:
triage:
hint: {specify|discuss|bugfix}
reason: "{1-line reason}"
Step 1.4: User Confirmation

Present debugger results + blast-radius scan + triage hint for user confirmation.

The triage hint is advisory — the user always makes the final routing decision.

AskUserQuestion:
header: "Root Cause & Triage"
question: "Review diagnosis and choose how to proceed."
Display:
- Bug Type: [classification]
- Root Cause: [file:line + 1-line description]
- Proposed Fix: [change description — 1 line]
- Verification: [verification commands from verification-planner]
- Assumptions: [debugger's Assumptions section]
- Key warnings from Gap Analysis
- Blast Radius: callers={N}, importers={M}, tests={T}, hot_path={H}
- Triage: {hint from Step 1.3c} — {reason}
(e.g. "/specify recommended — touches auth/ (hot path)")
options:
- "Continue with bugfix" → Phase 2
(if triage hint != bugfix, show as "Continue with bugfix (override triage)")
- "Switch to /specify" → Hand off requirements.md + debug-state.md to /specify
- "Switch to /discuss" → Exit bugfix, suggest running /discuss with the bug context
- "Root cause is different" → Re-run Step 1.2 with user's additional info
- "Stop" → Exit

Handoff on /specify selection:

# requirements.md hasn't been written yet (Phase 2 is skipped on handoff),
# but debug-state.md contains all Phase 1 findings. Save a skeleton so /specify
# has a starting point, then exit bugfix.
hoyeon-cli req init ${SPEC_DIR} --type bugfix --goal "Fix: {bug description}"
# Append debugger report + blast scan to ${SPEC_DIR}/requirements.md as context
# (sections: ## Debug Context, ## Blast Radius)
Update DEBUG_STATE: status: escalated, reason: "user_triage_specify"
print("Handed off to /specify. Run: /specify {SPEC_DIR}")

Phase 2: REQUIREMENTS GENERATION

Convert diagnosis results into requirements.md format. requirements.md is the standard format consumed by /execute, and serves as escalation context for /specify on failure.

Step 2.1: Initialize
SPEC_DIR = "$HOME/.hoyeon/$SESSION_ID"
hoyeon-cli req init ${SPEC_DIR} --type bugfix --goal "Fix: {bug description}"

This creates ${SPEC_DIR}/requirements.md with a stub template.

Step 2.2: Write requirements content

Overwrite ${SPEC_DIR}/requirements.md with the full requirements derived from diagnosis results. Use the Write tool directly.

What to include:

markdown
---
type: bugfix
goal: "Fix: {bug description}"
non_goals:
-"No refactoring beyond the fix"
-"No unrelated feature changes"
---
# Requirements
## R-B1: {Bug fix requirement title — describes the broken behavior}
-behavior: {one-sentence description of what should work correctly after fix}
#### R-B1.1: {sub-requirement — the core bug scenario}
-given: {the precondition/state that triggers the bug}
-when: {the action that exercises the broken path}
-then: {the expected (post-fix) outcome — what "fixed" looks like}
#### R-B1.2: {sub-requirement — edge case or similar issue, if any}
-given: {precondition for the edge case}
-when: {action that triggers it}
-then: {expected outcome}
## R-T1: Minimal diff constraint
-behavior: Fix targets root cause only with minimal code changes
#### R-T1.1: Root cause targeting
-given: {root cause identified at file:line}
-when: the fix is applied
-then: only the root cause location is modified, no unrelated changes
## Constraints
-Minimal diff (<5% of codebase)
-Fix root cause, not symptom
-No refactoring beyond what the fix requires

Mapping rules:

  • Convert debugger's reproduction steps into GWT (given/when/then) for each sub-requirement
  • given: the precondition/state that triggers the bug
  • when: the action that exercises the broken path
  • then: the expected (post-fix) outcome
  • If debugger identified edge cases / similar issues, add sub-requirements for each (one sub per scenario)
  • Include a constraints section with fix-scope guardrails
Step 2.3: Register
bash
hoyeon-cli session set --sid $SESSION_ID --spec "$SPEC_DIR"

Update debug-state.md with spec_dir: ${SPEC_DIR}.


Phase 3: EXECUTE

Hand off requirements.md to /execute. Execute2 reads requirements.md from the spec dir and derives plan.json internally.

Skill("execute", args="${SPEC_DIR}")

What execute handles:

  • Prompts the user for dispatch / work / verify via AskUserQuestion
  • Worker dispatch according to the chosen dispatch mode
  • Round-level commit
  • Verify recipe according to the chosen verify depth
  • Final report

Result judgment:

IF execute completed successfully (all tasks done, report output):
→ Phase 5
IF execute HALTED:
→ Phase 4

Phase 4: RESULT HANDLING

When execute HALTs.

Step 4.1: Read Failure Context
# Extract failure reason from execute's HALT output
# or read from context dir's audit.md, issues.json
CONTEXT_DIR = "${SPEC_DIR}/context"
failure_reason = {execute HALT output or last triage result from audit.md}
Step 4.2: 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

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
69
Repository forks
7
7-day trend score
21

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/team-attention/hoyeon/bugfix/badge)](https://verified-skill.com/skills/team-attention/hoyeon/bugfix)

Something wrong with this skill or its page? Tell us.