Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

legacy-code-changes

/legacy-code-changes

Pomaga bezpiecznie zmieniać kod legacy bez testów dzięki testom charakteryzującym, szwom (seams) i metodzie sprout, gdy nie da się udowodnić, że zmiana jest nieszkodliwa.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.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 05.09.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

Pomaga bezpiecznie zmieniać kod legacy bez testów dzięki testom charakteryzującym, szwom (seams) i metodzie sprout, gdy nie da się udowodnić, że zmiana jest nieszkodliwa.

Oryginalny opis (EN)

Change untested legacy code safely using characterization tests, seams, and the sprout method. Use when you must modify code that has no tests and you cannot prove your change is harmless.

Jak działa

  1. Method
  2. Signals
  3. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 47 linii, 395 słów
Podgląd SKILL.md
---
name: legacy-code-changes
description: Change untested legacy code safely using characterization tests, seams, and the sprout method. Use when you must modify code that has no tests and you cannot prove your change is harmless.
---

# Legacy code changes

Legacy code is code without tests, so you cannot change it and know you did
no harm. The instinct to rewrite is usually a trap: the safe path is to pin
the current behavior first, then make the smallest possible cut. Michael
Feathers named these moves, and they still hold.

## Method

1. **Characterize before you change.** Write tests that capture what the code
   does now, not what it should do. Feed it real inputs and assert the actual
   outputs, including the ugly ones. These tests document reality and turn a
   silent behavior change into a red bar.
2. **Find a seam to test at.** A seam is a place you can alter behavior
   without editing the code in question: a function argument, a subclass
   override, an injected dependency. Break a hidden `new Clock()` or global
   read into a parameter so the code becomes testable at all.
3. **Sprout new code, do not edit in place.** Write the new behavior in a
   fresh, fully tested method or class, then call it from one line in the old
   code. The tangle stays untouched while your addition is clean and covered.
4. **Wrap when new work must bracket the old path.** If behavior must happen
   before or after existing logic, rename the old method and have a new
   method of the old name call the original plus your addition. The old body
   moves unchanged.
5. **Cut the smallest hole.** Change the fewest lines that close the ticket.
   Every extra line touched in untested code is a bet with no test to
   collect on. Resist tidying the surrounding mess in this change.
6. **Bank the tests as coverage.** Keep the characterization tests after the
   change. They are now the safety net the next person lacked, converting
   this file from legacy to merely old.

## Signals

- If your change altered behavior by accident, would a characterization test
  go red?
- Did the new logic land in a tested unit rather than deep inside the
  untested block?
- Is the diff the minimum that closes the ticket?

## Boundaries

When a module is small, dead, or slated for deletion, a full characterization
suite can cost more than a careful rewrite: use judgment. This skill covers
making one change safely, not deciding whether to retire the system. For
staged replacement of a whole system, see strangler-fig.

Wersje

W bazie nie ma innych skilli o nazwie legacy-code-changes.

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

  • 100working-with-legacy-code
    Pomaga bezpiecznie zmieniać i testować kod bez testów według książki Feathersa o pracy z kodem legacy: szwy, testy charakteryzujące, golden master, sprout method i rozrywanie zależności.
  • 90design-legacy-seams
    Pomaga objąć testami kod legacy przed zmianą: znajduje szwy i pisze testy charakteryzujące, przy rozbijaniu zależności w nietestowanym kodzie.
  • 100legacy-code
    Bezpiecznie zmienia kod bez testów: przed jakąkolwiek zmianą zachowania stosuje testy charakteryzujące i techniki rozbijania zależności.
  • 100legacy-code-refactoring-characterization-tests
    Dopisuje testy charakteryzujące do starego kodu bez testów, zanim zacznie się refaktoryzację.
  • 100legacy-refactoring
    Zmienia stary lub nieprzetestowany kod bezpiecznie: testy charakteryzujące, punkty cięcia i małe kroki, które zachowują działanie i zielony build.
  • 90legacy-code-testing
    Dodaje testy do kodu legacy bez testów: testy charakteryzujące utrwalające obecne zachowanie, wyszukiwanie szwów dla zależności i strategia pokrycia według ryzyka.

Uwagi i zgłoszenia

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