Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

fail-first-testing

/fail-first-testing

Dowodzi zmiany testem, który najpierw pada przed poprawką, a po niej przechodzi, i daje dowód do opisu pull requesta.

Licencja
MIT
Ostatnia zmiana repozytorium
12.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 12.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

Dowodzi zmiany testem, który najpierw pada przed poprawką, a po niej przechodzi, i daje dowód do opisu pull requesta.

Oryginalny opis (EN)

Prove a change with a test that was seen failing before the fix and passing after. Use for every bug fix, and for the test discipline around features and performance claims. Produces the failing-then-passing evidence the pr-description skill pastes into the PR body.

Jak działa

  1. For a bug fix
  2. For a feature
  3. For a performance claim
  4. Anti-patterns
  5. Close-out
Sekcje z nagłówków SKILL.md, w oryginale · 35 linii, 514 słów
Podgląd SKILL.md
---
name: fail-first-testing
description: Prove a change with a test that was seen failing before the fix and passing after. Use for every bug fix, and for the test discipline around features and performance claims. Produces the failing-then-passing evidence the pr-description skill pastes into the PR body.
---

# Fail-First Testing

"Tests pass" is a claim. A regression test that you watched fail, for the right reason, before the fix and pass after it is evidence. Maintainers can tell the difference, and a test that has never been seen failing may test nothing at all: it might pass against the bug, against a mock of the bug, or against nothing.

Run this while implementing, after small-diff has set the scope. Its outputs are inputs to pr-description.

## For a bug fix

1. **Reproduce first.** Write the smallest test, or the smallest script, that demonstrates the bug against the current code. For a test that will stay in the suite, write it as a regression test in the project's own test style, in the file a maintainer would expect.
2. **Run it. Watch it fail.** The failure must be the bug: the wrong value, the exception, the missing behavior. A failure caused by a typo in your test proves nothing. Fix the test until it fails for the right reason.
3. **Save the failing output verbatim.** Command, and the relevant lines of output. You will paste this into the PR body.
4. **Write the smallest fix** that addresses the root cause inside the agreed scope. Not the widest fix, the smallest correct one.
5. **Run the test again. Watch it pass.** Save that output too.
6. **Run the surrounding suite**, at minimum the affected module's tests, and note the result honestly, including any pre-existing failures you did not cause and can demonstrate pre-date your change (run them on the base if challenged).

## For a feature

Tests for the new behavior ship in the same PR, written against the agreed behavior from the issue. There is no failing-before state for behavior that did not exist; the equivalent discipline is a test that would fail if the feature were removed, and a manual walkthrough in the PR body for anything that cannot be automated, saying plainly why it cannot.

## For a performance claim

No benchmark, no claim. Measure before and after with the same commands, on the same machine, and paste both numbers and the exact commands into the PR body so a reviewer can reproduce them. Performance changes are, in measured samples of real pull requests, among the hardest to get merged; an unmeasured one is asking for trust you have not earned.

## Anti-patterns

- Writing the test after the fix and never seeing it fail.
- Adjusting the test until it passes against the buggy behavior.
- A screenshot of green and no commands. Reviewers rerun things; give them what they need to rerun yours.
- Expanding the fix because a neighboring test failed for an unrelated reason. Report it, do not absorb it; that is scope growth, and small-diff forbids it.

## Close-out

Hand pr-description three things: the test command, the failing-before output, and the passing-after output (or, for a feature, the new-behavior tests and the walkthrough note; for performance, the before and after numbers with commands). If you cannot produce them, the change is not ready to describe.

Wersje

W bazie nie ma innych skilli o nazwie fail-first-testing.

Migawka bazy z 13.11.2026 · wersja paczki 52ace8e395c8 (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

  • 100test-driven-development
    Pisze najpierw test, który pada, potem najmniejszy kod, który go przechodzi, przy każdej funkcji, poprawce lub refaktoryzacji.
  • 100tdd
    Odtwarza błąd w zasobie TypeScript jako test regresyjny, który nie przechodzi przed poprawką i przechodzi po niej.
  • 100test-driven-development
    Pisze test, który najpierw pada z właściwego powodu, potem minimalna zmiana go przechodzi, a na koniec refaktoryzacja.
  • 100test-driven-development
    Buduje funkcje i naprawia błędy test-first: jeden test, który pada z właściwego powodu, minimalny kod i refaktoryzacja.
  • 95fix
    Naprawia jeden błąd z tablicy bez iteracji: najpierw test, który nie przechodzi, potem najmniejsza poprawka i jeden pull request.
  • 100regression-tests
    Utrwala każdy naprawiony błąd testem, który pada przed poprawką i przechodzi po niej, trzymanym przy chronionym kodzie, aby usterka nie wróciła po refaktoryzacji lub scaleniu.

Uwagi i zgłoszenia

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