thoreinstein/agents/refactor
Claude Code and agent skill by thoreinstein/agents
- community
Checking that the SKILL.md file is still in the repository.
Analyze code and suggest refactoring opportunities with blast radius assessment, risk evaluation, and recommended order of operations
Install
npx vskill@latest install thoreinstein/agents/refactorSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Refactor
Analyze code and suggest refactoring opportunities with rationale. This is an analysis-only skill - it identifies and documents refactoring opportunities but does not execute them.
When to Use
- Reviewing code for improvement opportunities
- Planning a refactoring initiative
- Assessing technical debt in a codebase area
- Evaluating complexity, duplication, or coupling concerns
- Understanding blast radius before making changes
Input
- Target: file path, directory/package, or function/component name
- Optional: specific concern (duplication, complexity, coupling, testability, etc.)
Investigation Strategy
Track 1: Codebase Exploration
- Map dependencies and call sites for target code
- Identify blast radius of potential changes
- Find related code with similar patterns
- Assess test coverage of affected areas
Track 2: Code Analysis
- Deep analysis of code smells and patterns
- Identify refactoring opportunities
- Assess complexity metrics
- Evaluate maintainability concerns
Refactoring Patterns
Universal Patterns
| Pattern | Description | |
|---|---|---|
| Extract function/method | Pull out reusable logic | |
| Inline function/variable | Remove unnecessary indirection | |
| Rename | Improve clarity (with blast radius assessment) | |
| Move | Relocate to better home (file, package, module) | |
| Replace conditional with polymorphism | Simplify branching | |
| Introduce parameter object | Group related parameters | |
| Dependency inversion | Decouple via interfaces/abstractions |
Go-Specific Patterns
| Pattern | Description | |
|---|---|---|
| Extract interface | Define behavior contracts | |
| Consolidate error handling | Reduce repetitive error checks | |
| Replace concrete with interface | Improve testability | |
| Extract middleware | Separate cross-cutting concerns | |
| Table-driven refactor | Convert repetitive code to data-driven |
Frontend-Specific Patterns
| Pattern | Description | |
|---|---|---|
| Extract component | Break down large components | |
| Extract custom hook | Reuse stateful logic | |
| Lift state up | Move state to common ancestor | |
| Push state down | Colocate state with usage | |
| Extract render function | Simplify complex JSX | |
| Memoization | Optimize re-renders |
Output
Document the analysis using the template at references/templates/refactor-analysis.md.
The analysis should include:
- Code smells identified with locations
- Suggested refactorings with risk assessment
- Blast radius for each change
- Recommended order of operations
- Test coverage assessment
Constraints
- Analysis only: Do not execute refactorings - document recommendations
- Blast radius required: Every suggestion must include affected files/functions
- Risk assessment required: Every suggestion must be rated Low/Medium/High
- Order matters: Recommend sequence based on risk and dependencies
- Test awareness: Note test coverage and impact for each suggestion
Example
Begin by identifying the target code and any specific concerns to focus on.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/refactor/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 14 May 2026, 5 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thoreinstein/agents/refactor)