command-code 1.93.1 → 1.93.3

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/dist/bundled/agent-browser/SKILL.md +73 -0
  3. package/dist/bundled/command-code-knowledge/SKILL.md +68 -0
  4. package/dist/bundled/command-code-knowledge/live-models.ts +284 -0
  5. package/dist/bundled/command-code-knowledge/reference/byok.md +390 -0
  6. package/dist/bundled/command-code-knowledge/reference/custom-agents.md +341 -0
  7. package/dist/bundled/command-code-knowledge/reference/custom-slash-commands.md +423 -0
  8. package/dist/bundled/command-code-knowledge/reference/headless.md +381 -0
  9. package/dist/bundled/command-code-knowledge/reference/hooks.md +1107 -0
  10. package/dist/bundled/command-code-knowledge/reference/mcp.md +648 -0
  11. package/dist/bundled/command-code-knowledge/reference/memory.md +137 -0
  12. package/dist/bundled/command-code-knowledge/reference/models.md +145 -0
  13. package/dist/bundled/command-code-knowledge/reference/permissions.md +486 -0
  14. package/dist/bundled/command-code-knowledge/reference/plan-mode.md +283 -0
  15. package/dist/bundled/command-code-knowledge/reference/plans.md +16 -0
  16. package/dist/bundled/command-code-knowledge/reference/product-help.md +490 -0
  17. package/dist/bundled/command-code-knowledge/reference/sessions.md +377 -0
  18. package/dist/bundled/command-code-knowledge/reference/skills.md +1009 -0
  19. package/dist/bundled/command-code-knowledge/reference/tools.md +522 -0
  20. package/dist/bundled/config/SKILL.md +18 -0
  21. package/dist/bundled/config/references/permissions.md +27 -0
  22. package/dist/bundled/config/references/settings.md +50 -0
  23. package/dist/bundled/design/SKILL.md +448 -0
  24. package/dist/bundled/design/references/accessibility.md +404 -0
  25. package/dist/bundled/design/references/border.md +161 -0
  26. package/dist/bundled/design/references/button.md +192 -0
  27. package/dist/bundled/design/references/checkup.md +164 -0
  28. package/dist/bundled/design/references/color.md +245 -0
  29. package/dist/bundled/design/references/create.md +291 -0
  30. package/dist/bundled/design/references/design-html.md +227 -0
  31. package/dist/bundled/design/references/deslop.md +285 -0
  32. package/dist/bundled/design/references/finish.md +156 -0
  33. package/dist/bundled/design/references/interaction.md +186 -0
  34. package/dist/bundled/design/references/layout.md +216 -0
  35. package/dist/bundled/design/references/media.md +112 -0
  36. package/dist/bundled/design/references/motion.md +237 -0
  37. package/dist/bundled/design/references/redesign.md +197 -0
  38. package/dist/bundled/design/references/refine.md +193 -0
  39. package/dist/bundled/design/references/reflexes.md +132 -0
  40. package/dist/bundled/design/references/relayout.md +207 -0
  41. package/dist/bundled/design/references/report-html.md +235 -0
  42. package/dist/bundled/design/references/responsive.md +233 -0
  43. package/dist/bundled/design/references/review.md +164 -0
  44. package/dist/bundled/design/references/setup.md +119 -0
  45. package/dist/bundled/design/references/severity.md +111 -0
  46. package/dist/bundled/design/references/shadow.md +164 -0
  47. package/dist/bundled/design/references/smell.md +213 -0
  48. package/dist/bundled/design/references/style-3d.md +23 -0
  49. package/dist/bundled/design/references/style-bento.md +21 -0
  50. package/dist/bundled/design/references/style-editorial.md +23 -0
  51. package/dist/bundled/design/references/style-futuristic.md +21 -0
  52. package/dist/bundled/design/references/style-glassmorphism.md +52 -0
  53. package/dist/bundled/design/references/style-maximalism.md +20 -0
  54. package/dist/bundled/design/references/style-minimalism.md +21 -0
  55. package/dist/bundled/design/references/style-neo-brutalism.md +21 -0
  56. package/dist/bundled/design/references/style-retro-futurism.md +21 -0
  57. package/dist/bundled/design/references/style-swiss.md +20 -0
  58. package/dist/bundled/design/references/style.md +77 -0
  59. package/dist/bundled/design/references/surface.md +163 -0
  60. package/dist/bundled/design/references/system.md +73 -0
  61. package/dist/bundled/design/references/typeset.md +210 -0
  62. package/dist/bundled/design/references/variants.md +193 -0
  63. package/dist/bundled/design/references/voice.md +184 -0
  64. package/dist/bundled/design/references/writing.md +174 -0
  65. package/dist/bundled/design/scripts/check/color.mjs +213 -0
  66. package/dist/bundled/design/scripts/check/contrast.mjs +141 -0
  67. package/dist/bundled/design/scripts/check/css.mjs +223 -0
  68. package/dist/bundled/design/scripts/check/named-colors.mjs +152 -0
  69. package/dist/bundled/design/scripts/check/pair.mjs +61 -0
  70. package/dist/bundled/design/scripts/check/preview.mjs +27 -0
  71. package/dist/bundled/design/scripts/check/reflexes.mjs +257 -0
  72. package/dist/bundled/design/scripts/check/sources.mjs +237 -0
  73. package/dist/bundled/design/scripts/check.mjs +165 -0
  74. package/dist/bundled/loop/SKILL.md +16 -0
  75. package/dist/bundled/mod-builder/SKILL.md +135 -0
  76. package/dist/bundled/mod-builder/examples/block-dangerous-commands.ts +41 -0
  77. package/dist/bundled/mod-builder/examples/custom-entry-renderer.ts +32 -0
  78. package/dist/bundled/mod-builder/examples/custom-tool.ts +53 -0
  79. package/dist/bundled/mod-builder/examples/flags-and-options.ts +29 -0
  80. package/dist/bundled/mod-builder/examples/input-shortcuts.ts +41 -0
  81. package/dist/bundled/mod-builder/examples/kitchen-sink.ts +129 -0
  82. package/dist/bundled/mod-builder/examples/lifecycle-hooks.ts +64 -0
  83. package/dist/bundled/mod-builder/examples/model-router.ts +43 -0
  84. package/dist/bundled/mod-builder/examples/observe-events.ts +30 -0
  85. package/dist/bundled/mod-builder/examples/pane-and-buttons.ts +60 -0
  86. package/dist/bundled/mod-builder/examples/pane-form.ts +68 -0
  87. package/dist/bundled/mod-builder/examples/permission-policy.ts +34 -0
  88. package/dist/bundled/mod-builder/examples/redact-secrets.ts +46 -0
  89. package/dist/bundled/mod-builder/examples/slash-command.ts +33 -0
  90. package/dist/bundled/mod-builder/examples/spinner-count.ts +47 -0
  91. package/dist/bundled/mod-builder/examples/stream-filter.ts +70 -0
  92. package/dist/bundled/mod-builder/reference/api.md +140 -0
  93. package/dist/bundled/mod-builder/reference/hooks-and-events.md +347 -0
  94. package/dist/bundled/mod-builder/reference/overview.md +271 -0
  95. package/dist/bundled/mod-builder/reference/packaging.md +187 -0
  96. package/dist/bundled/mod-builder/reference/ui.md +253 -0
  97. package/dist/bundled/mod-builder/reference/verify.md +67 -0
  98. package/dist/bundled/skill-builder/SKILL.md +104 -0
  99. package/dist/cli.mjs +16 -0
  100. package/dist/index.mjs +2 -0
  101. package/package.json +1 -1
  102. package/vsix/commandcode-vscode.vsix +0 -0
@@ -0,0 +1,163 @@
1
+ # Surface `/design surface`
2
+
3
+ Product design serves the work. The user is not here to admire the interface. They are here to finish a task, trust the system, and come back tomorrow without relearning it.
4
+
5
+ The best product UI becomes familiar faster than it becomes impressive.
6
+
7
+ ---
8
+
9
+ ## Discipline files
10
+
11
+ Surface drives the product hardening pass — consult these for correct execution when each dimension comes up, not as separate passes to layer on:
12
+
13
+ - [button.md](button.md) — for correct button states and control hierarchy when hardening interactive elements
14
+ - [interaction.md](interaction.md) — for correct state coverage, keyboard path, and touch targets when auditing component behavior
15
+ - [border.md](border.md) — for correct edge language and surface separation when tightening component boundaries
16
+ - [shadow.md](shadow.md) — for correct elevation decisions when adjusting depth and layering
17
+ - [writing.md](writing.md) — for correct label, error, and empty state copy when hardening operator-facing text
18
+
19
+ ---
20
+
21
+ ## Composition Starts With The Operator's Job
22
+
23
+ I name the operator's task before choosing structure.
24
+
25
+ Monitor: expose status, alerts, trends, and freshness.
26
+
27
+ Operate: keep commands, target objects, and feedback in one working field.
28
+
29
+ Compare: preserve columns, labels, filters, and scan paths.
30
+
31
+ Configure: group settings by consequence and show what will change.
32
+
33
+ Learn: onboard through progressive disclosure without hiding core controls.
34
+
35
+ Decide: surface proof, risk, tradeoffs, and the next safe action.
36
+
37
+ Explore: support search, filter, sort, and reversible browsing.
38
+
39
+ Product composition is not decoration. It is workflow made visible.
40
+
41
+ ---
42
+
43
+ ## Hardening Bar
44
+
45
+ `/design surface` hardens the working surface. It is not a visual polish pass.
46
+
47
+ At minimum, I cover the primary task, real data density, focus path, loading, empty, error, success, disabled, overflow, mobile structure, keyboard use, and copy for recovery where those states apply.
48
+
49
+ If I only changed color, spacing, or type while product states remain missing, the product pass failed.
50
+
51
+ ---
52
+
53
+ ## The Register
54
+
55
+ I use this file for app UIs, dashboards, admin panels, settings, authenticated routes, tools, tables, forms, editors, and operational screens.
56
+
57
+ In product, familiarity can be a feature. Surprise has to earn its place.
58
+
59
+ ---
60
+
61
+ ## What Good Feels Like
62
+
63
+ An experienced operator should open the screen for the eleventh time that day and move without hesitation.
64
+
65
+ Controls stay where they are expected. Labels use the same nouns. Rows keep stable density. Primary actions are obvious. Secondary actions are reachable but not loud.
66
+
67
+ If the user pauses because the UI is clever, I made the wrong trade.
68
+
69
+ ---
70
+
71
+ ## Type
72
+
73
+ I usually pick one strong sans or the system stack. Product labels, tables, settings, and forms do not need display type.
74
+
75
+ Scale stays compressed. Weight, color, and spacing carry hierarchy with size. Dense surfaces can use smaller type when the audience is skilled and the row structure is clear.
76
+
77
+ Numbers align. Tables deserve tabular figures. Metadata deserves restraint.
78
+
79
+ ---
80
+
81
+ ## Color
82
+
83
+ Product color has three jobs.
84
+
85
+ **Chrome** gives the app stable surfaces: page, sidebar, panel, row, input, divider.
86
+
87
+ **State** teaches the user the system vocabulary: selected, dirty, focused, loading, success, warning, error, disabled.
88
+
89
+ **Primary action** gets the strongest accent. If everything is accented, no action is primary.
90
+
91
+ Product starts restrained. A welcome flow or onboarding moment can carry more color. The working surface gets calmer after login.
92
+
93
+ ---
94
+
95
+ ## Components
96
+
97
+ Every interactive component needs its real life, not just its resting state.
98
+
99
+ Default, hover, focus-visible, active, disabled, loading, selected, error, success, empty, overflow. Some components use all of these. Some use fewer. None get to ignore the states they can enter.
100
+
101
+ Same control, same vocabulary. If two save buttons look unrelated, one is wrong.
102
+
103
+ ---
104
+
105
+ ## Density
106
+
107
+ Product surfaces breathe less than marketing. Density is not clutter when the relationships are clear.
108
+
109
+ Rows, panels, filters, toolbars, and tables should fit the work. Power users often need more on screen, not more air. Comfortable and compact modes can be a real feature.
110
+
111
+ ---
112
+
113
+ ## Motion
114
+
115
+ Product motion is short and functional.
116
+
117
+ Hover, press, selection, drawer open, popover close, loading, save confirmation. That is enough. No page-load ceremony. No scrolling performance. No animation that delays the task.
118
+
119
+ ---
120
+
121
+ ## What Product Can Own
122
+
123
+ - System fonts
124
+ - Standard navigation
125
+ - Tables with many rows
126
+ - Predictable sidebars and tabs
127
+ - Keyboard shortcuts
128
+ - Monochrome charts with one emphasized series
129
+ - Dense but organized screens
130
+ - Repetition, when repetition teaches the system
131
+
132
+ ---
133
+
134
+ ## What I Refuse
135
+
136
+ - Display fonts in labels, tables, or form controls
137
+ - Calling visual polish product hardening
138
+ - Leaving real data, error, empty, loading, or overflow states untested
139
+ - Marketing hero motion inside a working app
140
+ - Custom controls that lose native keyboard behavior
141
+ - Modals for long forms that need a route
142
+ - Five gray scales across one product
143
+ - Accent color on cancel, secondary, decorative, and inactive elements
144
+ - Custom scrollbars that make scrolling harder
145
+ - Cleverness where predictability would build trust
146
+
147
+ ---
148
+
149
+ ## How I Know Product UI Works
150
+
151
+ - The surface survives real data and real states
152
+ - The primary task is clear without reading instructions
153
+ - Focus, loading, error, empty, and success states exist
154
+ - A keyboard user can complete the core flow
155
+ - Tables and dense data stay aligned and scannable
156
+ - Mobile layout changes structure rather than hiding work
157
+ - The same pattern means the same thing across screens
158
+ - The interface feels calmer the more often it is used
159
+
160
+ STRICT RULE — NEVER BREAK THIS
161
+ Do not create report.md, any kind of report, summary, analysis file,
162
+ or extra documentation. This applies every time this file is used.
163
+ Generate no reports unless explicitly asked.
@@ -0,0 +1,73 @@
1
+ # Design System: `design-system.md` and `design-system.html`
2
+
3
+ I own two artifacts: `.commandcode/design/design-system.md` (the token spec) and `.commandcode/design/design-system.html` (the visual preview). Every mode that changes color, typography, spacing, or component language writes through this file's rules, not its own copy of them.
4
+
5
+ Extraction, not invention. I write down what the interface actually is, not what a generic system would look like.
6
+
7
+ ---
8
+
9
+ ## What `design-system.md` contains
10
+
11
+ - **Register:** brand or product
12
+ - **Color system:** full palette in OKLCH + hex, semantic roles (background, surface, text, accent, error, success, warning, border), dark/light strategy
13
+ - **Typography:** font families (display, body, mono), scale with rem values (xs → 6xl), weights, line-heights, letter-spacing
14
+ - **Spacing scale:** base unit and named steps
15
+ - **Component tokens:** border radius strategy, shadow levels, focus ring style
16
+ - **Button system:** primary, secondary, ghost, danger variant specs
17
+ - **Motion:** duration scale, easing functions
18
+ - **Anti-references:** what this design must not look or feel like
19
+
20
+ ## What `design-system.html` contains
21
+
22
+ A visual preview — color swatches, type specimens, button variants, component examples — generated using the structure in [references/design-html.md](design-html.md) but populated with the real token values from the current interface and `design-system.md`. Never inherit the template's demo colors or fonts, and never use it as inspiration for product UI. Swatches and specimens read the project's real tokens: link the project stylesheet (or Tailwind build) and use `var(--token)`, rather than redeclaring the values in the preview, so it cannot drift from the code.
23
+
24
+ ---
25
+
26
+ ## STRICT — Tokens must be real, not just documented
27
+
28
+ Writing a color or size into `design-system.md` is not the deliverable. The deliverable is a real, reusable token in the codebase that components actually consume.
29
+
30
+ - Every color, spacing, radius, or type value in `design-system.md` must exist as a real CSS custom property (`:root { --color-primary: oklch(...); }`) or a Tailwind theme entry (`theme.extend.colors`, `theme.extend.spacing`, or a Tailwind v4 `@theme` block) — whichever mechanism the project already uses.
31
+ - Components must reference the token (`var(--color-primary)`, `bg-primary`, `text-[length:--step-2]`), not repeat the literal value. Two components sharing a color by coincidence instead of by shared token is a failure state.
32
+ - I document only tokens real UI consumes. A role no component uses yet (a status color, a disabled state, an unused scale step) is not defined speculatively; it is added with the first component that needs it.
33
+ - In the sections I touched, no raw literals remain in component CSS — gradients, shadows, and overlays included. A one-off value becomes a token or derives from one (`color-mix()`, relative color syntax).
34
+ - If I document a value in `design-system.md` that isn't backed by a real token in the project's CSS or Tailwind config, the work is incomplete. I wire the token before ending the turn — I do not leave it as a documentation-only entry.
35
+ - This rule is not optional and is not satisfied by good intentions in the markdown file. I verify the token exists in the actual stylesheet or Tailwind config before claiming the system is up to date.
36
+ - Scope: the wiring duty covers the sections the calling mode touched. When I create the files and a section outside that scope is still raw literals (e.g. hardcoded type sizes during a recolor), I do not tokenize it — that is out of scope. I document the values that already have tokens and list the rest under **Not yet tokenized** in that section, so a later design pass can address them.
37
+
38
+ ---
39
+
40
+ ## How I update the files
41
+
42
+ I check whether `.commandcode/design/design-system.md` exists.
43
+
44
+ **If it exists** — I overwrite only the section(s) the calling mode touched (color/recolor → color system section only, typeset → typography only, relayout → spacing/component tokens, redesign → every section). I leave the rest untouched.
45
+
46
+ **If it does not exist** — I create both files in the same turn: `design-system.md` (full token spec) and `design-system.html` (visual preview, using `references/design-html.md` as the structural template only, populated with real extracted values). I extract from what currently exists or from what was just built — I do not invent placeholder brand values for sections the calling mode didn't touch.
47
+
48
+ I never ask the user to run a separate command to get these files. They are written as part of the mode that triggered the change.
49
+
50
+ ---
51
+
52
+ ## What I refuse
53
+
54
+ - Inventing token values that aren't grounded in the real interface or the work just done
55
+ - Leaving a documented value without a matching real CSS/Tailwind token
56
+ - Overwriting sections the calling mode didn't touch
57
+ - Creating report.md, a summary, or any documentation file beyond these two artifacts
58
+ - Treating `design-system.html`'s CMD/industrial template aesthetic as inspiration for product UI
59
+
60
+ ## How I know it worked
61
+
62
+ - `design-system.md` reflects the real, current interface — not generic defaults
63
+ - `design-system.html` renders from the project's own stylesheet, not template placeholders or a redeclared copy of the tokens
64
+ - Every documented token has a matching CSS custom property or Tailwind theme entry, and at least one real component references it; out-of-scope raw values are listed under **Not yet tokenized**, not presented as tokens
65
+ - Sections untouched by the calling mode are unchanged
66
+ - No extra report or documentation files were created
67
+
68
+ ---
69
+
70
+ STRICT RULE — NEVER BREAK THIS
71
+ Do not create report.md, any kind of report, summary, analysis file,
72
+ or extra documentation beyond `design-system.md` and `design-system.html`.
73
+ This applies every time this file is used.
@@ -0,0 +1,210 @@
1
+ # Typography: `/design typeset`
2
+
3
+ I use type to make thought visible. Fonts are only one part of it. The real work is rhythm, hierarchy, measure, voice, loading behavior, and the tiny details that make reading feel effortless.
4
+
5
+ Most generic design starts with a default font and a timid scale. I start with the content and the distance from the reader.
6
+
7
+ ---
8
+
9
+ ## Type Follows Composition
10
+
11
+ The work pattern decides how type behaves.
12
+
13
+ Monitor screens need labels, deltas, timestamps, thresholds, and compact hierarchy.
14
+
15
+ Operate screens need tool names, object names, status text, shortcuts, and fast confirmation.
16
+
17
+ Compare screens need aligned numbers, durable headers, scannable row text, and steady labels.
18
+
19
+ Configure screens need field labels, helper text, validation, section titles, and summary language.
20
+
21
+ Learn screens need long-form rhythm, generous measure, clear headings, and progress markers.
22
+
23
+ Decide screens need a strong claim, proof hierarchy, objections, and one action label.
24
+
25
+ Explore screens need search language, filters, tags, result titles, and metadata that can be skimmed.
26
+
27
+ I do not force a marketing type scale onto product work or a product type scale onto brand memory.
28
+
29
+ ---
30
+
31
+ ## System Bar
32
+
33
+ `/design typeset` creates or repairs a type system. It is not a font-size tweak.
34
+
35
+ At minimum, I apply readable body text, a clear heading scale, durable labels, button text, form text, metadata, empty/error/loading copy, line-height, measure, weight contrast, and responsive behavior.
36
+
37
+ If I change fonts, I verify the font is actually loaded or available. A font name in a style value does not count if the browser falls back silently.
38
+
39
+ Changing only the hero headline or one paragraph is not enough unless the user explicitly asked for that one element.
40
+
41
+ ---
42
+
43
+ ## What Type Must Do
44
+
45
+ Type has three jobs.
46
+
47
+ - Make the page understandable at a glance
48
+ - Make the content comfortable to read
49
+ - Give the surface a voice that matches its register
50
+
51
+ If a type choice does not help one of those jobs, I replace it.
52
+
53
+ ---
54
+
55
+ ## Reading Distance
56
+
57
+ I do not assume body text is fine because it is a common size. Phone, laptop, monitor, and TV are different reading situations.
58
+
59
+ Short, close interfaces can run tighter. Large displays and long reading contexts need more size, more line-height, and more controlled measure. Product UI can be dense. Brand display can be loud. Body copy still needs mercy.
60
+
61
+ ---
62
+
63
+ ## Content Length Rules The Measure
64
+
65
+ I match line-height and width to the text itself.
66
+
67
+ Microcopy wants tight leading and fast recognition. Short-form text wants two clean lines at most. Paragraphs want a comfortable measure, usually around the classic readable band. Long-form wants more air, not more decoration.
68
+
69
+ If a paragraph sprawls across the viewport, the layout is asking the reader to do the designer's work.
70
+
71
+ ---
72
+
73
+ ## Font Choice
74
+
75
+ For brand work, I use the physical-object method. I name the brand as a thing I can hold or see: a museum caption, a club flyer, a diner receipt, a technical manual, a ceramic stamp, a field notebook. Then I pick type that belongs to that object.
76
+
77
+ I ask whether the font choice carries any project-specific reason. A font that appears in every second launched product signals nothing — it just means the decision was not made. The brand already owns it, or it was the path of least resistance.
78
+
79
+ That test applies to whatever family is currently over-used. The answer changes over time; the question does not.
80
+
81
+ For product work, a strong system stack or one well-tuned sans is often the best choice. Product type should help operators move fast. It does not need a costume.
82
+
83
+ ---
84
+
85
+ ## Pairing & Font System
86
+
87
+ Add a second family only when it creates real contrast in structure, proportion, texture, or voice.
88
+
89
+ **The non-obvious truth:** One well-chosen font in multiple weights (Regular, Medium, Semibold, Bold + Italics) creates cleaner hierarchy than two competing faces. Only add a second font when you need genuine contrast.
90
+
91
+ **Bad pairing patterns:**
92
+ - Two similar geometric sans (tension without hierarchy)
93
+ - Fonts that compete for the same visual space
94
+ - A third font with no distinct job
95
+ **The pairing check:**
96
+ - Does the display font differ from body in x-height, stroke contrast, or width?
97
+ - Does each family serve a distinct job (headline vs body vs UI)?
98
+ - Would removing one font break the visual system?
99
+ If any answer is no, use one family with stronger weights instead.
100
+
101
+ **Three-font system (when justified):**
102
+ - **Display/Heading:** Bold personality, high contrast (serif, geometric, custom)
103
+ - **Body/Paragraph:** High readability, moderate x-height, comfortable at small sizes (humanist sans, system stack, text serif)
104
+ - **UI/Badge:** Compact, clear at small sizes, tabular numerals (condensed sans, mono, or body with tighter tracking)
105
+ Use three fonts only when each serves a visibly distinct purpose. Most work is better served by two fonts or one strong family.
106
+
107
+ ---
108
+
109
+ ## Hierarchy
110
+
111
+ Each text block needs a clear chain: hook, bridge, detail. More levels create fog. Fewer levels flatten the message.
112
+
113
+ Hierarchy can come from size, weight, color, position, spacing, and casing. Size alone is crude. The best systems combine two or three dimensions and keep the rest quiet.
114
+
115
+ Brand pages can use dramatic jumps. Product surfaces use compressed steps with weight and color doing more of the work.
116
+
117
+ ---
118
+
119
+ ## Dark Surfaces
120
+
121
+ Light type on dark backgrounds needs compensation. It reads thinner in some ways and brighter in others. I give it more line-height, a touch more spacing when needed, and a weight that feels optically correct.
122
+
123
+ I test it with real content, not a perfect headline.
124
+
125
+ ---
126
+
127
+ ## Details I Do Not Skip
128
+
129
+ - Tabular numbers for data, metrics, prices, and aligned values
130
+ - Balanced heading wraps where support exists
131
+ - Better paragraph wraps where support exists
132
+ - Small caps only when the font actually supports them
133
+ - Extra tracking for short all-caps labels
134
+ - No decorative faces for body text
135
+ - No widows, orphaned single words, or ugly rivers in important prose
136
+ - Font loading that avoids obvious layout shift
137
+
138
+ ---
139
+
140
+ ## Type Mechanics
141
+
142
+ The taste above decides what to do. This decides how to write it. I write every fix in the project's own styling system, never a second one alongside it.
143
+
144
+ **Wrapping.** `text-wrap: balance` on headings, `text-wrap: pretty` on descriptions. Both, together, on a heading-plus-subtitle pair. Neither in long-form: browsers ignore `balance` past a few lines, and evening out a whole article wastes space and slows reading. `overflow-wrap: break-word` wherever a long word, URL, or ID could escape its container. `white-space: nowrap` on labels and badges where a break looks broken.
145
+
146
+ **Measure.** 60–75 characters. `65ch` measures it directly, but a rem or pixel cap is equally valid — at a 16px body size the range lands roughly between 560px and 680px, so Tailwind's `max-w-xl` or `max-w-2xl` fit. What matters is that a cap exists and the rendered line length sits in range; I recheck it if the body size changes.
147
+
148
+ **Line-height by role.** Headings near `1.1`, body `1.5`–`1.6`, always unitless so it scales with the font size — `line-height: 24px` does not. Tight leading is for short text: anything that wraps to three or more lines needs at least `1.4`, even in a height-constrained card.
149
+
150
+ **Weight floors.** Below `18px`, stay at weight `400` or heavier. Weights under `300` are display-only at `28px`+; they disappear at text sizes. Long-form body starts near `16px`; UI text can go to `14px` for inputs and menus, `13px` for captions, rarely below `12px`.
151
+
152
+ **Properties over raw tags.** `font-weight: 650`, not `font-variation-settings: "wght" 650`. `font-optical-sizing: auto`, not `"opsz"`. `font-variant-numeric: tabular-nums`, not `font-feature-settings: "tnum" 1`. Properties keep working when a non-variable fallback renders; raw settings silently do nothing. Raw tags are for custom axes (`"GRAD" 80`) and numbered slots (`"ss01"`) that have no property of their own.
153
+
154
+ **Synthesis.** Browsers may fake a weight or style the family does not ship. I load the faces the design actually uses. `font-synthesis: none` goes on only after I have verified that every required bold, italic, small-cap, superscript, and subscript form stays visually distinct across the whole fallback stack — it is not a diagnostic, and it must never erase emphasis. If only one mode is unwanted, I use the longhand.
155
+
156
+ **Truncation.** Single line is `text-overflow: ellipsis` with `overflow: hidden` and `white-space: nowrap`. Multiple lines is `line-clamp`. Truncation hides content, so if the missing text matters, the full value stays reachable in a tooltip or an expanded view.
157
+
158
+ **Underlines.** Pull position and thickness from the font with `text-underline-position: from-font` and `text-decoration-thickness: from-font`, or tune with `text-underline-offset` and `text-decoration-skip-ink`. A dotted underline is the conventional hint that a word carries extra information. Color is the only part of a real underline that animates reliably — anything else, I build the underline as a separate element.
159
+
160
+ **Punctuation.** Copy is stored in natural case and presented with `text-transform`, so a redesign never means rewriting strings. Curly quotes in prose and straight quotes in code. En dash for ranges (`2010–2020`). The single `…` character, not three periods. ` ` to keep `16 px` together, `­` to control where a long word may break. Em dashes stay out of generated UI copy for this project — see [writing.md](writing.md).
161
+
162
+ **Rendering and language.** `-webkit-font-smoothing: antialiased` plus `-moz-osx-font-smoothing: grayscale` once at the root, never per component. `lang` set so the browser picks the right quotes, hyphenation, and pronunciation; `dir` set at the boundary where direction changes. Digit order never reverses in RTL — I wrap mixed-direction values in `<bdi>` rather than fighting the bidi algorithm. A paragraph of three or more lines aligns to its own script's direction; `text-align: start` with correct `lang`/`dir` handles it.
163
+
164
+ **Selection stays on.** `user-select: none` belongs only on a specific draggable or gesture surface where accidental selection demonstrably breaks the interaction — never across application chrome because a button label can be highlighted.
165
+
166
+ **Mobile inputs.** iOS Safari zooms the page when an input's text is under `16px`. Two fixes hold the size differently, so I ask which the design wants rather than choosing silently: size the input up on small screens (`text-base sm:text-sm`), which changes how it looks, or keep `font-size: 16px` and render the intended size with `transform: scale()`, compensating width and line-height so the design is identical everywhere. Details: [responsive.md](responsive.md#ios-safari-input-zoom).
167
+
168
+ ---
169
+
170
+ ## What I Refuse
171
+
172
+ - Choosing the first trendy family that fits the category
173
+ - Calling one headline resize a typography pass
174
+ - Naming a font that is not actually loaded or available
175
+ - A flat scale where everything is almost the same size
176
+ - Body text wider than comfortable reading allows
177
+ - All-caps paragraphs
178
+ - Display fonts in product labels
179
+ - A third font with no distinct job
180
+ - Tiny mobile text to preserve a desktop layout
181
+ - Broken fallback metrics that make text jump
182
+
183
+ ---
184
+
185
+ ## How I Know The Type Is Working
186
+
187
+ - Type changes appear across real content, not only the hero
188
+ - The loaded or available font matches the claimed type choice
189
+ - The primary message reads before the decoration
190
+ - Body text can be read without effort
191
+ - The type voice matches the surface register
192
+ - Numbers align cleanly
193
+ - Headings break with intention
194
+ - The system works with long strings and short labels
195
+ - The page would still feel designed if color disappeared
196
+
197
+ ## Design System Update
198
+
199
+ After all typography changes are complete, update the design-system artifacts following [references/system.md](system.md).
200
+
201
+ - If `.commandcode/design/design-system.md` exists — update only the typography section (font families, scale, weights, line-heights, letter-spacing). Leave color, spacing, and component sections untouched.
202
+ - If it does not exist — create both `.commandcode/design/design-system.md` (full token spec) and `.commandcode/design/design-system.html` (visual preview using `references/design-html.md` as template) by extracting non-typography sections from the current interface — list any of their values that are still raw literals under **Not yet tokenized** rather than wiring them (do not invent new color/spacing/component decisions in a typeset pass).
203
+
204
+ Do this in the same turn. Never ask the user to run a separate command. Every type-scale value written must be backed by a real CSS custom property or Tailwind theme entry that components reference — not a value repeated by coincidence. See `references/system.md` for the strict rule.
205
+
206
+ STRICT RULE — NEVER BREAK THIS
207
+ Do not create report.md, any kind of report, summary, analysis file,
208
+ or extra documentation. This applies every time this file is used.
209
+ Generate no reports unless explicitly asked.
210
+ Exception: `.commandcode/design/design-system.md` and `.commandcode/design/design-system.html` are required design-system artifacts, not reports or extra documentation. The "Design System Update" section above applies to those two files and supersedes this rule for them only.
@@ -0,0 +1,193 @@
1
+ # `/design variants`
2
+
3
+ I make alternative directions of one design, so the user can compare them and pick one. Then I apply the picked variant to the actual design. Every variant solves the same job with the same content, flows, and states. Only the design direction changes.
4
+
5
+ This mode writes files on purpose. The viewer at `.commandcode/variants/index.html` is the deliverable the user asked for, not a mockup or a report. I create no markdown reports.
6
+
7
+ ---
8
+
9
+ ## Step 1: Always ask how many
10
+
11
+ Before I read the project or change any file, I call `ask_user_question` with one question:
12
+
13
+ - Question: "How many variants should I make?"
14
+ - Header: "Variants"
15
+ - Options:
16
+ - "3 variants (Recommended)": three distinct directions, all visible on one screen.
17
+ - "4 variants": four directions, shown two at a time.
18
+
19
+ The user can type another number through Other. I accept 2 to 6. For anything else I ask once more and name the range. I ask every time, even when the prompt already contains a number. I wait for the answer before I continue.
20
+
21
+ ---
22
+
23
+ ## Step 2: Find the design
24
+
25
+ I check whether the project has interface code. I look for `.html`, `.css`, `.js`, `.ts`, `.jsx`, `.tsx`, `.vue`, or `.svelte` files, using the same test as the bare `/design` routing. Files under `.commandcode/` do not count.
26
+
27
+ - **Interface exists:** the target is the design the user named. If no target was given, I pick the main screen from the prompt and the project, and I name it in my reply.
28
+ - **Project is empty:** I build the base design first. I follow [create.md](create.md) to scaffold `index.html` with the design system wired in, then build the interface. That base is the design I make variants of.
29
+
30
+ ---
31
+
32
+ ## Step 3: Pick the directions
33
+
34
+ Each variant gets a different direction from the same brief. I choose them before I write any markup, and I write each one down as a short line: name, premise, and what it changes.
35
+
36
+ Every variant must look totally different from every other variant. Each pair differs on all five of these axes, not just some:
37
+
38
+ - **Composition:** the work pattern and spatial premise. Monitor, operate, compare, configure, learn, decide, or explore. See the composition section in [SKILL.md](../SKILL.md).
39
+ - **Palette:** color mood and the role each color plays. See [color.md](color.md).
40
+ - **Type voice:** typeface pairing, scale, and hierarchy. See [typeset.md](typeset.md).
41
+ - **Edges and depth:** radius, borders, and shadow language. See [border.md](border.md) and [shadow.md](shadow.md).
42
+ - **Controls:** button and control family. See [button.md](button.md).
43
+
44
+ A color swap alone is not a variant. Neither is the same layout with new fonts and radius. If someone could mistake two variants for the same design at a glance, I rework one of them before I ship. I also write down the five choices for each variant, one per axis, and check that no two variants share a choice on any axis.
45
+
46
+ The variants are product designs. They never borrow the look of the `index.html` viewer or of [design-html.md](design-html.md).
47
+
48
+ ---
49
+
50
+ ## Step 4: Build the variant files
51
+
52
+ I do not edit the original design files until the user picks a variant in Step 7. Everything this mode creates lives in `.commandcode/variants/` at the project root. I never write a viewer or variant file to the project root or anywhere else:
53
+
54
+ ```
55
+ .commandcode/variants/
56
+ index.html the comparison viewer
57
+ original.html snapshot of the original, when it is a standalone page
58
+ variant-1.html
59
+ variant-2.html
60
+ ...
61
+ ```
62
+
63
+ If `.commandcode/variants/` already holds files from an earlier run, I move them into `.commandcode/variants/previous/<YYYY-MM-DD-HHMM>/` before I write anything. A run with fewer variants must not leave an old `variant-5.html` beside the new ones, where the viewer or a later "apply variant 5" would pick up a direction from the wrong run.
64
+
65
+ Rules for every variant:
66
+
67
+ - It is a standalone HTML page with its own `<!doctype html>`, viewport meta, styles, and any scripts. It must render with no build step and no dev server.
68
+ - Asset paths are correct from `.commandcode/variants/`. If the variant uses the project's images or fonts, I point at them with relative paths such as `../../assets/logo.svg`, or inline them.
69
+ - If the original is a framework app, I rebuild the screen as a standalone page with the same copy, data, flows, and states. I say in my reply that these are static previews and are not wired into the app.
70
+ - It keeps every state the original has: default, empty, loading, error, and the rest that apply. A variant that drops states is not a valid variant.
71
+ - It uses real content from the original, including the hardest strings and the longest lists. No placeholder copy.
72
+ - It adds no content the original lacks: no new fields, sections, timestamps such as "Last changed", badges or sample records. Only the direction changes, so the applied design in Step 8 carries no invented content either.
73
+ - Its default render shows the default state. Error, empty and loading states stay hidden at rest. Where `hidden` hides them, the variant sets `[hidden] { display: none !important; }`, so a `display` rule cannot reveal them.
74
+ - It works at phone width and at desktop width.
75
+
76
+ If the original is a standalone HTML page, I copy it to `.commandcode/variants/original.html`, so the viewer can link to the original as it was when the variants were made.
77
+
78
+ ---
79
+
80
+ ## Step 5: Build the viewer, index.html
81
+
82
+ `.commandcode/variants/index.html` is a comparison viewer. The whole viewer fits in one screen: the page is exactly `100vh` tall, and the page itself never scrolls. The user sees the variants side by side without scrolling down.
83
+
84
+ ### Look
85
+
86
+ The viewer follows [design-html.md](design-html.md): black `#000` background, `#0a0a0b` panels, `#222226` borders, sharp `0px` corners, corner boxes on each panel, Inter for text, monospace uppercase labels in `#666` such as `// VARIANT 01`. I use that file's header pattern, section container, corner boxes, and secondary button style. That aesthetic belongs to the viewer only, never to the variants inside it.
87
+
88
+ ### Layout
89
+
90
+ The viewport splits into three rows, with no page scroll:
91
+
92
+ 1. **Header**, a compact single row: `// VARIANTS` label, the design name, the variant count, the date, and an "Original" link that opens the original in a new tab.
93
+ 2. **Stage**, filling all remaining height: the variant panels side by side.
94
+ 3. **Footer bar**, a compact single row: the Prev and Next buttons and a page indicator such as `01-02 / 05`.
95
+
96
+ How many panels the stage shows at once:
97
+
98
+ | Variants | On screen at once | Prev / Next |
99
+ |---|---|---|
100
+ | 2 | 2 | Hidden |
101
+ | 3 | 3 | Hidden |
102
+ | 4, 5, 6 | 2 | Shown |
103
+
104
+ When paging shows 2 at a time and the count is odd, the last page shows the final variant in the left slot at the same width. The right slot shows an empty panel labeled `// END`, so panel widths never jump between pages.
105
+
106
+ Below 768px wide, the stage shows one panel at a time and Prev and Next are always shown.
107
+
108
+ ### Each panel
109
+
110
+ - A label row: `// VARIANT 01`, the direction name, and an "Open" link that opens that variant's file in a new tab.
111
+ - One line with the premise: the composition, palette, and type choice.
112
+ - The variant in an `<iframe>` filling the rest of the panel. Iframes keep each variant's CSS isolated.
113
+ - The iframe renders the variant at a 1440px desktop viewport and is scaled down with `transform: scale()` to fit the panel width. Its height is the panel height divided by the scale, so it fills the panel exactly. I measure the iframe's own box with `getBoundingClientRect()` after the label row and premise line lay out, not the whole panel, so no empty band is left under the scaled frame. The variant scrolls inside its iframe. I recompute the scale on window resize. Below 768px I drop the scaling and render the iframe at the panel's real width.
114
+
115
+ ### Navigation
116
+
117
+ - Prev and Next are real `<button>` elements with visible focus, disabled at the first and last page.
118
+ - Left and Right arrow keys also page.
119
+ - Paging swaps which variants are in the panels. The page itself still does not scroll.
120
+
121
+ ### Verify the layout
122
+
123
+ At 1440x900 and at 1280x720, the page has no vertical or horizontal scrollbar, the header and footer are fully visible, and every panel shows its variant.
124
+
125
+ ---
126
+
127
+ ## Step 6: Verify, then open it for the user
128
+
129
+ I check the result before I report:
130
+
131
+ - Every iframe renders content, not a blank frame, at every page of the viewer.
132
+ - Every variant looks totally different from every other one: a different composition, palette, type voice, edges and depth, and control family. If two share any of these, I change one and check again.
133
+ - Each variant still has the original's states and works at phone width when opened on its own.
134
+ - The original design files are unchanged. I check this with `git status` or a file comparison.
135
+
136
+ Then I open the viewer in the user's default browser automatically, without asking. First I resolve the absolute path of `.commandcode/variants/index.html` and build its live link, a `file://` URL such as `file:///Users/ana/shop/.commandcode/variants/index.html`. On WSL the link is the Windows path from `wslpath -w`, as `file:///C:/...`.
137
+
138
+ I open that link with the platform's command, through the shell tool, in the background so it does not block:
139
+
140
+ - macOS: `open "<link>"`
141
+ - Linux: `xdg-open "<link>"`
142
+ - WSL, where `/proc/version` mentions Microsoft: `wslview "<link>"`, or `explorer.exe "<link>"` if `wslview` is missing
143
+ - Windows PowerShell: `Start-Process "<link>"`. In `cmd.exe`: `start "" "<link>"`. The `start ""` form fails in PowerShell, where `start` is `Start-Process` and rejects the empty title.
144
+
145
+ If the open command fails, I say so. The reply still gives the link, so the user can open it themselves.
146
+
147
+ Only claims I checked go in the reply. If I could not verify something, I say so.
148
+
149
+ ---
150
+
151
+ ## Step 7: Ask which variant to apply
152
+
153
+ After the viewer is open, I first send a short message: how many variants I made, the viewer path and its `file://` link, and each variant's name and premise in one line. Then I call `ask_user_question` with one question, so the user can compare in the browser and answer:
154
+
155
+ - Question: "Which variant should I apply to the actual design?"
156
+ - Header: "Pick"
157
+ - Options: one per variant, labeled with its number and direction name, such as "Variant 1: Ledger". The description is its premise in one line.
158
+ - When there are 2 or 3 variants, I add a last option: "Not yet": keep the original and leave the variants to compare.
159
+
160
+ The question takes at most 4 options. With 4 variants, the user types "not yet" through Other. With 5 or 6, the options are variants 1 to 4, and the user types 5, 6, or "not yet" through Other. I wait for the answer before I continue.
161
+
162
+ If the user picks "Not yet" or does not pick a variant, I leave the original design untouched and skip to Step 9. The user can tell me later which one to apply, even in a new session. Then I read the top level of `.commandcode/variants/`, never `previous/`, to find the variant files and their names, and follow Step 8.
163
+
164
+ ---
165
+
166
+ ## Step 8: Apply the picked variant
167
+
168
+ I update the actual design, the files the variants were made from, so it matches the picked variant. The variant file is the reference. I do not copy it over the original blindly:
169
+
170
+ - **Standalone HTML page:** I bring the variant's markup structure, styles, and scripts into the original file. If the original links external CSS or JS files, I update those files instead of inlining everything. I keep the original's file names, IDs, data hooks, form actions, and links that other code or pages depend on.
171
+ - **Framework app:** I rebuild the real components in the picked direction. I keep their data, logic, props, routes, handlers, and state. Only the markup structure and styling change. Design tokens and theme files change where the direction needs it.
172
+ - **Built from scratch in Step 2:** the base design is the original. I apply the variant to it the same way.
173
+
174
+ The applied design keeps every state the original has and works at phone width and desktop width. I leave `.commandcode/variants/` in place, so the user can still compare against the other directions.
175
+
176
+ Then I verify:
177
+
178
+ - The actual design now matches the picked variant in composition, palette, type, edges, and controls.
179
+ - Every state of the original still renders, and nothing that other code depends on was renamed or removed.
180
+ - If the project has a typecheck, lint, or build script, I run it and it passes.
181
+ - I list the changed files with `git status` or a file comparison.
182
+
183
+ ---
184
+
185
+ ## Step 9: Reply
186
+
187
+ The reply is short and checked:
188
+
189
+ - Which variant I applied, or that the user chose not to apply one yet.
190
+ - The files I changed in the actual design.
191
+ - Whether the variants were static previews, if the original is a framework app.
192
+ - What I verified, and anything that did not meet the bar.
193
+ - The next step: `/design finish` polishes the applied design, or `/design review` checks it.