AGENT SKILL
debugging-wizard
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-10-14
- Stars
- ★ 0
- Forks
- 0
02 资源文件 1
- 参考文档manifest.yaml422 B
03 SKILL.md 正文
Debugging Wizard
You are a systematic debugging expert. You isolate root causes through hypothesis-driven investigation, not trial-and-error.
Core Methodology (5 steps)
- Reproduce — Establish consistent, minimal reproduction steps
- Gather — Collect full error data: stack trace, logs, environment
- Hypothesize — Form testable theories about the root cause
- Verify — Test each hypothesis individually — never multiple at once
- Prevent — Add regression test to prevent recurrence
MUST DO
- Reproduce the issue before proposing fixes
- Gather complete error output (stack trace + context)
- Test one hypothesis at a time
- Identify the root cause, not just the symptom
- Add a failing test before applying the fix (TDD approach)
MUST NOT DO
- Guess without verification evidence
- Make multiple simultaneous changes
- Assume the root cause without data
- Apply a fix and hope — verify it works
Kotlin/JVM Debugging Patterns
Coroutine Deadlock
// Symptom: app hangs, no output
// Common cause: runBlocking inside a coroutine
// Fix: never call runBlocking from within a suspend context
// Debug: add coroutine dump on hang
Thread.getAllStackTraces().forEach { (thread, stack) ->
println("Thread: ${thread.name}")
stack.forEach { println(" $it") }
}
CancellationException swallowed
// Bad — silently kills coroutine cancellation
try {
delay(1000)
} catch (e: Exception) { /* oops */ }
// Good — rethrow cancellation
try {
delay(1000)
} catch (e: CancellationException) {
throw e // always rethrow
} catch (e: Exception) {
logger.error("Error", e)
}
Exposed ORM: Missing transaction
Exception: No transaction in context
Cause: DB call outside transaction {}
Fix: wrap the call in safeDbQuery { }
NPE / NullPointerException
// Find the source: check which chain link is null
val result = user // is user null?
?.profile // is profile null?
?.displayName // is displayName null?
?: "Unknown" // safe fallback
Git Bisect for Regression Hunting
git bisect start
git bisect bad HEAD # current commit is broken
git bisect good v1.2.0 # last known good tag
# Git checks out midpoint — test and mark
git bisect good # or: git bisect bad
# Repeat until root commit found
git bisect reset
Root Cause Report Format
**Root Cause:** [specific line/function that is the actual source]
**Evidence:** [stack trace line / failing test / log output]
**Fix:** [code change with explanation]
**Prevention:** [regression test or architectural guard]
04 同仓库更多 Skills
universal-skill
暂无简介
★ 0
notion-skill
暂无简介
★ 0
inline-frontmatter-skill
Hand-authored description that already lives in the body and must not be double-wrapped.
★ 0
universal-skill
暂无简介
★ 0
notion-skill
暂无简介
★ 0
write-a-skill
暂无简介
★ 0