Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

principle-test-behavior-not-implementation

/principle-test-behavior-not-implementation

Sprawdza w teście to, co widzą użytkownicy kodu, tak aby test padał przy zepsuciu zachowania i przechodził przy zmianie wnętrza.

Repozytorium
axiom-atropos ↗
Licencja
MIT
Ostatnia zmiana repozytorium
10.11.2026

Ocena i bezpieczeństwo

81/ 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ść16 / 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
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.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

Sprawdza w teście to, co widzą użytkownicy kodu, tak aby test padał przy zepsuciu zachowania i przechodził przy zmianie wnętrza.

Oryginalny opis (EN)

Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change.

Jak działa

SKILL.md bez nagłówków drugiego poziomu · 18 linii, 426 słów

Podgląd SKILL.md
---
name: principle-test-behavior-not-implementation
description: Apply when you write, change, or keep a test. Assert what the code's
  users can observe, so that the test fails when that behavior breaks and keeps passing
  when only the internals change.
---

Host integration: first read [HOSTS.md](../../pstack-resources/HOSTS.md); it maps the upstream workflow to the current agent host.

# Test Behavior, Not Implementation

A test is a claim about what the code does for its users: a caller, an end user, or another service. Behavior is what those users can observe through the interface they use. That includes return values, errors, state they can read back, and effects on systems outside the code, such as a request sent, a row written, or a message emitted. Implementation is what they cannot observe: private helpers, internal call order, intermediate data, and which internal collaborator did the work.

Judge each test against two imagined edits:

- **Break the behavior.** Make the code return a wrong value, skip an effect, or do the effect twice. If the test still passes, it proves nothing. The usual causes are an assertion looser than the contract, an expected value computed by the code under test, a restated constant or prompt string that never runs the code that reads it, and an assertion on data that the test built itself.
- **Change the internals.** Keep every observable result the same and restructure the code underneath. If the test now fails, it is pinned to the implementation. It will need a rewrite on every refactor and still catches no bug.

Keep a test that catches the first edit and survives the second. Rewrite or delete the rest. To write a test that does both, drive the code through its users' interface with a concrete input. Derive the expected value from the requirement, not from a run of the code. Assert what the contract promises, no less and no more.

The contract decides, not the shape of the assertion. When "an empty cart never charges" is the promise, an assertion that the payment client got no call is behavior. Pair it with a case where the charge happens, so that the test shows it can see a call. The payload that a mocked external service receives is behavior, because that service observes it. A call to an internal helper is implementation, because no user can see it. An empty list is the exact answer when no record matches, and a hollow check when the test only needs some result. An exact error message pins wording that no caller reads. The error type that callers branch on is the contract.

A test can pin an invariant instead of a call, such as a key that must exist in two tables or a compile-time type check. The invariant is the behavior.
Pliki w paczce (2)
  • SKILL.md 3 KB
  • agents/openai.yaml 1 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · xinhi6716/axiom-atropos81MIT
koolamusic/claudefiles96MIT
alexanderop/pstack96MIT
requie/endostack90MIT
chmonitor/chmonitor86GPL-3.0
tommy-ca/pstack86MIT
arjitj2/open-pstack81MIT
michael-denyer/pstack-claude81MIT
workerstack/clients81MIT

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

  • 90test-driven-development
    Wymusza cykl czerwony, zielony, refaktoryzacja przy każdej zmianie zachowania i wymaga testów, które faktycznie padają po zepsuciu kodu.
  • 90write-tests
    Pisze testy zachowania produktu zamiast szczegółów implementacji i wartości konfiguracji, a także naprawia kruche testy.
  • 100tdd
    Pilnuje dyscypliny test-first przy dodawaniu funkcji, naprawie błędu lub zmianie zachowania, także gdy kod nie ma testów.
  • 100principle-test-behavior
    Pisze lub przegląda testy sprawdzające zachowanie, którego wymaga wymaganie, przez publiczny interfejs kodu, i wykrywające prawdziwy błąd.
  • 90test-first
    Pisze nieprzechodzący test przed kodem, który ma go spełnić, przy dodawaniu funkcji, naprawie błędu lub zmianie zachowania.
  • 100write-tests
    Pisze testy sprawdzające zachowanie produktu, bez zależności od szczegółów implementacji i wartości konfiguracji.

Uwagi i zgłoszenia

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