返回 AiToEarn
shape.md
1 Shape the UX and UI for a feature before any code is written. This command produces a **design brief**: a structured artifact that guides implementation through discovery, not guesswork.
2
3 **Scope**: Design planning only. This command does NOT write code. It produces the thinking that makes code good.
4
5 **Output**: A design brief that can be handed off to $impeccable craft, or directly to $impeccable for freeform implementation. When visual direction probes are used, the images are supporting artifacts, not the primary output.
6
7 ## Philosophy
8
9 Most AI-generated UIs fail not because of bad code, but because of skipped thinking. They jump to "here's a card grid" without asking "what is the user trying to accomplish?" This command inverts that: understand deeply first, so implementation is precise.
10
11 ## Phase 1: Discovery Interview
12
13 **Do NOT write any code or make any design decisions during this phase.** Your only job is to understand the feature deeply enough to make excellent design decisions later.
14
15 This is a required interaction, not optional guidance. Ask these questions in conversation, adapting based on answers. Don't dump them all at once; have a natural dialogue. STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer.
16
17 ### Interview cadence
18
19 Discovery includes at least one user-answer round unless PRODUCT.md, DESIGN.md, or an already-confirmed brief directly answers the needed inputs. With a sparse prompt, do **not** synthesize a complete brief for confirmation on the first response.
20
21 - Use the harness's structured question tool when one exists. Otherwise, ask directly in chat and stop.
22 - Ask **2-3 questions per round**, then wait for answers.
23 - Treat PRODUCT.md and DESIGN.md as anchors; they reduce repeated questions but do **not** replace shape for craft. Shape is task-specific.
24 - One round is the default. Add a second only if the first answers leave material gaps. Don't run a second round just to feel thorough.
25 - Round 1 should clarify purpose, audience/context, content/scope, and (for brand) visual direction.
26 - Round 2, when needed, fills in whatever's still genuinely missing.
27
28 **Assert-then-confirm, not menu-with-escape.** When PRODUCT.md and the user's prompt make one option obvious, name it and ask the user to confirm or override. Don't enumerate "Restrained / Committed / Or something else?" as a real choice; "This reads as Restrained, confirm?" beats a four-option menu when the answer is already clear.
29
30 ### Purpose & Context
31 - What is this feature for? What problem does it solve?
32 - Who specifically will use it? (Not "users"; be specific: role, context, frequency)
33 - What does success look like? How will you know this feature is working?
34 - What's the user's state of mind when they reach this feature? (Rushed? Exploring? Anxious? Focused?)
35
36 ### Content & Data
37 - What content or data does this feature display or collect?
38 - What are the realistic ranges? (Minimum, typical, maximum, e.g., 0 items, 5 items, 500 items)
39 - What are the edge cases? (Empty state, error state, first-time use, power user)
40 - Is any content dynamic? What changes and how often?
41 - What visual assets are real content here? Note required images, product shots, illustrations, maps, textures, diagrams, generated objects, or existing project assets.
42
43 ### Design Direction
44
45 Force a visual decision on three fronts. Skip anything PRODUCT.md or DESIGN.md already answers; ask only what's missing.
46
47 - **Color strategy for this surface.** Pick one: Restrained / Committed / Full palette / Drenched. Can override the project default if the surface earns it (e.g. a drenched hero inside an otherwise Restrained product).
48 - **Theme via scene sentence.** Write one sentence of physical context for this surface: who uses it, where, under what ambient light, in what mood. The sentence forces dark vs light. If it doesn't, add detail until it does.
49 - **Two or three named anchor references.** Specific products, brands, objects. Not adjectives like "modern" or "clean."
50
51 ### Scope
52
53 Always ask. Sketch quality and shipped quality are different outputs; don't guess between them.
54
55 - **Fidelity.** Sketch / mid-fi / high-fi / production-ready?
56 - **Breadth.** One screen / a flow / a whole surface?
57 - **Interactivity.** Static visual / interactive prototype / shipped-quality component?
58 - **Time intent.** Quick exploration, or polish until it ships?
59
60 Scope answers are task-scoped. Don't write them to PRODUCT.md or DESIGN.md; carry them through the design brief only.
61
62 ### Constraints
63 - Are there technical constraints? (Framework, performance budget, browser support)
64 - Are there content constraints? (Localization, dynamic text length, user-generated content)
65 - Mobile/responsive requirements?
66 - Accessibility requirements beyond WCAG AA?
67
68 ### Anti-Goals
69 - What should this NOT be? What would be a wrong direction?
70 - What's the biggest risk of getting this wrong?
71
72 ## Phase 1.5: Visual Direction Probe (Capability-Gated)
73
74 After the discovery interview, generate a small set of visual direction probes **before** writing the final brief when all of these are true:
75
76 - The work is **net-new** or directionally ambiguous enough that visual exploration will clarify the brief.
77 - The requested fidelity is **mid-fi, high-fi, or production-ready**. Skip for sketch-only planning.
78 - The current harness gives you native image generation (Codex's `image_gen`, an equivalent MCP tool, or similar). Don't ask the user to install APIs or tooling.
79
80 When those conditions are met, this step is mandatory. If image generation isn't natively available, do not ask the user to install APIs or tooling. State in one line that the image step is skipped because the harness lacks native image generation, then proceed. The one-line announcement is required, not optional; it forces a conscious decision instead of letting the step quietly evaporate.
81
82 Use probes to explore visual lanes, not to replace the brief.
83
84 Do not skip probes because the final UI will be semantic, editable, code-native, responsive, or accessible. Those are implementation requirements, not reasons to avoid visual exploration.
85
86 ### What to generate
87
88 Generate **2 to 4** distinct direction probes based on the discovery answers, especially:
89
90 - Color strategy
91 - Theme scene sentence
92 - Named anchor references
93 - Scope and fidelity
94
95 The probes should differ in primary visual direction (hierarchy, topology, density, typographic voice, or color strategy), not just palette tweaks.
96
97 ### How to use the probes
98
99 - Treat them as **direction tests**, not final designs.
100 - Use them to pressure-test whether the brief is pointing at the right lane.
101 - Ask the user which direction feels closest, what feels off, and what should carry forward.
102 - If the probes reveal a mismatch, revise the brief inputs before finalizing the brief.
103
104 ### Important limits
105
106 - Do **not** skip discovery because image generation is available.
107 - Do **not** treat generated imagery as final UX specification, final copy, or final accessibility behavior.
108 - Do **not** use this step for minor refinements of existing work. It's for shaping a new surface or clarifying a big directional choice.
109
110 If image generation isn't natively available, announce the skip in one line and proceed to the design brief.
111
112 ## Phase 2: Design Brief
113
114 After the interview and any required probes, present a brief and **end your response**. The user must confirm before any implementation runs. Do not present a brief and then continue to code in the same response, even if the brief feels obvious to you. The user's confirmation is the gate.
115
116 **Choose the brief shape based on how clear the answers are:**
117
118 - **Compact form (3-5 bullets)** when discovery was crisp and the original prompt + PRODUCT.md already pinned scope, content, and direction. State what you're building, the visual lane, and end with one or two specific questions or a clear "confirm or override?" prompt. This is the default for typical craft requests with a clear prompt.
119 - **Full structured form (sections below)** when the task is genuinely ambiguous, multi-screen, or when the user asked for shape as a standalone step. Use this when the discipline of structure earns its weight.
120
121 Don't pad a clear brief into a long one to look thorough. A 70-line brief restating answers the user just gave is noise, not rigor. Equally, don't skip the confirmation pause to look efficient: the pause is the point.
122
123 Present the brief, then **stop and wait for explicit confirmation**. You are not the judge of whether the user already approved. Even when the brief feels obviously right, ask once and wait. The pause is what separates shape from premature implementation.
124
125 ### Brief Structure
126
127 **1. Feature Summary** (2-3 sentences)
128 What this is, who it's for, what it needs to accomplish.
129
130 **2. Primary User Action**
131 The single most important thing a user should do or understand here.
132
133 **3. Design Direction**
134 Color strategy (Restrained / Committed / Full palette / Drenched) + the theme scene sentence + 2–3 named anchor references. Reference PRODUCT.md and DESIGN.md where they already answer, and note any per-surface overrides.
135
136 If you ran the Visual Direction Probe step, name which probe direction won and what changed in the brief because of it.
137
138 **4. Scope**
139 Fidelity, breadth, interactivity, and time intent from the Scope section of the interview. Task-scoped; these don't persist beyond the brief.
140
141 **5. Layout Strategy**
142 High-level spatial approach: what gets emphasis, what's secondary, how information flows. Describe the visual hierarchy and rhythm, not specific CSS.
143
144 **6. Key States**
145 List every state the feature needs: default, empty, loading, error, success, edge cases. For each, note what the user needs to see and feel.
146
147 **7. Interaction Model**
148 How users interact with this feature. What happens on click, hover, scroll? What feedback do they get? What's the flow from entry to completion?
149
150 **8. Content Requirements**
151 What copy, labels, empty state messages, error messages, and microcopy are needed. Note any dynamic content and its realistic ranges. For image-led surfaces, also list the required image/media roles and their likely source (project asset, generated raster, semantic SVG/CSS, canvas/WebGL, icon library, or accepted omission).
152
153 **9. Recommended References**
154 Based on the brief, list which impeccable reference files would be most valuable during implementation (e.g., layout.md for complex layouts, animate.md for animated features, interaction-design.md for form-heavy features, typeset.md for typography-driven pages, colorize.md for color-led brands).
155
156 **10. Open Questions**
157 Anything genuinely unresolved. Don't list "open questions" you've already recommended a default for; assert the default and move on. If you'd write `Recommend: X` next to a question, just decide X.
158
159 ---
160
161 STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer. Ask for explicit confirmation of the brief before finishing.
162
163 If the user disagrees with any part, revisit the relevant discovery questions. A shape run is incomplete until the user confirms direction.
164
165 Once confirmed, the brief is complete. The user can now hand it to $impeccable, or use it to guide any other implementation approach. (If the user wants the full discovery-then-build flow in one step, they should use $impeccable craft instead, which runs this command internally.)
166
166 lines MARKDOWN