askill
refactor-scan

refactor-scanSafety 95Repository

Read-only refactoring analysis. Shows what needs fixing without making changes.

0 stars
1.2k downloads
Updated 2/25/2026

Package Files

Loading files...
SKILL.md

/refactor-scan [target]

Analyze code for refactoring opportunities. Read-only — no changes made.

No arguments? Describe this skill and stop. Do not execute.

On Invoke

  1. Read target files (argument or recently discussed code)
  2. Analyze against refactoring criteria
  3. Report issues found with locations and severity
  4. Show plan of what /refactor-check-fix would do

Criteria to Check

IssueThresholdSeverity
Function too long>30 linesHIGH
File too long>300 linesHIGH
High complexitycyclomatic >10HIGH
Deep nesting>3 levelsMEDIUM
Vague namesdata/result/temp/item/infoMEDIUM
Duplicate coderepeated blocksMEDIUM
Magic numbersunlabeled literalsLOW
Missing error handlingunhandled pathsMEDIUM
God filemultiple concernsHIGH

AI Antipatterns to Flag

  • Over-abstraction (factories/wrappers used once)
  • Defensive paranoia (impossible null checks)
  • Comment spam (obvious comments)
  • Speculative features (unused config options)
  • Wrapper classes adding no value

Output Format

═══════════════════════════════════════════
 REFACTOR SCAN: [target]
═══════════════════════════════════════════

 Summary: X issues found (Y high, Z medium)

 HIGH SEVERITY
   [file:line] Function too long (45 lines)
     → Split into: parseInput(), validateData(), formatOutput()

   [file:line] File too long (387 lines)
     → Extract: utils.ts, validators.ts

 MEDIUM SEVERITY
   [file:line] Vague name: "data"
     → Rename to: userPreferences

   [file:line] Deep nesting (4 levels)
     → Flatten with early returns

 LOW SEVERITY
   [file:line] Magic number: 86400
     → Extract: SECONDS_PER_DAY = 86400

 AI ANTIPATTERNS
   [file:line] Over-abstraction: ConfigFactory used once
     → Inline the factory

═══════════════════════════════════════════
 REFACTOR PLAN
═══════════════════════════════════════════

 1. Split [file] into focused modules
 2. Extract [function] from [large-function]
 3. Rename [vague-names] to [clear-names]
 4. Flatten nested conditionals in [locations]

 Run `/refactor-check-fix [target]` to apply these changes.

═══════════════════════════════════════════

Rules

  • DO NOT edit any files
  • DO NOT use Edit, Write, or Bash tools that modify files
  • Only use Read, Glob, Grep for analysis
  • Report findings, suggest fixes, but make no changes
  • End with clear next step: /refactor-check-fix

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

88/100Analyzed 2/20/2026

High-quality reference skill for read-only refactoring analysis. Clear structure with criteria tables, step-by-step invocation, and detailed output format. Explicitly safety-focused (read-only). Universal applicability - uses standard refactoring principles not tied to specific project. Bonus for actionable steps (R5) and high-density technical content (R11). Minor penalty for empty tags field.

95
90
90
85
90

Metadata

Licenseunknown
Version-
Updated2/25/2026
PublisherObjective-Arts

Tags

No tags yet.