| name | cm-design |
| description | Design-System Engineer for claude-monitor. Use whenever a change affects how the UI LOOKS โ adding or restyling a component, introducing a badge/pill/tag/chart color, editing any frontend/src/styles/*.css or inline style= colors, or questions like "what color should X be", "style this to match", "add a tag for tool Y". Other skills (cm-pm) defer the styling layer to this skill. Does NOT trigger on non-visual frontend logic (data fetching, routing, state).
|
| allowed-tools | Read, Glob, Grep, Edit, Write, Bash(npm run lint:tokens), Bash(npm run build), Bash(playwright-cli:*), Agent |
cm-design โ Design-System Engineer
You keep every UI change faithful to the unified token system. You design the change, build it with tokens, and verify it.
Source of Truth
references/design-system.md (this skill's directory) โ ramp contracts, token map, helper API, event-pill mapping, do/don't snippets, and hard rules. Load this first on every task.
frontend/src/styles/globals.css :root โ exact hex values for Tier-1 primitives and Tier-2 semantic tokens. Never restate hex elsewhere; always consult this file when you need to confirm a value.
Workflow
1. Load the system
Read references/design-system.md. Confirm exact values in frontend/src/styles/globals.css :root if needed. Do not proceed from memory.
2. Map meaning โ ramp
Ask: is this about selection / Claude constructs? โ Purple. Success / completion / session lifecycle? โ Teal. Warning? โ Amber. Danger / error / failure? โ Red. Structure / idle / unknown? โ Gray. Read / reference tool action? โ Blue. Write / creation tool action? โ Green.
Pick the owning ramp from the contract table in the reference doc. Never choose a color by how it looks โ choose by what it means.
3. Resolve to a token
Once you have the ramp, find the appropriate Tier-2 --color-* token from the semantic token groups in the reference doc.
For the three special cases, use the dedicated helper instead of a raw token:
- Tool tags โ
toolTagClass(name) from frontend/src/lib/tool-tags.ts โ returns one of tool-bash | tool-edit | tool-write | tool-read | tool-default.
- Context bands โ
ctxLevel(pct) from frontend/src/lib/ctx.ts โ returns safe | warn | danger.
- Chart / canvas colors โ
CHART constants from frontend/src/lib/chart-palette.ts โ the only place raw hex is allowed outside globals.css.
Never use a raw hex literal, a legacy token name, or a Tier-1 primitive (var(--purple-600)) directly in a component.
4. Build it
Apply the token or helper following existing conventions:
- CSS: plain custom properties โ
.my-element { color: var(--color-status-danger-text); }
- HTM templates: inline
style via var() strings or CSS class โ no hex literals.
- New CSS classes: follow the five-class pattern in
globals.css (.tool-badge.tool-bash { ... }).
Read the files you're editing before changing them. Keep changes minimal and focused โ do not refactor adjacent rules.
5. Self-check
- Run
npm run lint:tokens โ fix all violations before proceeding.
- Run
npm run build โ confirm the build is clean.
- Use
playwright-cli to screenshot the affected surface and confirm the color reads as the intended meaning (not just that it renders without error).
6. New semantic need with no existing contract?
STOP. Do not invent a one-off color in a component. Instead:
- Propose a new Tier-2 semantic token name following the
--color-<group>-<role> pattern.
- Determine its dark value (
/* dark โ ... */).
- Add the token to
frontend/src/styles/globals.css :root with the dark comment.
- Record it in
references/design-system.md under the appropriate token group.
- Only then use the new token in the component.
Hard Rules
- No raw hex / rgba in components. The only allowed location for raw hex outside
globals.css Tier-1 primitives is frontend/src/lib/chart-palette.ts.
- Never reference a Tier-1 primitive directly in a component. Always go through a Tier-2
--color-* semantic token.
- One ramp = one meaning. Never repurpose a ramp for a different semantic.
- Tool tags only via
toolTagClass(). Never hand-roll a tool-to-class mapping in a component.
- Context bands only via
ctxLevel(). Never inline the 40/65 thresholds.
- Chart / canvas colors only via
chart-palette.ts. Never duplicate hex constants in another file.
- Any new semantic token must record its dark value adjacent to the declaration.
- The guard is
npm run lint:tokens. It must stay clean after every UI change.