Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/Arete-Consortium/ai-skills --skill refactorコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
Intelligent CI failure diagnosis and guided remediation for GitHub Actions, GitLab CI, and local builds
Pre-execution mapping of codebases, document collections, or problem spaces. Runs BEFORE any Gorgon workflow to give all agents shared situational awareness
Investigative methodology for analyzing document collections — provenance analysis, anomaly detection, redaction detection, and cross-document validation
SKILL.md を表示中
| name | refactor |
| description | Code Refactoring Analysis |
| lifecycle | experimental |
Identify refactoring opportunities and code improvements.
/refactor path/to/file.py # Analyze specific file
/refactor path/to/module/ # Analyze entire module
/refactor --apply # Apply suggested refactorings
/refactor --complexity # Focus on complexity reduction
# Refactoring Report: module_name
## Summary
| Issue Type | Count | Priority |
|------------|-------|----------|
| High Complexity | 3 | High |
| Duplication | 5 | Medium |
| Code Smells | 8 | Low |
## High Priority Issues
### 1. Complex Function: `process_data()` (file.py:45)
**Complexity**: 15 (threshold: 10)
**Lines**: 87
**Problem**: Function does too many things - validates, transforms, saves.
**Suggested Refactoring**:
```python
# Before (simplified)
def process_data(data):
# validation (20 lines)
# transformation (40 lines)
# saving (25 lines)
# After
def process_data(data):
validated = validate_data(data)
transformed = transform_data(validated)
return save_data(transformed)
def validate_data(data): ...
def transform_data(data): ...
def save_data(data): ...
calculate_* functionsLocation: math_utils.py:23, math_utils.py:67, math_utils.py:112 Similarity: 85%
Problem: Three functions share nearly identical structure.
Suggested Refactoring:
# Before
def calculate_sum(items): ...
def calculate_avg(items): ...
def calculate_max(items): ...
# After
def calculate(items, operation: Callable):
return operation(items)
create_report()Parameters: 8
Suggested Refactoring: Use a dataclass or config object.
@dataclass
class ReportConfig:
title: str
format: str
...
def create_report(config: ReportConfig): ...
## Instructions for Claude
When /refactor is invoked:
1. **Read code** - Parse and understand structure
2. **Calculate metrics** - Complexity, length, nesting
3. **Find duplication** - Similar code blocks
4. **Identify smells** - God classes, feature envy, etc.
5. **Prioritize issues** - High/Medium/Low based on impact
6. **Suggest fixes** - Concrete, actionable refactorings
7. **Show before/after** - Code examples for each fix
8. **If --apply** - Implement the refactorings
9. **Verify** - Run tests after changes