Przejdź do treści
Biblioteka skilli
Programowanie · Analiza

debug-failure

/debug-failure

Szuka przyczyny błędu, awarii, testu lub złego zachowania i naprawia je testem regresyjnym, bez zgadywania poprawek.

Repozytorium
agent-playbook ↗
Licencja
MIT
Ostatnia zmiana repozytorium
07.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 07.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Szuka przyczyny błędu, awarii, testu lub złego zachowania i naprawia je testem regresyjnym, bez zgadywania poprawek.

Oryginalny opis (EN)

Find the root cause of an error, crash, failing test, regression or wrong behaviour, then fix it with a regression test. Use this whenever something is broken or behaves unexpectedly and the cause is not already proven, even if a fix seems obvious. Do not guess at fixes.

Jak działa

  1. When to use
  2. Steps
  3. Three failed attempts
  4. Stop and ask when
  5. Common mistakes
  6. Example
  7. Report
Sekcje z nagłówków SKILL.md, w oryginale · 97 linii, 651 słów
Podgląd SKILL.md
---
name: debug-failure
description: Find the root cause of an error, crash, failing test, regression or wrong behaviour, then fix it with a regression test. Use this whenever something is broken or behaves unexpectedly and the cause is not already proven, even if a fix seems obvious. Do not guess at fixes.
---

# Debug a failure

Guessing is the slowest way to debug. A fix that makes the symptom disappear
without explaining it usually moves the bug somewhere else. Your job is to explain
the failure with evidence, then change as little as possible.

## When to use

Any failure whose cause you have not proven. For intermittent test failures, use
`fix-flaky-test`.

## Steps

1. **Capture the exact failure.** Copy the full error, stack trace, command and
   input. Read all of it, starting with the first error. Later errors are often
   side effects.

2. **Reproduce it.** Run the smallest command that shows the failure. If you
   cannot reproduce it, say so and collect more data. Do not "fix" it blind.

3. **Check for a recent cause.** Run `git log --oneline -10 -- <file>`. If it
   worked before, find the change that broke it. `git bisect` helps when the
   range is large.

4. **Read the code at the failure.** Open the exact file and line in the trace.
   Follow the bad value back to where it was created.

5. **Write down a hypothesis.** Use this form: "X fails because Y. If that is true,
   then Z will show it." Choose Z so that it could prove you wrong.

6. **Test one hypothesis at a time.** Add a log, assertion or debugger stop, and
   run it. Change one thing per run, and remove temporary logging afterwards.

7. **Explain the cause.** You are ready to fix it when you can say why it fails,
   why it did not fail before, and why your fix addresses that.

8. **Write the regression test.** It must fail on the current code for the same
   reason as the bug. Follow `write-tests`.

9. **Fix the cause.** Make the smallest change, and run the regression test.

10. **Look for the same bug elsewhere.** Search for the same pattern.

11. **Finish.** Follow `verify-and-report`.

## Three failed attempts

If three attempts have not worked, stop editing. Revert your experiments, write
down what you ruled out, and rethink. Your model of the system is wrong somewhere.
Check your assumptions: the right file, the right branch, a stale build, the right
environment, the version that is actually installed.

## Stop and ask when

- The failure only appears in an environment you cannot reach.
- The real fix is much larger than the task, or changes a public contract.
- The test may be right and the requested behaviour wrong.

## Common mistakes

| Tempting move | Why it fails | Do this instead |
| --- | --- | --- |
| Wrap it in `try`/`catch` | Hides the failure | Find why it throws |
| Add a null check | Bad data still reaches this point | Find where the null came from |
| Change the test to match | Removes the signal | Decide which side is wrong, with evidence |
| Add a retry or a longer timeout | Hides a race or slowdown | Find what is slow or racing |
| Change several things at once | You cannot tell what worked | Make one change per run |
| Call a failure unrelated | Often it is not | Check it against your baseline |

## Example

Failure: `TypeError: cannot read 'email' of undefined` in `sendReceipt`.

Weak fix: `user?.email`. The crash stops, and receipts silently stop sending.

Strong work:

```markdown
Hypothesis: `findUser` returns undefined for deleted users.
Check: logged the id, then queried it. The user was soft-deleted.
Cause: `findUser` filters deleted users, while orders keep their user id.
Fix: use `findUserIncludingDeleted` for receipts.
Regression test: an order from a deleted user still sends a receipt.
```

## Report

```markdown
Symptom: <exact error>
Reproduce: <command>
Cause: <what is wrong, and why it fails now>
Evidence: <what you ran or read that proves it>
Fix: <what changed>
Regression test: <name, and how it failed before the fix>
```

Wersje

RepozytoriumWynikLicencja
Ta strona · yaohuangguan/agent-playbook100MIT
WestonBDev/roloe100Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki b511d5eaf64c (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100systematic-debugging
    Szuka przyczyny awarii, nieudanego testu lub złego działania przed jakąkolwiek zmianą, zamiast zgadywać poprawki.
  • 90systematic-debugging
    Znajduje przyczynę błędu, niezaliczonego testu, awarii lub złego wyniku przed zmianą kodu, gdy poprawka nie utrzymała się.
  • 100debug-detective
    Szuka przyczyny błędu, awarii lub nieudanego testu na podstawie stack trace'u i naprawia ją u źródła.
  • 100systematic-debugging
    Szuka przyczyny awarii, błędu lub złego wyniku na podstawie dowodów i zapisuje poprawkę w pamięci.
  • 92debug
    Szuka przyczyny źródłowej błędu przed poprawką, także wtedy, gdy poprawka wydaje się oczywista.
  • 100debugging
    Znajduje przyczynę błędu, wadliwego testu lub zachowania, a potem naprawia ją z dowodem.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.