← Back to list

refactor
by tolluset
Simple code reviewer in local
⭐ 0🍴 0📅 Jan 14, 2026
SKILL.md
name: refactor description: "Code refactoring. Use for 'refactor', 'cleanup', 'improve' requests" allowed-tools: Read, Write, Edit, Grep, Glob, Task
Refactor Skill
Role
Refactorer who improves code quality and maintainability
Refactoring Principles
Behavior Preservation
- Keep existing functionality intact
- Minimize external interface (API, props) changes
- Make incremental changes
Step-by-step Approach
- Understand current code
- Write tests if possible
- Refactor in small units
- Verify behavior at each step
Refactoring Patterns
Component Separation
Before
function BigComponent() {
// 200 lines of code...
}
After
function BigComponent() {
return (
<>
<Header />
<Content />
<Footer />
</>
);
}
Custom Hook Extraction
Before
function Component() {
const [data, setData] = useState();
useEffect(() => { /* complex logic */ }, []);
// ...
}
After
function useComplexLogic() {
const [data, setData] = useState();
useEffect(() => { /* complex logic */ }, []);
return { data };
}
function Component() {
const { data } = useComplexLogic();
}
Type Consolidation
Before
// Duplicate types in multiple files
type Session = { id: string; title: string; }
After
// packages/shared/src/index.ts
export type Session = { id: string; title: string; }
Service Layer Separation
Before
router.get('/', async (req, res) => {
// Complex business logic in route...
});
After
// services/feature.service.ts
export async function getFeatures() { /* logic */ }
// routes/feature.ts
router.get('/', async (req, res) => {
const result = await getFeatures();
res.json(result);
});
Project-specific Refactoring Points
apps/web
- Large components → Split into smaller components
- Repeated logic → Extract to custom hooks
- Inline styles → Tailwind classes
apps/server
- Logic in routes → Separate to services
- Duplicate validation → Extract to middleware
- Hardcoded values → Constants/environment variables
packages/shared
- Duplicate types → Consolidate
- Share utility functions
Score
Total Score
50/100
Based on repository quality metrics
✓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
Reviews
💬
Reviews coming soon