一键导入
refactoring
Refactoring assessment and patterns. Use after tests pass (GREEN phase) to assess improvement opportunities.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Refactoring assessment and patterns. Use after tests pass (GREEN phase) to assess improvement opportunities.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Apply template-downstream to all registered downstream projects in bulk, one project at a time. Use when you want to push the latest .claude/, .mcp.json, or .pre-commit-config.yaml to every project at once. Triggers on: "일괄 배포", "전체 프로젝트에 내려보내기", "모든 프로젝트 업데이트", "broadcast template", "bulk sync".
The standard business voice for any Korean text a human reads — a formal-yet-friendly business register built on 해요체 but elevated with 합니다/습니다 endings, polite recommendation phrasing, natural greetings/closings, and readable structure. Use whenever producing or rewriting reader-facing text: Telegram replies, reports, READMEs, job outputs, human-facing notes, and especially when rewriting raw TIL/technical notes for sharing with colleagues. Triggers: 비즈니스 톤, business voice, 격식 있는 톤, 동료 공유용 재작성, formal rewrite, 보고서 톤, 발표자료 톤.
한국 특화 기능(교통·날씨·부동산·쇼핑·법률·금융·공공데이터 등) 요청이 들어오면 실행. git pull로 최신화 후 README 레지스트리에서 스킬을 골라 해당 SKILL.md만 읽어 진행한다.
Import Dev Sentinel experiences into localdocs/learn.sentinel.md. Use when the user wants to bring gotchas, failure lessons, or struggle experiences captured by Dev Sentinel into the project's local knowledge base. Triggers: "sentinel 가져와", "sentinel import", "gotcha 정리", "경험 가져와", "sentinel에서 배운 것", "실패 경험 가져와".
Update .claude/, .mcp.json, and .pre-commit-config.yaml from the upstream python-project-template repository into the current project. Only files that exist upstream are updated — project-only files are never deleted. Use when pulling latest tooling, rules, hooks, or skills from the canonical template into this project. Triggers on: "템플릿 최신화", "template sync", "upstream 반영", "template 업데이트".
Planning work in small, known-good increments. Use when starting significant work or breaking down complex tasks.
| name | refactoring |
| description | Refactoring assessment and patterns. Use after tests pass (GREEN phase) to assess improvement opportunities. |
Refactoring is the third step of TDD. After GREEN, assess if refactoring adds value.
Having a working baseline before refactoring:
Workflow:
| Priority | Action | Examples |
|---|---|---|
| Critical | Fix now | Mutations, knowledge duplication, >3 levels nesting |
| High | This session | Magic numbers, unclear names, >30 line functions |
| Nice | Later | Minor naming, single-use helpers |
| Skip | Don't change | Already clean code |
Abstract when:
Keep separate when:
// After GREEN:
const processOrder = (order: Order): ProcessedOrder => {
const itemsTotal = order.items.reduce((sum, item) => sum + item.price, 0);
const shipping = itemsTotal > 50 ? 0 : 5.99;
return { ...order, total: itemsTotal + shipping, shippingCost: shipping };
};
// ASSESSMENT:
// ⚠️ High: Magic numbers 50, 5.99 → extract constants
// ✅ Skip: Structure is clear enough
// DECISION: Extract constants only
If code isn't driven by a failing test, don't write it.
Key lesson: Every line must have a test that demanded its existence.
❌ Speculative code examples:
What to do: Delete speculative code. Add behavior tests instead.
Don't refactor when:
Remember: Refactoring should improve code structure without changing behavior.
refactor: extract scenario validation logic
refactor: simplify error handling flow
refactor: rename ambiguous parameter names
Format: refactor: <what was changed>
Note: Refactoring commits should NOT be mixed with feature commits.