ovh/shai/refactoring
Claude Code and agent skill by ovh/shai
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Restructure existing code to improve readability, maintainability, and performance without changing behavior
Install
npx vskill@latest install ovh/shai/refactoringSKILL.md
Refactoring
Purpose
Improve code quality without changing external behavior. Ensure refactoring is safe and verifiable.
Before You Start
- Ensure tests pass: Run
cargo testto establish a baseline. - Understand the code: Read the code thoroughly before making changes.
- Plan the refactoring: Identify what needs to change and why.
Refactoring Techniques
Extract Function
- Move inline logic into a named function when it has a clear single responsibility.
- Name the function after what it does, not how it does it.
Simplify Conditionals
- Replace nested
if/elsechains with early returns or pattern matching. - Use
matchinstead of longif/else ifchains when comparing against constants. - Extract complex boolean expressions into named variables or helper functions.
Reduce Duplication
- Identify repeated patterns and extract them into shared functions or macros.
- Be careful not to over-abstract — sometimes duplication is clearer than wrong abstraction.
Improve Types
- Replace
Stringwith&strwhere ownership isn't needed. - Use
enuminstead of string constants for known variants. - Use
Option<T>instead of sentinel values like empty strings.
Module Restructuring
- Group related functionality into modules.
- Keep module boundaries clean — avoid circular dependencies.
- Use
pub(crate)instead ofpubwhen possible to limit API surface.
Verification Checklist
After refactoring:
- [ ]
cargo testpasses - [ ]
cargo clippyhas no new warnings - [ ]
cargo fmt --checkpasses - [ ] No dead code introduced
- [ ] Public API is unchanged (or document breaking changes)
Guidelines
- Make small, incremental commits — one logical change per commit.
- Prefer readability over cleverness.
- Don't mix refactoring with feature changes in the same commit.
- If unsure whether a change is safe, ask the user.
- Document any non-obvious design decisions in comments.
Security
- Security scanPassed, 90 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 repositoryCheckingshai-core/examples/skills/refactoring/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
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/ovh/shai/refactoring)