fix-hairball
v0.1.0
Published
Run commands-com quality until your code earns an A.
Downloads
129
Maintainers
Readme
fix-hairball
AI wrote your code. AI made it weird. AI can fix it.
Coding agents are great at producing. They are less great at stopping. Ask one for a bug fix and you will receive: the bug fix, three new abstractions you didn't ask for, a defensive try/catch wrapped around Math.max, a 40-line comment explaining the next line, and a feature flag for a feature that does not exist.
This is a hairball. It compiles. It even passes the tests it wrote for itself. It is going to be your problem in six weeks.
fix-hairball is a one-line brush.
npx fix-hairballIt runs commands-com in a loop, grades your code, untangles the over-engineering, deletes the fluff, and stops only when your project earns an A. It is AI cleaning up after AI, which is, frankly, what we deserve.
You might have a hairball if…
- A two-line change came back as a 600-line PR titled "refactor for clarity."
- Every function is wrapped in a
try/catchthat re-throws the error. - A new file appeared called
helpers.tsand nobody requested one. - A boolean got renamed from
enabledtoshouldEnableFeatureFlagBehavior. - Your last commit added an interface, an abstract class, and a factory — for a function with one caller.
- Each line of code has a comment above it narrating, in English, what the line does.
// for backwards compatibilityappears in a file that has never shipped.- The diff includes
package-lock.jsonchanges "while I was in there." - A 4-line utility now lives in its own package with its own README.
If any of those felt personal: not your fault. The model did that. We can help.
Install
npm install -g fix-hairballOr run it once, like a confessional:
npx fix-hairballUsage
The default is the right answer:
npx fix-hairballTranslation: keep grading my code until it earns an A, then stop bothering me.
Every flag accepted by commands-com quality is forwarded, so the grown-up invocation looks like:
npx fix-hairball --changed --area maintainability --fix --test "npm test"Run it on a clean branch. Make coffee. Come back to a tighter, smaller, less haunted diff.
What it actually does
The entire program is, roughly:
commands-com quality --until A "$@"That's it. That's the whole bit. The best wrappers are honest about their thinness.
FAQ
Is this AI? Yes. Fight fire with fire.
Will it delete my code? Only the parts the model added uninvited.
My agent says the code is already perfect. Of course it does.
An hour later we're still at B+. The model went hard. Let the cleaner cook.
Will this remove my comments?
The ones that say // increment counter above counter++? With pleasure.
Is this an anti-vibe-coding tool? This is a post-vibe-coding tool. Vibe in. Hairball out. We come behind.
Requirements
- Node.js
>=20.19 - A codebase recently visited by a coding agent
- The humility to accept the verdict
License
MIT. Go in peace.
