refactoring
Installation
SKILL.md
Refactoring Analysis with polyscan
Run the polyscan CLI to locate concrete refactoring targets in JavaScript, TypeScript, Go, Rust and C++ code. No install needed: npx polyscan@latest analyze <path>.
Commands
| User Request | Command |
|---|---|
| "Find complex functions" | npx polyscan@latest analyze --format text --select complexity <path> |
| "Find duplicate code" | npx polyscan@latest analyze --format text --select clone <path> |
| "Find dead code" (JS/TS only) | npx polyscan@latest analyze --format text --select deadcode <path> |
| "What should I refactor first?" | npx polyscan@latest analyze --format text --select complexity,deadcode,clone <path> |
Use --format json instead of --format text for line-level findings in machine-readable form (written to stdout). Without either, polyscan writes an HTML report and opens a browser.
Complexity and clone detection cover every supported language; dead code detection exists for JavaScript/TypeScript only.