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.
@@ -0,0 +1,192 @@
1
+ # Button Library
2
+
3
+ Buttons are decisions made visible. They tell the user what can happen, what should happen, and what must be handled with care.
4
+
5
+ I treat a button as an interaction contract, not a colored rectangle.
6
+
7
+ ---
8
+
9
+ ## Buttons Inherit The Work Pattern
10
+
11
+ I do not reuse one button family everywhere.
12
+
13
+ Monitor screens need compact controls for filters, acknowledgement, drill-down, and refresh.
14
+
15
+ Operate screens need tool buttons, command buttons, icon buttons, and shortcut-ready actions.
16
+
17
+ Compare screens need table actions, segmented controls, bulk selection, and quiet row commands.
18
+
19
+ Configure screens need save, reset, preview, test, and dependency-aware disabled states.
20
+
21
+ Learn screens need continue, back, skip, complete, and progress-aware actions.
22
+
23
+ Decide screens need one unmistakable primary action and careful secondary escape.
24
+
25
+ Explore screens need search triggers, filters, chips, clear all, and reversible navigation.
26
+
27
+ The button shape follows that job. A centered pill CTA is not a universal answer.
28
+
29
+ ---
30
+
31
+ ## System Bar
32
+
33
+ When an active mode consults this reference, I create or repair the button system. It is not a single CTA restyle.
34
+
35
+ At minimum, I cover primary, secondary, tertiary, danger, icon-only when present, grouped controls when present, loading, disabled, hover, active, focus-visible, success or error resolution when relevant, mobile reach, and accessible names.
36
+
37
+ If only one button exists, I still define how its unavailable, loading, focused, pressed, and completed states behave.
38
+
39
+ ---
40
+
41
+ ## The Hierarchy
42
+
43
+ A screen gets one primary action. If there are two primary buttons, neither is primary.
44
+
45
+ **Primary** is the main action. It gets the strongest visual treatment and the clearest placement.
46
+
47
+ **Secondary** is a valid alternative. It supports the primary without competing.
48
+
49
+ **Tertiary** is low-emphasis. It is for escape, navigation, supporting links, and quiet actions.
50
+
51
+ **Danger** is destructive. It is never styled as the default path unless the whole surface is explicitly about confirming destruction.
52
+
53
+ ---
54
+
55
+ ## Shape And Size
56
+
57
+ Button size follows context.
58
+
59
+ Small buttons belong inside dense product UI, toolbars, tables, and inline actions. Medium buttons carry most product actions. Large buttons belong to mobile primary actions and brand CTAs.
60
+
61
+ Icon-only buttons must keep a real hit target even when the visible icon is small.
62
+
63
+ Radius follows the project. Product UI usually wants modest corners. Brand pages can be rounder. Technical and blocky systems can go square. Pills are for filters, tags, segmented controls, and specific brand languages. I do not mix radius styles casually.
64
+
65
+ ---
66
+
67
+ ## States
68
+
69
+ Every button needs the states it can enter.
70
+
71
+ Resting tells the user the action exists. Hover invites pointer users. Focus-visible guides keyboard users. Pressed confirms contact. Disabled explains that action is unavailable. Loading keeps the system accountable. Error and success resolve the action.
72
+
73
+ A button that only has a resting style is unfinished.
74
+
75
+ ---
76
+
77
+ ## Motion
78
+
79
+ Apply a scale-down effect on button press to signal responsiveness.
80
+
81
+ **Implementation:**
82
+ - On `:active` pseudo-class, scale to 0.97–0.98
83
+ - Transition duration: ~150ms
84
+ - Easing: ease-out
85
+
86
+ A loading button does not freeze. Choose one:
87
+
88
+ - **Spinner icon:** Smooth 360° rotation with a faster-spinning spinner makes the app seem to load faster
89
+ - **Dot pulse:** Three dots fade in sequence (0 → 1 → 0), 400ms per dot, looping
90
+ - **Width breathing:** Button width grows and shrinks 2-3px (200ms cycle) to signal activity
91
+ - **Shimmer:** Subtle left-to-right shimmer across the label (1000ms, one pass per cycle)
92
+
93
+ Pick one approach per design system. Do not combine.
94
+
95
+ ---
96
+
97
+ ## Text
98
+
99
+ Button text names the action.
100
+
101
+ I use one clear verb with an object when needed: save changes, create account, delete project, send invite, continue to payment.
102
+
103
+ I avoid OK, Submit, Click here, vague Learn more, and yes/no labels when the action can be named. No exclamation points. Urgency comes from context, not punctuation.
104
+
105
+ For destructive actions, I name the object and the consequence clearly.
106
+
107
+ ---
108
+
109
+ ## Placement
110
+
111
+ Placement follows the decision structure.
112
+
113
+ In dialogs and forms, the primary action sits where the flow resolves. Secondary actions stay nearby but quieter. Destructive actions move away from the safe path and lose visual dominance.
114
+
115
+ On mobile, primary actions often need full width and reachable placement. Stacked buttons should keep the primary easy to find without making the secondary feel hidden.
116
+
117
+ Toolbars place the strongest action where scanning naturally ends. Repeated toolbar actions keep the same order across screens.
118
+
119
+ ---
120
+
121
+ ## Icons
122
+
123
+ Icons reinforce button text. They do not replace it unless the action is globally familiar and has an accessible name.
124
+
125
+ Icon-only buttons need a clear accessible label and, on pointer devices, a tooltip when the icon can be misunderstood. The hit area remains large enough for touch.
126
+
127
+ Icons must come from the same visual family. A button row with mismatched icon styles feels assembled.
128
+
129
+ ---
130
+
131
+ ## Groups
132
+
133
+ Button groups are for choosing within one dimension: day, week, month; list, grid; light, dark, system.
134
+
135
+ Grouped buttons share edges and state vocabulary. The selected item is obvious. The group does not pretend to be navigation unless it changes the current view.
136
+
137
+ On mobile, a group can stack or become a segmented control, but the active state must remain unmistakable.
138
+
139
+ ---
140
+
141
+ ## Loading
142
+
143
+ A loading button keeps the action anchored. It changes label or indicator so the user knows the system heard them.
144
+
145
+ I disable repeat submission while the action is in flight. I preserve the button's footprint so the layout does not jump. Success resolves briefly. Failure returns control and explains recovery somewhere visible.
146
+
147
+ Long operations can show progress. Routine saves do not need theater.
148
+
149
+ ---
150
+
151
+ ## Danger
152
+
153
+ Danger buttons are serious.
154
+
155
+ Recoverable destructive actions should prefer undo. Irreversible actions need confirmation with clear consequence text. The safe action gets dignity. The destructive action is specific and visually controlled.
156
+
157
+ I never use danger styling for attention. Red is not a marketing accent.
158
+
159
+ ---
160
+
161
+ ## What I Refuse
162
+
163
+ - Multiple primary actions on one decision surface
164
+ - Calling one hero CTA restyle a button system
165
+ - Leaving focus, disabled, loading, or danger states undefined
166
+ - Vague labels like OK, Submit, Yes, or Click here
167
+ - Icon-only buttons without accessible names
168
+ - Tiny hit targets
169
+ - Disabled buttons that look clickable
170
+ - Loading states that collapse the layout
171
+ - Danger as the default path for irreversible actions
172
+ - Mixed radius styles without a system reason
173
+ - Button shadows as default decoration
174
+
175
+ ---
176
+
177
+ ## How I Know Buttons Work
178
+
179
+ - The button system covers real states, not only resting style
180
+ - The main action is unmistakable
181
+ - Button labels say what happens
182
+ - Every reachable state has a visual answer
183
+ - Keyboard focus is visible
184
+ - Touch targets are physically usable
185
+ - Danger actions are recoverable or clearly confirmed
186
+ - Button groups show one clear selection model
187
+ - The same hierarchy means the same thing across the product
188
+
189
+ STRICT RULE — NEVER BREAK THIS
190
+ Do not create report.md, any kind of report, summary, analysis file,
191
+ or extra documentation. This applies every time this file is used.
192
+ Generate no reports unless explicitly asked.
@@ -0,0 +1,160 @@
1
+ # Checkup: `/design checkup`
2
+
3
+ I use checkup for fast design triage. It tells me whether an interface is basically healthy or whether something is unsafe to ship.
4
+
5
+ This is not a deep critique. It is a vital-sign read.
6
+
7
+ ---
8
+
9
+ ## Composition Vital Sign
10
+
11
+ I check whether the page shape matches the work.
12
+
13
+ Monitor: can the user see priority, change, and freshness fast?
14
+
15
+ Operate: are tools, targets, feedback, and undo close enough to use?
16
+
17
+ Compare: do rows, columns, criteria, and filters support scanning?
18
+
19
+ Configure: are choices grouped by dependency and consequence?
20
+
21
+ Learn: does the flow create orientation and progress?
22
+
23
+ Decide: is the next action obvious and supported by proof?
24
+
25
+ Explore: are search, filters, results, and return paths easy?
26
+
27
+ If the composition fails this vital sign, visual polish will not fix the surface.
28
+
29
+ ---
30
+
31
+ ## Prompt Fidelity Vital Sign
32
+
33
+ I check whether the visible design matches the prompt invariants.
34
+
35
+ The name must be exact when supplied. The category must be visible. The core artifact must belong to the domain. The proof must answer the user's pressure. The copy and layout must not reuse language or structure from an unrelated design.
36
+
37
+ If the visible design could be reassigned to another random product by changing only the logo and headline, the checkup fails before style is considered.
38
+
39
+ ---
40
+
41
+ ## Evidence Bar
42
+
43
+ `/design checkup` is a fast read, but it still needs evidence.
44
+
45
+ At minimum, I inspect the rendered surface or actual implementation, touch the core task enough to judge it, and base every vital status on something visible, interactive, or present in files.
46
+
47
+ If I cannot verify a vital, I mark it unknown or unverified. I do not invent health.
48
+
49
+ ---
50
+
51
+ ## What I Check
52
+
53
+ I look at six vital signs.
54
+
55
+ **Intentionality**: Does it look chosen, or does it look assembled from defaults?
56
+
57
+ **Readability**: Can people read it comfortably, in its real contexts and themes?
58
+
59
+ **Usability**: Can the primary task be completed with the available controls?
60
+
61
+ **Responsiveness**: Does the surface adapt across width, input mode, zoom, and safe areas?
62
+
63
+ **Speed**: Does it load and respond without visible hesitation, shift, or jank?
64
+
65
+ **Accessibility**: Can keyboard, screen reader, color-blind, low-vision, and reduced-motion users operate it?
66
+
67
+ When accessibility is weak, the whole checkup is weak. It affects real people, not just a score.
68
+
69
+ ---
70
+
71
+ ## Scoring
72
+
73
+ Checkup uses a `/60` score across the six vital signs. **MAX_SCORE = 60.** Use `/60` as the denominator in the report template — never `/40` or `/10`.
74
+
75
+ Each vital is scored by status:
76
+
77
+ | Status | Points |
78
+ |---|---|
79
+ | Healthy | 10 |
80
+ | Watch | 5 |
81
+ | Critical | 0 |
82
+
83
+ Six vitals × 10 pts max = 60 total. No normalization needed.
84
+
85
+ The heuristics table in the report uses 6 rows (one per vital sign), each scored `/10`.
86
+
87
+ ## My Read
88
+
89
+ I classify each vital as healthy, watch, or critical.
90
+
91
+ Healthy means the surface is fit for continued work. Watch means the issue is real but contained. Critical means it blocks trust, task completion, access, or shipping confidence.
92
+
93
+ I stop pretending everything is equally important. A broken keyboard path outranks a slightly dull palette. Illegible text outranks a missing hover flourish.
94
+
95
+ ---
96
+
97
+ ## Fast Probes
98
+
99
+ I use short probes, not a ceremonial audit.
100
+
101
+ I glance for purpose, primary action, and dominant color. I blur the page mentally and check whether hierarchy survives. I test the thumb path on narrow viewports. I tab through the core route. I look for obvious layout shift, slow media, contrast failure, and generated-design tells.
102
+
103
+ These probes are small on purpose. Checkup is meant to catch danger quickly.
104
+
105
+ ---
106
+
107
+ ## Prescriptions
108
+
109
+ For every critical issue, I write the prescription in my working answer:
110
+
111
+ - What is broken
112
+ - Why it matters
113
+ - What command or design discipline should fix it
114
+
115
+ I do not bury the next move in a report. The user should know the practical fix immediately.
116
+
117
+ ---
118
+
119
+ ## Report Boundary
120
+
121
+ Checkup always produces two report artifacts:
122
+
123
+ - `.commandcode/design/checkup-report.md`
124
+ - `.commandcode/design/checkup-report.html`
125
+
126
+ **Important Rule for Generating HTML Report:**
127
+
128
+ - **Use the following template structure** [report-html.md](report-html.md) to generate `checkup-report.html`:
129
+ - Do not change the visual design. Only fill in the content.
130
+
131
+ These are the only report artifacts checkup creates.
132
+
133
+ ---
134
+
135
+ ## What I Refuse
136
+
137
+ - Treating checkup as a full design review
138
+ - Marking a vital healthy without evidence
139
+ - Inventing checks I did not run
140
+ - Creating extra report artifacts beyond `checkup-report.md` and `checkup-report.html`
141
+ - Calling a surface healthy when keyboard users cannot finish the task
142
+ - Ignoring mobile because desktop looks good
143
+ - Letting performance scores hide visible jank
144
+ - Letting a pretty surface pass with missing states
145
+
146
+ ---
147
+
148
+ ## How I Know Checkup Is Done
149
+
150
+ - Each vital is backed by observed evidence or marked unverified
151
+ - Each vital has a clear status
152
+ - Critical issues have direct prescriptions
153
+ - The core task has been touched, not just inspected visually
154
+ - The user knows whether to proceed, fix, or pause
155
+ - `checkup-report.md` and `checkup-report.html` both exist
156
+
157
+ STRICT RULE — NEVER BREAK THIS
158
+ Always create .commandcode/design/checkup-report.md and
159
+ .commandcode/design/checkup-report.html. Do not create any other report,
160
+ summary, analysis file, or extra documentation.
@@ -0,0 +1,166 @@
1
+ # Color: `/design recolor`
2
+
3
+ I treat color as atmosphere, structure, and promise. A palette is not a bag of nice swatches. It is the emotional weather of the interface, the hierarchy system, and the accessibility contract.
4
+
5
+ I pick color after I know what the surface is trying to make someone feel. Calm is a different palette from urgency. Trust is different from momentum. A brand page can flood the room. A product screen earns restraint.
6
+
7
+ ---
8
+
9
+ ## Pre-execution checklist
10
+
11
+ Before proceeding, check for existing reports in the `.commandcode/design/` directory. Look for these files:
12
+
13
+ - `checkup-report.md`
14
+ - `review-report.md`
15
+ - `smell-report.md`
16
+
17
+ If any of these files exist, read the report content and use it as context for your analysis. Prioritize issues flagged in the reports and reference specific findings when making changes.
18
+
19
+ If no reports are found, proceed with the task normally.
20
+
21
+ ---
22
+
23
+
24
+ ---
25
+
26
+ ## Color Follows Composition
27
+
28
+ The work pattern decides where color is allowed to carry weight.
29
+
30
+ Monitor surfaces reserve strong color for urgency, status, freshness, and thresholds.
31
+
32
+ Operate surfaces use color to separate tools, active objects, selection, and feedback.
33
+
34
+ Compare surfaces keep color stable across rows, columns, legends, and categories.
35
+
36
+ Configure surfaces use color for dependency, validation, preview, and commit risk.
37
+
38
+ Learn surfaces use color for pacing, section memory, progress, and emphasis.
39
+
40
+ Decide surfaces use color to focus proof, action, reassurance, and risk.
41
+
42
+ Explore surfaces use color for category, active filters, map clusters, and reversible paths.
43
+
44
+ I do not spread accent color evenly because the composition feels empty.
45
+
46
+ ---
47
+
48
+ ## System Bar
49
+
50
+ `/design recolor` creates or repairs a color system. It is not an accent swap.
51
+
52
+ At minimum, I define and apply roles for canvas, surface, text, muted text, border, primary action, secondary action, focus, selection, success, warning, error, disabled, and any domain-specific status colors.
53
+
54
+ I verify that real components use the roles: navigation, hero or page header, body content, controls, cards or panels, forms, states, and at least one edge case.
55
+
56
+ Changing one button color, adding a gradient, or darkening the background is not enough unless the user explicitly asked for that one change.
57
+
58
+ ---
59
+
60
+ ## What I Decide First
61
+
62
+ I decide the emotional arc before I decide the hue.
63
+
64
+ - Arrival: what the user feels before reading
65
+ - Decision: what needs the strongest signal
66
+ - Completion: what confirms progress or relief
67
+ - Risk: where danger, loss, or uncertainty appears
68
+ - Rest: where the eye gets to stop working
69
+
70
+ If the palette does not support that arc, the colors are decorative. I replace them.
71
+
72
+ ---
73
+
74
+ ## My Color Space
75
+
76
+ I build fresh palettes in OKLCH. I do this because lightness has to behave visually, not mathematically. Equal lightness moves should look equal. HSL cannot promise that.
77
+
78
+ I keep chroma under control at the extremes. Near-white high chroma fluoresces. Near-black high chroma muddies. The middle of a scale can carry more color; the ends need restraint.
79
+
80
+ I tint neutrals toward the brand hue. Pure gray goes cold next to color. A tiny hue cast makes surfaces feel related without shouting.
81
+
82
+ ---
83
+
84
+ ## Palette Strategies
85
+
86
+ I choose the strategy by intent.
87
+
88
+ **Whisper** means neutrals carry the surface and one accent carries action. Product UI starts here. The accent stays rare enough to mean something.
89
+
90
+ **Statement** means one color owns a large part of the surface. Brand work often belongs here. If the color is the voice, I let it speak.
91
+
92
+ **Conversation** means several named roles, each with a job. Campaigns, editorial systems, and data-rich surfaces can use this. I avoid decorative extras with no role.
93
+
94
+ **Flood** means the surface is the color. Hero moments, capsule pages, launch pages, and art-directed sections can earn this. Product chrome almost never does.
95
+
96
+ ---
97
+
98
+ ## What I Refuse
99
+
100
+ - Indigo or blue-purple because the brief says tech
101
+ - Cyan accent on neutral SaaS because it feels safe
102
+ - Indigo-to-violet gradients on CTAs
103
+ - Color used only because a component needed "visual interest"
104
+ - Calling a one-off accent change a recolor pass
105
+ - Adding decorative gradients without semantic color roles
106
+ - Red and green as the only difference between states
107
+ - Pure black, pure white, or pure gray as a lazy default
108
+ - Accent color spread across everything
109
+ - Dark mode made by inversion
110
+ - Transparency used because the palette is unfinished
111
+
112
+ ---
113
+
114
+ ## Contrast Is Not Optional
115
+
116
+ I check contrast as a design material, not as a late compliance pass.
117
+
118
+ Body text must be comfortably readable. UI components and icons must remain visible. Placeholder text still counts. Text over images needs a stable backing treatment, not hope.
119
+
120
+ I never let color carry meaning alone. State needs shape, label, icon, position, or motion support.
121
+
122
+ ---
123
+
124
+ ## The Grey Test
125
+
126
+ I mentally strip every hue to gray. The hierarchy must survive.
127
+
128
+ If primary, secondary, and accent collapse into the same value, the palette fails for color-blind users and for tired users in bad lighting. I separate lightness before I add more hue.
129
+
130
+ ---
131
+
132
+ ## Dark Mode
133
+
134
+ Dark mode is a second theme. It is not light mode with the lights off.
135
+
136
+ Depth comes from surface lightness, not heavy shadow. Accents lose a little chroma so they do not glow. Borders become subtle light, often with a trace of brand hue. Light text needs careful weight because it reads heavier and brighter than dark text.
137
+
138
+ ---
139
+
140
+ ## Domain Default Trap
141
+
142
+ I ask whether the palette could be guessed from the domain.
143
+
144
+ A legal platform does not have to be navy and serif. A developer tool does not have to be dark with a terminal font. A logistics product does not have to be yellow and utilitarian. A health app does not have to be white and calm blue.
145
+
146
+ If the palette is the first idea anyone would expect, I change the scene sentence before I change the swatches.
147
+
148
+ ---
149
+
150
+ ## How I Know Color Is Working
151
+
152
+ - The palette is applied to real UI, not only declared
153
+ - Semantic roles cover actions, text, surfaces, borders, focus, and states
154
+ - The dominant color is memorable for the right reason
155
+ - The primary action is obvious without being loud everywhere
156
+ - Neutrals feel related to the brand
157
+ - State colors are consistent and learnable
158
+ - The design still reads in grayscale
159
+ - Color blindness simulation keeps primary roles distinct
160
+ - Dark mode feels authored, not inverted
161
+ - The palette does not smell like a generated SaaS template
162
+
163
+ STRICT RULE — NEVER BREAK THIS
164
+ Do not create report.md, any kind of report, summary, analysis file,
165
+ or extra documentation. This applies every time this file is used.
166
+ Generate no reports unless explicitly asked.