← スキル一覧に戻る

refactor
by place-to-stand
⭐ 0🍴 0📅 2026年1月19日
SKILL.md
name: refactor description: Find dead code, duplications, complexity issues, and refactoring opportunities. Use when cleaning up code, removing unused exports, simplifying complex functions, or during tech debt sprints.
Refactor & Dead Code Removal
Analyze and refactor code for clarity, maintainability, and removal of unused code.
Scope
1. Dead Code Detection
- Unused exports (functions, types, constants)
- Unused imports
- Unreachable code paths
- Commented-out code blocks
- Unused CSS classes
- Deprecated code marked for removal
- Unused dependencies in package.json
2. Code Duplication
- Repeated logic across files (DRY violations)
- Similar components that should be abstracted
- Copy-pasted utility functions
- Duplicated type definitions
3. Complexity Reduction
- Functions exceeding 50 lines
- Deeply nested conditionals (>3 levels)
- Complex boolean expressions
- God components doing too much
- Files approaching 300 lines (per AGENTS.md)
4. Naming & Clarity
- Unclear variable/function names
- Misleading names that don't match behavior
- Inconsistent naming conventions
- Magic numbers without constants
5. Pattern Consistency
- Inconsistent error handling patterns
- Mixed async patterns (callbacks vs promises vs async/await)
- Inconsistent state management approaches
- Varying component structure patterns
6. Type Safety
anytypes that should be specific- Missing type annotations
- Overly broad types that could be narrowed
- Type assertions that could be avoided
Output Format
For each finding:
[TYPE: DEAD_CODE|DUPLICATION|COMPLEXITY|NAMING|PATTERN|TYPES]
File: path/to/file.ts:lineNumber
Issue: Brief description
Current: Code snippet or pattern
Recommended: Refactored approach
Risk: LOW|MEDIUM|HIGH (breaking change potential)
Actions
- Run
npm run lintto catch obvious issues - Run
npm run type-checkfor type issues - Search for unused exports with grep patterns
- Identify files over 300 lines
- Look for duplicated code blocks
Refactoring Principles
Per AGENTS.md guidelines:
- Single Responsibility Principle
- Reuse > Rebuild
- Abstract only when pattern appears 3+ times
- Keep PRs scoped to single purpose
Post-Review
Generate:
- Safe deletions (no breaking changes)
- Refactoring candidates with dependency analysis
- Suggested extraction of shared utilities
- Migration path for larger refactors
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です