skills/systematic-debug/SKILL.md
Systematically investigates unexpected behavior — reproduces the issue by writing a test, fixes the root cause, and establishes a regression test. Not for simple fixes where the root cause is already known, nor for intuitive fixes without test verification.
npx skillsauth add laitszkin/apollo-toolkit systematic-debugInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reproduce unexpected behavior through a structured process. Fix the root cause, then establish a regression test to prevent recurrence.
Classify the error type to select the right approach:
| Type | Characteristics | Approach | |------|----------------|----------| | Syntax / type | Compiler or linter points directly at it | Fix the indicated location directly | | Logic | Wrong output, test failure | Hypothesis-driven debugging + binary search | | State | Intermittent, order-dependent | Track state transitions, identify mutation points | | Integration | Works in isolation, fails when connected | Check boundaries, contracts, formats | | Environment | Works in some environments, fails in others | Compare environment differences, check config | | Performance | Correct result but slow or resource-heavy | Profile, find hotspots, check complexity |
Read the relevant code based on the user's report. Collect evidence from error messages, recent changes, and logs.
Form a falsifiable hypothesis using the chosen method.
Write a test case to reproduce the issue based on your hypothesis.
Change one variable at a time. Changing multiple conditions simultaneously makes it impossible to attribute causality.
If none of the hypothesized causes reproduce the behavior, formulate a new hypothesis and repeat.
Apply the fix until the reproduction test passes.
Fix the root cause, not the symptom. After fixing, keep the reproduction test as the regression test.
Before delivering, verify:
Choose the method that best fits the error type and context:
Best for production incidents, logic errors. Test hypotheses in cheapest-first order.
Best for simple, linear failures. Repeatedly ask "why" along a single causal chain. Caution: When multiple causes interact, Five Whys may miss branching causes.
Best for multi-cause interaction, architecture-level prevention. Start from the top-level failure, decompose all contributing causes downward to observable, testable leaf nodes. Identify minimal cut sets — address single-point failures first. Reference: NASA SW Handbook, Chaos Engineering
Best for cross-team, cross-service complex problems. Force structured analysis through four dimensions:
| Dimension | IS (problem is here) | IS NOT (problem is not here) | Difference (cause lies here) | |-----------|---------------------|-----------------------------|------------------------------| | What | | | | | Where | | | | | When | | | | | Extent | | | |
A valid root cause must explain all IS and all IS NOT. Best for stable environments with clear boundaries; not for cascading disasters. Reference: Kepner-Tregoe Problem Solving
Method selection principle: When multiple possible root causes exist, start with the cheapest to verify.
If you notice any of the following patterns, you are skipping investigation. Stop immediately and go back to Step 1:
If the same error survives 3 fix attempts:
Record each hypothesis during debugging:
Hypothesis: [Root cause guess]
Status: [Unverified / Confirmed / Ruled out]
Verification: [What check was performed]
Evidence: [Observed result]
Every new hypothesis must explain all observed symptoms before being tested.
If systematic investigation still cannot identify the root cause (environmental, timing, external dependency):
95% of "cannot find root cause" cases are insufficient depth. Confirm all available evidence has been exhausted before concluding.
development
Review a pull request — interactive PR selection via `gh`, 4-dimension code review (hallucinated code, architecture, performance, test validity), then post severity-graded comments with fix suggestions on the PR. Not for spec-based review — use `review` instead.
development
Read a user-specified PDF that marks the week's key financial events, deeply research each marked event with current sources, capture any additional breaking financial developments, and produce a concise Chinese-capable PDF briefing that explains what happened and why it matters.
documentation
Generate long-form videos (more than 10 minutes) by following user instructions and invoking related skills only when needed (`openai-text-to-image-storyboard`, `docs-to-voice`, `remotion-best-practices`). For text inputs, extract a complete long-form story arc, generate fresh storyboard images (no reuse of previously generated pictures), and render a 16:9 animated long-form video.
tools
協助完成自動化版本發佈。同步文檔、更新版本號、推送 tag 並建立 GitHub Release。