debug-diagnose
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "debug-diagnose" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-2e69221516ebe74946c128bfdf899c17f34a1622c499cda31580321aa93c9b50. Verify the upstream source and version against https://github.com/theneoai/awesome-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
A structured six-stage debugging process centered on building reliable feedback loops, used to establish feedback mechanisms before forming hypotheses. Applicable to hard-to-reproduce issues, performance regressions, enigmatic failures, agent-based root-cause analysis, and systemic defect fixes.
Introduction source: third_party · theneoai · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Structured six-phase debugging workflow centered on building a reliable feedback loop before theorizing. Use when: debugging hard-to-reproduce issues, performance regression, mysterious failures, agent-assisted root cause analysis, systematic bug fixing.
- Audience
- Use when:** A bug is hard to reproduce or intermittent A performance regression appeared without obvious cause The same bug keeps recurring An agent is stuck in a "try random things" loop You need to present root cause analysis to stakeholders Do NOT use when:** The bug is a typo or trivially obvious from the error message You need to design a new feature (use `to-prd`) The codebase is unfamiliar — run `zoom-out` first
- Testing
- Not tested
Browse files
Frontmatter
name: debug-diagnose
kind: workflow
version: 1.0.0
tags:
- domain: engineering
- subtype: debug-diagnose
- methodology: structured-debugging
description: "Structured six-phase debugging workflow centered on building a reliable feedback loop before theorizing. Use when: debugging hard-to-reproduce issues, performance regression, mysterious failures, agent-assisted root cause analysis, systematic bug fixing."
license: MIT
metadata:
author: theNeoAI <lucas_hsueh@hotmail.com>
inspired_by: mattpocock/skillsDebug & Diagnose
One-Liner
Build a fast, deterministic, agent-runnable pass/fail signal first — the bug is 90% fixed once you have that.
§ 1 · Core Philosophy
The critical insight: If you have a fast, deterministic, agent-runnable pass/fail signal for the bug, you will find the cause. Without it, you are guessing.
Most debugging fails not because the engineer lacks knowledge, but because they skip directly to hypotheses without first establishing a reproducible signal. Build the loop, then let the loop drive everything else.
§ 2 · The Six Phases
Phase 1 — Build a Feedback Loop
Create the fastest reproducible test signal you can. Options in order of preference:
- Unit test — isolates the exact failing condition
- Integration test — exercises the real subsystem path
- CLI script — passes known-bad input, asserts known-bad output
- REPL session — interactive exploration to narrow the search space
- Fuzz input — for non-deterministic or data-dependent failures
Key constraints:
- Must be runnable by the agent without human interaction
- Must produce pass/fail, not just "looks wrong"
- Must be deterministic (same input → same result)
Be aggressive and creative. Refuse to give up. A slow loop is better than no loop; a noisy loop can be narrowed.
Gate: You have a script/test that reproducibly demonstrates the failure.
Phase 2 — Reproduce
Run the loop and confirm it demonstrates exactly the reported failure — not a nearby issue, not a similar symptom.
If the loop shows a different failure than reported:
- You have found a second bug (note it, don't pursue it now)
- Continue narrowing until the loop matches the report precisely
Gate: Loop output matches the failure description word-for-word.
Phase 3 — Hypothesize
Before touching any code, generate 3–5 ranked hypotheses. Each must be:
- Falsifiable — a specific, testable prediction
- Ranked — order by likelihood given what you know
- Independent — don't let one hypothesis assume another is true
Write them down. Do not skip this step even if one hypothesis feels obvious — the obvious hypothesis is frequently wrong.
Phase 4 — Instrument
Test hypotheses in ranked order. For each:
- Add targeted instrumentation at the relevant boundary (not blanket logging)
- Use a debugger or tagged log output, not
print-everywhere - Run the feedback loop
- Does the output confirm or falsify the hypothesis?
Stop when one hypothesis is confirmed. Remove instrumentation from all falsified hypotheses immediately to keep signal clean.
Anti-pattern: Adding instrumentation for all hypotheses at once. You lose the ability to read the signal.
Phase 5 — Fix + Regression Test
- Write a test at the appropriate architectural seam that fails because of the bug — before writing the fix
- Implement the minimal fix
- Confirm: feedback loop is now green, new regression test is green, existing tests still green
- If the fix required touching more than one module, consider whether the modules should be decoupled
Phase 6 — Cleanup + Post-Mortem
- Remove all debug instrumentation
- Verify the feedback loop test is committed (it is now a permanent regression guard)
- Document findings:
- Root cause in one sentence
- Why the bug was not caught earlier
- What architectural change (if any) would prevent the class of bug
§ 3 · Quick Reference
Phase 1: BUILD THE LOOP (deterministic, agent-runnable, pass/fail)
Phase 2: REPRODUCE (confirm the loop shows exactly the reported failure)
Phase 3: HYPOTHESIZE (3-5 ranked, falsifiable hypotheses — written down)
Phase 4: INSTRUMENT (targeted, one hypothesis at a time)
Phase 5: FIX + REGRESSION TEST (test first, then fix)
Phase 6: CLEANUP + POST-MORTEM (remove debug code, document root cause)
§ 4 · When to Use This Skill
Use when:
- A bug is hard to reproduce or intermittent
- A performance regression appeared without obvious cause
- The same bug keeps recurring
- An agent is stuck in a "try random things" loop
- You need to present root cause analysis to stakeholders
Do NOT use when:
- The bug is a typo or trivially obvious from the error message
- You need to design a new feature (use
to-prd) - The codebase is unfamiliar — run
zoom-outfirst
§ 5 · Relationship to Other Skills
| Skill | When to reach for it |
|---|---|
zoom-out |
Unfamiliar codebase — map it before Phase 1 |
tdd-workflow |
Once the bug is fixed — retrofit the regression test into the test suite |
architecture-review |
Post-mortem reveals a structural issue |
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供结构化六阶段调试方法论,解决难复现问题和性能退化等高频痛点
- 强调构建确定性反馈循环的核心理念,具有强实践指导价值
Highlights
- description明确覆盖多种调试场景变体,边界清晰
Areas to improve
-
缺少When to Use显式章节标题 Reported severity: Minor
§4内容实质完整但未使用标准'When to Use'标题
Recommendation: 建议将'§ 4 · When to Use This Skill'改为标准'## When to Use'格式以保持一致性
-
文档结构可优化 Reported severity: Minor
Phase间分隔符风格不完全统一
Recommendation: 建议统一使用相同的分隔符样式(如全部使用---或全部使用空行+标题)
Highlights
- 六阶段划分清晰,每阶段有明确目标和出口门控
- frontmatter完整,包含必要元数据和许可证信息
Highlights
- 方法论定义明确,各阶段操作参数正确
- 覆盖主要异常情况并提供处理建议
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.