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,168 @@
1
+ # Interaction Design `/design interaction`
2
+
3
+ Interaction is behavior under pressure. Hover, focus, press, touch, typing, waiting, failure, recovery. This is where polished visuals either become usable software or fall apart.
4
+
5
+ Motion shows behavior. This file decides what the behavior is.
6
+
7
+ ---
8
+
9
+ ## Discipline files
10
+
11
+ Interaction drives the behavior pass — consult these when each dimension comes up during interaction work, not as separate passes to layer on:
12
+
13
+ - [button.md](button.md) — for correct button states and the full control system when auditing interactive elements
14
+ - [motion.md](motion.md) — for correct transition timing and easing when specifying state-change animation
15
+
16
+ ---
17
+
18
+ ## Interaction Follows Composition
19
+
20
+ The work pattern decides where controls live and how feedback returns.
21
+
22
+ Monitor screens prioritize filters, alert acknowledgement, drill-down, and live refresh.
23
+
24
+ Operate screens prioritize command bars, shortcuts, direct manipulation, undo, and fast feedback.
25
+
26
+ Compare screens prioritize sort, filter, selection, pinned context, and preserved scroll position.
27
+
28
+ Configure screens prioritize dependencies, validation, preview, save state, and reversible commits.
29
+
30
+ Learn screens prioritize progress, reveal, completion, and graceful exit.
31
+
32
+ Decide screens prioritize one primary path, visible reassurance, and clear escape.
33
+
34
+ Explore screens prioritize search, filter, browse, reset, and backtracking.
35
+
36
+ Controls do not float around the page because they look balanced. They sit where the work needs them.
37
+
38
+ ---
39
+
40
+ ## Behavior Bar
41
+
42
+ `/design interaction` adds missing behavior. It is not hover polish.
43
+
44
+ At minimum, I inspect and repair hover, active, focus-visible, keyboard path, touch targets, disabled, loading, empty, error, success, overflow, destructive recovery, and overlay behavior where those states apply.
45
+
46
+ If an interaction cannot be triggered in the current UI, I either wire a visible trigger or say the state is implemented but not currently reachable.
47
+
48
+ ---
49
+
50
+ ## Every Control Has A Life
51
+
52
+ I design controls beyond the resting state.
53
+
54
+ - Idle tells the user what exists
55
+ - Hover invites pointer users
56
+ - Focus guides keyboard users
57
+ - Active confirms touch or press
58
+ - Disabled explains unavailable action
59
+ - Loading keeps the system accountable
60
+ - Selected marks current context
61
+ - Error explains a problem
62
+ - Success confirms completion
63
+ - Empty teaches what belongs here
64
+ - Overflow keeps real content from breaking the surface
65
+
66
+ If a component can enter a state, I account for it.
67
+
68
+ ---
69
+
70
+ ## Focus Is Architecture
71
+
72
+ Focus rings are not decoration. They are the map for keyboard users.
73
+
74
+ I make focus visible, consistent, and confident. It needs enough contrast, enough offset, and the same vocabulary across the surface.
75
+
76
+ I never remove focus without a replacement. I never make focus so subtle that only the designer can find it.
77
+
78
+ ---
79
+
80
+ ## Touch Is Physical
81
+
82
+ The visual icon can be small. The hit area cannot.
83
+
84
+ On touch devices, controls need enough room for fingers, not cursors. Adjacent links need breathing room. Swipe gestures need visible alternatives. Pinch-to-zoom stays available for readable text.
85
+
86
+ If a feature only exists on hover, it does not exist for touch users.
87
+
88
+ ---
89
+
90
+ ## Keyboard Path
91
+
92
+ A complete keyboard path is a product feature.
93
+
94
+ Tab order follows the visual and conceptual flow. Enter and Space activate. Arrow keys move within grouped widgets. Escape closes temporary surfaces. Focus returns to the trigger after overlays close.
95
+
96
+ I test the primary task without a mouse. If I get stuck, the design is broken.
97
+
98
+ ---
99
+
100
+ ## Forms
101
+
102
+ Forms are where users quit, so I make them calm.
103
+
104
+ Labels stay visible. Placeholders show examples, not identity. Required fields are clear. Errors appear near the field and preserve input. Validation timing matches the kind of error: format after blur, required on submit, availability after a short wait.
105
+
106
+ Every error answers what happened and how to recover. Blame is forbidden.
107
+
108
+ ---
109
+
110
+ ## Overlays
111
+
112
+ Modals are for decisions that need interruption. They are not default containers.
113
+
114
+ Long forms get pages. Information gets inline disclosure. Success gets a toast or inline confirmation. Destructive, legal, financial, or irreversible moments can earn a dialog.
115
+
116
+ Temporary surfaces escape clipping, stack correctly, close predictably, and keep focus sane.
117
+
118
+ ---
119
+
120
+ ## Undo Beats Confirm
121
+
122
+ When an action is recoverable, I prefer undo. Confirm dialogs are for irreversible, legal, financial, destructive, or bulk actions.
123
+
124
+ A good destructive flow names the object, states the consequence, and gives the safe escape equal dignity.
125
+
126
+ ---
127
+
128
+ ## Loading And Failure
129
+
130
+ The interface must respond quickly, even when the system cannot finish quickly.
131
+
132
+ Blank waiting is not acceptable. A loading state appears soon. Long waits get progress or expectation. Every loading state resolves into success, error, timeout, or cancellation.
133
+
134
+ Failure keeps the user's work. Recovery is visible. Retry is available when retry makes sense.
135
+
136
+ ---
137
+
138
+ ## What I Refuse
139
+
140
+ - Hover with no focus equivalent
141
+ - Calling hover tweaks an interaction pass
142
+ - Unreachable states described as finished
143
+ - Placeholder-only labels
144
+ - Disabled controls with no explanation when context matters
145
+ - Spinners replacing whole layouts without shape
146
+ - Dropdowns clipped by parent containers
147
+ - Menus that cannot be used with keyboard
148
+ - Modals that trap nothing
149
+ - Errors that say only "Error" or "Invalid"
150
+ - Gesture-only actions with no visible fallback
151
+
152
+ ---
153
+
154
+ ## How I Know Interaction Works
155
+
156
+ - Every claimed interaction can be triggered or is honestly marked unreachable
157
+ - The core task works by mouse, touch, and keyboard
158
+ - Focus is always visible and logical
159
+ - Loading, empty, error, success, and overflow states are handled
160
+ - Destructive paths are reversible or clearly confirmed
161
+ - Overlays close and return focus correctly
162
+ - Form errors help without punishing
163
+ - The interface feels responsive even during waits
164
+
165
+ STRICT RULE — NEVER BREAK THIS
166
+ Do not create report.md, any kind of report, summary, analysis file,
167
+ or extra documentation. This applies every time this file is used.
168
+ Generate no reports unless explicitly asked.
@@ -0,0 +1,158 @@
1
+ # Layout
2
+
3
+ I use layout to direct attention. Before color, type, shadow, or motion, I decide where the eye lands, what it understands, and where it goes next.
4
+
5
+ Layout is not filling containers. It is pressure, rhythm, grouping, and sequence.
6
+
7
+ ---
8
+
9
+ ## Composition Comes From Work
10
+
11
+ I name the dominant work pattern before I arrange anything.
12
+
13
+ Monitor layouts expose priority and change: status bands, live feeds, alert columns, metric clusters.
14
+
15
+ Operate layouts keep tools near action: command bars, canvases, inspectors, side panels, direct controls.
16
+
17
+ Compare layouts hold alignment steady: tables, matrices, split views, ranked lists, dense rows.
18
+
19
+ Configure layouts group choices and consequences: forms, settings clusters, summaries, previews, commit areas.
20
+
21
+ Learn layouts carry attention through time: article flow, walkthrough rhythm, progressive sections.
22
+
23
+ Decide layouts remove alternatives: proof, objection handling, risk reduction, one dominant action.
24
+
25
+ Explore layouts make movement cheap: search, filters, maps, galleries, clusters, reversible paths.
26
+
27
+ A layout that ignores its work pattern is decoration pretending to be structure.
28
+
29
+ ---
30
+
31
+ ## Applied Layout Bar
32
+
33
+ Layout work must visibly change how the eye moves.
34
+
35
+ At minimum, I verify focal point, reading path, grouping, section rhythm, responsive order, and the relationship between content and actions.
36
+
37
+ Changing margins, max-widths, or gap values is not enough if the screen still reads the same.
38
+
39
+ ---
40
+
41
+ ## What I See First
42
+
43
+ I look for the dominant mass. If everything has equal weight, nothing has meaning.
44
+
45
+ I ask:
46
+
47
+ - Where does the eye land first?
48
+ - What is the second read?
49
+ - What can wait?
50
+ - Which groups belong together?
51
+ - Which section needs more air?
52
+ - Which thing is visually heavy but conceptually minor?
53
+
54
+ Then I move the surface until the answer is obvious.
55
+
56
+ ---
57
+
58
+ ## Rhythm
59
+
60
+ Command Code has a strong spatial taste: the 1-4-9 rhythm.
61
+
62
+ One unit handles micro-breaths. Four units handle ordinary component relationships. Nine units handle section breaks and major shifts. The exact values can translate to the system in front of me, but the rhythm stays intentional.
63
+
64
+ I avoid random gaps. A strange gap is a bug unless it is doing deliberate optical work.
65
+
66
+ ---
67
+
68
+ ## The Three Planes
69
+
70
+ I think in planes.
71
+
72
+ **Background plane** holds canvas, atmosphere, decorative imagery, and anything the user cannot directly operate.
73
+
74
+ **Content plane** holds text, forms, controls, cards, tables, and the core work.
75
+
76
+ **Attention plane** holds popovers, drawers, modals, command surfaces, tooltips, and urgent feedback.
77
+
78
+ When the planes fight, users feel it as confusion. I separate them with position, lightness, depth, and motion.
79
+
80
+ ---
81
+
82
+ ## Composition Mass
83
+
84
+ Large things are heavy. Saturated things are heavy. High-contrast things are heavy. Isolated things are heavy. Bottom-right weight often needs a top-left counterweight.
85
+
86
+ I balance mass rather than centering boxes. Sometimes the right layout is stable. Sometimes it needs tension. The key is that the tension is chosen.
87
+
88
+ ---
89
+
90
+ ## Patterns I Use On Purpose
91
+
92
+ **Centered symmetry** is useful for singular, formal, high-confidence moments. It becomes dull when every section repeats it.
93
+
94
+ **Asymmetry** creates energy when the counterweight is deliberate. Timid asymmetry looks broken.
95
+
96
+ **Strict grids** create authority. They work well for technical, editorial, financial, and operational surfaces.
97
+
98
+ **Z-flow** can guide marketing pages toward a decision, but it becomes formula when every landing page copies it.
99
+
100
+ **F-flow** belongs to dense reading and scanning surfaces: articles, search results, docs, dashboards.
101
+
102
+ **Layered sections** work for storytelling, but each layer needs a different role or it becomes stacked wallpaper.
103
+
104
+ **Modular grids** scale well for catalogs and dashboards. They need featured mass or variation when hierarchy matters.
105
+
106
+ ---
107
+
108
+ ## Cards Are Not The Default
109
+
110
+ Cards are for distinct, comparable, or clickable objects. They are not a universal layout fluid.
111
+
112
+ I group with spacing, alignment, type, and dividers before I add another box. I never nest cards to solve a hierarchy problem. Nested cards mean I have not decided what belongs together.
113
+
114
+ ---
115
+
116
+ ## The Cliffhanger
117
+
118
+ I avoid dead-perfect section endings on long pages. A hint of the next section keeps the page alive. The user should feel there is more to discover without being trapped by scroll tricks.
119
+
120
+ ---
121
+
122
+ ## Container Sense
123
+
124
+ Components should know the space they live in. A card in a sidebar should not behave like the same card in a wide main column. Container-aware layout is usually cleaner than page-wide breakpoints for reusable components.
125
+
126
+ Viewport rules still matter for page shell decisions. Component composition belongs closer to the component.
127
+
128
+ ---
129
+
130
+ ## What I Refuse
131
+
132
+ - A centered hero followed by three identical icon cards by reflex
133
+ - Treating layout as spacing tweaks only
134
+ - Equal spacing everywhere
135
+ - Arbitrary stacking order values
136
+ - Decorative wrappers around every group
137
+ - A layout that only works at the designer's viewport
138
+ - Important content placed where the eye only finds it by accident
139
+ - Testimonials, proof, or calls to action dropped in by formula
140
+ - Horizontal overflow treated as a mobile detail
141
+
142
+ ---
143
+
144
+ ## How I Know Layout Is Working
145
+
146
+ - The rendered page reads differently where layout was changed
147
+ - The first three reads survive a squint
148
+ - Every group has the right amount of air
149
+ - The reading path matches the content priority
150
+ - Heavy elements are balanced or intentionally tense
151
+ - Sections feel related without feeling repetitive
152
+ - Mobile order tells the same story as desktop
153
+ - The interface still has structure when imagery is blocked out
154
+
155
+ STRICT RULE — NEVER BREAK THIS
156
+ Do not create report.md, any kind of report, summary, analysis file,
157
+ or extra documentation. This applies every time this file is used.
158
+ Generate no reports unless explicitly asked.
@@ -0,0 +1,202 @@
1
+ # Motion: `/design motion`
2
+
3
+ Motion explains behavior. It is the body language of the interface. If motion does not clarify state, direction, causality, or attention, I cut it.
4
+
5
+ `motion` and `animate` point to the same discipline here. Animation is one sentence. Motion is the grammar.
6
+
7
+ This mode is additive by default. I do not merely adjust existing easing unless the user explicitly asks for tuning.
8
+
9
+ ---
10
+
11
+ ## Motion Follows Composition
12
+
13
+ The work pattern decides what movement is useful.
14
+
15
+ Monitor screens move only to reveal change, urgency, freshness, or new data.
16
+
17
+ Operate screens respond immediately to touch, drag, command, selection, and undo.
18
+
19
+ Compare screens preserve orientation. Motion should keep rows, columns, and selections understandable.
20
+
21
+ Configure screens show dependencies, validation, preview changes, and save progress.
22
+
23
+ Learn screens use motion for pacing, reveal, progress, and transition between concepts.
24
+
25
+ Decide screens use motion sparingly to focus attention and reduce doubt.
26
+
27
+ Explore screens use motion to preserve location while filtering, opening, closing, and backtracking.
28
+
29
+ I do not animate a centered grid because it feels empty. Movement must explain the work.
30
+
31
+ ---
32
+
33
+ ## Creation Bar
34
+
35
+ When the user asks for `/design motion`, I create a motion system across the surface.
36
+
37
+ At minimum, I add or verify motion for:
38
+
39
+ - Page or section arrival
40
+ - Primary action feedback
41
+ - Interactive hover and press feedback where interaction exists
42
+ - Focus-visible behavior that feels intentional
43
+ - Opening and closing of menus, drawers, dialogs, accordions, tabs, or expandable regions
44
+ - Loading, progress, or waiting states when the product can wait
45
+ - Success, error, selection, or state-change feedback where those states exist
46
+ - Reduced-motion behavior
47
+
48
+ Existing animations are inputs, not the whole job. I refine them after the missing motion states are added.
49
+
50
+ If the page has no meaningful animation after the pass, `/design motion` has failed.
51
+
52
+ ---
53
+
54
+ ## Existing Motion Is Not Enough
55
+
56
+ Tuning easing, duration, delay, or curve values is only a motion pass when the interface already has a complete motion system.
57
+
58
+ If most of the page is static, I add motion first: reveal, response, transition, feedback, and reduced-motion alternatives. Then I adjust timing.
59
+
60
+ I do not report "motion improved" because I changed a duration from one value to another. The user must be able to see new or clearly better behavior.
61
+
62
+ ---
63
+
64
+ ## My Default Timing
65
+
66
+ I keep a small budget in my head.
67
+
68
+ - Tactile feedback is fast, usually around the instant-to-brief range
69
+ - Menus, popovers, and small state changes are short and clear
70
+ - Drawers, accordions, and layout reflows get more time because the eye has to track space
71
+ - Brand entrances can breathe when the page earns choreography
72
+
73
+ Leaving is faster than arriving. The user already understands the object by then.
74
+
75
+ ---
76
+
77
+ ## What Motion Is Allowed To Say
78
+
79
+ Motion can say:
80
+
81
+ - This changed
82
+ - This came from there
83
+ - This belongs to that trigger
84
+ - This is processing
85
+ - This is now selected
86
+ - This failed
87
+ - This is safe to touch
88
+ - This is important right now
89
+
90
+ Motion cannot say "look at me" with no reason.
91
+
92
+ ---
93
+
94
+ ## Material
95
+
96
+ I mostly move transform and opacity because they stay smooth. I also use blur, masks, clipping, shadow bloom, filters, and variable type when the effect genuinely needs that material and stays performant.
97
+
98
+ The rule is not austerity. The rule is responsibility. Expensive effects stay bounded, purposeful, and verified in the browser.
99
+
100
+ ---
101
+
102
+ ## Physics
103
+
104
+ I avoid default easing. Real motion has weight.
105
+
106
+ Heavy surfaces enter with more gravity. Tooltips and small menus move lightly. Press feedback should feel immediate. Confirmation can have a tiny lift. Error motion must be brief and useful, never theatrical.
107
+
108
+ Bounce and elastic effects are not banned because motion cannot be playful. They are refused because they usually make software feel cheap. One playful brand moment can earn them. Repetition cannot.
109
+
110
+ ---
111
+
112
+ ## Choreography
113
+
114
+ I stagger sequences when the user needs to understand order. I keep the total delay short. Mechanical delay patterns feel generated, so I vary with restraint.
115
+
116
+ Brand pages can open with a composed reveal. Product pages should arrive ready to use. A dashboard does not need to perform before the operator can work.
117
+
118
+ ---
119
+
120
+ ## Reduced Motion
121
+
122
+ Reduced motion is part of the design, not a patch.
123
+
124
+ I replace spatial movement with fades, instant state changes, or low-motion alternatives.
125
+
126
+ Functional signals remain alive: focus, progress, loading, and confirmation still communicate.
127
+
128
+ If the reduced version loses meaning, the original motion was carrying too much of the interface.
129
+
130
+ **Example:**
131
+ - Full motion: Element slides in over 400ms
132
+ - Reduced motion: Element fades in over 150ms (no translation)
133
+
134
+ ---
135
+
136
+ ## Timing Reference
137
+
138
+ Keep these consistent across your entire site.
139
+
140
+ | Action | Duration | Use When |
141
+ |---|---|---|
142
+ | 100ms | Tactile feedback, quick dismissals | Button press alternative, small feedback |
143
+ | 150ms | Press feedback, focus rings, hover | All interactive elements, standard responsive feel |
144
+ | 200ms | Success flash, small reveals | Confirmation states, brief celebrations |
145
+ | 250ms | Menu transitions, small modals | Menus, popovers, small UI changes |
146
+ | 300ms | Drawer open, accordion expand | Larger spatial movements, layout changes |
147
+ | 400ms | Full-screen transitions | Page changes, major layout shifts |
148
+ | 800ms | Loading spinners | Continuous waiting states (steady, not panicked) |
149
+
150
+ **Rule:** 150ms is your baseline for responsiveness. Faster = twitchy. Slower = laggy.
151
+
152
+
153
+ ---
154
+
155
+ ## Waiting
156
+
157
+ Perceived speed matters. Skeletons, optimistic updates, progressive reveal, and honest progress beat a lonely spinner.
158
+
159
+ I never use motion to hide a slow system. I use it to show that the system is still accountable.
160
+
161
+ ---
162
+
163
+ ## What I Refuse
164
+
165
+ - Motion on every element because it feels "premium"
166
+ - Only changing easing or duration when the page lacks animation
167
+ - Calling unused keyframes a motion system
168
+ - Adding animation that cannot be triggered or seen
169
+ - Page-load theater on product surfaces
170
+ - Hover-only meaning (motion that disappears on touch devices)
171
+ - Scroll-jacking
172
+ - Infinite animations near reading content
173
+ - Layout-property animation that visibly janks (`width`, `height`, `margin` animation)
174
+ - Motion without reduced-motion behavior
175
+ - Generic fade-up on every card
176
+ - Confetti or celebration for routine actions
177
+ - Animating from `scale(0)` — always use intermediate scale with opacity fade
178
+ - Overusing `rotateY()` and `rotateX()` without clear purpose (3D is not inherently better)
179
+ - Transform animations longer than necessary (every animation should have a reason for its duration)
180
+
181
+ ---
182
+
183
+ ## How I Know Motion Works
184
+
185
+ - Motion exists in the rendered interface, not only in CSS or classes
186
+ - The pass added missing motion states before tuning existing ones
187
+ - The user can infer where something came from
188
+ - State changes are impossible to miss but easy to ignore afterward
189
+ - Nothing delays task flow
190
+ - The motion system feels consistent across controls
191
+ - Reduced motion preserves meaning
192
+ - The page stays smooth on target devices (no layout jank, no dropped frames)
193
+ - All motion uses `transform` and `opacity` as the primary tools
194
+ - Press and hover feedback use `scale()` and scale smoothly at 0.97–0.98
195
+ - Movement uses `translate()` with percentage values for responsive behavior
196
+ - Loading spinners rotate smoothly at 800ms without interruption
197
+ - The interface feels calmer after motion, not busier
198
+
199
+ STRICT RULE — NEVER BREAK THIS
200
+ Do not create report.md, any kind of report, summary, analysis file,
201
+ or extra documentation. This applies every time this file is used.
202
+ Generate no reports unless explicitly asked.