refactor-safely
/refactor-safely
Poprawia strukturę trudnego do zmiany kodu małymi krokami przy zielonych testach, bez mieszania refaktoryzacji ze zmianą zachowania.
- Autor
- wastedcode ↗
- Repozytorium
- truecast ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 17.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 17.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Poprawia strukturę trudnego do zmiany kodu małymi krokami przy zielonych testach, bez mieszania refaktoryzacji ze zmianą zachowania.
Oryginalny opis (EN)
Use when code is hard to change, has accumulated cruft, or before a feature that the current structure resists — improve structure in small, behavior-preserving steps under green tests; never mix a refactor with a behavior change.
Jak działa
- The method
- The discipline
Podgląd SKILL.md
--- name: refactor-safely description: Use when code is hard to change, has accumulated cruft, or before a feature that the current structure resists — improve structure in small, behavior-preserving steps under green tests; never mix a refactor with a behavior change. --- # Refactor safely — small behavior-preserving steps under green tests Refactoring is changing structure **without** changing behavior (Fowler). Done right it's nearly free of risk; done as a big rewrite mixed with features, it's how regressions ship. ## The method 1. **Get a test net first.** Ensure the behavior you're about to preserve is covered (add characterization tests if not). Green before, green after — that's the proof you changed structure, not behavior. 2. **Small steps.** Extract a function, rename, inline, move — one mechanical step at a time, tests green after each. Commit in small steps so any regression is trivial to locate. 3. **Separate refactor from feature.** *"Make the change easy, then make the easy change"* (Beck): do the structural prep as its own diff/commit, then the behavior change as another. Never in one tangle. 4. **Prefer incremental over big-bang rewrite.** A full rewrite throws away hard-won edge-case knowledge and is high-risk; strangle the old code path gradually where you can. ## The discipline - If the tests aren't there, the refactor isn't safe yet — add the net first. - A "refactor" that changes behavior is a bug wearing a refactor's clothes — separate them. - Rewrites are the most over-chosen, most-regretted move; default to incremental.
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · wastedcode/truecast | 100 | MIT |
| jelvodev/yaap | 100 | MIT |
| mistakeknot/clavain | 100 | MIT |
| yaohuangguan/agent-playbook | 100 | MIT |
| devpilotX/ai-skill-ai | 100 | MIT |
| the-open-agent/oss-skills | 100 | Apache-2.0 |
| Kuan-AI-com/agent-skills | 90 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki a1b29702b833 (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
- 90refactoring
Poprawia strukturę kodu małymi, zawsze zielonymi krokami bez zmiany zachowania, przy sprzątaniu, upraszczaniu, restrukturyzacji i usuwaniu duplikacji w działającym kodzie. - 100refactor
Przebudowuje istniejący kod bez zmiany zachowania, małymi krokami za testami charakteryzującymi, w obrębie jednego serwisu. - 100refactor
Poprawia jakość kodu po zakończeniu implementacji, bez zmiany jego zachowania. - 100orch-refine-code
Prowadzi refaktoryzację bez zmiany zachowania: potwierdza zielone testy, przebudowuje strukturę kodu, utrzymuje testy zielone, robi review i zatwierdzony commit. - 100refactor
Restrukturyzuje działający kod bez zmiany zachowania: mapuje wywołania i pokrycie testami, dodaje testy charakteryzujące i wprowadza zmiany małymi krokami z pełnym zestawem testów po każdym. - 100refactor
Planuje i wykonuje refaktoryzację bez zmiany zachowania w małych krokach, z zielonym zestawem testów przed, w trakcie i po zmianach.