refactoring
Installation
SKILL.md
Python Refactoring Analysis with pyscn
Run the pyscn CLI to locate concrete refactoring targets. No install needed: uvx pyscn@latest <command>.
Commands
| User Request | Command |
|---|---|
| "Find complex functions" | uvx pyscn@latest analyze --select complexity <path> |
| "Find duplicate code" | uvx pyscn@latest analyze --select clones <path> |
| "Find dead code" | uvx pyscn@latest analyze --select deadcode <path> |
| "What should I refactor first?" | uvx pyscn@latest analyze --select complexity,deadcode,clones <path> |
Key Flags
--min-complexity <n>: minimum complexity to report (default: 5). Risk levels: Low (<10), Medium (10-20), High (>20)--clone-threshold <0.0-1.0>: minimum similarity for clone detection (default: 0.65)--min-severity <critical|warning|info>: dead code severity floor (default: warning). Critical means code after return/break/continue/raise that can never execute.--json: write a detailed report with line-level findings. Report files are NOT written to stdout; they go to.pyscn/reports/and the path is printed on completion.