refactor

Solid

Behaviour-preserving restructuring under this repo's norms — split a file past ~200 lines or doing two things, remove dead code with evidence, untangle a dependency pointing outward — with golden files and the corpus as the proof nothing moved. Use "refactor", "split this file", "this is dead code", "simplify". Deleting code is proposed with evidence, not done unasked.

Code & Development 63 stars 0 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 85/100

Stars 20%
60
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
65
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

Target: $ARGUMENTS ## Evidence first - `wc -l` on the target; the two responsibilities named when claiming a split. - Dead code: `grep -rn` for every symbol, plus `go vet` and `golangci-lint run` (`unused`, `unparam`); a symbol only tests reference is dead in the product. List candidates with the evidence — **deleting them is a separate decision the maintainer takes**, unless the task said to delete. - `git log --oneline -10 -- <path>` to know why the shape is what it is before changing it. ## Rules - Behaviour identical: `make test` green before and after; golden files unchanged (a golden diff means this was not a refactor); for anything on the figure path, `corpus-prover` A/B on a pinned window shows identical output. - One file, one responsibility, ~200 lines; small functions; names that say what. - Dependencies point inward; `internal/` never imports `plugin/` or `ee/` (depguard). - No new abstraction for a need that does not exist; no TODO left behind; comments kept only where they state a constraint the code cannot show. - `make docs` afterwards: a moved command or flag changes the generated reference. Finish with `bash .claude/checks/gate.sh`, then `/review diff` with the go-reviewer's file-size and single-responsibility judgement stated explicitly.

Details

Author
assaio
Repository
assaio/assaio
Created
2 months ago
Last Updated
today
Language
Go
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

refactor

Change the shape of the code without changing what it does — pin current behaviour in characterization tests first, transform, then prove equivalence by those tests passing unmodified and no existing test being deleted, skipped or loosened.

6 Updated 4 days ago
saman-mb
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.

9 Updated 1 weeks ago
duthaho
Code & Development Listed

refactor-code

Change existing code through narrow, behavior-preserving, test-backed simplification without speculative architecture or scope growth. Use for requests to refactor, clean up, restructure, or simplify code. Use explain-code instead when the user only wants an explanation of the current structure.

1 Updated 4 days ago
drafael