proffesor-for-testing/agentic-qe/refactoring-patterns
Claude Code and agent skill by proffesor-for-testing/agentic-qe
- community
Checking that the SKILL.md file is still in the repository.
Apply safe refactoring patterns to improve code structure without changing behavior. Use when cleaning up code, reducing technical debt, or improving maintainability.
Install
npx vskill@latest install proffesor-for-testing/agentic-qe/refactoring-patternsSKILL.md
Refactoring Patterns
<default_to_action> When refactoring:
- ENSURE tests pass (never refactor without tests)
- MAKE small change (one refactoring at a time)
- RUN tests (must stay green)
- COMMIT (save progress)
- REPEAT
Safe Refactoring Cycle:
Code Smells → Refactoring:
| Smell | Refactoring | |
|---|---|---|
| Long method (>20 lines) | Extract Method | |
| Large class | Extract Class | |
| Long parameter list (>3) | Introduce Parameter Object | |
| Duplicated code | Extract Method/Class | |
| Complex conditional | Decompose Conditional | |
| Magic numbers | Named Constants | |
| Nested loops | Replace Loop with Pipeline |
NEVER REFACTOR:
- Without tests (write tests first)
- When deadline is tomorrow
- Code you don't understand
- Code that works and won't be touched
</default_to_action>
Quick Reference Card
Common Refactorings
| Pattern | Before | After | |
|---|---|---|---|
| Extract Method | 50-line function | 5 small functions | |
| Extract Class | Class doing 5 things | 5 single-purpose classes | |
| Parameter Object | fn(a,b,c,d,e,f) | fn(options) | |
| Replace Conditional | if (type === 'a') {...} | Polymorphism | |
| Pipeline | Nested loops | .filter().map().reduce() |
The Rule of Three
- First time → Just do it
- Second time → Wince and duplicate
- Third time → Refactor
Key Patterns
Extract Method
Replace Loop with Pipeline
Decompose Conditional
Refactoring Anti-Patterns
| ❌ Anti-Pattern | Problem | ✅ Better | |
|---|---|---|---|
| Without tests | No safety net | Write tests first | |
| Big bang | Rewrite everything | Small incremental steps | |
| For perfection | Endless tweaking | Good enough, move on | |
| Premature abstraction | Pattern not clear yet | Wait for Rule of Three | |
| During feature work | Mixed changes | Separate commits |
Agent Integration
Agent Coordination Hints
Memory Namespace
Fleet Coordination
Related Skills
- tdd-london-chicago - TDD refactor phase
- code-review-quality - Review refactored code
- xp-practices - Collective ownership
Remember
Refactoring is NOT:
- Adding features
- Fixing bugs
- Performance optimization
- Rewriting from scratch
Refactoring IS:
- Improving structure
- Making code clearer
- Reducing complexity
- Removing duplication
- Without changing behavior
Always have tests. Always take small steps. Always keep tests green.
Security
- Security scanPassed, 95 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 repositoryCheckingassets/skills/refactoring-patterns/SKILL.md
Popularity
- Repository stars
- 366
- Repository forks
- 72
- Repository npm downloads, 7 days
- 1,109
- 7-day trend score
- 47
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 1 Jun 2026, 5 months ago.
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/proffesor-for-testing/agentic-qe/refactoring-patterns)