بنقرة واحدة
refactor-scan
Scan codebase for repeated patterns and produce a refactoring proposal
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Scan codebase for repeated patterns and produce a refactoring proposal
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Single entry point for frontend work. Classify intent, create a plan, and run the minimal agent workflow.
Independent adversarial code review via Codex CLI to eliminate Claude self-review bias
Find reusable components with compact output before UI work
Create a task branch after plan approval
Create scoped Conventional Commits after reviewer PASS
Create an issue for failed tests or tracked follow-up work
استنادا إلى تصنيف SOC المهني
| name | refactor-scan |
| description | Scan codebase for repeated patterns and produce a refactoring proposal |
Trigger: /refactor-scan or auto-triggered when component-auditor detects 3+ similar patterns
Purpose: Scan codebase for repeated patterns and produce a refactoring proposal.
/refactor-scanStep 1: refactor-architect (opus)
→ Full codebase scan for:
- Duplicate JSX structures (3+ occurrences)
- Repeated state patterns (loading/error/data)
- Duplicate API call patterns
- Repeated class strings / inline styles
- Duplicate utility functions
Step 2: Produce refactor plan.md
→ List all detected patterns
→ Propose extraction targets (component/hook/utility)
→ Estimate impact (files affected, risk level)
Step 3: Present to user
→ "Refactor plan ready. Review plan.md to approve."
Step 4 (after approval): execute-feature
→ Implement the refactoring
## Refactor Scan Results
### High Priority (3+ occurrences)
1. loading/error/data state pattern — 5 files → extract: useAsyncData hook
2. Card layout pattern — 4 files → extract: BaseCard component
### Medium Priority
1. Filter + pagination pattern — 3 files → extract: useFilteredList hook
### Low Priority
1. formatDate utility — 2 files → extract: lib/utils.ts