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

refactor

/refactor

Zmienia strukturę kodu bez zmiany zachowania, najpierw przypinając obecne działanie testami, gdy trzeba wydzielić, przenieść lub zmienić nazwę.

Repozytorium
todoist-cli ↗
Licencja
MIT
Ostatnia zmiana repozytorium
12.11.2026

Ocena i bezpieczeństwo

85/ 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ść20 / 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

Zmienia strukturę kodu bez zmiany zachowania, najpierw przypinając obecne działanie testami, gdy trzeba wydzielić, przenieść lub zmienić nazwę.

Wyzwalacze z opisu

refactorclean upsimplifyextractrenamemovededuplicate
Oryginalny opis (EN)

Changes the structure of code without changing its behaviour, with the current behaviour pinned by tests first. Use when asked to "refactor", "clean up", "simplify", "extract", "rename", "move" or "deduplicate" code, or when another task needs restructuring first.

Jak działa

  1. 1. Pin the current behaviour
  2. 2. Delete dead code first
  3. 3. Move one concept at a time
  4. 4. Leave the tests alone
  5. 5. Keep it only if it reads better
  6. 6. Verify
Sekcje z nagłówków SKILL.md, w oryginale · 29 linii, 306 słów
Podgląd SKILL.md
---
name: refactor
description: Changes the structure of code without changing its behaviour, with the current behaviour pinned by tests first. Use when asked to "refactor", "clean up", "simplify", "extract", "rename", "move" or "deduplicate" code, or when another task needs restructuring first.
---

# Refactor

A refactor changes structure, not behaviour. Bugs included: if you find one, note it for a separate fix and keep it as it is.

## 1. Pin the current behaviour

Find the tests that cover the code at its public interface: the command run through `program.parseAsync(['node', 'td', ...])`, or the exported helper. Where a behaviour has no test, add one that passes **now**, asserting what the code does today. Run them. Done when every behaviour you will touch has a passing test.

## 2. Delete dead code first

Remove code nothing reaches, if you can prove it: no caller (`rg` for every name, including the lazy command registry in `src/index.ts` and `scripts/`). Run the tests. Done when they pass.

## 3. Move one concept at a time

Make one structural change, run the pinned tests, repeat. Migrate every caller and delete the old API; no shims left behind. Command names, flags, `--json` output shapes and error codes are what people's scripts and agents rely on, and `SKILL_CONTENT` documents them: keep them, or stop and ask (changing them is a breaking `feat!:` release). Done when the tests pass after each step and no caller uses the old shape.

## 4. Leave the tests alone

Existing tests may change how they reach the code: import paths, names, call sites. They may not change their inputs or their assertions, including every expected output string. If an expected value changes, the behaviour changed: stop and say so.

## 5. Keep it only if it reads better

Name what got easier to read or change. If you can't, revert. Done when you can say it in one sentence.

## 6. Verify

`npm run verify`, then report with the `verify` format. Say which tests pinned the behaviour, and confirm `git diff` shows no change to any test input or assertion.

Wersje

RepozytoriumWynikLicencja
Ta strona · doist/todoist-cli85MIT
froglet-studio/cosmic-shore100MIT
mgiovani/cc-arsenal100MIT
jongio/skills100MIT
boshu2/agentops100Apache-2.0
y-miyazaki/terraform-aws-base100Apache-2.0
mickeyyaya/evolve-loop100Apache-2.0
j0hanz/j0hanz-marketplace100MIT
kriscard/kriscard-claude-plugins100MIT

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

  • 100dev-refactor
    Zmienia strukturę kodu bez zmiany zachowania: wyodrębnia funkcje, zmienia nazwy, usuwa duplikaty i dzieli moduły.
  • 100refactoring
    Zmienia strukturę kodu bez zmiany zachowania: wyodrębnia fragmenty, zmienia nazwy w wielu plikach, redukuje duplikaty i porządkuje architekturę.
  • 100refactor-safely
    Zmienia strukturę działającego kodu bez zmiany jego działania: wyodrębnia metody, zmienia nazwy, dodaje testy i pracuje z kodem odziedziczonym.
  • 96safe-refactor
    Pomaga przebudować strukturę kodu bez zmiany jego zachowania widocznego z zewnątrz.
  • 100refactor-module
    Restrukturyzuje kod na zlecenie z ticketu bez zmiany działania: wydziela funkcje, dzieli pliki, zmienia nazwy i redukuje duplikację z zachowaniem zachowania.
  • 90refactor-safely
    Refaktoryzuje kod bez zmiany jego działania: zmienia nazwy, wyodrębnia, dzieli pliki, usuwa duplikaty i upraszcza funkcje.

Uwagi i zgłoszenia

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