refactor

Featured

Execute one behavior-preserving structural transformation and report evidence. Triggers: "refactor this", "simplify without changing behavior".

Code & Development 414 stars 40 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 96/100

Stars 20%
87
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Refactor — one structural experiment Refactor changes structure while preserving observable behavior. It performs one caller-selected transformation and reports the result. ## Procedure 1. Name the preserved behavior and the focused acceptance surface. 2. Record an honest baseline, including any reproducible ambient failures. 3. Apply one bounded transformation: extract, rename, inline, simplify, encapsulate, move, or delete dead code. 4. Run the focused check and the smallest package-level regression check justified by the changed surface. 5. Return the diff summary, commands, results, and behavior not checked. Do not combine a newly discovered behavior fix with the structural change. A red result is evidence for the caller; this skill does not revert, narrow, retry, commit, validate, or route subsequent work automatically. ## Seam experiments before commitment When the transformation needs a seam — an extraction boundary, interface, or module split — and more than one candidate seam exists, probe before you cut. Run the probe in disposable isolation (a scratch branch, worktree, or copied tree the caller's policy allows): rough in the seam, see what it forces — signature churn, import cycles, test rewrites — then discard the probe and keep only the knowledge. Stop condition: at most two probes; if the second candidate seam also fights back, report both findings to the caller instead of trying a third. Cutting the first imaginable seam directly into the working ...

Details

Author
boshu2
Repository
boshu2/agentops
Created
8 months ago
Last Updated
today
Language
Go
License
Apache-2.0

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Listed

refactor

Use for authorised, behaviour-preserving structural simplification backed by characterisation and equivalence evidence. Not for new behaviour, read-only review, or unknown root cause; use tdd, code-review, or diagnose.

2 Updated today
mblauberg
Code & Development Solid

refactor

Restructure existing code without changing its behavior — extract, rename, inline, split, deduplicate, reshape — with tests holding behavior fixed before and after. Scoped to structure only: no new features, no bug fixes, no behavior changes. Use when the user says "refactor", "clean up the structure", "extract this", "split this file", "untangle", or "restructure".

72 Updated yesterday
genai-io
Code & Development Listed

refactor

Evidence-driven refactoring — where does structural improvement actually pay off, then make that change without changing behavior. Survey mode diagnoses by evidence, not aesthetics — git churn × complexity hotspots, the recurring-bug log, upcoming work — and verdicts each candidate REFACTOR/PREP/LEAVE/WATCH, where LEAVE is the default and "the textbook recommends it" is never a reason. Execute mode takes one approved candidate in small behavior-preserving moves, suite green after each. Keeps a debt register in out/refactor/tracker.md so repeat surveys open with what changed. Use for "clean up this module", "improve the architecture", "pay down tech debt" — e.g. "/refactor", "/refactor <target>". For new behavior use feature; for something broken use bugfix.

6 Updated today
duthaho