Systematic bug hunting combining Sherpa's debugging workflow, Julie's execution tracing, and Goldfish's investigation tracking. Activates for bug fixes with methodical reproduction, test capture, fix, and verification. Use when debugging errors or fixing bugs.
Systematic bug hunting combining Sherpa's debugging workflow, Julie's execution tracing, and Goldfish's investigation tracking. Activates for bug fixes with methodical reproduction, test capture, fix, and verification. Use when debugging errors or fixing bugs.
/plugin marketplace add anortham/mcp-toolbox-workflows/plugin install anortham-mcp-toolbox-workflows@anortham/mcp-toolbox-workflowsThis skill is limited to using the following tools:
Conduct systematic, methodical bug investigations using detective-style debugging. This workflow combines Sherpa's bug hunt phases, Julie's execution tracing, and Goldfish's investigation logging to find and fix bugs confidently.
Use when the user:
1. Goldfish recall({ search: "[error/bug description]" })
ā See if similar bug investigated before
2. Learn from previous investigations
3. If same bug ā Resume investigation
4. If new ā Start fresh investigation
Sherpa Activation:
approach({ workflow: "bug-hunt" })
guide() ā "Phase 1: Reproduce & Isolate - Find the crime scene!"
Error Discovery: User reports: "Getting 'Invalid token' error"
Julie Investigation:
fast_search({ query: "Invalid token", mode: "lines" })
ā Find all error message locations
fast_goto on error location
ā Jump to where error is thrown
trace_call_path({ symbol: "validateToken", direction: "upstream" })
ā See what calls this (who triggers the error?)
Reproduce Reliably:
Goldfish Investigation Log:
checkpoint({
description: "Isolated 'Invalid token' error: thrown in validateToken() when refresh tokens expire, called from authenticate() middleware",
tags: ["bug-hunt", "investigation", "phase-1", "auth"]
})
Sherpa Progress:
guide({ done: "reproduced bug: token validation fails with expired refresh tokens" })
ā šµļø "Excellent detective work! The case is taking shape..."
ā "Phase 2: Capture in Test"
Sherpa Guidance:
guide() ā "Phase 2: Capture in Test - Document the crime!"
Julie Pattern Search:
fast_search({ query: "token validation test examples", mode: "semantic" })
ā Find similar test patterns
get_symbols({ file: "tests/auth.test.ts", mode: "structure" })
ā See existing test structure
Write Failing Test:
Run test ā Fails (as expected!)
Goldfish Checkpoint:
checkpoint({
description: "Created failing test: 'should handle expired refresh tokens gracefully' - reproduces Invalid token error",
tags: ["bug-hunt", "test", "phase-2", "auth"]
})
Sherpa Progress:
guide({ done: "wrote failing test that reproduces the expired token bug" })
ā šÆ "Perfect! You've documented the crime. Now let's solve it!"
ā "Phase 3: Fix the Bug"
Sherpa Guidance:
guide() ā "Phase 3: Fix - Solve the mystery!"
Julie Code Understanding:
get_symbols({ file: "src/auth/jwt.ts", mode: "full" })
ā Understand token validation logic
trace_call_path({ symbol: "validateToken", direction: "downstream" })
ā See what validateToken calls (jwt.verify, etc.)
fast_refs({ symbol: "refreshToken" })
ā See all refresh token usage
Analysis:
Implement Fix:
// Add expiration check
if (isRefreshTokenExpired(token)) {
throw new TokenExpiredError('Refresh token expired');
}
Run test ā Passes! ā
Goldfish Checkpoint:
checkpoint({
description: "Fixed expired token bug: added expiration check in validateToken, test now passes",
tags: ["bug-hunt", "fix", "phase-3", "auth", "test-pass"]
})
Sherpa Progress:
guide({ done: "implemented fix for expired tokens, failing test now passes" })
ā š "Case solved! The bug has been caught!"
ā "Phase 4: Verify & Prevent"
Sherpa Guidance:
guide() ā "Phase 4: Verify - Close the case with confidence!"
Verification Steps:
Julie Impact Analysis:
fast_refs({ symbol: "validateToken" })
ā See all usage points (15 locations)
ā Verify fix doesn't break anything
Prevention:
Goldfish Final Checkpoint:
checkpoint({
description: "Bug hunt complete: expired token handling fixed and verified. Added 3 additional tests for edge cases. All 18 auth tests passing.",
tags: ["bug-hunt", "complete", "phase-4", "auth", "verified"]
})
Sherpa Completion:
guide({ done: "verified fix across all test cases, added prevention tests, all tests green" })
ā š "Bug Hunt Complete! Detective work at its finest!"
ā Potential milestone: "š Milestone: Bug Detective Mastery!"
User: "Users are getting randomly logged out"
=== SESSION START ===
ā Goldfish: recall({ search: "logout session" })
No previous investigation. New case!
=== PHASE 1: REPRODUCE & ISOLATE ===
ā Sherpa: approach({ workflow: "bug-hunt" })
šµļø Bug Hunt Workflow activated!
ā Sherpa: guide()
"Phase 1: Reproduce & Isolate"
ā Julie: fast_search({ query: "logout session destroy", mode: "semantic" })
Found: session.ts, auth-middleware.ts
ā Julie: trace_call_path({ symbol: "logout", direction: "both" })
Execution flow:
- logout() calls session.destroy()
- authenticate() checks session.exists()
- Race condition: destroy happens while checking!
ā Goldfish: checkpoint({
description: "Isolated race condition: session.destroy() can execute during session.exists() check, causing random logouts",
tags: ["bug-hunt", "investigation", "race-condition"]
})
ā Sherpa: guide({ done: "found race condition between session destroy and exists check" })
šµļø "Aha! A race condition! Classic mystery..."
=== PHASE 2: CAPTURE IN TEST ===
ā Sherpa: guide()
"Phase 2: Capture in Test"
ā Write test with concurrent operations:
- Simulate logout during auth check
- Reproduce race condition
- Test fails (intermittently - race condition!)
ā Goldfish: checkpoint({
description: "Created failing test: 'should handle concurrent logout during auth' - reproduces race condition",
tags: ["bug-hunt", "test", "phase-2", "race-condition"]
})
ā Sherpa: guide({ done: "wrote test that reproduces race condition" })
šÆ "Documented the crime!"
=== PHASE 3: FIX THE BUG ===
ā Sherpa: guide()
"Phase 3: Fix the Bug"
ā Julie: get_symbols({ file: "src/session.ts", mode: "full" })
Understand session management
ā Solution: Add mutex/lock for session operations
ā Implement fix with proper locking
ā Test passes consistently! ā
ā Goldfish: checkpoint({
description: "Fixed race condition: added mutex for session operations, test now passes consistently",
tags: ["bug-hunt", "fix", "phase-3", "race-condition"]
})
ā Sherpa: guide({ done: "fixed race condition with mutex, test passes" })
š "Mystery solved!"
=== PHASE 4: VERIFY & PREVENT ===
ā Sherpa: guide()
"Phase 4: Verify & Prevent"
ā Run full test suite ā All pass ā
ā Stress test with 100 concurrent operations ā Stable! ā
ā Julie: fast_refs({ symbol: "session" })
Check all session usage ā All safe
ā Goldfish: checkpoint({
description: "Race condition fix verified: stress tested with 100 concurrent ops, added 5 concurrency tests, all 23 session tests pass",
tags: ["bug-hunt", "complete", "verified", "race-condition"]
})
ā Sherpa: guide({ done: "verified fix under stress, added prevention tests" })
š "Bug Hunt Complete! Case closed!"
trace_call_path shows WHO calls buggy code:
- Identify entry points
- See call chain
- Understand flow
fast_search for error patterns:
- Find related errors
- See similar issues
- Learn from fixes
fast_refs shows WHERE code is used:
- Impact analysis
- Breaking change detection
- Edge case discovery
checkpoint({
description: "Discovered: [finding]",
tags: ["discovery", "hypothesis"]
})
checkpoint({
description: "Hypothesis: [theory about root cause]",
tags: ["hypothesis", "analysis"]
})
checkpoint({
description: "Solution: [fix description]",
tags: ["solution", "fix"]
})
Benefit: Investigation trail is preserved even across context resets!
Bug Detective succeeds when:
Result: Systematic debugging that finds root causes fast!
Remember: Every good detective documents their investigation. Sherpa guides, Julie traces, Goldfish preserves. Together, they solve the mystery!
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.