When the user requests modifications to the page's UI style (visual adjustments such as layout, spacing, colors, component combinations, etc.). Use a structured collaboration process to complete the modification, ensuring every step aligns with the goal and avoiding useless guesswork.
Core Principles
- Don't guess, don't jump ahead — Never touch the code before aligning on the goal
- Screenshots are the primary language — Actively ask the user to provide screenshots; use screenshots to pinpoint the issue
- Draw proposals with ASCII — Draw layout proposals using ASCII art; text descriptions are prone to ambiguity
- Change only one thing at a time — Don't change multiple places at once; approach the target gradually
Workflow
Step 1: Identify the Problem
When the user says they want to change something, do two things first:
- Read the code — Read the relevant files to understand the current implementation
- Describe the current state — Draw the current layout using ASCII and confirm with the user: "Is this what I see?"
Example:
┌─────────────────────────────────────────────┐
│ 📈 Title [🔄] │
│ Subtitle description text │
│ 🔍 [Search box... ] │
├─────────────────────────────────────────────┤
Forbidden: Skipping this step and directly asking "What do you want it to look like?" You must first get the user to confirm you understand the current state.
Step 2: Provide Solutions
Offer 2-3 solutions, each containing:
- ASCII layout diagram — Draw what it will look like after the change
- One-line description — The core idea of this solution
Example:
Solution A: Search and refresh on the same line
┌──────────────────────────────────────────┐
│ 🔍 [Search box... ] [🔄] │
└──────────────────────────────────────────┘
Solution B: Move refresh to the title line
┌──────────────────────────────────────────┐
│ 📈 Title [🔄] │
│ 🔍 [Search box... ] │
└──────────────────────────────────────────┘
Forbidden:
- Providing only one solution (the user has no choice)
- Providing more than 3 solutions (choice paralysis)
- Solutions without ASCII diagrams, only text
Step 3: Wait for User Selection
Only start writing code after the user has chosen a solution.
Forbidden: Starting to change code before the user has selected.
Step 4: Change the Code
Execute minimal changes, only modifying the parts involved in the user's chosen solution.
Forbidden: Fixing other things on the side, optimizing code structure, or adding comments.
Step 5: Fine-Tune
After the change, show the user the result. The user may ask for fine-tuning:
- "Add a border"
- "The color is too dark"
- "Make the spacing a bit larger"
Fine-tuning is specific, small changes; execute them directly without going through the solution selection process again.
If the user's feedback is not specific enough (e.g., "It feels wrong"), actively ask:
- "Is it a size issue, a color issue, or a positioning issue?"
- "Which element next to it feels mismatched?"
Communication Guidelines
What the User Should Provide
| Information | Description |
|---|---|
| Screenshot | Mark the area they want to change |
| Problem description | "These two elements don't match" / "The spacing is too large" |
| Solution selection | Choose one from the proposed solutions |
What the AI Should Do
| Phase | Output |
|---|---|
| Identify | ASCII diagram of the current state |
| Propose | 2-3 ASCII solution diagrams + one-line descriptions |
| Change code | Minimal changes, only what's in the chosen solution |
| Fine-tune | Execute specific adjustments directly |
What the AI Must Never Do
- Guess and start changing code directly when the user says "change the layout"
- Provide a large code refactor all at once
- During fine-tuning, still offer multiple solutions for the user to choose
- Change things the user hasn't mentioned