refactoring
/refactoring
Poprawia strukturę kodu małymi, zawsze zielonymi krokami bez zmiany zachowania, przy sprzątaniu, upraszczaniu, restrukturyzacji i usuwaniu duplikacji w działającym kodzie.
- Autor
- Amey-Thakur ↗
- Repozytorium
- AI-SKILLS ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 05.09.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 05.09.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ę kodu małymi, zawsze zielonymi krokami bez zmiany zachowania, przy sprzątaniu, upraszczaniu, restrukturyzacji i usuwaniu duplikacji w działającym kodzie.
Oryginalny opis (EN)
Improve code structure in small, always-green steps without changing behavior. Use when asked to clean up, simplify, restructure, or de-duplicate working code.
Jak działa
- Method
- Judgment calls
- Litmus tests
Podgląd SKILL.md
---
name: refactoring
description: Improve code structure in small, always-green steps without changing behavior. Use when asked to clean up, simplify, restructure, or de-duplicate working code.
---
# Refactoring
A refactor changes structure while behavior stays identical. The moment
behavior changes on purpose, it is a feature; by accident, a bug. Keep the
line sharp.
## Method
1. **Secure the net first.** Confirm the tests around the target pass and
actually pin its behavior. If coverage is thin, write characterization
tests *before* touching anything: capture what the code does now, even
its oddities. An odd behavior may be load-bearing.
2. **Name the smell and the target shape.** "Three near-copies of this
query builder → one function with two parameters." If you cannot state
the after-state in a sentence, you are wandering, not refactoring.
3. **Move in reversible steps, green after each.** Rename; extract function;
inline; move; then delete the old path. Each step compiles, passes, and
could ship. Twenty two-minute steps beat one two-hour rewrite in every
dimension that matters: reviewability, bisectability, abort-ability.
4. **Separate refactor commits from behavior commits.** A reviewer must be
able to skim a refactor commit ("no behavior change") and scrutinize the
small behavior commit. Mixed commits get neither reading.
5. **Follow the house style,** even where you prefer another. A codebase
with one accent is maintainable; your improvement in a foreign accent is
someone else's cleanup ticket.
6. **Stop at the target.** The neighboring mess you noticed goes on a list,
not into this change. Scope creep is how refactors become rewrites and
rewrites become incidents.
## Judgment calls
- **Duplication:** two copies are cheaper than the wrong abstraction; three
copies with the same change-reason justify extraction. Extract for shared
*meaning*, not shared characters.
- **Small functions:** extraction pays when the name says something the code
cannot; a five-line function called once with a vague name is indirection,
not clarity.
- **Dead code:** delete it, do not comment it out. Version control is the
attic.
## Litmus tests
- Could every commit in the series ship alone?
- Did any test's *assertions* change? (Renames aside: that is the tell that
behavior moved.)
- Is the diff smaller than the improvement it buys?
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · Amey-Thakur/AI-SKILLS | 90 | MIT |
| gabrieldulolmarques/refactoring-skill | 100 | CC-BY-4.0 |
| 4typen/skills | 100 | MIT |
| t8jwscc7qy-sketch/foma-skills | 100 | Apache-2.0 |
| mtwuser/zero-cloud-gravity | 100 | MIT |
| krzysztofsurdy/code-virtuoso | 100 | MIT |
| sagargupta16/claude-skills | 100 | MIT |
| nimadorostkar/Claude-Skills-collection | 100 | MIT |
| DariuszDusza/agentic-workflow-foundry | 100 | Apache-2.0 |
Migawka bazy z 13.11.2026 · wersja paczki e4792e154008 (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
- 100refactor-safely
Poprawia strukturę trudnego do zmiany kodu małymi krokami przy zielonych testach, bez mieszania refaktoryzacji ze zmianą zachowania. - 100refactor
Przebudowuje istniejący kod bez zmiany zachowania, małymi krokami za testami charakteryzującymi, w obrębie jednego serwisu. - 100refactoring-workflow
Poprawia strukturę istniejącego kodu bez zmiany zachowania w małych zweryfikowanych krokach przy zielonych testach, redukując duplikację i sprzężenia oraz przygotowując kod pod nową funkcję. - 100refactor
Bezpiecznie refaktoryzuje kod pod ochroną testów: czyści, upraszcza, wydziela funkcje i poprawia jakość bez zmiany zachowania. - 100qe-refactoring-patterns
Stosuje bezpieczne wzorce refaktoryzacji, które poprawiają strukturę kodu bez zmiany zachowania, przy porządkowaniu kodu i redukcji długu technicznego. - 100safe-refactor
Przebudowuje kod bez zmiany zachowania: najpierw zapisuje testy charakteryzujące, potem małe kroki sprawdzane osobno. Przydaje się przy refaktoryzacji, upraszczaniu i dzieleniu dużych plików.