code-refactor

Execute safe, targeted refactoring by analyzing code and providing actionable steps.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "code-refactor" with this command: npx skills add sirn/dotfiles/sirn-dotfiles-code-refactor

Execute safe, targeted refactoring by analyzing code and providing actionable steps.

Process

Identify context:

  • If code changes are involved: run jj diff -s first to see changed files; then use jj diff -- path to restrict to specific files/directories

  • If the user specified specific files or paths, focus on those

  • Understand the refactoring goal (extract function, rename, simplify, etc.)

Analyze the code:

  • Identify safe refactoring transformations and structural changes

  • Identify over-engineered areas to simplify, dead code to remove

  • Research idiomatic refactoring patterns for the language (use WebSearch/WebFetch)

Synthesize findings into concrete refactoring steps

Output

Present a refactoring plan with:

Identified Refactorings - Each refactoring opportunity with rationale

  • Function extraction

  • Variable renaming

  • Dead code removal

  • Complexity reduction

Complexity Analysis

  • Over-engineered areas

  • Unnecessary abstractions

  • Dead code identified

Best Practices Alignment

  • Idiomatic patterns to apply

  • Language-specific refactorings

  • Modern alternatives to legacy code

Step-by-Step Plan - Numbered, file:line specific

  • Each step with purpose and expected outcome

  • Safe ordering (dependencies first)

Verification Steps - How to confirm each refactoring works

  • Run tests after each major refactoring

  • Commands to validate behavior

IMPORTANT: Only provide the plan. Do NOT auto-apply changes.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

code-quality

No summary provided by upstream source.

Repository SourceNeeds Review
16-sirn
Coding

code-explain

No summary provided by upstream source.

Repository SourceNeeds Review
16-sirn
Coding

code-config-ci

No summary provided by upstream source.

Repository SourceNeeds Review
16-sirn
Coding

code-plan

No summary provided by upstream source.

Repository SourceNeeds Review
16-sirn