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

refactor-safely

/refactor-safely

Refaktoryzuje kod bez zmiany jego działania: zmienia nazwy, wyodrębnia, dzieli pliki, usuwa duplikaty i upraszcza funkcje.

Repozytorium
agent-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
13.11.2026

Ocena i bezpieczeństwo

90/ 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ść25 / 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 13.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

Refaktoryzuje kod bez zmiany jego działania: zmienia nazwy, wyodrębnia, dzieli pliki, usuwa duplikaty i upraszcza funkcje.

Wyzwalacze z opisu

clean this uprefactorsplit this filesimplify this functionrename X everywhereremove this duplication
Oryginalny opis (EN)

Refactor code without changing what it does (rename, extract, split files, remove duplication, simplify). Use when the user says "clean this up", "refactor", "split this file", "simplify this function", "rename X everywhere", or "remove this duplication".

Jak działa

  1. 1. Scope it
  2. 2. Baseline
  3. 3. Find every usage
  4. 4. Change in small steps
  5. 5. Stay in scope
  6. 6. Verify and report
Sekcje z nagłówków SKILL.md, w oryginale · 41 linii, 446 słów
Podgląd SKILL.md
---
name: refactor-safely
description: Refactor code without changing what it does (rename, extract, split files, remove duplication, simplify). Use when the user says "clean this up", "refactor", "split this file", "simplify this function", "rename X everywhere", or "remove this duplication".
---

# Safe refactoring

A refactor changes structure, not behavior. Behavior includes return values, thrown errors and their messages, side effects and their order, public names and types, and log or event output that other systems read.

## 1. Scope it

State in one or two sentences what will change and what will not. If the user's request implies a behavior change ("and make it faster", "and fix the edge case"), split that into a separate step after the refactor.

## 2. Baseline

- Find and run the checks the project has: tests, type checker (`tsc --noEmit`, `mypy`, `go vet`), linter. Get the commands from `package.json`, `Makefile`, CI config.
- Record what passes now. Pre-existing failures are not yours to fix; note them.
- If the code you will touch has no tests, write characterization tests that pin its current output for typical and edge inputs, including current odd behavior. Do not refactor untested code you cannot run.

## 3. Find every usage

Before renaming or moving anything, search for it in all forms:
- static references (`git grep -n`, editor "find references")
- dynamic ones: string keys, `getattr`/reflection, dependency-injection names, route names, template and config files, serialized data, SQL column names
- external consumers: exported package API, HTTP or event contracts, other repos. If it is public, keep the old name as a deprecated alias or ask first.

## 4. Change in small steps

- One mechanical move per step: rename, extract function, inline, move file, replace conditional with lookup.
- After each step, run the fast checks (affected tests and the type checker). If something breaks, fix or revert that step before continuing.
- Prefer tooling for renames and moves (IDE refactor, `git mv`) over hand edits so history and references follow.
- If the user is using git, suggest a commit per meaningful step so each one can be reverted alone.

## 5. Stay in scope

- Do not fix bugs you find mid-refactor; list them and fix later as separate changes (a bug fix changes behavior and the tests should show it).
- Do not reformat unrelated code or change style across files you only passed through.
- If the refactor grows past what was agreed (more files, a new abstraction), stop and check with the user.

## 6. Verify and report

- Run the full baseline again; results must match.
- Read your own final diff once, looking for accidental logic changes: flipped conditions, changed defaults, reordered side effects, dropped `await`, changed error types.
- Report: what moved where, why the new shape is simpler, the checks you ran with results, and any bugs or follow-ups you noticed but did not touch.

Wersje

RepozytoriumWynikLicencja
Ta strona · Kuan-AI-com/agent-skills90MIT
jelvodev/yaap100MIT
mistakeknot/clavain100MIT
yaohuangguan/agent-playbook100MIT
devpilotX/ai-skill-ai100MIT
wastedcode/truecast100MIT
the-open-agent/oss-skills100Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki 5e13c3cc5524 (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.
  • 86simplify
    Upraszcza ostatnio zmieniony kod bez zmiany jego działania: usuwa duplikaty, martwy kod i zbędną złożoność.
  • 100refactor-module
    Restrukturyzuje kod na zlecenie z ticketu bez zmiany działania: wydziela funkcje, dzieli pliki, zmienia nazwy i redukuje duplikację z zachowaniem zachowania.
  • 100safe-refactor
    Refaktoryzuje JavaScript, TypeScript lub Python bez zmiany działania: wydziela funkcje, zmienia nazwy i dodaje typy. Przydaje się przy migracji JS do TS i upraszczaniu kodu.
  • 100refactoring
    Zmienia strukturę kodu bez zmiany zachowania: wyodrębnia fragmenty, zmienia nazwy w wielu plikach, redukuje duplikaty i porządkuje architekturę.
  • 100refactor
    Bezpiecznie refaktoryzuje kod pod ochroną testów: czyści, upraszcza, wydziela funkcje i poprawia jakość bez zmiany zachowania.

Uwagi i zgłoszenia

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