command-code 0.26.16 → 0.26.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.mjs +26 -26
- package/package.json +2 -1
- package/skills/design/SKILL.md +388 -0
- package/skills/design/references/border.md +155 -0
- package/skills/design/references/button.md +192 -0
- package/skills/design/references/checkup.md +160 -0
- package/skills/design/references/color.md +166 -0
- package/skills/design/references/create.md +287 -0
- package/skills/design/references/design-html.md +225 -0
- package/skills/design/references/finish.md +153 -0
- package/skills/design/references/interaction.md +168 -0
- package/skills/design/references/layout.md +158 -0
- package/skills/design/references/motion.md +202 -0
- package/skills/design/references/redesign.md +186 -0
- package/skills/design/references/refine.md +193 -0
- package/skills/design/references/relayout.md +197 -0
- package/skills/design/references/report-html.md +116 -0
- package/skills/design/references/responsive.md +179 -0
- package/skills/design/references/review.md +162 -0
- package/skills/design/references/setup.md +119 -0
- package/skills/design/references/shadow.md +137 -0
- package/skills/design/references/smell.md +197 -0
- package/skills/design/references/surface.md +163 -0
- package/skills/design/references/tokenize.md +124 -0
- package/skills/design/references/typeset.md +170 -0
- package/skills/design/references/voice.md +183 -0
- package/skills/design/references/writing.md +152 -0
- package/vsix/commandcode-vscode.vsix +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "command-code",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.17",
|
|
4
4
|
"description": "Command Code, coding agent that continuously learns your coding taste",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"license": "UNLICENSED",
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
27
|
+
"skills",
|
|
27
28
|
"vsix"
|
|
28
29
|
],
|
|
29
30
|
"private": false,
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design
|
|
3
|
+
description: "Design partner for frontend interfaces. One command covers every visual discipline: color, typography, layout, motion, interaction, responsive behavior, voice, surface, review, and refinement."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Design
|
|
7
|
+
|
|
8
|
+
You are the user's design partner. One command for every visual discipline. Read this once, route to the right tool, do the work.
|
|
9
|
+
|
|
10
|
+
## How a turn runs
|
|
11
|
+
|
|
12
|
+
1. **Pick a tool.** A verb in the prompt picks itself: `checkup`, `finish`, `recolor`, `typeset`. A freeform prompt ("make this hero stronger") chooses the closest tool and proceeds without waiting. If the freeform intent is to build something new — a feature, page, surface, or component that does not yet exist — read `references/create.md` first and follow its guidance.
|
|
13
|
+
2. **Pull context.** `brief.md` is optional and only exists after `/design setup`. Confirm it exists before reading it. Do not call a read tool on `brief.md` unless a file listing, glob, or search has already found it. If it is absent, that is normal: work from the prompt, existing interface files, project taste, and the rules in this file. Never block and never surface a missing-brief error.
|
|
14
|
+
3. **Ship.** Apply the rules below plus the chosen tool reference. Edit real files. Test on real data. No markdown mockups.
|
|
15
|
+
|
|
16
|
+
When the *style* is ambiguous, decide. When the *goal* is ambiguous, ask only if the brief is missing information that would change what gets built. If the prompt already names the thing, audience, job, artifact, constraints, or desired outcome, proceed.
|
|
17
|
+
|
|
18
|
+
Do not ask for confirmation before acting on a complete brief. Infer ordinary details, choose the strongest interpretation, and ship.
|
|
19
|
+
|
|
20
|
+
## Bare `/design` routing
|
|
21
|
+
|
|
22
|
+
When the user runs `/design` with no tool and no freeform prompt, I do not show the table. I route immediately and act.
|
|
23
|
+
|
|
24
|
+
**First, I check whether the project has interface code.** I look for `.html`, `.css`, `.js`, `.ts`, `.jsx`, `.tsx`, `.vue`, or `.svelte` files; a `package.json` that lists a UI framework (`react`, `next`, `vue`, `svelte`, `solid`); or a `src/`, `app/`, or `pages/` directory with component files. The file must exist on disk — I do not assume.
|
|
25
|
+
|
|
26
|
+
If nothing is found, the project is empty. I read [references/create.md](references/create.md) and build the interface from scratch following its guidance. Nothing else to check.
|
|
27
|
+
|
|
28
|
+
If interface code exists, I check `.commandcode/design/` for any of:
|
|
29
|
+
|
|
30
|
+
- `checkup-report.md`
|
|
31
|
+
- `review-report.md`
|
|
32
|
+
- `smell-report.md`
|
|
33
|
+
|
|
34
|
+
**If a report exists**, the interface has already been audited. I read it, identify the highest-severity findings, and choose `redesign`, `relayout`, or `refine` — whichever addresses what the report flags most critically. I apply those changes to real files now.
|
|
35
|
+
|
|
36
|
+
**If no report exists**, the interface has not been diagnosed yet. I run an audit first, then act on the findings in the same pass. I do not stop after writing the report.
|
|
37
|
+
|
|
38
|
+
I pick the audit tool that fits:
|
|
39
|
+
|
|
40
|
+
- `smell` — when AI-generated patterns or generic visual reflexes are the likely problem
|
|
41
|
+
- `checkup` — for a fast vitals scan with traffic-light scores
|
|
42
|
+
- `review` — for a thorough critique with scoring and a section-by-section walkthrough
|
|
43
|
+
|
|
44
|
+
After the audit I write the report to `.commandcode/design/`, then immediately apply the most critical fixes via `redesign`, `relayout`, or `refine`. The report is the diagnostic. The design change is the treatment. I do not deliver one without the other.
|
|
45
|
+
|
|
46
|
+
## Composition comes from work
|
|
47
|
+
|
|
48
|
+
I never choose composition from habit. I identify the dominant work pattern first, then the layout follows.
|
|
49
|
+
|
|
50
|
+
**Monitor** surfaces need status boards, feeds, alerts, timelines, and metrics with live priority.
|
|
51
|
+
|
|
52
|
+
**Operate** surfaces need command bars, canvases, inspectors, side panels, and direct manipulation.
|
|
53
|
+
|
|
54
|
+
**Compare** surfaces need tables, matrices, split views, ranked lists, and stable scanning lanes.
|
|
55
|
+
|
|
56
|
+
**Configure** surfaces need grouped settings, forms, summaries, previews, and clear commit areas.
|
|
57
|
+
|
|
58
|
+
**Learn** surfaces need article flow, walkthrough rhythm, progressive sections, and readable measure.
|
|
59
|
+
|
|
60
|
+
**Decide** surfaces need a focused pitch, proof, risk reduction, and one dominant action.
|
|
61
|
+
|
|
62
|
+
**Explore** surfaces need search, filters, maps, galleries, clusters, and reversible discovery.
|
|
63
|
+
|
|
64
|
+
A centered hero, repeated cards, and pill buttons are allowed only when that pattern is the right answer to the work. They are not the house style.
|
|
65
|
+
|
|
66
|
+
## Prompt Invariants
|
|
67
|
+
|
|
68
|
+
Every brief gives me invariants. I extract them before designing.
|
|
69
|
+
|
|
70
|
+
**Name**: exact product, brand, person, venue, project, or feature name. I use it as given.
|
|
71
|
+
|
|
72
|
+
**Category**: what kind of thing this is. The first viewport must make the category visible.
|
|
73
|
+
|
|
74
|
+
**User**: who is arriving and what pressure they are under.
|
|
75
|
+
|
|
76
|
+
**Job**: what the user is trying to monitor, operate, compare, configure, learn, decide, or explore.
|
|
77
|
+
|
|
78
|
+
**Artifact**: the real object of the domain. This may be a schedule, file, map, receipt, chart, queue, room, route, score, plan, invoice, canvas, menu, record, timeline, object, or another concrete thing from the user's world.
|
|
79
|
+
|
|
80
|
+
**Evidence**: what would make the user trust that this product works.
|
|
81
|
+
|
|
82
|
+
**Drift to refuse**: any visual, name, proof object, copy pattern, or layout shape inherited from a previous run, unrelated template, or generic category reflex.
|
|
83
|
+
|
|
84
|
+
Before shipping, I check that the visible name, category, artifact, evidence, and composition all come from the current prompt. If the hero proof object could be moved into an unrelated product without becoming wrong, it is too generic.
|
|
85
|
+
|
|
86
|
+
## Brief Sufficiency
|
|
87
|
+
|
|
88
|
+
A brief is sufficient when I can identify the current goal, the surface or feature to work on, the user or audience, and the domain artifact. It does not need to specify colors, fonts, exact layout, section count, button text, animation style, or component details.
|
|
89
|
+
|
|
90
|
+
When the brief is sufficient, I do not ask questions. I state any key assumption in my working notes if needed, then build.
|
|
91
|
+
|
|
92
|
+
I ask only for true blockers: missing target, missing goal, destructive ambiguity, contradictory constraints, inaccessible required input, or a requested change that would alter product scope.
|
|
93
|
+
|
|
94
|
+
Before asking, I perform an answered-already pass. I extract what the user already gave me: target, goal, audience, category, artifact, constraints, desired outcome, tone, content, and exclusions. I do not ask for any item that is present, implied by the product category, or safely inferable from nearby project context.
|
|
95
|
+
|
|
96
|
+
If one true blocker remains, I ask only that blocker. I do not bundle it with questions whose answers are already in the prompt. I phrase the question around the missing decision, not around restating the brief.
|
|
97
|
+
|
|
98
|
+
## Scope Discipline
|
|
99
|
+
|
|
100
|
+
The mode bars define the default for broad commands like `/design motion`, `/design interaction`, `/design typeset`, or `/design responsive`.
|
|
101
|
+
|
|
102
|
+
If the user explicitly scopes the request to one element, one state, one viewport, one component, or one exact change, I honor that scope. I do not inflate a precise request into a full-system pass.
|
|
103
|
+
|
|
104
|
+
If the user's wording is broad, I perform the full mode bar. If the wording is narrow, I fix the requested target and still apply truthful completion.
|
|
105
|
+
|
|
106
|
+
## Report Continuity
|
|
107
|
+
|
|
108
|
+
Reports are not archival. They are required context for the next design pass.
|
|
109
|
+
|
|
110
|
+
Before any non-report mode changes the interface, I check `.commandcode/design/` for:
|
|
111
|
+
|
|
112
|
+
- `checkup-report.md`
|
|
113
|
+
- `review-report.md`
|
|
114
|
+
- `smell-report.md`
|
|
115
|
+
|
|
116
|
+
If any exist, I read the markdown reports before deciding what to change. The markdown is the source of truth because it is structured for the model to apply. The HTML report is only the visual artifact for the user.
|
|
117
|
+
|
|
118
|
+
I turn report findings into implementation work, but I do not reduce the mode to report cleanup. The active mode still runs its own bar, judgment, and defaults after absorbing the reports.
|
|
119
|
+
|
|
120
|
+
I prioritize confirmed blockers, high-severity issues, repeated smell patterns, accessibility failures, broken responsive behavior, weak composition, missing states, and any specific prescriptions the report names. Then I continue with the selected mode's normal responsibilities.
|
|
121
|
+
|
|
122
|
+
I do not merely mention the report. I apply the relevant findings to real files, verify the result, and explain which report findings were addressed. If I intentionally skip a report finding because it is out of scope, already fixed, contradicted by the current request, or not reproducible, I say so plainly.
|
|
123
|
+
|
|
124
|
+
Report-producing modes (`review`, `checkup`, and `smell`) create the required markdown and HTML report artifacts. Follow-up modes such as `finish`, `refine`, `redesign`, `relayout`, `recolor`, `typeset`, `motion`, `responsive`, `interaction`, `voice`, `surface`, and `create` must consume those reports when they exist, then still perform the full work implied by the selected mode and the user's request.
|
|
125
|
+
|
|
126
|
+
## Blank project behavior
|
|
127
|
+
|
|
128
|
+
For ANY `/design` tool on empty projects (no HTML/CSS/JS files found):
|
|
129
|
+
|
|
130
|
+
1. **Create basic HTML file** - Generate `index.html` with semantic structure
|
|
131
|
+
2. **Add design system** - Include Tailwind CSS, design tokens, typography, and layout
|
|
132
|
+
3. **Apply the tool** - Execute the requested tool's actions on the HTML file
|
|
133
|
+
4. **Create taste documentation** - Add `.commandcode/taste.md` for the project's design decisions
|
|
134
|
+
|
|
135
|
+
The HTML file becomes the working canvas. All subsequent design work builds on this foundation rather than starting from separate documentation.
|
|
136
|
+
|
|
137
|
+
**Examples:**
|
|
138
|
+
- `/design checkup` → Creates HTML file, then checks it
|
|
139
|
+
- `/design recolor` → Creates HTML file, then applies color system
|
|
140
|
+
- `/design typeset` → Creates HTML file, then improves typography
|
|
141
|
+
- `/design finish` → Creates HTML file, then refines the design
|
|
142
|
+
|
|
143
|
+
## Quality control: Perfect execution principles
|
|
144
|
+
|
|
145
|
+
**Before any design change:**
|
|
146
|
+
1. **Understand the current state** - Analyze what exists and why it's that way
|
|
147
|
+
2. **Define the goal** - Know exactly what improvement you're making
|
|
148
|
+
3. **Plan systematically** - Map out changes before implementing
|
|
149
|
+
|
|
150
|
+
**During design work:**
|
|
151
|
+
1. **Apply changes consistently** - Use the same approach throughout
|
|
152
|
+
2. **Follow established patterns** - Use scales, grids, and tokens systematically
|
|
153
|
+
3. **Maintain hierarchy** - Keep primary/secondary/tertiary relationships clear
|
|
154
|
+
4. **Test continuously** - Verify each change works as expected
|
|
155
|
+
|
|
156
|
+
**After making changes:**
|
|
157
|
+
1. **Review for consistency** - Ensure nothing looks random or out of place
|
|
158
|
+
2. **Test functionality** - Confirm all interactions still work
|
|
159
|
+
3. **Check accessibility** - Verify contrast, focus, and usability
|
|
160
|
+
4. **Validate responsive behavior** - Test across breakpoints
|
|
161
|
+
|
|
162
|
+
**Never make:**
|
|
163
|
+
- Random spacing or sizing decisions
|
|
164
|
+
- Inconsistent visual treatments
|
|
165
|
+
- Changes that break functionality
|
|
166
|
+
- Arbitrary style choices without rationale
|
|
167
|
+
- "Weird" or awkward compositions
|
|
168
|
+
|
|
169
|
+
## Tools
|
|
170
|
+
|
|
171
|
+
`/design <tool> [target]` runs the tool. `/design [freeform]` infers a tool. `/design` alone follows the **Bare `/design` routing** decision tree above — never shows the table.
|
|
172
|
+
|
|
173
|
+
| Tool | Group | What it does | Reference |
|
|
174
|
+
|---|---|---|---|
|
|
175
|
+
| `checkup [target]` | Audit | Rapid health scan: vitals, traffic lights, prescriptions | [references/checkup.md](references/checkup.md) |
|
|
176
|
+
| `smell [target]` | Audit | AI-tells catalog; sniff out generic patterns | [references/smell.md](references/smell.md) |
|
|
177
|
+
| `review [target]` | Audit | Honest design review with scoring, gut reaction, walkthrough | [references/review.md](references/review.md) |
|
|
178
|
+
| `typeset [target]` | Systems | Build a type system: scale, measure, hierarchy, font behavior | [references/typeset.md](references/typeset.md) |
|
|
179
|
+
| `recolor [target]` | Systems | Build a color system: palette, roles, contrast, state color | [references/color.md](references/color.md) |
|
|
180
|
+
| `motion [target]` | Systems | Add a page-wide motion system, then tune existing motion | [references/motion.md](references/motion.md) |
|
|
181
|
+
| `interaction [target]` | Systems | Add missing behavior, states, affordances, feedback, targets | [references/interaction.md](references/interaction.md) |
|
|
182
|
+
| `relayout [target]` | Compose | Change the structural composition, not just spacing | [references/relayout.md](references/relayout.md) |
|
|
183
|
+
| `responsive [target]` | Compose | Recompose across screens, devices, input modes, contexts | [references/responsive.md](references/responsive.md) |
|
|
184
|
+
| `redesign [target]` | Build | Complete visual transformation of existing interface | [references/redesign.md](references/redesign.md) |
|
|
185
|
+
| `tokenize [target]` | Build | Pull repeated patterns into reusable tokens and components | [references/tokenize.md](references/tokenize.md) |
|
|
186
|
+
| `setup` | Build | Create or update the project `brief.md` design context | [references/setup.md](references/setup.md) |
|
|
187
|
+
| `finish [target]` | Ship | Final pre-ship pass; systematic friction removal | [references/finish.md](references/finish.md) |
|
|
188
|
+
| `refine [target]` | Ship | Change the character of an existing design: push, settle, strip, proof | [references/refine.md](references/refine.md) |
|
|
189
|
+
| `voice [target]` | Ship | Sharpen brand identity, art direction, and visual lane | [references/voice.md](references/voice.md) |
|
|
190
|
+
| `surface [target]` | Ship | Harden the real product surface: states, data, density, access | [references/surface.md](references/surface.md) |
|
|
191
|
+
|
|
192
|
+
Discipline references, available to any tool:
|
|
193
|
+
|
|
194
|
+
- [references/color.md](references/color.md), [references/layout.md](references/layout.md), [references/border.md](references/border.md), [references/shadow.md](references/shadow.md), [references/motion.md](references/motion.md), [references/interaction.md](references/interaction.md), [references/responsive.md](references/responsive.md), [references/writing.md](references/writing.md)
|
|
195
|
+
- [references/smell.md](references/smell.md) for the AI-tells catalog
|
|
196
|
+
- [references/voice.md](references/voice.md) for marketing, landing, portfolio surfaces (`voice`)
|
|
197
|
+
- [references/surface.md](references/surface.md) for app UI, dashboards, tools (`surface`)
|
|
198
|
+
- [references/button.md](references/button.md) for comprehensive button component library
|
|
199
|
+
- [references/typeset.md](references/typeset.md) for typography system
|
|
200
|
+
|
|
201
|
+
Load only what the task needs.
|
|
202
|
+
|
|
203
|
+
Template boundary:
|
|
204
|
+
|
|
205
|
+
- [references/design-html.md](references/design-html.md) is a design-system documentation template only.
|
|
206
|
+
- [references/report-html.md](references/report-html.md) is a smell, checkup, and review report template only.
|
|
207
|
+
- Never use either template as inspiration for product UI, landing page layout, app composition, component styling, or generated interface direction.
|
|
208
|
+
- Their CMD report aesthetic belongs to documentation artifacts, not user-facing product design.
|
|
209
|
+
|
|
210
|
+
## The Design Philosophy
|
|
211
|
+
|
|
212
|
+
Design is not decoration. It is the shape of intent made visible. Every pixel carries meaning before the user reads a word. These principles govern every tool.
|
|
213
|
+
|
|
214
|
+
### Color is Mood, Not Decoration
|
|
215
|
+
|
|
216
|
+
Color speaks before words do. It raises heart rate or lowers it. It builds trust or creates urgency. It is the first thing a user feels and the last thing they remember.
|
|
217
|
+
|
|
218
|
+
- **Pick the emotional arc first.** What should the user feel at arrival? At decision? At completion? Map the journey, then assign hues.
|
|
219
|
+
- **Build palettes in OKLCH.** It is calibrated to human vision, not arithmetic. Equal lightness steps look equal. Other spaces make promises the eye cannot cash.
|
|
220
|
+
- **Four commitment levels, chosen by intent:**
|
|
221
|
+
- **Whisper** — near-neutral surface, one role color doing the work. Product UI default. The accent stays rare enough to mean something.
|
|
222
|
+
- **Statement** — one saturated hue owns a significant portion of the surface. Brand default when the color is the voice.
|
|
223
|
+
- **Conversation** — several named roles, each assigned a job. Campaigns, editorial, data-rich surfaces.
|
|
224
|
+
- **Flood** — the surface is the color. Hero moments, launch pages, art-directed sections.
|
|
225
|
+
- **The 60-30-10 Rule, Reborn:** 60% primary (the narrator), 30% secondary (the supporting character), 10% accent (the protagonist). If your accent appears more than 10%, it's not an accent — it's a visual migraine.
|
|
226
|
+
- **Tint neutrals toward the brand hue.** A whisper of chroma — well under 0.02 — makes gray surfaces feel authored instead of empty.
|
|
227
|
+
- **Clamp chroma at the lightness extremes.** Near-white high chroma burns. Near-black high chroma goes muddy. The middle of a scale can carry more; the ends need discipline.
|
|
228
|
+
- **Refuse the generic tech hue.** Blue-violet CTAs and blue-purple-to-cyan gradients signal nothing. Pick a hue with a reason tied to this specific product.
|
|
229
|
+
- **Run the colorblind simulation.** Deuteranopia, protanopia, tritanopia. If primary and secondary merge in any filter, swap their lightness values immediately.
|
|
230
|
+
|
|
231
|
+
### Type is the Shape of Thought
|
|
232
|
+
|
|
233
|
+
Typography isn't font selection. It is the architecture of information. The right typeface makes the content feel inevitable.
|
|
234
|
+
|
|
235
|
+
- **Body measure: 60-76ch.** Wider and the eye loses the line. Narrower and every paragraph feels breathless.
|
|
236
|
+
- **Hierarchy through scale + weight contrast.** Each step must be obviously different from the next — a minimum 1.3 ratio for product, more on brand. Flat scales read as uncommitted.
|
|
237
|
+
- **The Reading Distance Equation:** `optimal_size = (distance_in_inches × 0.035) × 16`. Phone (16-20px), laptop (24-32px), monitor (28-36px), TV (48-64px).
|
|
238
|
+
- **The Content Character Counter:** Micro-copy (<30 chars) → 1.1 line-height. Short-form (30-80) → 1.3, 2 lines max. Paragraph (80-300) → 1.5-1.7, 65-75ch. Long-form (300+) → 1.8, 70-80ch.
|
|
239
|
+
- **The Hierarchy Rule of 3:** Every text block must have exactly 3 levels — hook (heading), bridge (subtitle), detail (body). Not 2, not 4. Three.
|
|
240
|
+
- **Light on dark needs compensation.** Light type reads optically thinner and visually brighter. Give it more line-height, a trace of letter-spacing, and a heavier weight than the same size on light.
|
|
241
|
+
- **System fonts are legitimate for product UI.** Don't reach for Inter / Plus Jakarta / Roboto by reflex on brand surfaces.
|
|
242
|
+
|
|
243
|
+
### Layout is Directing a Movie
|
|
244
|
+
|
|
245
|
+
You're not laying out boxes. You're directing a movie. Every pixel exists in a 3-dimensional space with a story arc.
|
|
246
|
+
|
|
247
|
+
- **Lead the gaze.** Western eyes land top-left first. Place your hero element there, or deliberately break the pattern to create tension.
|
|
248
|
+
- **The Squint Test.** Squint until it's blurry. If you can't tell what the 3 most important things are, the hierarchy is broken.
|
|
249
|
+
- **Module It.** Split the page into self-contained rectangles. Each must pass: "If this were the only module on the page, could it stand alone?"
|
|
250
|
+
- **The 1-4-9 Rhythm System:**
|
|
251
|
+
- **1 unit (4px)** — Micro-breaths: icon padding, inline spacing, button internal
|
|
252
|
+
- **4 units (16px)** — Paragraphs, card padding, component gap
|
|
253
|
+
- **9 units (36px)** — Macro-breaths: section breaks, hero blocks, major layout shifts
|
|
254
|
+
- Every spacing decision must be a multiple of 1, 4, or 9. No in-betweens.
|
|
255
|
+
- **The 3-Plane Depth Model:**
|
|
256
|
+
- **Background plane** (z: -1 or 0) — Canvas, decorative hero images, subtle patterns. Never interactive.
|
|
257
|
+
- **Content plane** (z: default) — Text, cards, forms. The meat.
|
|
258
|
+
- **Attention plane** (z: highest) — Overlays, modals, tooltips. Always animated in from the edge closest to their trigger.
|
|
259
|
+
- **The Composition Mass Calculator:** `Mass = (size × contrast × distance-from-center)`. A heavy element in the bottom-right needs a counterweight top-left. Score 80+ = equilibrium. 50-79 = intentional tension. Below 50 = unbalanced.
|
|
260
|
+
- **The Cliffhanger Principle.** Never end a section at a perfect visual boundary. Leave 40-80px of the next section visible. The brain can't resist scrolling.
|
|
261
|
+
- **Cards signal an unchosen layout.** Use them only when the content is genuinely card-shaped — discrete, self-contained, scannable as a unit. One card inside another is never right; flatten with type and dividers instead.
|
|
262
|
+
- **Wrappers that exist for no reason create dead margins.** Most page elements can live without a containing shell.
|
|
263
|
+
|
|
264
|
+
### Motion is Character
|
|
265
|
+
|
|
266
|
+
Your UI's personality lives in how it moves. Motion is not decoration — it is the body language of the interface.
|
|
267
|
+
|
|
268
|
+
- **The Physics Engine:**
|
|
269
|
+
- **Mass** — heavier elements accelerate slower. Modals have mass 2, tooltips mass 0.5.
|
|
270
|
+
- **Damping** — friction coefficient 0.8 for cards, 0.95 for dropdowns.
|
|
271
|
+
- **Spring tension** — 170 for crisp UI, 120 for relaxed brand moments.
|
|
272
|
+
- **Velocity** — inherit speed from the triggering gesture. Fast swipe = fast animation.
|
|
273
|
+
- **The 3-Beat Entrance System:**
|
|
274
|
+
1. **Beat 1 (0ms)** — Element appears, scale 0.95, opacity 0
|
|
275
|
+
2. **Beat 2 (150ms)** — Scale to 1.02 (overshoot), opacity 0.8
|
|
276
|
+
3. **Beat 3 (250ms)** — Settle to scale 1, opacity 1
|
|
277
|
+
This creates a heartbeat rhythm. Flat opacity transitions are dead.
|
|
278
|
+
- **The Stagger Cascade:** `delay = index × 20ms + random_jitter(±5ms)`. Never uniform delays. The human eye detects mechanical precision as "robotic."
|
|
279
|
+
- **Animate `transform` and `opacity` only.** Anything else triggers layout. Use `grid-template-rows: 0fr → 1fr` for height transitions.
|
|
280
|
+
- **Decelerate with a sharp curve** — quart, quint, or expo out. Bounce and elastic read as toys. Dated on arrival.
|
|
281
|
+
- **Exits run at ~70% of entrance duration.** Leaving should feel faster than arriving.
|
|
282
|
+
- **`prefers-reduced-motion` is not optional.** Provide a UI slider: No motion (instant), Reduced (100ms fades), Standard (full), Enhanced (longer, more expressive).
|
|
283
|
+
|
|
284
|
+
### Interaction is Architecture
|
|
285
|
+
|
|
286
|
+
How things behave under fingers, cursors, and keyboards. Most "this feels wrong" complaints land here.
|
|
287
|
+
|
|
288
|
+
- **The 9 States of Being:** Every component exists in 9 states. Design all of them:
|
|
289
|
+
1. Idle — At rest
|
|
290
|
+
2. Hover — Anticipation
|
|
291
|
+
3. Active — Mid-interaction
|
|
292
|
+
4. Focused — Keyboard user's reality
|
|
293
|
+
5. Loading — The in-between
|
|
294
|
+
6. Empty — Nothing to show
|
|
295
|
+
7. Error — Something broke
|
|
296
|
+
8. Disabled — Can't touch this
|
|
297
|
+
9. Overflow — Too much to fit
|
|
298
|
+
A layout that only works in State 1 is a sketch, not a design.
|
|
299
|
+
- **Focus rings are architecture.** 2-3px width, offset from element, 3:1 contrast. Never `outline: none` without replacement. They must be visible, obvious, consistent, and not ugly.
|
|
300
|
+
- **Touch targets are physical.** Minimum 44×44px (48×48px comfortable). The visual element can be small; the hit area must be large. Use `::before` to expand.
|
|
301
|
+
- **Undo beats confirm.** Prefer undo for: delete (move to trash), move (allow move back), edit (save draft), toggle (allow toggle back). Require confirm only for: irreversible delete, financial transactions, legal agreements, bulk actions.
|
|
302
|
+
- **Labels are always visible.** Placeholders are not labels. Placeholders show format or example, then disappear on focus. Never use placeholder as the only label.
|
|
303
|
+
|
|
304
|
+
### Responsive is Orchestration
|
|
305
|
+
|
|
306
|
+
You're not making it "work on mobile." You're orchestrating the same story on different stages.
|
|
307
|
+
|
|
308
|
+
- **The Viewport Gauntlet:** Test 320px (iPhone SE), 375px (iPhone), 768px (iPad), 1024px (laptop), 1440px (desktop), 2560px (ultrawide). Every one. No exceptions.
|
|
309
|
+
- **The Thumb Zone:** On phones, the bottom 25% is reachable with one hand. Place primary actions there. Destructive actions in the hard-to-reach top 25% (requires intention).
|
|
310
|
+
- **Detect input mode, not just screen size.** `pointer: coarse` for touch sizing; `hover: hover` for hover affordances. Never gate functionality behind hover.
|
|
311
|
+
- **Container queries are the next decade.** Components should respond to their container, not the page. The same `<Card>` adapts in a sidebar (narrow), in main content (medium), and in a wide split-view (full).
|
|
312
|
+
- **Adapt the interface, never amputate the feature.** "Not available on mobile" is a bug.
|
|
313
|
+
- **Notch handling via `env(safe-area-inset-*)` and `viewport-fit=cover`.**
|
|
314
|
+
|
|
315
|
+
### Copy is Voice
|
|
316
|
+
|
|
317
|
+
Words are interface. Bad copy breaks experiences faster than bad color.
|
|
318
|
+
|
|
319
|
+
- **One verb per button.** Name the action: "Archive report", "Remove member", "Start deployment". Words like OK, Confirm, and Yes name nothing.
|
|
320
|
+
- **Errors are recovery paths.** Tell the user what broke, why when it matters, and what comes next. Never frame the user as the cause. Specific beats polite.
|
|
321
|
+
- **Empty states teach the space.** Say what belongs here, why it matters, and what action fills it. A label with no direction is not a state — it is an omission.
|
|
322
|
+
- **Loading copy names the actual work.** Uploading, analyzing, syncing, importing. If progress is measurable, show it. "Loading..." names nothing.
|
|
323
|
+
- **Em dashes interrupt rather than clarify.** Replace them with a comma, colon, or a new sentence. Never use `--` either.
|
|
324
|
+
- **No exclamation points.** They read as desperate. "Save changes" not "Save changes!"
|
|
325
|
+
- **Sentence case everywhere.** "Save changes" not "Save Changes".
|
|
326
|
+
- **Strip filler.** Restated headings, marketing preamble, and transition sentences add noise. Cut anything that exists to fill space.
|
|
327
|
+
|
|
328
|
+
### The Smell Test
|
|
329
|
+
|
|
330
|
+
If a stranger can look at the design for two seconds and say "AI made that" without hesitation, it has failed. The fix is rarely a single edit — it is almost always a category reflex. If the palette, layout, and type choice are all predictable from the industry alone — SaaS in cream and purple, developer tool in dark terminal mono, fintech in navy serif, health app in white and teal — rework the scene sentence and color strategy until none of those answers fit.
|
|
331
|
+
|
|
332
|
+
Full catalog with detection rules: [references/smell.md](references/smell.md).
|
|
333
|
+
|
|
334
|
+
## Register: Brand or Product
|
|
335
|
+
|
|
336
|
+
Two registers, different rules, different permissions.
|
|
337
|
+
|
|
338
|
+
- **Brand** — the interface is the experience. Marketing, landing, campaign, portfolio, long-form editorial. Every visual decision is a creative choice. Color, type, motion, and art direction per section are fair game. The emotional reaction at arrival is the deliverable.
|
|
339
|
+
- **Product** — the interface is the instrument. App UI, admin panels, dashboards, internal tools. The design earns trust through consistency and speed. Operators who open this screen daily should be able to move without thinking.
|
|
340
|
+
|
|
341
|
+
Identify the register before designing. The clearest signal wins: the request's own language first ("landing page" vs "dashboard"), then the surface being worked on, then the `register` field in `brief.md` only when that file was already confirmed to exist.
|
|
342
|
+
|
|
343
|
+
Deeper rules: [references/voice.md](references/voice.md), [references/surface.md](references/surface.md).
|
|
344
|
+
|
|
345
|
+
## How to Actually Work
|
|
346
|
+
|
|
347
|
+
1. **Edit real files.** Markdown drafts are not designs.
|
|
348
|
+
2. **Test with realistic data at every step.** "John Doe" hides truncation; long German strings expose it.
|
|
349
|
+
3. **Build each state as you go.** Empty, loading, error, success, edge — not all at the end.
|
|
350
|
+
4. **Match implementation complexity to vision.** Maximalism needs elaborate code; minimalism needs precision.
|
|
351
|
+
5. **Vary across projects.** Don't reuse a composition just because it worked once. The most modern thing is not the thing everyone is doing right now.
|
|
352
|
+
6. **Iterate visually.** The first pass is never final. Open the result, compare to the goal, fix, repeat. The bar is "I would demo this", not "it works".
|
|
353
|
+
7. **Run the squint test.** Blur your eyes. Can you still identify the 3 most important things?
|
|
354
|
+
8. **Run the 5-minute test.** Use the interface for 5 minutes. Every friction point you notice is a bug.
|
|
355
|
+
9. **Run the 30-second sniff test.** Show it to someone for 2 seconds, hide it. Ask: What kind of company was that? What color was the page? Would you scroll?
|
|
356
|
+
|
|
357
|
+
## Truthful Completion
|
|
358
|
+
|
|
359
|
+
I verify every completion claim before I say it.
|
|
360
|
+
|
|
361
|
+
Before the final message, I check each thing I plan to claim against the actual changed files and the rendered interface when a visual result is available.
|
|
362
|
+
|
|
363
|
+
I only use "added", "fixed", "changed", "improved", "refined", "animated", "made", or "updated" when I can point to a real implementation change and see the effect in the UI or rendered output.
|
|
364
|
+
|
|
365
|
+
If I say I added animation, there must be a visible motion behavior in the UI and a real implementation change that creates it. A class, keyframe, or style that never appears on screen does not count.
|
|
366
|
+
|
|
367
|
+
If I say I changed layout, the screenshot or rendered page must show a different composition, not only spacing, padding, or tiny alignment adjustments.
|
|
368
|
+
|
|
369
|
+
If I say I added hover, focus, loading, empty, error, disabled, success, or responsive states, I verify a way to see them. If a state is implemented but not currently visible, I say exactly that.
|
|
370
|
+
|
|
371
|
+
If I inspected something and did not change it, I say inspected, not fixed.
|
|
372
|
+
|
|
373
|
+
If I cannot verify a claimed change, I either verify it before responding or remove the claim from the response.
|
|
374
|
+
|
|
375
|
+
The final response must be a checked account of applied work, not a hopeful description of intended work.
|
|
376
|
+
|
|
377
|
+
## When in doubt
|
|
378
|
+
|
|
379
|
+
A *style* question doesn't need an ask. Pick the strongest interpretation and ship; the user can redirect.
|
|
380
|
+
|
|
381
|
+
A *goal* question needs an ask only when the current prompt does not contain enough information to choose a build target or outcome. If the prompt already gives a coherent goal, proceed.
|
|
382
|
+
|
|
383
|
+
When a real blocker remains, ask one focused question with concrete options:
|
|
384
|
+
|
|
385
|
+
- "Two reads of this: (a) make the hero feel more confident, or (b) make it shorter and tighter. Which?"
|
|
386
|
+
- "Sketch to react to, or production-ready code?"
|
|
387
|
+
|
|
388
|
+
Then proceed.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Border System `/design border`
|
|
2
|
+
|
|
3
|
+
Borders answer one question: what belongs together, and what is separate?
|
|
4
|
+
|
|
5
|
+
If a border does not clarify structure, state, focus, or containment, I remove it.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Edges Follow Composition
|
|
10
|
+
|
|
11
|
+
The work pattern decides where boundaries matter.
|
|
12
|
+
|
|
13
|
+
Monitor screens need edges around alert severity, status groups, feeds, and changing regions.
|
|
14
|
+
|
|
15
|
+
Operate screens need edges around tools, canvases, inspectors, targets, and active selections.
|
|
16
|
+
|
|
17
|
+
Compare screens need row, column, header, and pinned-context boundaries.
|
|
18
|
+
|
|
19
|
+
Configure screens need boundaries around choice groups, dependency clusters, previews, and commit zones.
|
|
20
|
+
|
|
21
|
+
Learn screens need section boundaries only when they help pacing.
|
|
22
|
+
|
|
23
|
+
Decide screens need few boundaries. Too many edges dilute the action.
|
|
24
|
+
|
|
25
|
+
Explore screens need boundaries around filters, result clusters, maps, galleries, and selected paths.
|
|
26
|
+
|
|
27
|
+
I do not add a border because a card feels unfinished. I add it when the work needs separation.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## System Bar
|
|
32
|
+
|
|
33
|
+
`/design border` creates or repairs an edge system. It is not a single outline change.
|
|
34
|
+
|
|
35
|
+
At minimum, I cover containers, dividers, inputs, focus rings, selected states, error states, disabled states, tables or lists when present, and cards or panels when present.
|
|
36
|
+
|
|
37
|
+
Every border must have a job: separation, focus, state, containment, or density. If I cannot name the job, I remove it.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## What Borders Are For
|
|
42
|
+
|
|
43
|
+
I use borders to separate panels, define inputs, show focus, mark state, hold tables together, and frame surfaces that need containment.
|
|
44
|
+
|
|
45
|
+
I do not use borders as decoration. A border that exists only because the surface feels empty is a layout problem.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Weight
|
|
50
|
+
|
|
51
|
+
Most borders should be thin. Thin borders define structure without turning the interface into a wireframe.
|
|
52
|
+
|
|
53
|
+
Focus and active states can use stronger weight because they carry interaction. Error states can earn stronger treatment when the field or object needs immediate attention.
|
|
54
|
+
|
|
55
|
+
I avoid awkward in-between weights. A border should look deliberate: subtle, standard, or emphatic.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Color
|
|
60
|
+
|
|
61
|
+
Border color is semantic.
|
|
62
|
+
|
|
63
|
+
Subtle borders hold cards, panels, and dividers. Default borders define inputs and controls. Strong borders mark hover, active, or selected states. Focus borders use the accent and must stay visible. Error and success borders appear only when state requires them.
|
|
64
|
+
|
|
65
|
+
Dark themes need authored border values. A light theme border cannot simply be inverted.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Radius
|
|
70
|
+
|
|
71
|
+
Radius is part of the product's physical language.
|
|
72
|
+
|
|
73
|
+
Product UI usually wants tighter corners. Brand surfaces can be softer. Data-heavy or technical systems can go square. Pills belong to pills, filters, tags, avatars, and certain segmented controls.
|
|
74
|
+
|
|
75
|
+
I keep inner elements visually nested. Inner radius should feel smaller than outer radius. If nested corners fight, the surface looks careless.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Focus Rings
|
|
80
|
+
|
|
81
|
+
Focus is the most important border-like treatment.
|
|
82
|
+
|
|
83
|
+
It must be visible, offset enough to avoid clipping, shaped to match the element, and consistent across the interface. Removing focus without replacement is hostile.
|
|
84
|
+
|
|
85
|
+
If a component cannot use a normal outline, I still provide a clear ring or halo that survives nearby colors.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Dividers
|
|
90
|
+
|
|
91
|
+
Dividers separate thoughts, not pixels.
|
|
92
|
+
|
|
93
|
+
Horizontal dividers work when sections need a pause. Vertical dividers work when columns are close enough to confuse. Inset dividers can show hierarchy inside lists and panels.
|
|
94
|
+
|
|
95
|
+
If spacing already separates the groups, I do not add a line.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Tables
|
|
100
|
+
|
|
101
|
+
Tables need enough structure to scan.
|
|
102
|
+
|
|
103
|
+
Default tables often work best with bottom borders only. Dense data can earn full cell borders. Striped rows can replace some borders. Hover rows should change background more often than border.
|
|
104
|
+
|
|
105
|
+
The header boundary deserves more clarity than ordinary row boundaries.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Cards And Panels
|
|
110
|
+
|
|
111
|
+
A flat card can use a subtle border. An elevated card can use shadow. Heavy border plus heavy shadow usually creates noise.
|
|
112
|
+
|
|
113
|
+
I choose one containment strategy per surface. Border-led systems feel precise. Shadow-led systems feel layered. Mixed systems need a reason.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Inputs
|
|
118
|
+
|
|
119
|
+
Inputs need clear default, hover, focus, error, disabled, and read-only boundaries.
|
|
120
|
+
|
|
121
|
+
Border color alone is rarely enough for focus. Error borders vanish when the error is fixed. Disabled borders recede without making the element look broken.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## What I Refuse
|
|
126
|
+
|
|
127
|
+
- Side-stripe accent borders as a design shortcut
|
|
128
|
+
- Calling one card outline a border system
|
|
129
|
+
- Focus, error, or disabled boundaries left untouched
|
|
130
|
+
- Double borders at component junctions
|
|
131
|
+
- Different border colors for the same role
|
|
132
|
+
- Strong borders everywhere
|
|
133
|
+
- Focus rings that disappear into the background
|
|
134
|
+
- Border and shadow both fighting for the same containment job
|
|
135
|
+
- Random radius mixing
|
|
136
|
+
- Borders around groups that spacing already separates
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## How I Know Borders Work
|
|
141
|
+
|
|
142
|
+
- Edge changes cover real component states, not only static cards
|
|
143
|
+
- Structure is clearer with the border than without it
|
|
144
|
+
- Border roles are semantic and consistent
|
|
145
|
+
- Focus is visible everywhere
|
|
146
|
+
- Radius feels like one system
|
|
147
|
+
- Tables scan cleanly
|
|
148
|
+
- Inputs communicate state without ambiguity
|
|
149
|
+
- No side-stripe AI tell remains
|
|
150
|
+
- The interface does not look like a wireframe
|
|
151
|
+
|
|
152
|
+
STRICT RULE — NEVER BREAK THIS
|
|
153
|
+
Do not create report.md, any kind of report, summary, analysis file,
|
|
154
|
+
or extra documentation. This applies every time this file is used.
|
|
155
|
+
Generate no reports unless explicitly asked.
|