askill
refactor

refactorSafety 95Repository

Refactor code for improved structure, readability, and maintainability. Use when code needs cleanup following SOLID/DRY/KISS principles, adding type hints, reducing complexity, improving naming, or modernizing to current language idioms. Preserves behavior.

0 stars
1.2k downloads
Updated 2/12/2026

Package Files

Loading files...
SKILL.md

Refactor

Improve code structure without changing behavior.

Constraints

RuleLimit
Function length< 40 lines
Cyclomatic complexity< 10
Nesting depth< 4 levels

Actions

  1. Break large functions into small, pure functions
  2. Add type annotations (no Any, no interface{})
  3. Rename variables descriptively (no x, data, temp)
  4. Extract magic numbers to constants
  5. Use modern language idioms (Python 3.12+, Go 1.22+, ESNext)

Output

Full refactored code only. No explanations.

For significant changes, add a comment header:

# Refactored:
# - Extracted validation logic
# - Added type hints
# - Renamed variables

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

77/100Analyzed 2/18/2026

Solid skill document with clear constraints (function length, complexity, nesting limits) and 5 actionable refactoring steps. Includes useful 'when to use' trigger and is well-structured in a dedicated skills folder. Deducts for missing tags/icons and lacks concrete examples/commands. Language-agnostic approach enhances reusability."

95
82
80
65
68

Metadata

Licenseunknown
Version-
Updated2/12/2026
Publishermlorentedev

Tags

No tags yet.