codexkit 1.0.2 → 1.0.4

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 (53) hide show
  1. package/.codex/.template-manifest.json +44 -35
  2. package/.codex/.version +1 -1
  3. package/.codex/agents/builder.toml +6 -1
  4. package/.codex/agents/debugger.toml +1 -0
  5. package/.codex/agents/general.toml +6 -1
  6. package/.codex/agents/painter.toml +1 -0
  7. package/.codex/agents/planner.toml +1 -0
  8. package/.codex/agents/refactorer.toml +1 -0
  9. package/.codex/agents/reviewer.toml +1 -0
  10. package/.codex/agents/runner.toml +1 -0
  11. package/.codex/agents/scout.toml +43 -1
  12. package/.codex/agents/shipper.toml +1 -0
  13. package/.codex/agents/vision.toml +1 -0
  14. package/.codex/config.toml +32 -8
  15. package/.codex/mcp/README.md +47 -4
  16. package/.codex/mcp/context7.toml.example +41 -9
  17. package/.codex/mcp/exa.toml.example +35 -2
  18. package/.codex/memory/_templates/project.md +8 -0
  19. package/.codex/memory/_templates/session-context.md +8 -0
  20. package/.codex/memory/_templates/state.md +10 -0
  21. package/.codex/memory/_templates/tech-stack.md +9 -0
  22. package/.codex/memory/_templates/user.md +6 -0
  23. package/.codex/prompts/create.md +63 -26
  24. package/.codex/prompts/init.md +24 -0
  25. package/.codex/prompts/resume.md +6 -0
  26. package/.codex/prompts/search.md +78 -0
  27. package/.codex/prompts/ship.md +36 -25
  28. package/.codex/prompts/start.md +2 -2
  29. package/.codex/prompts/ui-slop-check.md +119 -0
  30. package/.codex/scripts/audit_memory_hygiene.sh +65 -0
  31. package/.codex/scripts/build_startup_brief.sh +15 -0
  32. package/.codex/scripts/start_bead.sh +9 -5
  33. package/.codex/scripts/verify_bead.sh +18 -6
  34. package/.codex/skills/compaction/SKILL.md +76 -125
  35. package/.codex/skills/context-management/SKILL.md +65 -55
  36. package/.codex/skills/frontend-design/SKILL.md +137 -55
  37. package/.codex/skills/frontend-design/references/color-system.md +125 -0
  38. package/.codex/skills/frontend-design/references/interaction.md +115 -0
  39. package/.codex/skills/frontend-design/references/motion-core.md +102 -0
  40. package/.codex/skills/frontend-design/references/responsive-design.md +104 -0
  41. package/.codex/skills/frontend-design/references/spatial-design.md +103 -0
  42. package/.codex/skills/frontend-design/references/typography-rules.md +118 -0
  43. package/.codex/skills/frontend-design/references/ux-writing.md +105 -0
  44. package/.codex/skills/session-management/SKILL.md +12 -5
  45. package/.template-manifest.json +44 -35
  46. package/AGENTS.md +3 -3
  47. package/CHANGELOG.md +44 -0
  48. package/README.md +4 -1
  49. package/bin/codexkit +3 -3
  50. package/install/install-global.sh +93 -52
  51. package/install/install-project.sh +211 -117
  52. package/install/validate.sh +1 -1
  53. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  name: context-management
3
- description: Unified protocol for context health and session lifecycle management using DCP tools, thresholds, handoff, and resume workflows
4
- version: 2.0.0
3
+ description: Unified protocol for context health and session lifecycle management using Codex-native /compact, repo-visible memory files, thresholds, handoff, and resume workflows
4
+ version: 3.0.0
5
5
  tags: [context, workflow, session]
6
6
  dependencies: []
7
7
  ---
8
8
 
9
9
  # Context Management
10
10
 
11
- > **Replaces** manual context tracking and ad-hoc session management — unified protocol for context health across a session lifecycle
11
+ > Unified protocol for context health across a session lifecycle using Codex-native primitives.
12
12
 
13
13
  Use this skill to keep context useful from first turn to final handoff.
14
14
 
@@ -17,7 +17,7 @@ Use this skill to keep context useful from first turn to final handoff.
17
17
  - Context size is growing and you need to reduce noise without losing critical details
18
18
  - You are finishing a work phase and want to compress completed exploration/implementation
19
19
  - You are preparing `/handoff` or resuming a prior session
20
- - You need to recover relevant prior context with `find_sessions`, `read_session`, and memory files
20
+ - You need to recover relevant prior context from repo files or session history
21
21
 
22
22
  ## When NOT to Use
23
23
 
@@ -29,61 +29,69 @@ Use this skill to keep context useful from first turn to final handoff.
29
29
  Prefer **phase-level compression** over reactive cleanup.
30
30
 
31
31
  ```text
32
- compress > sweep > handoff
32
+ /compact > persist to files > handoff
33
33
  ```
34
34
 
35
- - **compress**: Best default when a phase is complete
36
- - **sweep**: Use `/dcp sweep` to clean stale/noisy content after completion
37
- - **handoff**: Use when context pressure remains high even after compression
35
+ - **/compact**: Use the Codex-native command when a phase is complete
36
+ - **persist**: Write durable findings to repo files before they leave the context window
37
+ - **handoff**: Use when context pressure remains high even after compaction
38
38
 
39
- ## DCP Command Usage
39
+ ## Codex-Native Compaction
40
40
 
41
- ### `/dcp compress`
41
+ ### `/compact`
42
42
 
43
- Use for completed chapters of work (research, implementation wave, review sweep).
43
+ The built-in Codex CLI command that summarizes conversation history server-side.
44
+
45
+ Use for completed chapters of work (research, implementation wave, review sweep):
46
+
47
+ ```
48
+ /compact focus on the authentication refactor
49
+ ```
44
50
 
45
51
  - Best for large ranges of now-stable outputs
46
52
  - Lowest cognitive overhead on later turns
53
+ - Accepts optional focus instructions to guide what it preserves
47
54
  - Usually lowest risk of deleting needed details
48
55
 
49
- ### `/dcp sweep`
50
-
51
- Use after a phase is complete to let DCP remove stale/noisy content automatically.
56
+ ### `codex resume`
52
57
 
53
- Good candidates for sweep-driven cleanup:
58
+ Resume a previous Codex session by thread ID:
54
59
 
55
- - wrong-target searches
56
- - failed dead-end exploration no longer needed
57
- - duplicate or superseded junk output
60
+ ```bash
61
+ codex resume
62
+ ```
58
63
 
59
- Do **not** sweep because output is merely "long". Length alone is not noise.
64
+ This restores the session transcript from `~/.codex/sessions/`. Useful for short interruptions where the full session context is still relevant.
60
65
 
61
66
  ## Session Lifecycle Protocol
62
67
 
63
68
  ### 1) Start Session
64
69
 
65
70
  1. Load task spec and essential policy docs only
66
- 2. Check context health (`/dcp context`)
67
- 3. Pull prior work only if needed:
68
- - `find_sessions({ query })`
69
- - `read_session({ session_id, focus })`
70
- - `memory-read({ file })` or `memory-search({ query })`
71
+ 2. Pull prior work only if needed:
72
+ - Read `.codex/context/session-context.md` for the last stop point
73
+ - Read `.codex/memory/project/state.md` for durable state
74
+ - Search repo memory: `bash .codex/scripts/memory_search.sh "query"`
75
+ - Use `codex resume` if continuing from the same thread
71
76
 
72
77
  ### 2) During Active Work
73
78
 
74
79
  - Keep active files readable until edits are done
75
- - At each natural boundary, evaluate compress candidates
76
- - Compress completed phases before starting the next chapter
80
+ - At each natural boundary, evaluate `/compact` candidates
81
+ - Persist durable findings to repo files before compacting
77
82
 
78
83
  ### 3) Pre-Handoff / Closeout
79
84
 
80
- 1. Compress completed phase ranges
81
- 2. Persist key decisions/learnings to memory (observation or memory-update)
82
- 3. Create concise handoff summary (what changed, what is pending, known risks)
85
+ 1. Run `/compact` on completed phase ranges
86
+ 2. Persist key decisions/learnings to durable repo files:
87
+ - `.codex/context/decision-log.md` for architecture decisions
88
+ - `.codex/context/worklog.md` for milestone trail
89
+ - `.codex/memory/project/state.md` for durable state
90
+ 3. Create concise handoff in `.codex/context/session-context.md`
83
91
 
84
92
  ### 4) Resume Session
85
93
 
86
- 1. Rehydrate only relevant context (dont replay everything)
94
+ 1. Rehydrate only relevant context (don't replay everything)
87
95
  2. Validate assumptions against current files/git state
88
96
  3. Continue with fresh context budget, not accumulated clutter
89
97
 
@@ -94,8 +102,8 @@ Use these thresholds as operational triggers:
94
102
  | Threshold | Interpretation | Required Action |
95
103
  | --- | --- | --- |
96
104
  | <50k | Healthy start | Keep inputs minimal, avoid unnecessary reads |
97
- | 50k100k | Moderate growth | Compress completed phases, keep active files intact |
98
- | >100k | High pressure | Aggressively compress by phase; run `/dcp sweep` on stale noise |
105
+ | 50k-100k | Moderate growth | `/compact` completed phases, keep active files intact |
106
+ | >100k | High pressure | Aggressively compact by phase; persist findings to repo files |
99
107
  | >150k | Near capacity | Perform handoff and resume in a fresh session |
100
108
 
101
109
  Secondary guardrails:
@@ -106,23 +114,25 @@ Secondary guardrails:
106
114
 
107
115
  ## Phase Boundary Triggers
108
116
 
109
- Compress at these boundaries:
117
+ Compact at these boundaries:
110
118
 
111
- - Research complete compress exploration + search outputs
112
- - Implementation wave complete compress completed read/edit/test cycles
113
- - Review complete compress raw reviewer outputs, keep synthesized findings
114
- - Before `/handoff` compress everything non-essential since last checkpoint
119
+ - Research complete -> persist findings to `memory/research/`, then `/compact`
120
+ - Implementation wave complete -> `/compact` completed read/edit/test cycles
121
+ - Review complete -> persist synthesized findings, `/compact` raw outputs
122
+ - Before `/handoff` -> compact everything non-essential since last checkpoint
115
123
 
116
- Rule: **Completed phases should not remain uncompressed for long.**
124
+ Rule: **Completed phases should not remain uncompacted for long.**
117
125
 
118
126
  ## Context Transfer Sources (Cross-Session)
119
127
 
120
128
  Use in priority order:
121
129
 
122
- 1. Memory artifacts (`memory-search`, `memory-read`, observations)
123
- 2. Session history (`find_sessions`, `read_session`)
124
- 3. Task tracker state (`br show <id>` when applicable)
125
- 4. Git evidence (`git diff`, `git log`, test output)
130
+ 1. Repo-visible files: `.codex/context/`, `.codex/memory/project/`, `.codex/memory/research/`
131
+ 2. Local retrieval: `bash .codex/scripts/memory_search.sh "query"`
132
+ 3. Codex session history: `codex resume` for thread-based recall
133
+ 4. Task tracker state: `br show <id>` when applicable
134
+ 5. Git evidence: `git diff`, `git log`, test output
135
+ 6. Optional MCP memory: only when repo docs are insufficient (requires MCP setup)
126
136
 
127
137
  Carry forward decisions and constraints, not every intermediate log.
128
138
 
@@ -130,31 +140,31 @@ Carry forward decisions and constraints, not every intermediate log.
130
140
 
131
141
  | Anti-Pattern | Why It Hurts | Correct Pattern |
132
142
  | --- | --- | --- |
133
- | Compressing active work areas (losing precision needed for edits) | Removes exact lines needed for safe edits | Keep active file/tool outputs until edit + verification complete |
134
- | Sweeping content you still need | Forces rework and increases error risk | Keep active files/tool outputs until phase is complete |
135
- | Not compressing completed exploration phases | Bloats context and degrades later turns | Compress immediately at phase completion |
136
- | Session handoff without persisting key decisions to memory | Next session loses rationale and constraints | Write observations/memory updates before handoff |
143
+ | Compacting active work areas | Removes exact lines needed for safe edits | Keep active file/tool outputs until edit + verification complete |
144
+ | Not compacting completed phases | Bloats context and degrades later turns | `/compact` immediately at phase completion |
145
+ | Session handoff without persisting to repo files | Next session loses rationale and constraints | Write to decision-log, state, worklog before handoff |
146
+ | Relying only on session memory for durable facts | Facts are lost when session ends | Persist to `.codex/context/` or `.codex/memory/` |
137
147
 
138
148
  ## Verification
139
149
 
140
- Check context health: are completed phases compressed? Are active files still readable?
150
+ Check context health: are completed phases compacted? Are active files still readable?
141
151
 
142
152
  Before claiming cleanup done, confirm:
143
153
 
144
154
  - Active edit targets are still present in readable form
145
- - Completed phases are compressed or intentionally kept for active work
146
- - No critical decision exists only in transient tool output
147
- - Handoff includes next actions and blockers
155
+ - Completed phases are compacted or intentionally kept for active work
156
+ - No critical decision exists only in transient session output
157
+ - Handoff includes next actions and blockers in repo-visible files
148
158
 
149
159
  ## Quick Playbook
150
160
 
151
161
  ```text
152
- 1) Start turn: /dcp context
162
+ 1) Start: read session-context.md + state.md
153
163
  2) Identify completed phase ranges
154
- 3) /dcp compress completed ranges
155
- 4) /dcp sweep stale/noisy outputs after phase completion
156
- 5) persist key decisions to memory
157
- 6) handoff/resume with focused rehydration
164
+ 3) Persist durable findings to repo files
165
+ 4) /compact completed ranges
166
+ 5) At session end: update session-context.md, state.md, worklog.md
167
+ 6) Resume: /prompts:resume or codex resume
158
168
  ```
159
169
 
160
170
  ## See Also
@@ -1,13 +1,16 @@
1
1
  ---
2
2
  name: frontend-design
3
- description: Create distinctive, production-grade frontend interfaces. Use when building web components, pages, or applications with React-based frameworks. Includes Tailwind CSS v4, shadcn/ui components, Motion animations, and visual design philosophy for avoiding generic AI aesthetics.
4
- version: 1.0.0
3
+ description: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
4
+ version: 1.1.0
5
5
  tags: [ui, design]
6
6
  dependencies: []
7
+ license: Apache 2.0. Inspired by pbakaus/impeccable design language kit and Anthropic's frontend-design skill.
7
8
  ---
8
9
 
9
10
  # Frontend Design
10
11
 
12
+ This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
13
+
11
14
  ## When to Use
12
15
  - Building or refactoring React UI (Next.js, Remix, Vite)
13
16
  - Creating reusable component systems with Tailwind and shadcn/ui
@@ -17,33 +20,146 @@ dependencies: []
17
20
  ## When NOT to Use
18
21
  - Backend-only tasks with no user-facing surface
19
22
 
20
- ## Design Intent First
21
- Define before coding:
22
- 1. Audience and usage context
23
- 2. Visual direction (minimal/editorial/playful/industrial/luxury)
24
- 3. Interaction tone (calm/fast/expressive/utilitarian)
25
- 4. Primary success metric (clarity, conversion, task speed)
23
+ ---
24
+
25
+ ## Design Direction
26
+
27
+ Commit to a BOLD aesthetic direction before coding:
28
+
29
+ 1. **Purpose**: What problem does this interface solve? Who uses it?
30
+ 2. **Tone**: Pick an extreme — brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian. Use these for inspiration but design one true to the aesthetic direction.
31
+ 3. **Constraints**: Technical requirements (framework, performance, accessibility).
32
+ 4. **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
33
+
34
+ **CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work — the key is intentionality, not intensity.
35
+
36
+ ---
37
+
38
+ ## Frontend Aesthetics Guidelines
39
+
40
+ ### Typography
41
+ *Consult [typography reference](references/typography-rules.md) for scales, pairing, and loading strategies.*
42
+
43
+ Choose fonts that are beautiful, unique, and interesting. Pair a distinctive display font with a refined body font.
44
+
45
+ **DO**: Use a modular type scale with fluid sizing (clamp)
46
+ **DO**: Vary font weights and sizes to create clear visual hierarchy
47
+ **DON'T**: Use overused fonts — Inter, Roboto, Arial, Open Sans, system defaults
48
+ **DON'T**: Use monospace typography as lazy shorthand for "technical/developer" vibes
49
+ **DON'T**: Put large icons with rounded corners above every heading — they rarely add value and make sites look templated
50
+
51
+ ### Color & Theme
52
+ *Consult [color reference](references/color-system.md) for OKLCH, palettes, and dark mode.*
53
+
54
+ Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
55
+
56
+ **DO**: Use modern CSS color functions (oklch, color-mix, light-dark) for perceptually uniform, maintainable palettes
57
+ **DO**: Tint your neutrals toward your brand hue — even a subtle hint creates subconscious cohesion
58
+ **DON'T**: Use gray text on colored backgrounds — it looks washed out; use a shade of the background color instead
59
+ **DON'T**: Use pure black (#000) or pure white (#fff) — always tint; pure black/white never appears in nature
60
+ **DON'T**: Use the AI color palette: cyan-on-dark, purple-to-blue gradients, neon accents on dark backgrounds
61
+ **DON'T**: Use gradient text for "impact" — especially on metrics or headings; it's decorative rather than meaningful
62
+ **DON'T**: Default to dark mode with glowing accents — it looks "cool" without requiring actual design decisions
63
+
64
+ ### Layout & Space
65
+ *Consult [spatial reference](references/spatial-design.md) for grids, rhythm, and container queries.*
66
+
67
+ Create visual rhythm through varied spacing. Embrace asymmetry and unexpected compositions. Break the grid intentionally for emphasis.
68
+
69
+ **DO**: Create visual rhythm through varied spacing — tight groupings, generous separations
70
+ **DO**: Use fluid spacing with clamp() that breathes on larger screens
71
+ **DO**: Use asymmetry and unexpected compositions; break the grid intentionally for emphasis
72
+ **DON'T**: Wrap everything in cards — not everything needs a container
73
+ **DON'T**: Nest cards inside cards — visual noise, flatten the hierarchy
74
+ **DON'T**: Use identical card grids — same-sized cards with icon + heading + text, repeated endlessly
75
+ **DON'T**: Use the hero metric layout template — big number, small label, supporting stats, gradient accent
76
+ **DON'T**: Center everything — left-aligned text with asymmetric layouts feels more designed
77
+ **DON'T**: Use the same spacing everywhere — without rhythm, layouts feel monotonous
78
+
79
+ ### Visual Details
80
+ **DO**: Use intentional, purposeful decorative elements that reinforce brand
81
+ **DON'T**: Use glassmorphism everywhere — blur effects, glass cards, glow borders used decoratively rather than purposefully
82
+ **DON'T**: Use rounded elements with thick colored border on one side — a lazy accent that almost never looks intentional
83
+ **DON'T**: Use sparklines as decoration — tiny charts that look sophisticated but convey nothing meaningful
84
+ **DON'T**: Use rounded rectangles with generic drop shadows — safe, forgettable, could be any AI output
85
+ **DON'T**: Use modals unless there's truly no better alternative — modals are lazy
86
+
87
+ ### Motion
88
+ *Consult [motion reference](references/motion-core.md) for timing, easing, and reduced motion.*
89
+
90
+ Focus on high-impact moments: one well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions.
26
91
 
27
- If intent is fuzzy, align first; implementation quality depends on this.
92
+ **DO**: Use motion to convey state changes entrances, exits, feedback
93
+ **DO**: Use exponential easing (ease-out-quart/quint/expo) for natural deceleration
94
+ **DO**: For height animations, use grid-template-rows transitions instead of animating height directly
95
+ **DON'T**: Animate layout properties (width, height, padding, margin) — use transform and opacity only
96
+ **DON'T**: Use bounce or elastic easing — they feel dated and tacky; real objects decelerate smoothly
97
+
98
+ ### Interaction
99
+ *Consult [interaction reference](references/interaction.md) for forms, focus, and loading patterns.*
100
+
101
+ Make interactions feel fast. Use optimistic UI — update immediately, sync later.
102
+
103
+ **DO**: Use progressive disclosure — start simple, reveal sophistication through interaction
104
+ **DO**: Design empty states that teach the interface, not just say "nothing here"
105
+ **DO**: Make every interactive surface feel intentional and responsive
106
+ **DON'T**: Repeat the same information — redundant headers, intros that restate the heading
107
+ **DON'T**: Make every button primary — use ghost buttons, text links, secondary styles; hierarchy matters
108
+
109
+ ### Responsive
110
+ **DO**: Use container queries (@container) for component-level responsiveness
111
+ **DO**: Adapt the interface for different contexts — don't just shrink it
112
+ **DON'T**: Hide critical functionality on mobile — adapt the interface, don't amputate it
113
+
114
+ ### UX Writing
115
+ *Consult [ux-writing reference](references/ux-writing.md) for labels, errors, and empty states.*
116
+
117
+ **DO**: Make every word earn its place
118
+ **DON'T**: Repeat information users can already see
119
+
120
+ ---
121
+
122
+ ## The AI Slop Taxonomy
123
+
124
+ **Critical quality check**: If you showed this interface to someone and said "AI made this," would they believe you immediately? If yes, that's the problem.
125
+
126
+ A distinctive interface should make someone ask "how was this made?" not "which AI made this?"
127
+
128
+ ### 12 AI Fingerprint Anti-Patterns
129
+
130
+ | # | Anti-Pattern | Description | Correction |
131
+ |---|-------------|-------------|------------|
132
+ | 1 | **Inter/Roboto font** | Defaulting to Inter, Roboto, Arial, or Open Sans for everything | Use distinctive fonts: Instrument Sans, Plus Jakarta Sans, Outfit, Fraunces, Newsreader |
133
+ | 2 | **Purple-to-blue gradients** | Cyan-on-dark, purple gradients, neon accents on dark backgrounds — the "AI color palette" | Build an OKLCH palette with tinted neutrals and a single committed brand hue |
134
+ | 3 | **Cards-on-cards** | Nesting cards inside cards, wrapping everything in rounded containers | Use spacing, typography, and subtle dividers; flatten the hierarchy |
135
+ | 4 | **Glassmorphism abuse** | Blur effects, glass cards, glow borders used decoratively everywhere | Use transparency and blur only where it serves a purpose (overlay context) |
136
+ | 5 | **Bounce/elastic easing** | Bounce and elastic animations that feel dated and draw attention to themselves | Use exponential easing (ease-out-quart/quint/expo) for natural deceleration |
137
+ | 6 | **Pure black/white** | Using #000 or #fff without any tinting | Always tint — even oklch with 0.005-0.01 chroma creates natural feel |
138
+ | 7 | **Hero metric template** | Big number, small label, supporting stats, gradient accent — the dashboard cliche | Design unique data presentations that serve the specific content |
139
+ | 8 | **Identical card grids** | Same-sized cards with icon + heading + text, repeated endlessly | Vary card sizes, use featured items, break the repetition |
140
+ | 9 | **Gradient text impact** | Using gradient text on metrics or headings for "impact" | Use weight, size, and color contrast for emphasis instead |
141
+ | 10 | **Gray text on color** | Gray text on colored backgrounds — it looks washed out and dead | Use a darker shade of the background color, or transparency |
142
+ | 11 | **Decorative sparklines** | Tiny charts that look sophisticated but convey nothing meaningful | Only use charts when they communicate real data the user needs |
143
+ | 12 | **Dark mode default** | Defaulting to dark mode with glowing accents to avoid making real design decisions | Design in light mode first; dark mode should be a considered adaptation |
28
144
 
29
145
  ---
30
146
 
31
147
  ## Component Architecture Patterns
32
148
 
33
- ### 1) Primitive Composite Screen
149
+ ### Primitive > Composite > Screen
34
150
  - **Primitives:** Button, Input, Badge, Icon, Stack
35
151
  - **Composites:** SearchBar, FilterPanel, ProductCard
36
152
  - **Screen sections:** Hero, ResultsGrid, CheckoutSummary
37
153
 
38
154
  Keep business logic out of primitives; place behavior in composites/hooks.
39
155
 
40
- ### 2) Headless behavior + visual shells
156
+ ### Headless behavior + visual shells
41
157
  - Encapsulate logic in hooks (`useDialogState`, `useComboboxFilter`)
42
158
  - Keep visual components presentational
43
159
  - Improves portability and testability
44
160
 
45
- ### 3) Composition over prop explosion
46
- Prefer slot/compound APIs over huge prop matrices.
161
+ ### Composition over prop explosion
162
+ Prefer slot/compound APIs over huge prop matrices:
47
163
 
48
164
  ```tsx
49
165
  <Card>
@@ -53,7 +169,7 @@ Prefer slot/compound APIs over huge prop matrices.
53
169
  </Card>
54
170
  ```
55
171
 
56
- ### 4) State locality
172
+ ### State locality
57
173
  - Keep transient UI state local
58
174
  - Lift only shared/derived state
59
175
  - Use URL state for shareable filters/tabs/pagination
@@ -64,7 +180,6 @@ Prefer slot/compound APIs over huge prop matrices.
64
180
 
65
181
  ### Tokenize decisions
66
182
  Use theme tokens for color, spacing, typography, radius, shadow.
67
- Avoid scattered arbitrary values.
68
183
 
69
184
  ```css
70
185
  @theme {
@@ -75,14 +190,13 @@ Avoid scattered arbitrary values.
75
190
  ```
76
191
 
77
192
  ### Deterministic class generation
78
- - Avoid dynamic class strings purge tools cant statically detect
193
+ - Avoid dynamic class strings purge tools can't statically detect
79
194
  - Use `cva`/`clsx` with explicit variant maps
80
195
 
81
196
  ### Layout discipline
82
197
  - Grid for page-level structure
83
198
  - Flex for one-dimensional alignment
84
199
  - Consistent spacing scale (`gap-*`, `space-y-*`)
85
- - Avoid one-off dimensions unless design requires them
86
200
 
87
201
  ### Dark mode parity
88
202
  Every themed component must preserve hierarchy and contrast in dark mode.
@@ -91,19 +205,14 @@ Every themed component must preserve hierarchy and contrast in dark mode.
91
205
 
92
206
  ## Responsive Design Checklist
93
207
  - [ ] Mobile-first base styles
94
- - [ ] Progressive breakpoints (`sm`→`2xl`)
95
- - [ ] Touch targets at least 44×44px
208
+ - [ ] Progressive breakpoints (`sm` > `2xl`)
209
+ - [ ] Touch targets at least 44x44px
96
210
  - [ ] Navigation works without hover
97
211
  - [ ] Dense tables reflow for narrow screens
98
212
  - [ ] Long text wraps without clipping
99
213
  - [ ] Safe-area support where relevant
100
214
  - [ ] Container queries for component-level adaptation
101
215
 
102
- Practical defaults:
103
- - Collapse multi-column layouts below `md`
104
- - Convert large tables to cards on small screens
105
- - Keep primary CTA visible early in scroll
106
-
107
216
  ---
108
217
 
109
218
  ## Accessibility Requirements
@@ -130,39 +239,11 @@ Practical defaults:
130
239
 
131
240
  ---
132
241
 
133
- ## Animation Guidelines
134
-
135
- ### Motion hierarchy
136
- 1. Micro-interactions: 120–180ms
137
- 2. State transitions: 180–260ms
138
- 3. Section/page transitions: 220–320ms
139
-
140
- ### Tool selection
141
- - Tailwind transitions for simple state feedback
142
- - Motion for layout, gestures, enter/exit choreography
242
+ ## Implementation Principles
143
243
 
144
- ```tsx
145
- <motion.div
146
- initial={{ opacity: 0, y: 8 }}
147
- animate={{ opacity: 1, y: 0 }}
148
- exit={{ opacity: 0, y: -6 }}
149
- transition={{ duration: 0.22 }}
150
- />
151
- ```
152
-
153
- ### Performance rules
154
- - Prefer transform/opacity animations
155
- - Avoid expensive paint/layout animations on large surfaces
156
- - Test on low-end devices for jank
157
-
158
- ---
244
+ Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details.
159
245
 
160
- ## Common UI Anti-Patterns
161
- - Generic gradient-heavy hero with weak hierarchy
162
- - Inconsistent spacing/radius across components
163
- - Too many accent colors without semantic mapping
164
- - Decorative animation that slows core tasks
165
- - Copied components with drifted behavior/naming
246
+ Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices across generations.
166
247
 
167
248
  ## Pre-Ship QA Pass
168
249
  1. Visual check at mobile/tablet/desktop widths
@@ -171,6 +252,7 @@ Practical defaults:
171
252
  4. Reduced-motion behavior pass
172
253
  5. Empty/loading/error state pass
173
254
  6. Performance smoke for interaction smoothness
255
+ 7. **AI Slop check** — run through the 12 anti-patterns above
174
256
 
175
257
  ## Bottom Line
176
258
  Build interfaces with clear intent, strong visual character, accessible interaction, and production-grade responsiveness/performance from the first iteration.
@@ -0,0 +1,125 @@
1
+ # Color System
2
+
3
+ > Reference for the `frontend-design` skill. Covers OKLCH-first color pipeline, tinted neutrals, dark mode, and accessibility.
4
+ > Adapted from [pbakaus/impeccable](https://github.com/pbakaus/impeccable) (Apache 2.0).
5
+
6
+ ## Color Spaces: Use OKLCH
7
+
8
+ **Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal. In HSL, 50% lightness in yellow looks bright while 50% in blue looks dark.
9
+
10
+ ```css
11
+ /* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */
12
+ --color-primary: oklch(60% 0.15 250); /* Blue */
13
+ --color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */
14
+ --color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */
15
+ ```
16
+
17
+ **Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish.
18
+
19
+ ## Tinted Neutrals
20
+
21
+ **Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals:
22
+
23
+ ```css
24
+ /* Dead grays */
25
+ --gray-100: oklch(95% 0 0); /* No personality */
26
+ --gray-900: oklch(15% 0 0);
27
+
28
+ /* Warm-tinted grays (add brand warmth) */
29
+ --gray-100: oklch(95% 0.01 60);
30
+ --gray-900: oklch(15% 0.01 60);
31
+
32
+ /* Cool-tinted grays (tech, professional) */
33
+ --gray-100: oklch(95% 0.01 250);
34
+ --gray-900: oklch(15% 0.01 250);
35
+ ```
36
+
37
+ The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI.
38
+
39
+ ## Palette Structure
40
+
41
+ A complete system needs:
42
+
43
+ | Role | Purpose | Example |
44
+ |------|---------|---------|
45
+ | **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
46
+ | **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
47
+ | **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
48
+ | **Surface** | Cards, modals, overlays | 2-3 elevation levels |
49
+
50
+ **Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color.
51
+
52
+ ## The 60-30-10 Rule
53
+
54
+ This rule is about **visual weight**, not pixel count:
55
+
56
+ - **60%**: Neutral backgrounds, white space, base surfaces
57
+ - **30%**: Secondary colors — text, borders, inactive states
58
+ - **10%**: Accent — CTAs, highlights, focus states
59
+
60
+ The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare.
61
+
62
+ ## Contrast & Accessibility
63
+
64
+ | Content Type | AA Minimum | AAA Target |
65
+ |--------------|------------|------------|
66
+ | Body text | 4.5:1 | 7:1 |
67
+ | Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
68
+ | UI components, icons | 3:1 | 4.5:1 |
69
+ | Non-essential decorations | None | None |
70
+
71
+ **Gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere usually fails WCAG.
72
+
73
+ ### Dangerous Color Combinations
74
+
75
+ - Light gray text on white (the #1 accessibility fail)
76
+ - **Gray text on any colored background** — gray looks washed out on color; use a darker shade of the background color or transparency instead
77
+ - Red text on green background (or vice versa) — 8% of men can't distinguish these
78
+ - Blue text on red background (vibrates visually)
79
+ - Yellow text on white (almost always fails)
80
+ - Thin light text on images (unpredictable contrast)
81
+
82
+ ### Never Use Pure Gray or Pure Black
83
+
84
+ Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature. Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted.
85
+
86
+ ### Testing
87
+
88
+ - [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
89
+ - Browser DevTools: Rendering > Emulate vision deficiencies
90
+ - [Polypane](https://polypane.app/) for real-time testing
91
+
92
+ ## Dark Mode
93
+
94
+ ### Dark Mode Is Not Inverted Light Mode
95
+
96
+ | Light Mode | Dark Mode |
97
+ |------------|-----------|
98
+ | Shadows for depth | Lighter surfaces for depth (no shadows) |
99
+ | Dark text on light | Light text on dark (reduce font weight) |
100
+ | Vibrant accents | Desaturate accents slightly |
101
+ | White backgrounds | Never pure black — use dark gray (oklch 12-18%) |
102
+
103
+ ```css
104
+ /* Dark mode depth via surface color, not shadow */
105
+ :root[data-theme="dark"] {
106
+ --surface-1: oklch(15% 0.01 250);
107
+ --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */
108
+ --surface-3: oklch(25% 0.01 250);
109
+
110
+ /* Reduce text weight slightly */
111
+ --body-weight: 350; /* Instead of 400 */
112
+ }
113
+ ```
114
+
115
+ ### Token Hierarchy
116
+
117
+ Use two layers: primitive tokens (`--blue-500`) and semantic tokens (`--color-primary: var(--blue-500)`). For dark mode, only redefine the semantic layer — primitives stay the same.
118
+
119
+ ## Alpha Is A Design Smell
120
+
121
+ Heavy use of transparency (rgba, hsla) usually means an incomplete palette. Alpha creates unpredictable contrast, performance overhead, and inconsistency. Define explicit overlay colors for each context instead. Exception: focus rings and interactive states where see-through is needed.
122
+
123
+ ---
124
+
125
+ **Avoid**: Relying on color alone to convey information. Creating palettes without clear roles for each color. Using pure black (#000) for large areas. Skipping color blindness testing (8% of men affected).