← スキル一覧に戻る

refactor-code
by mvillmow
Training framework written in Mojo
⭐ 11🍴 4📅 2026年1月24日
SKILL.md
name: refactor-code description: "Restructure code for improved clarity and maintainability. Use when addressing code smells or technical debt." mcp_fallback: none category: generation tier: 2 user-invocable: false
Refactor Code
Apply systematic refactoring techniques to improve code clarity, maintainability, and performance without changing functionality.
When to Use
- Addressing code smells identified in reviews
- Reducing cyclomatic complexity
- Extracting methods and classes
- Improving naming and organization
Quick Reference
# Common refactoring patterns
# Extract method
# BEFORE: Long function with multiple responsibilities
def process_data(data):
result = validate(data)
formatted = format_data(result)
return save(formatted)
# AFTER: Clear single responsibility
def process_data(data):
validated = _validate_and_format(data)
return save(validated)
def _validate_and_format(data):
return format_data(validate(data))
Workflow
- Identify refactoring targets: From code review or analysis tools
- Plan changes: Document what will change and why
- Apply refactoring: Use IDE refactoring tools or manual changes
- Run tests: Verify all tests still pass
- Verify performance: Check no performance regression
Output Format
Refactoring report:
- Issues addressed
- Refactoring techniques applied
- Metrics before/after (complexity, lines of code)
- Test coverage status
- Performance impact
References
- See
detect-code-smellsskill for identifying issues - See CLAUDE.md > SOLID principles for refactoring goals
- See
run-testsskill for verification
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です