Zum Inhalt springen
Skillpedia
Allgemeines Programmieren48k · #4194

code-showcase-systematic-debugging

Was er macht

Dieses System hilft dir, die Ursache von Code-Problemen mit einer 4-Schritte-Methode zu finden. Es konzentriert sich darauf, zu verstehen, warum ein Fehler auftritt, bevor du versuchst, ihn zu beheben.

Wann du ihn nutzt

  • ✓Wenn im Code ein Fehler auftaucht und du die Ursache nicht kennst.
  • ✓Wenn automatische Tests fehlschlagen und du das beheben willst.
  • ✓Um unerwartetes Verhalten eines Programms zu untersuchen.

Link zum Skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/code-showcase-systematic-debugging/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/code-showcase-systematic-debugging/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Ich sehe Fehler X. Kannst du mir helfen, die Ursache mit der 4-Phasen-Methode zu finden?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Das System führt dich durch 4 Phasen: Ursachenanalyse, Mustererkennung, Hypothese und Test und zuletzt die Umsetzung. Es besteht darauf, zuerst den eigentlichen Grund zu finden, bevor eine Lösung umgesetzt wird.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Systematic Debugging

When to Use

Use this skill when you need four-phase debugging methodology with root cause analysis. Use when investigating bugs, fixing test failures, or troubleshooting unexpected behavior. Emphasizes NO FIXES WITHOUT ROOT CAUSE FIRST.

Core Principle

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.

Never apply symptom-focused patches that mask underlying problems. Understand WHY something fails before attempting to fix it.

The Four-Phase Framework

Phase 1: Root Cause Investigation

Before touching any code:

  1. Read error messages thoroughly - Every word matters
  2. Reproduce the issue consistently - If you can't reproduce it, you can't verify a fix
  3. Examine recent changes - What changed before this started failing?
  4. Gather diagnostic evidence - Logs, stack traces, state dumps
  5. Trace data flow - Follow the call chain to find where bad values originate

Root Cause Tracing Technique:

1. Observe the symptom - Where does the error manifest?
2. Find immediate cause - Which code directly produces the error?
3. Ask "What called this?" - Map the call chain upward
4. Keep tracing up - Follow invalid data backward through the stack
5. Find original trigger - Where did the problem actually start?

Key principle: Never fix problems solely where errors appear—always trace to the original trigger.

Phase 2: Pattern Analysis

  1. Locate working examples - Find similar code that works correctly
  2. Compare implementations completely - Don't just skim
  3. Identify differences - What's different between working and broken?
  4. Understand dependencies - What does this code depend on?

Phase 3: Hypothesis and Testing

Apply the scientific method:

  1. Formulate ONE clear hypothesis - "The error occurs because X"
  2. Design minimal test - Change ONE variable at a time
  3. Predict the outcome - What should happen if hypothesis is correct?
  4. Run the test - Execute and observe
  5. Verify results - Did it behave as predicted?
  6. Iterate or proceed - Refine hypothesis if wrong, implement if right

Phase 4: Implementation

  1. Create failing test case - Captures the bug behavior
  2. Implement single fix - Address root cause, not symptoms
  3. Verify test passes - Confirms fix works
  4. Run full test suite - Ensure no regressions
  5. If fix fails, STOP - Re-evaluate hypothesis

Critical rule: If THREE or more fixes fail consecutively, STOP. This signals architectural problems requiring discussion, not more patches.

Red Flags - Process Violations

Stop immediately if you catch yourself thinking:

  • "Quick fix for now, investigate later"
  • "One more fix attempt" (after multiple failures)
  • "This should work" (without understanding why)
  • "Let me just try..." (without hypothesis)
  • "It works on my machine" (without investigating difference)

Warning Signs of Deeper Problems

Consecutive fixes revealing new problems in different areas indicates architectural issues:

  • Stop patching
  • Document what you've found
  • Discuss with team before proceeding
  • Consider if the design needs rethinking

Common Debugging Scenarios

Test Failures

1. Read the FULL error message and stack trace
2. Identify which assertion failed and why
3. Check test setup - is the test environment correct?
4. Check test data - are mocks/fixtures correct?
5. Trace to the source of unexpected value

Runtime Errors

1. Capture the full stack trace
2. Identify the line that throws
3. Check what values are undefined/null
4. Trace backward to find where bad value originated
5. Add validation at the source

"It worked before"

1. Use git bisect to find the breaking commit
2. Compare the change with previous working version
3. Identify what assumption changed
4. Fix at the source of the assumption violation

Intermittent Failures

1. Look for race conditions
2. Check for shared mutable state
3. Examine async operation ordering
4. Look for timing dependencies
5. Add deterministic waits or proper synchronization

Debugging Checklist

Before claiming a bug is fixed:

  • Root cause identified and documented
  • Hypothesis formed and tested
  • Fix addresses root cause, not symptoms
  • Failing test created that reproduces bug
  • Test now passes with fix
  • Full test suite passes
  • No "quick fix" rationalization used
  • Fix is minimal and focused

…

Häufige Fragen

Warum ist es wichtig, die Ursache zu finden, bevor man repariert?

Wenn du nur das Symptom behandelst, kann das eigentliche Problem verdeckt bleiben. Es kann später wiederkommen oder weitere Fehler verursachen. Wer die Ursache versteht, findet eine dauerhafte Lösung.

Was sind 'Red Flags'?

Das sind Warnsignale, die darauf hindeuten, dass du wichtige Schritte überspringst, etwa wenn du schnelle Lösungen suchst, ohne das Problem zu verstehen, oder mehrere erfolglose Korrekturen ausprobierst.

Was tue ich, wenn ich mehrfach versuche zu reparieren und es klappt nicht?

Wenn du drei oder mehr Korrekturen versuchst und keine funktioniert, empfiehlt das System, anzuhalten. Das kann auf ein größeres strukturelles Problem im Code hindeuten, das im Team besprochen werden sollte.

Details

Originalbeschreibung des Autors

Four-phase debugging methodology with root cause analysis. Use when investigating bugs, fixing test failures, or troubleshooting unexpected behavior. Emphasizes NO FIXES WITHOUT ROOT CAUSE FIRST.

repo: sickn33/agentic-awesome-skills

Beliebtheit

GitHub-Sterne
48k
Platz im Ranking
#4194
Lizenz
MIT
Aktualisiert
15.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills