Refactor
Lightweight batch refactoring using jscpd, knip, eslint, ast-grep. USE WHEN refactor, scan for duplication, find dead code, unused exports, cleanup session, refactoring pass.From its SKILL.md
npx -y skills add mj-deving/pai-skills --skill RefactorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.4 KB, 356 tokens by cl100k_base, as published. Nobody here has run it
Refactor
Lightweight, transparent, stateless batch refactoring. Four CLI tools you own.
/refactor is stretching after exercise — quick, transparent, stateless. Desloppify is an annual physical — comprehensive, scored, persistent.
When to Use
| Say This | Gets You |
|---|---|
/refactor | Full scan→triage→fix→verify cycle |
| "find dead code" / "unused exports" | knip-focused scan |
| "scan for duplication" | jscpd-focused scan |
| "cleanup session" / "refactoring pass" | Full cycle |
When NOT to Use
- Health score / debt audit → use Desloppify
- Review a diff → use /simplify
- Security scan → use /security
Tool Inventory
| Tool | What It Finds | Command |
|---|---|---|
| knip 6.1.1 | Dead code, unused exports, unused deps | npx knip --reporter json |
| jscpd 4.0.8 | Code duplication (cloned blocks) | npx jscpd --min-lines 5 --reporters json --output .refactor/ |
| eslint | Lint violations, deprecation warnings | eslint . --format json |
| ast-grep 0.42.0 | Structural anti-patterns (AST-level) | sg scan --rule <rules-dir> --json |
Workflow
Route to the scan workflow:
→ Workflows/Scan.md — the scan→triage→fix→verify cycle
What ships with it: 6 files
5.6 KB alongside SKILL.md
Rules/
- no-any-type.yml159 B
- no-console-log.yml188 B
- no-empty-catch.yml460 B
- no-process-exit.yml242 B
Workflows/
- Scan.md4.6 KB
- sgconfig.yml22 B