Fix GoodCode findings in existing code, one rule at a time, without changing what the code does. Takes the findings of a review, a rule id with a file or folder, or plain words such as "fix the GC-24 findings in billing". Use for "goodcode refactor", "fix these findings", "bring this file up to the standard", /goodcode-refactor.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Goodcode Refactor?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/matasurbonavicius-goodcode-refactor)
---
name: goodcode-refactor
description: >
Fix GoodCode findings in existing code, one rule at a time, without changing
what the code does. Takes the findings of a review, a rule id with a file or
folder, or plain words such as "fix the GC-24 findings in billing". Use for
"goodcode refactor", "fix these findings", "bring this file up to the
standard", /goodcode-refactor.
---
# GoodCode refactor
Read the standard first: `../../CODE_ARCHITECTURE.md` from this skill's base
directory. The examples in `../../examples/` show each rule's fix in code.
## What to fix
- Given findings: fix those.
- Given a rule and a target: run that rule's Check on the target to find them.
- Given only a target: run the review order from the goodcode-review skill, list
the findings, and ask which to fix. Do not start a whole-file rewrite unasked.
## How to fix
1. **Know what holds the behaviour.** Find the tests that cover the code and run
them. If nothing covers it, say so before changing anything: a refactor
without a check is a rewrite.
2. **One finding, one change.** Fix a single finding, run the tests, then move
to the next. Do not mix two rules in one step: when something breaks, you
need to know which step broke it.
3. **Finish each change** (GC-40). Every caller is updated, the old name is
gone, nothing is left behind as a shim.
4. **Stay in scope.** Other findings you notice on the way are reported, not
fixed.
## Fixes that change behaviour
Most fixes move code without changing what it does. Some change behaviour by
design, and those need a yes from the person first:
- GC-24, GC-27: removing a fallback, a swallowed error or a silent filter means
something that used to carry on will now stop. That is the point, and callers
may depend on the old silence.
- GC-19: a stricter parser rejects input that used to get in.
- GC-15: a declared state machine refuses moves that used to be possible.
- GC-37, GC-40: removing an option or an old path breaks anyone still using it.
Search for users first, including outside this repository if it is published.
For each of these, say what will behave differently and for whom, then wait.
## When you finish
List each fix as `GC-id · file · what changed`, then the test result, then what
you saw and left alone.