refactor-assist

Verified·Scanned 2/18/2026

This skill is a CLI tool that reads a source file, sends it to OpenAI to produce refactoring diffs, and can write changes back. It requires OPENAI_API_KEY, makes network calls via openai.chat.completions.create, and is invoked with npx ai-refactor.

from clawhub.ai·vc114dc3·54.2 KB·0 installs
Scanned from 1.0.0 at c3976de · Transparency log ↗
$ vett add clawhub.ai/lxgicstudios/refactor-assist

ai-refactor

Point it at a file and get refactoring suggestions with colored diffs. Like having a code review buddy who doesn't get tired.

Install

npm install -g ai-refactor

Usage

# See suggestions
npx ai-refactor src/utils.ts

# Apply changes directly
npx ai-refactor src/utils.ts --apply

# Focus on something specific
npx ai-refactor src/api.ts --focus "error handling"

Setup

export OPENAI_API_KEY=your-key-here

Options

  • --apply - Write the refactored code back to the file
  • --focus <area> - Zero in on a specific concern

What it looks at

  • Readability and naming
  • Duplication
  • Modern language patterns
  • Performance gotchas
  • Type safety

It won't change what your code does. Just how it's written.

License

MIT