← スキル一覧に戻る

refactoring
by duhenri9
Landing page oficial da WM3, criada para consolidar o reposicionamento da agência no mercado digital. Centraliza todos os links, serviços e projetos em um só hub estratégico, refletindo a nova fase da marca e a integração de soluções de automação e IA.
⭐ 0🍴 0📅 2026年1月17日
SKILL.md
name: refactoring description: Safe code refactoring with step-by-step approach phases: [E]
Refactoring Guide
When to Use
Use this skill when refactoring code or improving code structure.
Refactoring Principles
1. Safety First
- Ensure tests exist before refactoring
- Make small, incremental changes
- Commit after each successful step
- Keep functionality identical
2. Common Refactorings
Extract Method
When: Code block does one thing and can be named
Before: Long method with multiple responsibilities
After: Small methods with clear names
Extract Variable
When: Complex expression needs explanation
Before: if (user.age >= 18 && user.country === 'US' && user.verified)
After: const canPurchase = user.age >= 18 && user.country === 'US' && user.verified;
Replace Conditional with Polymorphism
When: Switch/if statements based on type
Before: switch(type) { case 'A': ... case 'B': ... }
After: type.process() // Each type implements process()
3. Step-by-Step Process
- Identify code smell
- Write characterization tests if missing
- Apply refactoring
- Run tests
- Commit
- Repeat
Code Smells to Watch
- Long methods (>20 lines)
- Long parameter lists (>3 params)
- Duplicate code
- Feature envy
- Data clumps
- Primitive obsession
スコア
総合スコア
70/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です