Build & Code / D12
ProPreview cut from the real Pro body
Refactor a messy component
Split a hard-to-read component without changing behavior or wandering into unrelated cleanup.
For
Frontend teams
Time per use
25 min
Format
.md and .skill
How to use it
- 1.Open ChatGPT or Claude.Either works. The skill is just text.
- 2.Inspect the real preview, then unlock the full file.One click; no install, no setup.
- 3.Paste it as your first message.The assistant now knows how to do this one job.
- 4.Give it your specifics, get the result.Roughly 25 min, every time you need it.
Skill filed12-refactor-a-messy-component.skill.md1.4 KB
Run once
Advanced
Install permanently ↓Mobile apps: if ChatGPT or Claude opens blank, tap the message box and paste. Skillbook copies first.
Mobile apps: if ChatGPT or Claude opens blank, tap the message box and paste. Skillbook copies first.
Fill the blanks first.
These fields update the skill preview and the ChatGPT/Claude buttons instantly.
IncludePaste the component code, file summary, props, state, screenshots described in text, or pain points.
IncludeReact, Vue, SwiftUI, Tailwind, CSS modules, component library, local primitives, etc.
IncludeToo long, mixed concerns, duplicated markup, hard-to-test state, mobile bugs, performance, unclear naming, etc.
IncludeNo visual changes, no prop changes, no package changes, deadline, tests, or ownership limits.
Install as agent behavior
Permanent agent install needs the full body.
This page is only showing a preview. Unlock the full skill to install it in Claude Code, Claude Projects, or a Custom GPT.
# Refactor a messy component
You are a frontend refactoring partner. I will paste a component or describe one. Help split it into clearer pieces without changing behavior, styling, or user-facing copy.
## Inputs
Component code or summary: {{component_context||Paste the component code, file summary, props, state, screenshots described in text, or pain points.}}
Framework and design system: {{stack_and_environment||React, Vue, SwiftUI, Tailwind, CSS modules, component library, local primitives, etc.}}
Pain points: {{pain_points||Too long, mixed concerns, duplicated markup, hard-to-test state, mobile bugs, performance, unclear naming, etc.}}
Constraints: {{constraints||No visual changes, no prop changes, no package changes, deadline, tests, or ownership limits.}}
## Output
**1. Behavior lock.** What must stay exactly the same.
**2. Responsibility map.** Which concerns are currently mixed together.
**3. Refactor plan.** Step-by-step changes that keep the app working after each step.
**4. Proposed component split.** Names, props, and what each subcomponent owns.
**5. State and effects audit.** What state should stay, move, or be derived.
**6. Verification.** Visual, responsive, keyboard, and regression checks.
## Rules
[Preview stops here. Unlock the Pro library for the full rules, guardrails, examples, and copyable file.]The rest is in the Pro library.
This preview is cut from a real Pro workflow. Unlock the founding Pro library for the full file, rules, examples, and installable skill.
Full Pro file includes
- ✓ Input checklist
- ✓ Step-by-step workflow
- ✓ Quality bar
- ✓ Guardrails
- ✓ Output format
- ✓ Example run
- ✓ Install formats
Other things on the Build & Code shelf