원클릭으로
debugging
ALWAYS load when investigating bugs, failures, or unexpected behavior - ensures root cause analysis before attempting fixes.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
ALWAYS load when investigating bugs, failures, or unexpected behavior - ensures root cause analysis before attempting fixes.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
| name | debugging |
| description | ALWAYS load when investigating bugs, failures, or unexpected behavior - ensures root cause analysis before attempting fixes. |
Trust comes from verifiers, not from the LLM. Every technique below is a way to build a verifier the model cannot talk around: a failing test, a printf line, a diff that is either zero or nonzero. The trustworthiness of any conclusion in this mode is bounded above by the strength of the verifier that produced it. See ai/docs/validation-cycle-principles.md for the full framing.
When investigating bugs, failures, or unexpected behavior, shift into debugging mode. This is fundamentally different from development mode.
Read these files before investigating:
ai/docs/debugging-principles.md - Complete methodology
ai/docs/leak-debugging-guide.md - Handle/memory leak specifics
Always start by answering these:
| Cycle Time | Strategy |
|---|---|
| < 1 min | Printf debugging, rapid bisection, be self-sufficient |
| 1-60 min | Batch diagnostics, careful hypothesis |
| Hours+ | Statistical bisection or strategic instrumentation |
| Intermittent only | DocChangeLogger pattern, deploy and wait |
Never ask the user about runtime behavior you can observe yourself.
When cycle time is fast:
Console.WriteLine($"Instance: {RuntimeHelpers.GetHashCode(obj)}")Console.WriteLine($"Thread: {Thread.CurrentThread.ManagedThreadId}")You can answer your own questions faster and more comprehensively than any human operating a debugger.
Never claim to know what code does at runtime from reading it. Instrument and observe.
See ai/docs/debugging-principles.md → "Prove It From Inside" for the full methodology, failure modes, and examples. Key points:
Before declaring a fix, write a test that fails on the current code and passes after the fix.
The test does three jobs at once:
For nightly test failures, exception reports, and reproducible bug reports: the test usually already exists or can be constructed from the stack trace and the report's reproduction steps. Write it first, watch it fail, then make it pass. The fix is the diff between "test red" and "test green."
For bugs that resist reproduction: make reproduction the first deliverable. Until a test fails reliably, no fix can be trusted. See "Long-Cycle Mode" in ai/docs/debugging-principles.md for amplification, statistical bisection, and DocChangeLogger strategies.
This is the "permanent verifier" rule from ai/docs/validation-cycle-principles.md made operational. The bug is not allowed to be considered fixed without also being gated against forever after.
// Object identity
Console.WriteLine($"Instance: {RuntimeHelpers.GetHashCode(obj)}");
// Thread identity
Console.WriteLine($"Thread: {Thread.CurrentThread.ManagedThreadId}");
// Call stack — add selectively to calls of interest (verbose)
Console.WriteLine($"[DEBUG] Stack:\n{Environment.StackTrace}");
// Method entry with context
Console.WriteLine($"[DEBUG] {nameof(MethodName)}: param={value}");
Once you add instrumentation, the log output is your primary source of truth:
Run-Tests.ps1 writes to bin\x64\Debug\TestName.log. Use Read to examine it — don't just grep stdoutEnvironment.StackTrace to the specific cases of interest. Use StackTraceLogger (TestUtil/StackTraceLogger.cs) for scoped logging that filters out expected callersprotected override void DoTest()
{
// ... first half ...
return; // BISECT: Testing if bug is in first half
// ... second half ...
}
If bug present → it's before the return If bug absent → it's after the return Repeat to isolate.
Recognize debugging mode when user:
The mode shift: Stop thinking "how do I implement?" → Start thinking "how do I observe and isolate?"
SOC 직업 분류 기준
ALWAYS load when working in pwiz_tools/Osprey (C# port), on maccoss/osprey (Rust), or debugging Osprey-Rust parity issues.
ALWAYS load before git commit, push, or PR - team-specific commit format differs from standard conventions.
ALWAYS load when working on LabKey Server modules (MacCossLabModules, targetedms), in a LabKey enlistment directory, or on GitHub issues/PRs in LabKey repositories.
ALWAYS load when working in pwiz_tools/Skyline, on GitHub issues labeled 'skyline', or TODOs referencing Skyline code.
Invoke when starting an autonomous overnight session ("this is a nighttime autonomous session"). Sets a deep-investigation posture - premium on progress and high-definition findings, expects 5-8 hours of work without check-ins.
Load when investigating handle leaks, memory leaks, or GC-LEAK failures. Covers handle counting, dotMemory profiling, and GC leak tracker workflows.