This commit is contained in:
dahyeon committed 2026-08-12 02:11:40 -07:00
1 parent 77a5f5248c
commit f0bba7e7b9
68 files changed
+5149 -142

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
---
name: ss-a11y
description: Audit a component or page for accessibility issues and fix them
argument-hint: "[file-path]"
allowed-tools: Read, Write, Edit, Grep, Glob
---
# Accessibility Audit
## When NOT to use
- For general design system compliance review → use `/ss-review`
- For Nielsen UX heuristics → use `/ss-audit`
- For non-StyleSeed code (no `data-slot`, no semantic tokens) — assumes StyleSeed conventions
- For runtime testing — this is a static code audit, not a screen-reader simulation
Target: **$ARGUMENTS**
## Audit Criteria
### WCAG 2.2 AA Compliance
#### 1. Perceivable
- **Color contrast**: Text must meet 4.5:1 (normal) or 3:1 (large/bold text)
- Check `text-muted-foreground` (#717182) on `bg-background` (#FFFFFF) = 4.6:1 (passes)
- Check `text-brand` on white (verify contrast with your skin's brand color)
- Flag any custom colors that don't meet ratio
- **Non-text contrast**: UI controls/graphics must meet 3:1
- **Text alternatives**: All `<img>` need `alt`, icons need `aria-label` when meaningful
- **Color independence**: Don't convey info by color alone (add icons/text)
#### 2. Operable
- **Touch targets**: Minimum 44x44px (`min-h-11 min-w-11`)
- Common violation: `h-9` (36px) buttons — should be `h-11`
- Icon buttons need explicit size: `w-11 h-11`
- **Keyboard navigation**: All interactive elements must be keyboard-accessible
- Tab order should be logical
- `focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`
- **Motion**: Animations must respect `prefers-reduced-motion`
```css
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
```
#### 3. Understandable
- **Labels**: Form inputs must have visible labels or `aria-label`
- **Error messages**: Form errors must be programmatically associated (`aria-describedby`)
- **Language**: `<html lang="en">` (or appropriate language code for your project)
#### 4. Robust
- **Semantic HTML**: Use appropriate elements (`<button>`, `<nav>`, `<main>`, `<header>`)
- **ARIA**: Use Radix UI components (they handle ARIA automatically)
- **Roles**: Custom interactive elements need proper `role` attributes
## Design System Token Reference
| Token | Minimum Contrast | Note |
|-------|-----------------|------|
| `--foreground` | 7:1+ | Body text — verify with your skin |
| `--muted-foreground` | 4.5:1+ | Secondary text — verify with your skin |
| `--brand` | 4.5:1+ | Accent — verify with your skin's brand color |
| `--destructive` | 4.5:1+ | Error — verify with your skin |
| `--success` | 3:1+ | Large text/icons only — verify with your skin |
| `--warning` | 4.5:1+ | Warning text — some skins need a darker variant |
## Output
1. **Issues found**: List with severity (Critical/Major/Minor)
2. **Auto-fixes**: Apply fixes directly where possible
3. **Manual review needed**: Flag items that need human judgment
+119
View File
@@ -0,0 +1,119 @@
---
name: ss-audit
description: Audit screens for UX issues using Nielsen's heuristics and modern mobile UX best practices
argument-hint: "[file-path or screen-name]"
allowed-tools: Read, Grep, Glob
---
# UX Audit
## When NOT to use
- For accessibility-only issues → use `/ss-a11y`
- For design system token/golden-rule compliance → use `/ss-review`
- For copy/microcopy quality → use `/ss-copy`
- For brand new screens that don't exist yet — design first with `/ss-page` or `/ss-flow`
Target: **$ARGUMENTS**
## Audit Framework
### Nielsen's 10 Usability Heuristics
#### 1. Visibility of System Status
- [ ] Loading states present (skeleton screens, not spinners)
- [ ] Success/error feedback after actions (toast notifications)
- [ ] Progress indicators for multi-step flows
- [ ] Active state clearly shown on navigation items
- [ ] Real-time data has timestamp showing freshness
#### 2. Match Between System and Real World
- [ ] Labels use user's language, not technical jargon
- [ ] Icons are universally recognizable (Lucide standard set)
- [ ] Number formats match user expectations (comma separators, currency symbols)
- [ ] Date formats are locale-appropriate
#### 3. User Control and Freedom
- [ ] Back navigation available on all non-root screens
- [ ] Destructive actions have confirmation dialogs
- [ ] Undo available for reversible actions (toast with undo)
- [ ] Bottom sheet/modal can be dismissed (backdrop tap, swipe down, X button)
- [ ] No dark patterns (no forced actions, always a way to dismiss)
#### 4. Consistency and Standards
- [ ] Same action = same appearance everywhere
- [ ] Color meanings are consistent (green=success, red=error, brand=active)
- [ ] Text hierarchy follows the 5-level grayscale system
- [ ] All cards use the same shadow, radius, padding
- [ ] Spacing follows the 6px grid system
#### 5. Error Prevention
- [ ] Destructive buttons are visually distinct (destructive variant)
- [ ] Form validation happens on blur (not while typing)
- [ ] Dangerous actions require explicit confirmation
- [ ] Input constraints are visible before errors occur (character limits, format hints)
#### 6. Recognition Rather Than Recall
- [ ] Labels on all icons (especially BottomNav)
- [ ] Current state visible without memorization (active tab highlighted)
- [ ] Recent/frequent items shown for quick access
- [ ] Placeholder text shows expected format
#### 7. Flexibility and Efficiency
- [ ] Key actions reachable within 3 taps from home
- [ ] Pull-to-refresh on data screens
- [ ] Touch targets >= 44x44px (no tiny tap areas)
- [ ] Frequently used actions in easy-to-reach zones (bottom of screen)
#### 8. Aesthetic and Minimalist Design
- [ ] Each screen focuses on ONE primary task
- [ ] No decorative elements that don't serve a purpose
- [ ] Information pyramid respected (most important = biggest)
- [ ] Card density follows the max-4-items rule
- [ ] No competing visual elements (one hero metric per page)
#### 9. Help Users Recover from Errors
- [ ] Error messages explain what went wrong in plain language
- [ ] Error messages suggest how to fix the problem
- [ ] Partial failures don't break the whole page (one card fails, others load)
- [ ] Network errors show retry button
- [ ] Form errors highlight the specific field
#### 10. Help and Documentation
- [ ] Empty states guide users to take action
- [ ] Onboarding for first-time features (if applicable)
- [ ] Tooltips for complex metrics (if applicable)
### Mobile-Specific UX Checks
#### Touch & Gesture
- [ ] Touch targets minimum 44x44px
- [ ] Minimum 8px between adjacent touch targets
- [ ] No hover-dependent interactions (mobile has no hover)
- [ ] Swipe gestures have visible affordances (carousel indicators)
#### Performance Perception
- [ ] Skeleton screens appear within 300ms
- [ ] Optimistic updates for user actions
- [ ] Above-the-fold content loads first
- [ ] No layout shift after content loads
#### Safe Areas
- [ ] Content not hidden behind notch/Dynamic Island
- [ ] Bottom content not behind home indicator
- [ ] BottomNav has `pb-safe` padding
### Dark Pattern Prevention
- [ ] No forced bottom sheets on entry
- [ ] No exit-prevention dialogs
- [ ] Every screen has a way to go back/dismiss
- [ ] CTA labels clearly describe the action
- [ ] No manipulative graphics (begging, urgency)
## Output Format
1. **Score**: A+ to F rating with breakdown
2. **Critical Issues**: Must fix (blocks usability)
3. **Major Issues**: Should fix (degrades experience)
4. **Minor Issues**: Nice to fix (polish)
5. **Recommendations**: Specific code changes for each issue
+80
View File
@@ -0,0 +1,80 @@
---
name: ss-build
description: Build a screen with StyleSeed's composed design method — choose or compile an output grammar, apply a brand recipe plus domain/page/profile/lock constraints, then run the code and pixel gates before presenting.
argument-hint: "[what to build]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash, WebFetch
---
# Build with the composed StyleSeed method
The build method is the product. Score and screenshots are auxiliary evidence, not the source
of design judgment.
## Step 1 — Establish the rule set before code
If `STYLESEED.md` does not exist, run `/ss-setup` and write it before UI code. If the user
supplied a visual reference that the selected built-in grammar does not capture, run
`/ss-reference` first. Never reduce an unfamiliar reference to a palette swap.
Then invoke `/ss-resolve` (Claude Code) or `$ss-resolve` (Codex), or run its bundled
`scripts/resolve-context.mjs --project-root . --from-lock STYLESEED.md --agent <agent>`.
Read `.styleseed/effective-rules.md` and preserve `.styleseed/manifest.json` as the provenance
record. Do not load `llms-full.txt` after resolution succeeds.
## Step 2 — Compose, do not improvise
The compiled bundle already composes the authority order: core invariants → selected grammar →
surface adapter → domain/page → brand recipe → optional profile → bounded lock → craft baseline. Use the
manifest selection and source hashes to detect drift. Open a full source document only when the
bundle points to a genuine ambiguity; do not reassemble the handbook ad hoc.
Before code, state the effective rule set in one line, for example:
```text
operations-console × SaaS × dashboard × enterprise-workbench × swiss × locked brand tokens
```
Resolve conflicts by authority. A profile or lock cannot waive task fitness, coherence, or
accessibility.
## Step 3 — Build with design judgment
- Make the grammar's user job and primary decision visible in the first viewport.
- Establish one focal point; avoid equal-weight template grids.
- Use the grammar's composition, density, type, color, surface, imagery/data, action, state,
responsive, and motion contracts.
- Use the recipe's containment, geometry, control, collection, and navigation morphology.
Set `data-styleseed-recipe="<id>"` on the artifact root when using bundled pattern components.
- Use product-specific content and evidence. Never copy the StyleSeed demo or a reference screen.
- Implement loading, empty, error, focus, reduced-motion, and responsive behavior where relevant.
## Step 4 — Code gate loop
Run `/ss-score` on the actual implementation. The score must name the effective rule set and
check both core invariants and grammar-specific tells. Fix the highest-gain failures and
re-score, up to roughly three passes, until ≥80. If it cannot pass, report the real blocker.
## Step 5 — Pixel gate loop
For every renderable artifact, invoke `/ss-verify`: use the adapter renderer, inspect every
required viewport/frame/page and relevant state, fix perceptual failures, and re-render. If no renderer
is available, say the visual gate was skipped; never imply it passed.
## Step 6 — Present with proof
Report:
- effective rule set and why it fits;
- final code score;
- visual verification status and viewport;
- material fixes made by the gates;
- `STYLESEED.md` and any compiled grammar path.
## Rules
- Grammar before code; code gate after build; pixel gate last.
- Output grammar is functional. Brand recipe is morphological. Aesthetic profile is optional.
Neither substitutes for the grammar or permits a brand clone.
- The primary action must remain identifiable; additional color is permitted only where the
grammar gives it stable semantic or categorical meaning.
- Re-read the lock and grammar on every UI change.
+62
View File
@@ -0,0 +1,62 @@
---
name: ss-component
description: Generate a new UI component following the StyleSeed design conventions
argument-hint: "[component-name] [description]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# UI Component Generator
## When NOT to use
- For full-page scaffolding → use `/ss-page`
- For composed multi-component patterns → use `/ss-pattern`
- For tweaking an existing component — just edit the file directly
- For non-StyleSeed projects (no `components/ui/` directory or no Tailwind v4)
Generate a new component: **$0**
Description: $ARGUMENTS
## Instructions
1. First, read the compiled design method:
- Read `.styleseed/effective-rules.md` and `.styleseed/manifest.json`; resolve if stale
- Read `css/theme.css` for available design tokens
- Read `css/recipes.css` for morphology variables and helper classes
- Read `components/ui/button.tsx` as a reference pattern
2. Follow these conventions strictly:
- Use `function` declaration (not `const`)
- Add `data-slot="component-name"` attribute
- Use `cn()` from `@/components/ui/utils` for all className merging
- Use `React.ComponentProps<>` for prop typing
- Always support `className` prop for overrides
- Use CVA (`class-variance-authority`) if the component has variants
- Use semantic color tokens (`bg-card`, `text-foreground`) — never inline hex
3. Design token usage:
- Colors: `text-foreground`, `bg-card`, `text-brand`, `text-muted-foreground`, `border-border`
- Pattern surfaces: `ss-pattern-surface`; insets/controls/icons use the matching `ss-*` class
- Primitives use the project token scale; do not hardcode one radius or shadow personality
- Spacing follows one repeatable selected-recipe rhythm
- Motion: `duration-[var(--duration-fast)]`, `ease-[var(--ease-default)]`
4. Typography rules:
- Display (36-48px): `leading-none tracking-[-0.02em]`
- Heading (18-24px): `leading-snug tracking-[-0.01em]`
- Body (14-17px): `leading-normal` (default tracking)
- Caption uppercase (10-13px): `tracking-[0.05em]`
- Use `size-*` shorthand instead of `w-* h-*`
- Use `ms-*/me-*` instead of `ml-*/mr-*` (logical properties)
5. Accessibility requirements:
- Minimum touch target: 44x44px (`min-h-11 min-w-11`)
- Support `aria-*` attributes passthrough
- Use `focus-visible:ring-2 focus-visible:ring-ring` for keyboard focus
- Respect `prefers-reduced-motion` for animations
6. Export the component as a named export (not default)
7. Place the file in the appropriate directory:
- Primitive/reusable → `src/components/ui/`
- Composed pattern → `src/components/patterns/`
+100
View File
@@ -0,0 +1,100 @@
---
name: ss-copy
description: Generate UX microcopy (button labels, error messages, empty states, toasts) following a casual-but-polite voice and tone
argument-hint: "[context] [description]"
allowed-tools: Read, Write, Edit, Grep, Glob
---
# UX Microcopy Generator
## When NOT to use
- For long-form content (blog posts, docs, marketing pages) — out of scope
- For full feedback state design (not just text) → use `/ss-feedback`
- For brand voice/tone definition itself — this skill consumes a voice spec, doesn't create it
- For translations to non-English languages — single-language only
Context: **$0**
Description: $ARGUMENTS
> **Read `engine/UX-WRITING.md` first** — it's the rule set this skill applies: buttons
> name the action (not "Submit"), errors help instead of blame, empty states invite,
> money copy stays calm, one term per concept. Korean/CJK projects: see §W8 for the
> clear-calm-human "Toss feel" (존댓말 일관성, 사용자 관점 "내 계좌", 군더더기 빼기).
## Instructions
1. Read the design language reference:
- `DESIGN-LANGUAGE.md` sections on Microcopy Tone Guide and UX Writing
2. Apply the voice principles:
### Tone Rules
- **Casual but polite**: Friendly, not robotic. Like talking to a helpful friend.
- **Active voice**: "We saved your changes" not "Your changes have been saved"
- **Positive framing**: "Free shipping on orders over $30" not "Orders under $30 have shipping fees"
- **Plain language**: "Send money" not "Initiate transfer"
- **Concise**: Every word must earn its place
### Copy Patterns by Context
#### Button Labels (CTA)
```
Format: [Action verb] + [Object] (optional)
Good: "Place order", "Get started", "Save changes", "Try again"
Bad: "Submit", "OK", "Click here", "Proceed to next step"
```
- One primary CTA per screen
- Label must clearly describe what happens next
- Max 3 words for primary CTA
#### Empty States
```
Format: [Friendly observation] + [Suggested action]
Good: "No activity yet. Create your first project to get started."
Bad: "No data found."
```
- Always suggest a next action
- Use a relevant icon (32px, text-text-tertiary)
- Tone: encouraging, not blaming
#### Error Messages
```
Format: [What happened] + [What to do]
Good: "Couldn't load the data. Please try again."
Bad: "Error 500: Internal Server Error"
```
- Never show technical errors to users
- Blame the system, not the user
- Always provide a recovery action
#### Toast Notifications
```
Format: [Confirmation of what happened]
Good: "Saved!", "Changes applied", "Item deleted · Undo"
Bad: "Operation completed successfully"
```
- Max 2 lines
- Include "Undo" link for reversible destructive actions
- Info toasts: 3 seconds. Action toasts: 5 seconds.
#### Form Labels & Helpers
```
Label: Noun phrase ("Email address", "Password")
Placeholder: Example or hint ("name@example.com")
Helper: Format guidance ("Must be at least 8 characters")
Error: Specific issue ("This email is already registered")
```
#### Confirmation Dialogs
```
Title: [Question about the action]
Body: [Consequence explanation]
Primary: [Action verb] ("Delete", "Confirm")
Secondary: "Close" (not "Cancel" — avoids confusion)
```
3. Generate copy for the requested context, providing:
- Primary copy (what to display)
- Variants (if context varies)
- Do's and Don'ts for the specific context
+171
View File
@@ -0,0 +1,171 @@
---
name: ss-dial
description: Turn ONE design axis up or down as a coordinated, deterministic transform — "denser", "sharper corners", "more muted", "bolder", "flatter", "livelier". Not a vibe the model reinterprets each time; a defined ramp that moves many tokens together, respects the guardrails (8px grid, a11y floors, single accent, nested-radius), updates the lock, and re-runs the gate. Use this when a human saying "more X" would otherwise get an inconsistent one-off.
argument-hint: "<axis> <direction> — e.g. \"density denser\", \"radius sharper\", \"color more-muted\", \"weight bolder\""
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# Dial an axis
"Make it more minimal" is something you can just *say* — the model already reads plain
language. A skill only earns its place where **one word must move many tokens at once, in a
coordinated way, without breaking a rule** — and where doing it by hand gives an inconsistent
result (some tokens changed, the grid broken, a second accent introduced). That's what
`/ss-dial` is: **not interpretation, but a deterministic ramp + guardrails + re-gate.**
If the request is a *mood word* ("more premium", "more editorial", "more playful"), that's not
one axis — it's a *combination* of positions across several axes. Use **`/ss-restyle
<preset>`** for those. `/ss-dial` moves exactly one axis.
## When NOT to use
- A vague vibe the model can just apply from words ("cleaner", "nicer") → don't wrap it in a
skill; say it.
- A named aesthetic (Swiss / editorial / brutalist) → `/ss-restyle` (a preset of dial positions).
- Changing the accent *hue itself* (rebrand) → edit the lock's Key color directly, then re-derive.
- No `STYLESEED.md` lock yet → run `/ss-build` or `/ss-setup` first; there's nothing to dial from.
## The mechanic (every axis)
1. **Read `STYLESEED.md`** — find the axis's current position (Mood/Density/Radius/Elevation/
Type scale/Font weight/Motion fields). If the lock doesn't record it, infer it from the code.
2. **Move ONE position** in the requested direction on that axis's ramp (below). "more X" = one
step; an explicit target ("density: dense") jumps straight there. **Clamp at the ends** — you
cannot dial past `dense` or below `airy`. If already at the end, say so and stop (this is why
"each use makes it *more*" is bounded, not runaway).
3. **Apply the whole coordinated token set** for the new position across every file that uses
those tokens — not just the one component in view. This is the point: system-wide, consistent.
4. **Respect the guardrails** (each axis lists its own). Never break a Golden Rule to satisfy a
dial — if "denser" would push a touch control below 44px, stop at the floor and note it.
5. **Update `STYLESEED.md`** with the new position (so it persists and the next prompt obeys it).
6. **Re-run the Quality Gate** (`/ss-score`, loop to ≥ 80). A dial that drops the score below 80
is reverted or fixed, not shipped. Report: axis, old → new position, score.
---
## The axes
### 1. Density — spacing rhythm + internal padding + type/line-height, together
Ramp: `airy → comfortable → compact → dense`. The page gutter stays `px-6`/`mx-6` always
(fixed rule); density moves the *vertical rhythm, card interior, and reading scale*.
| Position | Section `space-y` | Card padding | Grid `gap` | Body line-height | Type scale |
|---|---|---|---|---|---|
| **airy** | `space-y-10` | `p-8` | `gap-8` | `leading-relaxed` | one step up (desktop-larger) |
| **comfortable** | `space-y-6` | `p-6` | `gap-6` | `leading-normal` | surface default |
| **compact** | `space-y-4` | `p-4` | `gap-4` | `leading-normal` | surface default, tighter headings |
| **dense** | `space-y-4` | `p-4` | `gap-3` (12px half-step) | `leading-snug` on data | data-table scale |
**Guardrails:** stay on the 8px grid (only `p-2/4/6/8`, `gap-*` on grid or the 4px half-step —
never invent `p-5`/`gap-2.5`); **touch controls stay ≥ 44px even at `dense`** (shrink padding,
not tap targets); body never drops below the surface floor (desktop 16px). Dense is for
data-heavy surfaces; don't dense-ify a marketing landing.
### 2. Hierarchy contrast — the size/weight gap between levels
Ramp: `subtle → balanced → strong → dramatic`. Moves the ratio between the hero and the body,
plus display tracking.
| Position | Hero : body size ratio | Display weight | Display tracking |
|---|---|---|---|
| **subtle** | ~2:1 | 600 | `-0.01em` |
| **balanced** | ~2.5:1 | 700 | `-0.02em` |
| **strong** | ~3.2:1 | 700–800 | `-0.02em` |
| **dramatic** | ~4:1 | 800 | `-0.03em` |
**Guardrails:** pick sizes from the Font Size table only (don't invent); body stays at the
surface floor regardless; keep the number-to-unit 2:1 pairing intact; one focal element still
dominates (dialing contrast up must not create two competing heroes).
### 3. Radius — the corner personality (categorical swap, not a slider)
Ramp: `sharp ↔ soft ↔ pill`. Swaps the **whole mapping table** as one set, never one component.
| Position | Controls (btn/input/chip) | Cards | Inner panels |
|---|---|---|---|
| **sharp** | 2–4px | 6–8px | 4–6px |
| **soft** | 8–10px | 12–16px | 10–12px |
| **pill** | full (9999px) | 20–24px | 14–16px |
**Guardrails:** one personality *everywhere* (sharp cards + pill buttons is the exact
mixed-personality tell we ban); nested elements still follow `inner = outer − padding`.
### 4. Elevation / depth — how surfaces separate
Ramp: `flat → subtle → layered → lifted`. **Light and dark speak different languages** — apply
the one that matches the theme.
| Position | Light (shadow, ≤8% opacity) | Dark (tonal + hairline) |
|---|---|---|
| **flat** | no shadow; 1px hairline border | page = card tone; hairline only |
| **subtle** | `0 1px 3px /4%` | one surface step + hairline |
| **layered** | `0 1px 3px /4%` + `0 4px 12px /8%` | two surface steps + hairline |
| **lifted** | add `0 8px 24px /8%` on raised | three steps; brightest = highest |
**Guardrails:** never exceed ~8% shadow opacity in light; **never a drop shadow in dark** (use
the tonal surface ramp + hairline borders); one shadow language / one light direction across
the whole UI.
### 5. Color — saturation and temperature (two sub-dials, accent stays single)
`saturation: muted ↔ balanced ↔ vivid` · `temperature: cooler ↔ neutral ↔ warmer`. Shifts the
**one** accent in HSL and re-derives its tints; may nudge the neutral greys' chroma. Does NOT
add a hue.
| Sub-dial | Move | Applies to |
|---|---|---|
| **more-muted** | accent saturation −10–15% (HSL S) | `--brand` + re-derive `bg-*-tint` at 10–14% alpha |
| **more-vivid** | accent saturation +10–15% | same |
| **warmer** | hue toward 20–40° (amber/terracotta) | `--brand`; optionally greys +2–4% warm chroma |
| **cooler** | hue toward 200–220° (blue/teal) | `--brand`; greys toward cool |
**Guardrails:** still **one accent** — this shifts the existing hue, never introduces a second;
tints follow the 10–14%-alpha-over-card formula (light + dark); accent keeps ≥4.5:1 where it
carries text; a warm/cool grey shift must stay near-neutral (chroma ≤ ~6%), not become a tint.
### 6. Font weight — the weight ramp
Ramp: `light → regular → bold`. Shifts the whole weight scale up/down by one notch, keeping the
*spread* (so hierarchy survives).
| Position | Body | Labels / nav | Headings / metrics |
|---|---|---|---|
| **light** | 400 | 400–500 | 600 |
| **regular** | 400 | 500 | 700 |
| **bold** | 500 | 600 | 700–800 |
**Guardrails:** keep contrast between levels (don't make everything one weight — that flattens
hierarchy); body ≤ 500 for readability at length; CJK weight does the work tracking can't.
### 7. Motion energy — seed + durations
Ramp: `still → calm → lively → energetic`. Swaps the motion seed and scales durations globally.
| Position | Seed | Durations | Character |
|---|---|---|---|
| **still** | none | instant / color-only | no entrance motion |
| **calm** | Silk / Snap | 100–200ms, ease-out | smooth, restrained |
| **lively** | Spring | 200–350ms, slight overshoot | responsive, alive |
| **energetic** | Spring / Pulse | 250–400ms, visible spring | bouncy, playful |
**Guardrails:** **numbers, balances, and money never animate** at any level; always honor
`prefers-reduced-motion`; scroll-linked/parallax/3D is surface-scoped (§43 — forbidden on app/data
surfaces, allowed as the Cinematic tier on marketing/landing pages; scroll-JACKING banned everywhere);
motion never delays content
or blocks an action.
---
## Rules
- **One axis per call.** A mood word ("premium") is a *combination* → `/ss-restyle`, not this.
- **System-wide, or don't.** Applying a position to one component and not the rest re-creates the
incoherence this skill exists to prevent. Grep the token across the project and move all of it.
- **Clamp at the ends.** Bounded ramp, not an infinite "more" — if already at `dense`/`sharp`/
`bold`, say so and stop.
- **Guardrails beat the dial.** Never break a Golden Rule (grid, ≥44px touch, single accent,
nested-radius, ≤8% shadow, no dark drop-shadow, font-size table) to satisfy a direction — stop
at the floor and tell the user.
- **Persist + re-gate.** Write the new position to `STYLESEED.md`, then `/ss-score` to ≥ 80.
Report `axis: old → new` and the score. A dial that lowered the score is fixed, not shipped.
+101
View File
@@ -0,0 +1,101 @@
---
name: ss-feedback
description: Add appropriate user feedback states (loading, success, error, empty) to a component or page
argument-hint: "[file-path]"
allowed-tools: Read, Write, Edit, Grep, Glob
---
# UX Feedback States Generator
## When NOT to use
- For only the words inside a state → use `/ss-copy`
- For accessibility issues in existing states → use `/ss-a11y`
- For brand-new component creation → use `/ss-component`
- For analytics or error-logging plumbing — UI presentation only
Target: **$ARGUMENTS**
## Instructions
1. Read the target file and identify all data-dependent areas.
2. Read the design language reference:
- `DESIGN-LANGUAGE.md` sections on Loading States (Skeleton), Empty States, Error States
3. For each data-dependent area, implement ALL 4 states:
### State 1: Loading (Skeleton)
```tsx
// Skeleton must match the final layout shape
<div className="bg-card rounded-2xl p-6 shadow-[var(--shadow-card)]">
<div className="flex items-center gap-2 mb-3">
<div className="size-7 bg-surface-muted rounded-lg animate-pulse" />
<div className="h-3 w-16 bg-surface-muted rounded animate-pulse" />
</div>
<div className="h-9 w-24 bg-surface-muted rounded-lg animate-pulse mb-3" />
<div className="h-3 w-12 bg-surface-muted rounded animate-pulse" />
</div>
```
Rules:
- Show skeleton for 300ms minimum (prevent flash)
- Delay skeleton display by 300ms (fast loads skip skeleton entirely)
- Use `animate-pulse` (1.5s cycle)
- Match skeleton shapes to real content dimensions
- Never use spinners inside cards
### State 2: Empty (Zero Data)
```tsx
<EmptyState
icon={PackageIcon}
title="No activity yet"
description="Create your first project to get started."
action={<Button>Create Project</Button>}
/>
```
Rules:
- Center-aligned in the card
- Icon: 32px, `text-text-tertiary`
- Title: 14px, `text-text-secondary`
- Always suggest a next action
- Zero values show as "0" (don't hide or dash)
### State 3: Error (Load Failed)
```tsx
<div className="flex flex-col items-center justify-center py-8 text-center">
<AlertCircle className="size-8 text-destructive mb-3" />
<p className="text-[14px] text-text-secondary mb-4">Couldn't load the data</p>
<Button variant="brandGhost" size="sm" onClick={retry}>Try again</Button>
</div>
```
Rules:
- Partial failure: only affected card shows error, rest loads normally
- Full page failure: full-screen EmptyState with retry
- Error message: plain language, blame the system
- Always provide retry button
### State 4: Success (Action Feedback)
```tsx
// Toast notification for action confirmations
toast("Changes saved")
// With undo for destructive actions
toast("Item deleted", { action: { label: "Undo", onClick: handleUndo } })
```
Rules:
- Info toast: 3s display
- Action toast (with undo): 5s display
- Toast position: above BottomNav
- One toast at a time (new replaces old)
4. Implementation pattern:
```tsx
function DataCard({ data, isLoading, error }) {
if (isLoading) return <DataCardSkeleton />
if (error) return <DataCardError onRetry={refetch} />
if (!data || data.length === 0) return <DataCardEmpty />
return <DataCardContent data={data} />
}
```
5. Check `prefers-reduced-motion` — disable `animate-pulse` when reduced motion is preferred.
+58
View File
@@ -0,0 +1,58 @@
---
name: ss-flow
description: Design user flows and navigation structure following proven UX patterns
argument-hint: "[flow-name] [description]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# UX Flow Designer
## When NOT to use
- For implementing a single page → use `/ss-page` after the flow is settled
- For copy on each step → use `/ss-copy` after the structure is settled
- For information architecture of an entire product — narrow scope to one flow first
- For high-fidelity mockups — this produces a flow map, not pixel-perfect designs
Design a user flow: **$0**
Description: $ARGUMENTS
## Instructions
1. Read the design system reference:
- `CLAUDE.md` for component inventory
- `DESIGN-LANGUAGE.md` for layout patterns (sections 13-14, 19-20)
- `components/patterns/` for available building blocks
2. Apply these UX principles:
### Information Architecture
- **Progressive Disclosure**: Show only what's needed at each step. Hide complexity behind logical drill-downs.
- **Miller's Law**: Chunk information into groups of 5-9 items maximum.
- **Hick's Law**: Minimize choices per screen. Fewer options = faster decisions.
### Navigation Patterns
- **Hub & Spoke**: Dashboard → detail pages → back to dashboard (default for mobile apps)
- **Linear Flow**: Step 1 → Step 2 → Step 3 (for forms, onboarding, checkout)
- **Tab Navigation**: 3-5 top-level sections via BottomNav
### Screen Flow Rules
- Every flow must have a **clear entry point** and **clear exit point**
- Maximum **3 taps** to reach any key feature from the home screen
- Back navigation must always be available (except root screens)
- Error states must provide **recovery paths** (retry, go back, contact support)
- Loading states must use skeleton screens (never spinners in cards)
### Page Composition (from DESIGN-LANGUAGE.md)
- Follow the **Information Pyramid**: Hero → KPI Grid → Details → Lists
- Each screen should answer ONE primary question
- Above the fold: the most important metric or action
- Use the 4 section types: Full Card (A), Grid (B), Carousel (C), Hero (D)
3. Output format:
- **Flow diagram** in ASCII showing screen connections
- **Screen inventory** listing each screen's purpose and key components
- **Edge cases** (empty states, errors, loading) for each screen
- **Scaffolded pages** using `PageShell`, `TopBar`, `BottomNav` patterns
4. Generate the actual page files using `/ss-page` conventions.
+106
View File
@@ -0,0 +1,106 @@
---
name: ss-lint
description: Quick automated lint — detects common design system violations in seconds
argument-hint: "[file-path or directory]"
allowed-tools: Read, Grep, Glob, Bash
---
# Design Lint (Quick Check)
Read `.styleseed/effective-rules.md` and `.styleseed/manifest.json`; invoke `/ss-resolve` or
`$ss-resolve` first when they are missing or stale. Lint detects deterministic drift; it must
not flag an exact grammar/recipe/profile/adapter contract as a violation or let an arbitrary lock
value create an exception.
## When NOT to use
- For deeper review of design judgment (composition, hierarchy, rhythm) → use `/ss-review`
- For accessibility specifically → use `/ss-a11y`
- For Nielsen UX heuristics → use `/ss-audit`
- For applying refactors — this only flags violations; use `/ss-review` to fix
Target: **$ARGUMENTS**
## What This Does
Fast, grep-based scan for common design violations. Runs in seconds (unlike /ss-review which is a deep manual audit). Run this after every file change.
## Checks
### 1. Hardcoded Colors
Search for hex colors in className strings that should be semantic tokens:
```bash
grep -n '#[0-9a-fA-F]\{3,8\}' [file] | grep -v 'theme.css\|tokens\|\.json'
```
**Violation:** `text-[#3C3C3C]`, `bg-[#3182F6]`
**Fix:** `text-text-primary`, `bg-brand`
### 2. Raw Pixel Values in Tailwind
```bash
grep -n 'p-\[.*px\]\|m-\[.*px\]\|gap-\[.*px\]' [file]
```
**Violation:** `p-[24px]`, `gap-[12px]`
**Fix:** `p-6`, `gap-3`
### 3. Old Width/Height Syntax
```bash
grep -n 'w-[0-9] h-[0-9]\|w-\[.*\] h-\[' [file]
```
**Violation:** `w-4 h-4`
**Fix:** `size-4`
### 4. Physical Properties (LTR-only)
```bash
grep -n ' ml-\| mr-\| pl-\| pr-' [file]
```
**Violation:** `ml-2`, `mr-4`
**Fix:** `ms-2`, `me-4`
### 5. Uncontracted Hard Black
```bash
grep -n 'text-black\|bg-black\|#000000\|#000"' [file]
```
**Violation:** Pure black without an exact structural role in the selected grammar/profile
**Fix:** Use the semantic ink token, or cite the maintained contract that requires hard black
### 6. Missing data-slot
```bash
grep -n 'function [A-Z]' [file] # find components
grep -n 'data-slot' [file] # check if present
```
**Violation:** Component without `data-slot`
**Fix:** Add `data-slot="component-name"`
### 7. Font Size CSS Variables (CRITICAL — Tailwind v4 conflict)
```bash
grep -n 'text-\[var(--' [file]
grep -n '\-\-text-.*px\|--fs-.*px' [file]
```
**Violation:** `text-[var(--text-sm)]` or `--text-sm: 13px` in theme.css
**Fix:** Use explicit `text-[13px]`. CSS variable font sizes conflict with Tailwind v4's `--text-*` namespace — Tailwind reads them as color, not font-size.
### 8. className Without cn()
```bash
grep -n 'className={`' [file]
```
**Violation:** Template literal className
**Fix:** Use `cn()` for all className composition
### 9. Universal Soft-card Drift
Search for repeated `rounded-2xl`, `shadow-[var(--shadow-card)]`, and `mx-6` in pattern files.
Flag the combination when the selected recipe is not `calm-consumer`.
**Fix:** use `ss-pattern-surface`, `ss-page-gutter`, and the other recipe-aware helper classes.
## Output Format
```
🔴 FAIL [file:line] Hardcoded hex: text-[#3C3C3C] → use text-text-primary
🔴 FAIL [file:line] Raw px: p-[24px] → use p-6
🟡 WARN [file:line] Physical prop: ml-2 → use ms-2
🟡 WARN [file:line] Missing data-slot on MyComponent
🟢 PASS No violations found
Total: X errors, Y warnings
```
If errors > 0, list specific fixes for each violation.
+172
View File
@@ -0,0 +1,172 @@
---
name: ss-motion
description: Apply a named StyleSeed motion to a component — either one of the 5 personality seeds (Spring/Silk/Snap/Float/Pulse × entrance/exit/hover/press/layout) or a distinctive keyword move from the motion library (toggle-flip, toggle-curtain, reveal-blur, pop-in, shimmer, …). Translates vibe words into framer-motion code from one source of truth.
argument-hint: "[vibe-seed-or-keyword] [context] [file-path]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# Motion Seed Applier
## When NOT to use
- For general framer-motion docs or learning → use the framer-motion site
- For non-React motion (CSS-only transitions, GSAP) — this skill targets `motion.X` JSX only
- For full scroll-linked timelines or parallax — out of scope for *this* skill (it does per-component
seeds/moves). Note these ARE allowed on a marketing/landing/brand page (DESIGN-LANGUAGE §43
Cinematic tier); just build them with a scroll library, not this skill. On app/data surfaces they
stay banned.
- For tweaking the existing FadeIn/FadeUp/Stagger wrappers — edit `engine/components/ui/motion.tsx` directly
## Vibe → Seed mapping
Translate the user's prompt to one of the five seeds before applying. Use this lookup table from `engine/motion/index.ts`:
| Words the user might say | Seed |
|---|---|
| bouncy, springy, playful, energetic, alive | **Spring** |
| smooth, silky, fluid, elegant, composed, continuous | **Silk** |
| snappy, quick, instant, decisive, sharp, precise | **Snap** |
| floaty, gentle, weightless, dreamy, ambient, drifting | **Float** |
| rhythmic, punchy, pulsing, heartbeat, beat | **Pulse** |
| "Toss style", "Arc style" | **Spring** (per brand default) |
| "Stripe style", "Notion style" | **Silk** |
| "Linear style", "Raycast style", "Vercel style" | **Snap** |
If the user says only a *brand* name, use that brand's default seed from `BRAND_DEFAULT_SEED`. If the user is explicit about a seed name (`spring`, `silk`, etc.), respect it verbatim.
## Recommend mode — use-case → motion (when the user describes the *moment*, not the vibe)
If the user describes **what the thing is** ("a like button", "a modal", "the loading
state", "items in a feed") rather than a feeling, recommend from the use-case map
(`MOTION_BY_USECASE` in `engine/motion/library.ts`, exported from `@engine/motion`):
| Use case | Reach for | Why |
|---|---|---|
| Primary button / CTA press | `spring · press` | tactile, confident — the press should "give" |
| Modal / dialog / sheet enter | `silk · entrance` | smooth; never bounce serious/destructive content |
| Dropdown / popover / menu | `snap · entrance` | instant, precise — frequent UI shouldn't wait |
| Toast / inline notification | `spring · entrance` | small friendly arrival, non-blocking |
| List / feed items appearing | `stagger-cascade` | choreograph order, gently |
| Feature / marketing card hover | `tilt-3d` | depth/flair OK on content-light marketing |
| Dashboard / data card hover | `snap · hover` | a subtle lift only — keep dense UI calm |
| Like / favorite / reaction | `like-burst` | a celebratory one-shot; reward the tap |
| Live / online / recording dot | `pulse-beat` | looping heartbeat = "alive" |
| Loading / skeleton | `shimmer` | calm directional progress |
| Success / confirmation | `pop-in` | positive little "done" |
| Toggle / tab / segment switch | `toggle-flip` | distinctive, recognizable switch |
| Page / route transition | `silk · entrance` | smooth, minimal, get out of the way |
| Number / balance / KPI / price reveal | **none** | don't animate the payload — it must read instantly |
**Two anti-rules override the table** (state them if you deviate):
1. **One seed per product.** If the project already uses a seed, match it — don't introduce a second personality.
2. **Never delay the payload.** Don't animate a balance, price, or search result into view; motion is for affordance, not content.
## Named motion keywords (distinctive moves)
Seeds set a *personality* (how a fade/scale feels). The **motion library** in
`engine/motion/library.ts` adds *distinctive moves* — a flip, a curtain wipe, a
morph — each behind a unique keyword. Prefer a keyword when the user wants a
specific, recognizable motion rather than a generic feel.
`engine/motion/library.ts` (exported as `MOTION_LIBRARY` / `MOTION_BY_KEY` from
`@engine/motion`) is the **single source of truth** — every keyword carries its
own runnable `snippet`. Pull the snippet from there; never hand-write the params.
| Keyword | Move | Say it when the user wants… |
|---|---|---|
| `toggle-flip` | 3D Y-axis card flip | a switch/toggle to flip between two faces |
| `toggle-slide` | slide-stack swap | a value to slide out and the next to slide in |
| `toggle-morph` | pill ⇄ circle morph | a control to change shape on toggle |
| `toggle-curtain` | top→bottom clip-path wipe | a panel to reveal like a curtain |
| `reveal-blur` | blur(12px)→0 focus-in | content to focus-pull into place |
| `reveal-rise` | masked clip-path text rise | a headline/text to climb into view |
| `reveal-unfold` | scaleY from top edge | an accordion/panel to unfold |
| `pop-in` | spring overshoot from 0 | a badge/checkmark to pop in bouncily |
| `press-squish` | scale-down + skew | a button to feel jelly/tactile on tap |
| `tap-ripple` | radial ripple from tap | Material-style press feedback |
| `pulse-beat` | looping scale pulse | a live/recording/heartbeat indicator |
| `wiggle` | quick horizontal shake | error / invalid-input feedback |
| `shimmer` | skeleton loading sweep | a loading placeholder |
| `stagger-cascade` | children fade-up in sequence | a list to animate in one-by-one |
**Applying a keyword:**
1. Read the exact recipe from `engine/motion/library.ts` — find the entry whose
`key` matches, copy its `snippet` verbatim (it is calibrated and runnable).
2. Adapt only the element/content to the user's JSX; keep the transition values.
3. If the keyword is stateful (toggles, ripple), wire the `useState` shown in the
snippet. If it's a one-shot reveal, a `key` bump replays it.
4. Tell the user the keyword you applied so they can reuse it elsewhere for
consistency, and point them at `/motion` to preview/Copy others.
If the user describes a move but no exact keyword fits, fall back to a seed +
context. If they say a keyword that doesn't exist, suggest the closest real one
from the table — never invent a keyword.
## Context detection
Infer one of the five contexts from the prompt:
- "on hover" / "when hovered" → `hover`
- "on press" / "on tap" / "on click" → `press`
- "when it appears" / "on mount" / "entering" → `entrance`
- "when it leaves" / "on close" / "exiting" → `exit` (requires `<AnimatePresence>`)
- "when layout changes" / "FLIP" / "rearranging" → `layout`
If ambiguous, default to `entrance`. If multiple contexts are reasonable (e.g., a button needs both `hover` and `press`), apply both.
## Application steps
Apply seed: **$0** · Context: **$1** · Target: **$ARGUMENTS**
1. **Read the target file** at the path given (or, if no path was given, ask the user which file). Locate the JSX element the user is talking about — usually a `<button>`, `<div>`, `<Card>`, or similar.
2. **Confirm the import paths**. The component file must be able to import:
- `motion` (and `AnimatePresence` for `exit`) from `"framer-motion"`
- the chosen seed from `"@engine/motion"` — in a project that doesn't use the `@engine/*` alias, use a relative path to `engine/motion`
3. **Replace the target tag with a `<motion.X>` and spread the seed's recipe**:
```tsx
// hover example
<motion.button {...spring.hover}>Save</motion.button>
// press + hover combined
<motion.button {...spring.press} {...spring.hover}>Save</motion.button>
// entrance (mount)
<motion.div {...silk.entrance}>...</motion.div>
// exit (requires AnimatePresence wrapper somewhere up the tree)
<AnimatePresence>
{open && <motion.div {...silk.entrance} {...silk.exit} />}
</AnimatePresence>
// layout (FLIP)
<motion.div {...snap.layout}>...</motion.div>
```
4. **Do NOT inline the params**. The whole point of the seed is that the values come from one source. Never expand `{ type: "spring", stiffness: 300, damping: 18 }` into the JSX — always spread the recipe.
5. **Respect `prefers-reduced-motion`** in long-running surfaces. For one-off interactions (hover/press), framer-motion already throttles. For mount/exit/layout sequences in a long-lived page, import `usePrefersReducedMotion` and `REDUCED_TRANSITION` from `@engine/motion` and override the transition when reduced motion is on.
6. **Validate** by re-reading the file and confirming the JSX still parses (matching brackets, motion tag closed, AnimatePresence in place if `exit` was used).
7. **Tell the user which seed and context you applied**, and offer one related context they might want next ("Want `press` too so it feels clickable?").
## Defaults if the user is vague
- No file given → ask "which file?"
- No vibe word → ask "any vibe word, brand, or seed name?"
- Vibe is "natural" or "feel like a real app" → default to **Silk** (the safest of the five)
- Element is a CTA button → also apply `press`
## Forbidden
- Do not invent new seed names. There are exactly five.
- Do not edit `engine/motion/seeds/*.ts` from this skill — those are calibrated by hand. Add a new seed only via a separate, explicit ask.
- Do not introduce a third-party animation lib (gsap, anime.js). StyleSeed targets framer-motion exclusively.
- Do not add scroll-linked, parallax, or infinite animations *via this skill* — it does
per-component seeds/moves. (Scroll-linked/parallax/3D ARE allowed on a marketing/landing/brand
page per DESIGN-LANGUAGE §43 Cinematic tier — build those directly with a scroll lib; on
app/data surfaces they stay forbidden.) Infinite loops remain banned everywhere except skeleton pulse.
+78
View File
@@ -0,0 +1,78 @@
---
name: ss-page
description: Scaffold a new product page or screen from the compiled StyleSeed output grammar, surface adapter, brand recipe, and project lock.
argument-hint: "[page-name] [description]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# Product Page Scaffolder
## When NOT to use
- For a single composed pattern within an existing page → use `/ss-pattern`
- For multi-page navigation structure → use `/ss-flow` first
- For tweaking an existing page — edit the file directly
Create a new page: **$0**
Description: $ARGUMENTS
## Instructions
1. Resolve and read the active design method:
- `.styleseed/effective-rules.md` and `.styleseed/manifest.json`
- If missing or stale, invoke `/ss-resolve` or `$ss-resolve` from `STYLESEED.md`
- `components/patterns/page-shell.tsx` for page layout
- `components/patterns/top-bar.tsx` for header pattern
- `components/patterns/bottom-nav.tsx` for navigation
2. Page structure template:
```tsx
import { PageShell, PageContent } from "@/components/patterns/page-shell"
import { TopBar, TopBarAction } from "@/components/patterns/top-bar"
import { BottomNav } from "@/components/patterns/bottom-nav"
export default function PageName() {
return (
<PageShell recipe="enterprise-workbench">
<TopBar
logo={/* logo or page title */}
subtitle={/* optional subtitle */}
actions={/* optional action buttons */}
/>
<PageContent>
{/* Compose the grammar's focal point and recipe-fit sections */}
</PageContent>
<BottomNav items={[/* nav items */]} activeIndex={0} />
</PageShell>
)
}
```
3. Apply the selected adapter and recipe:
- Set `recipe="<manifest selection.recipe>"` on `PageShell`, or
`data-styleseed-recipe="<id>"` on a custom artifact root.
- Use the lock's viewports and the adapter's responsive contract. Do not assume 430px mobile.
- Use `ss-page-padding`, `ss-page-gutter`, `ss-pattern-stack`, `ss-pattern-surface`,
`ss-pattern-inset`, `ss-pattern-control`, and `ss-pattern-icon` where bundled patterns fit.
- Select components by recipe: aligned panels/rows for workbenches, flat steps for public
service, reading flow for editorial, focused canvas/tool groups for creative tools, and
soft grouping only when the recipe calls for it.
- A page may contain cards, panels, rules, whitespace, rows, tables, or a canvas. Never force
every content block into a card.
4. Use semantic tokens for all colors — never hardcode hex values.
5. Compose the page from existing components (ui/ and patterns/) wherever possible.
6. Safe area: include `env(safe-area-inset-*)` padding for modern devices.
7. **Post-generation verification (MANDATORY):**
Run `/ss-score` then `/ss-verify`. Confirm:
- [ ] The first viewport exposes the grammar's user job and one focal point
- [ ] Containment, geometry, controls, collections, density, and navigation fit the recipe
- [ ] Only `--brand` color used for accents (no other accent colors)
- [ ] No hardcoded hex values (all semantic tokens)
- [ ] Section types alternate (no two identical types in a row)
- [ ] Spacing uses one repeatable recipe-fit rhythm
- [ ] Touch targets ≥ 44px on all interactive elements
If any violation is found, fix it before presenting the page to the user.
+63
View File
@@ -0,0 +1,63 @@
---
name: ss-pattern
description: Generate a composed UI pattern from the active StyleSeed grammar and brand recipe using existing primitives.
argument-hint: "[pattern-type] [description]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# UI Pattern Generator
## When NOT to use
- For a single primitive component → use `/ss-component`
- For a full mobile screen → use `/ss-page`
- For an entire multi-page user flow → use `/ss-flow`
- For design tokens and color/spacing decisions → use `/ss-tokens`
Pattern type: **$0**
Description: $ARGUMENTS
## Available Pattern Types
### Layout Patterns
- **focal-summary**: one dominant state, briefing, artifact, or decision
- **panel-section**: aligned workbench panel with related controls and evidence
- **flat-step**: public-service task step with explicit labels, help, and recovery
- **reading-section**: bounded prose, figure, caption, quote, or source group without app cards
- **resource-collection**: rows, table, grid, or sequence selected by the recipe and user job
- **canvas-tools**: focused artifact/canvas with quiet supporting tool groups
### Data Display Patterns
- **data-table**: Table with header and rows
- **detail-card**: Key-value pair display
- **chart-card**: Card wrapper for a Recharts chart
- **ranking-list**: Numbered ranking with highlight
### Interactive Patterns
- **action-sheet**: Bottom sheet with action buttons
- **filter-bar**: Horizontal filter/tab bar
- **search-header**: Search input in header area
## Instructions
1. Read `.styleseed/effective-rules.md` and `.styleseed/manifest.json`. Resolve first when stale.
Then inspect:
- `components/ui/` for available primitives
- `components/patterns/` for existing patterns
2. Compose the pattern from existing components — DO NOT recreate primitives.
3. Follow the selected recipe rather than one default card language:
- Use `ss-pattern-surface` only when containment is earned.
- Use `ss-page-gutter` or `ss-page-padding` instead of hardcoded universal gutters.
- Use `ss-pattern-inset`, `ss-pattern-control`, and `ss-pattern-icon` for recipe-aware shape.
- Public-service and editorial recipes usually prefer flat flow, rules, and whitespace.
- Enterprise/developer recipes prefer aligned panels, rows, tables, and compact controls.
- Calm-consumer may use soft groups; expressive-brand must add a product-specific composition.
4. Use semantic tokens for all visual properties.
5. Make the pattern a reusable component with props for dynamic content.
6. Run `/ss-score` and verify that the pattern has a functional relationship to its page
instead of being an isolated pretty card.
+36
View File
@@ -0,0 +1,36 @@
---
name: ss-reference
description: Compile screenshots, URLs, Figma exports, or an existing UI into a project-local StyleSeed output grammar with evidence, tokens, confidence, anti-patterns, and a validation screen. Use when the user supplies a design reference that StyleSeed does not already model.
argument-hint: "[reference paths or URLs] [--name slug]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash, WebFetch
---
# Compile references into a design grammar
Do not merely imitate the supplied screen. Read `PRODUCT-PRINCIPLES.md`, `RULESETS.md`,
`ADAPTERS.md`, and `REFERENCE-COMPILER.md`, then execute the compiler pipeline in full.
## Workflow
1. Ingest every supplied reference and assign evidence IDs (`R1`, `R2`, ...). If a URL can be
rendered, capture it. If an image cannot be seen, stop claiming visual analysis for it.
2. Separate references by surface adapter and job. Do not merge a marketing homepage with an app
dashboard unless the user explicitly wants both languages connected.
3. Observe and measure the twelve axes. Every rule cites evidence IDs and a confidence level.
4. Resolve contradictions instead of averaging them. Explain any material choice briefly.
5. Choose the nearest built-in fallback grammar and adapter, then compile the project artifacts required by
`REFERENCE-COMPILER.md` under `.styleseed/rulesets/<slug>/`.
6. Update `STYLESEED.md` to select `reference:<slug>` while preserving bounded brand choices.
7. Validate transfer: apply the grammar to one representative screen not present in the source
set, run `/ss-score`, then `/ss-verify` if renderable. Fix and repeat to the gate floor.
8. Report what was learned, what remains low-confidence, where the artifacts live, and the
validation result.
## Rules
- Visible evidence before adjectives. “Calm” is not a rule; the spacing, type, color, hierarchy,
and motion decisions that create calm are rules.
- Never copy protected assets, brand marks, or prose.
- One reference produces a provisional grammar. Say so and keep confidence low where warranted.
- The generated grammar is project-local. Do not edit `RULESETS.md` or publish it as built-in.
- Core invariants and accessibility remain non-negotiable.
+57
View File
@@ -0,0 +1,57 @@
---
name: ss-resolve
description: Compile a small, deterministic StyleSeed rule bundle for one agent, output grammar, surface adapter, domain, page type, brand recipe, palette recipe, and optional profile. Use before setup or build, when STYLESEED.md changes, when updating StyleSeed, or whenever an agent would otherwise load the full rule handbook.
---
# Resolve effective StyleSeed context
Use the bundled `scripts/resolve-context.mjs`; do not hand-compose the rule stack.
1. Read `STYLESEED.md` when it exists. Confirm missing required selections with the user.
2. Keep the working directory at the user's project root. Invoke the script by its installed
path; do not `cd` into the skill directory. Prefer `--from-lock STYLESEED.md`; explicit flags
override lock values.
3. Read the emitted `.styleseed/effective-rules.md` before building.
4. Preserve `.styleseed/manifest.json`. It records selections, source hashes, and the bundle hash
for updates and reproducibility.
5. Use `--check` to detect context drift without rewriting files.
```bash
node <installed-ss-resolve>/scripts/resolve-context.mjs \
--from-lock STYLESEED.md \
--agent codex
```
Without a lock:
```bash
node <installed-ss-resolve>/scripts/resolve-context.mjs \
--agent claude \
--grammar operations-console \
--adapter product-ui \
--domain saas \
--page dashboard \
--recipe enterprise-workbench \
--palette cobalt-instrument \
--key-color "#175CD3" \
--palette-character balanced \
--palette-mode light \
--palette-harmony auto \
--surface-temperature cool \
--profile swiss
```
Use `--list` to print supported IDs. `--recipe auto` maps the selected grammar to a maintained
default; `--palette auto` maps that recipe to a contrast-verified semantic palette. Pass explicit
values when the product needs a different morphology or color posture. The default
output directory is `.styleseed/` in the
project root. For a project-local reference grammar, pass `reference:<slug>` and ensure
`.styleseed/rulesets/<slug>/RULESET.md` exists.
When a key color is present in flags or the lock, the resolver uses the shared OKLCH generator and
writes `.styleseed/palette.json` plus `.styleseed/palette.css`. The manifest records the generation
inputs. The maintained recipe still supplies product posture and semantic restrictions; its fixed
hex values become fallbacks rather than overriding the generated system.
Do not load `llms-full.txt` after a bundle resolves successfully. Load a larger source document
only when the bundle names an unresolved ambiguity that requires it.
@@ -0,0 +1,78 @@
#!/usr/bin/env node
import { mkdirSync, writeFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { generatePalette } from "./generator.mjs";
function parseArgs(argv) {
const supported = new Set(["help", "key-color", "mode", "character", "harmony", "temperature", "format", "out"]);
const options = {};
for (let index = 0; index < argv.length; index += 1) {
const token = argv[index];
if (!token.startsWith("--")) throw new Error(`Unexpected argument: ${token}`);
const key = token.slice(2);
if (!supported.has(key)) throw new Error(`Unknown option: --${key}`);
if (key === "help") {
options.help = true;
continue;
}
const value = argv[index + 1];
if (!value || value.startsWith("--")) throw new Error(`Missing value for --${key}`);
options[key] = value;
index += 1;
}
return options;
}
function help() {
return `StyleSeed Palette Engine
Usage:
generate-palette.mjs --key-color <hex> [options]
Options:
--key-color <hex> Brand/product key color (required)
--mode light|dark default: light
--character calm|balanced|vivid|deep
--harmony auto|tonal|adjacent|contrast
--temperature neutral|warm|cool
--format json|css|summary default: json
--out <path> write output instead of stdout
`;
}
try {
const args = parseArgs(process.argv.slice(2));
if (args.help) {
console.log(help());
process.exit(0);
}
if (!args["key-color"]) throw new Error("--key-color is required");
const palette = generatePalette({
keyColor: args["key-color"],
mode: args.mode,
character: args.character,
harmony: args.harmony,
temperature: args.temperature,
});
const format = args.format || "json";
if (!["json", "css", "summary"].includes(format)) {
throw new Error(`Invalid format: ${format}. Supported: json, css, summary`);
}
const output = format === "css"
? `${palette.css}\n`
: format === "summary"
? `${JSON.stringify({ input: palette.input, roles: palette.roles, valid: palette.valid, contrast: palette.contrast, decisions: palette.decisions }, null, 2)}\n`
: `${JSON.stringify(palette, null, 2)}\n`;
if (args.out) {
const target = resolve(args.out);
mkdirSync(dirname(target), { recursive: true });
writeFileSync(target, output);
console.log(target);
} else {
process.stdout.write(output);
}
} catch (error) {
console.error(`Palette generation failed: ${error.message}`);
process.exit(1);
}
@@ -0,0 +1,40 @@
export type PaletteMode = "light" | "dark";
export type PaletteCharacter = "calm" | "balanced" | "vivid" | "deep";
export type PaletteHarmony = "auto" | "tonal" | "adjacent" | "contrast";
export type PaletteTemperature = "neutral" | "warm" | "cool";
export type PaletteGenerationOptions = {
keyColor?: string;
mode?: PaletteMode;
character?: PaletteCharacter;
harmony?: PaletteHarmony;
temperature?: PaletteTemperature;
};
export type GeneratedPalette = {
schemaVersion: number;
generator: { name: string; version: string; colorSpace: string; targetGamut: string };
input: Required<PaletteGenerationOptions>;
normalizedKey: { hex: string; oklch: { l: number; c: number; h: number } };
decisions: {
character: string;
accent: { hue: number; offset: number; method: PaletteHarmony; avoidsStatusCollisionBy: number };
primaryAdjustedForContrast: boolean;
accentAdjustedForContrast: boolean;
allocation: { dominant: string; secondary: string; accent: string };
};
ramps: { primary: Record<string, string>; accent: Record<string, string> };
roles: Record<string, string>;
contrast: Array<{ foreground: string; background: string; ratio: number; minimum: number; pass: boolean }>;
valid: boolean;
assetBrief: { anchors: string[]; hierarchy: string; avoid: string[] };
reasoning: string[];
css: string;
};
export function generatePalette(options?: PaletteGenerationOptions): GeneratedPalette;
export function contrast(a: string, b: string): number;
export function hexToOklch(hex: string): { l: number; c: number; h: number };
export function normalizeHex(hex: string): string;
export function oklchToHex(color: { l: number; c: number; h: number }): string;
export function generatePaletteCss(result: GeneratedPalette): string;
@@ -0,0 +1,308 @@
const VERSION = "1.0.0";
const CHARACTER = {
calm: { label: "Calm", chroma: 0.72, accent: 0.78, surface: 0.010, primaryLight: 0.48, primaryDark: 0.76 },
balanced: { label: "Balanced", chroma: 0.94, accent: 0.96, surface: 0.014, primaryLight: 0.50, primaryDark: 0.75 },
vivid: { label: "Vivid", chroma: 1.14, accent: 1.15, surface: 0.018, primaryLight: 0.53, primaryDark: 0.78 },
deep: { label: "Deep", chroma: 0.90, accent: 0.92, surface: 0.014, primaryLight: 0.42, primaryDark: 0.70 },
};
const TEMPERATURE_HUE = { neutral: null, warm: 65, cool: 245 };
const STATUS_HUES = { success: 148, warning: 78, danger: 27 };
const RAMP_LIGHTNESS = [0.98, 0.94, 0.88, 0.80, 0.70, 0.61, 0.53, 0.45, 0.36, 0.27, 0.18];
const RAMP_KEYS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
function option(value, fallback, supported, label) {
if (value === undefined || value === null || value === "") return fallback;
if (!supported.includes(value)) {
throw new Error(`Invalid ${label}: ${value}. Supported: ${supported.join(", ")}`);
}
return value;
}
function clamp(value, min = 0, max = 1) {
return Math.min(max, Math.max(min, value));
}
function wrapHue(value) {
return ((value % 360) + 360) % 360;
}
function hueDistance(a, b) {
const direct = Math.abs(wrapHue(a) - wrapHue(b));
return Math.min(direct, 360 - direct);
}
function normalizeHex(input) {
const value = String(input || "").trim();
const expanded = /^#[0-9a-f]{3}$/i.test(value)
? `#${value.slice(1).split("").map((part) => part + part).join("")}`
: value;
if (!/^#[0-9a-f]{6}$/i.test(expanded)) throw new Error(`Invalid key color: ${input}`);
return expanded.toUpperCase();
}
function hexToRgb(hex) {
const value = normalizeHex(hex);
return [1, 3, 5].map((index) => Number.parseInt(value.slice(index, index + 2), 16) / 255);
}
function linearize(value) {
return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
}
function delinearize(value) {
return value <= 0.0031308 ? value * 12.92 : 1.055 * value ** (1 / 2.4) - 0.055;
}
function rgbToOklab(rgb) {
const [r, g, b] = rgb.map(linearize);
const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
return {
l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
};
}
function oklabToLinearRgb({ l, a, b }) {
const ll = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
const mm = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
const ss = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
return [
4.0767416621 * ll - 3.3077115913 * mm + 0.2309699292 * ss,
-1.2684380046 * ll + 2.6097574011 * mm - 0.3413193965 * ss,
-0.0041960863 * ll - 0.7034186147 * mm + 1.707614701 * ss,
];
}
function oklchToOklab({ l, c, h }) {
const radians = wrapHue(h) * Math.PI / 180;
return { l, a: c * Math.cos(radians), b: c * Math.sin(radians) };
}
function hexToOklch(hex) {
const lab = rgbToOklab(hexToRgb(hex));
const c = Math.sqrt(lab.a ** 2 + lab.b ** 2);
return { l: lab.l, c, h: c < 0.0001 ? 0 : wrapHue(Math.atan2(lab.b, lab.a) * 180 / Math.PI) };
}
function inSrgb(linearRgb) {
return linearRgb.every((value) => value >= -0.000001 && value <= 1.000001);
}
function fitOklch(color) {
const target = { l: clamp(color.l), c: Math.max(0, color.c), h: wrapHue(color.h) };
if (inSrgb(oklabToLinearRgb(oklchToOklab(target)))) return target;
let low = 0;
let high = target.c;
for (let index = 0; index < 24; index += 1) {
const c = (low + high) / 2;
if (inSrgb(oklabToLinearRgb(oklchToOklab({ ...target, c })))) low = c;
else high = c;
}
return { ...target, c: low };
}
function oklchToHex(input) {
const color = fitOklch(input);
const rgb = oklabToLinearRgb(oklchToOklab(color)).map((value) => clamp(delinearize(value)));
return `#${rgb.map((value) => Math.round(value * 255).toString(16).padStart(2, "0")).join("")}`.toUpperCase();
}
function luminance(hex) {
const [r, g, b] = hexToRgb(hex).map(linearize);
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
}
function contrast(a, b) {
const values = [luminance(a), luminance(b)].sort((x, y) => y - x);
return (values[0] + 0.05) / (values[1] + 0.05);
}
function readableForeground(background, dark, light, target = 4.5) {
const candidates = [dark, light].map((hex) => ({ hex, ratio: contrast(hex, background) }));
candidates.sort((a, b) => b.ratio - a.ratio);
return { ...candidates[0], pass: candidates[0].ratio >= target };
}
function accessibleFill(color, dark, light, target = 4.5) {
const firstHex = oklchToHex(color);
const firstForeground = readableForeground(firstHex, dark, light, target);
if (firstForeground.pass) return { color: fitOklch(color), hex: firstHex, foreground: firstForeground.hex, ratio: firstForeground.ratio, adjusted: false };
let winner = null;
for (let step = 3; step <= 97; step += 1) {
const candidate = fitOklch({ ...color, l: step / 100 });
const hex = oklchToHex(candidate);
const foreground = readableForeground(hex, dark, light, target);
if (!foreground.pass) continue;
const distance = Math.abs(candidate.l - color.l) + Math.abs(candidate.c - color.c) * 0.25;
if (!winner || distance < winner.distance) winner = { color: candidate, hex, foreground: foreground.hex, ratio: foreground.ratio, distance };
}
if (!winner) throw new Error("Unable to derive an accessible fill");
return { ...winner, adjusted: true };
}
function rolePair(roles, foreground, background, minimum) {
const ratio = contrast(roles[foreground], roles[background]);
return { foreground, background, ratio: Number(ratio.toFixed(2)), minimum, pass: ratio >= minimum };
}
function chooseAccentHue(keyHue, harmony, character) {
const offsets = {
tonal: [0, 24, -24],
adjacent: [42, -42, 68, -68],
contrast: [145, -145, 180, 118, -118],
auto: character === "calm" ? [42, -42, 68, -68] : character === "deep" ? [-72, 72, 132, -132] : [118, -118, 148, -148, 42],
}[harmony];
const candidates = offsets.map((offset, index) => {
const hue = wrapHue(keyHue + offset);
const semanticDistance = Math.min(...Object.values(STATUS_HUES).map((statusHue) => hueDistance(hue, statusHue)));
const keyDistance = hueDistance(hue, keyHue);
const separationTarget = harmony === "tonal" ? 12 : harmony === "adjacent" ? 46 : 130;
const score = semanticDistance * 0.75 - Math.abs(keyDistance - separationTarget) * 0.3 - index * 0.5;
return { hue, offset, score, semanticDistance };
});
candidates.sort((a, b) => b.score - a.score);
return candidates[0];
}
function surfaceColor(lightness, hue, chroma) {
return oklchToHex({ l: lightness, c: chroma, h: hue });
}
function makeRamp(hue, chroma) {
return Object.fromEntries(RAMP_LIGHTNESS.map((lightness, index) => {
const centerWeight = 0.62 + 0.38 * (1 - Math.abs(lightness - 0.56) / 0.5);
return [RAMP_KEYS[index], oklchToHex({ l: lightness, c: chroma * clamp(centerWeight, 0.5, 1), h: hue })];
}));
}
function tokenCss(result) {
const declarations = Object.entries(result.roles)
.map(([role, value]) => ` --ss-${role.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`)}: ${value};`)
.join("\n");
const ramps = Object.entries(result.ramps)
.flatMap(([name, ramp]) => Object.entries(ramp)
.map(([step, value]) => ` --ss-${name}-${step}: ${value};`))
.join("\n");
return `:root {\n${declarations}\n${ramps}\n}`;
}
export function generatePalette(options = {}) {
const keyColor = normalizeHex(options.keyColor || "#276B5E");
const mode = option(options.mode, "light", ["light", "dark"], "mode");
const character = option(options.character, "balanced", Object.keys(CHARACTER), "character");
const harmony = option(options.harmony, "auto", ["auto", "tonal", "adjacent", "contrast"], "harmony");
const temperature = option(options.temperature, "neutral", Object.keys(TEMPERATURE_HUE), "temperature");
const config = CHARACTER[character];
const key = hexToOklch(keyColor);
const keyHue = key.c < 0.025 ? 250 : key.h;
const neutralHue = TEMPERATURE_HUE[temperature] ?? keyHue;
const neutralChroma = temperature === "neutral" ? Math.min(config.surface, Math.max(0.004, key.c * 0.08)) : config.surface;
const darkInk = surfaceColor(mode === "dark" ? 0.10 : 0.15, neutralHue, neutralChroma * 0.55);
const lightPaper = surfaceColor(mode === "dark" ? 0.96 : 0.99, neutralHue, neutralChroma * 0.42);
const primaryChroma = clamp(Math.max(key.c, 0.095) * config.chroma, 0.075, character === "vivid" ? 0.25 : 0.19);
const primary = accessibleFill({ l: mode === "dark" ? config.primaryDark : config.primaryLight, c: primaryChroma, h: keyHue }, darkInk, lightPaper);
const accentChoice = chooseAccentHue(keyHue, harmony, character);
const accentChroma = clamp(Math.max(primary.color.c * config.accent, 0.085), 0.075, character === "vivid" ? 0.22 : 0.17);
const accent = accessibleFill({ l: mode === "dark" ? 0.79 : 0.48, c: accentChroma, h: accentChoice.hue }, darkInk, lightPaper);
const levels = mode === "dark"
? { background: 0.105, surface: 0.155, chrome: 0.215, muted: 0.72, border: 0.34 }
: { background: 0.965, surface: 0.992, chrome: 0.91, muted: 0.43, border: 0.79 };
const background = surfaceColor(levels.background, neutralHue, neutralChroma);
const surface = surfaceColor(levels.surface, neutralHue, neutralChroma * 0.55);
const chrome = surfaceColor(levels.chrome, neutralHue, neutralChroma * 1.25);
const foreground = mode === "dark" ? lightPaper : darkInk;
const mutedForegroundCandidate = surfaceColor(levels.muted, neutralHue, neutralChroma * 0.7);
const mutedForeground = contrast(mutedForegroundCandidate, background) >= 4.5
? mutedForegroundCandidate
: readableForeground(background, darkInk, lightPaper, 4.5).hex;
const chromeForeground = readableForeground(chrome, darkInk, lightPaper, 4.5).hex;
const status = Object.fromEntries(Object.entries(STATUS_HUES).map(([role, hue]) => {
const chroma = role === "warning" ? 0.12 : 0.14;
return [role, accessibleFill({ l: mode === "dark" ? 0.78 : 0.44, c: chroma, h: hue }, darkInk, lightPaper)];
}));
const focusCandidates = [accent.hex, primary.hex, surfaceColor(mode === "dark" ? 0.82 : 0.48, 250, 0.16)];
const focus = focusCandidates
.map((hex) => ({ hex, score: Math.min(contrast(hex, background), contrast(hex, surface)) }))
.sort((a, b) => b.score - a.score)[0].hex;
const roles = {
background,
surface,
chrome,
foreground,
mutedForeground,
chromeForeground,
border: surfaceColor(levels.border, neutralHue, neutralChroma * 1.4),
primary: primary.hex,
primaryForeground: primary.foreground,
accent: accent.hex,
accentForeground: accent.foreground,
focus,
success: status.success.hex,
successForeground: status.success.foreground,
warning: status.warning.hex,
warningForeground: status.warning.foreground,
danger: status.danger.hex,
dangerForeground: status.danger.foreground,
};
const contrastChecks = [
rolePair(roles, "foreground", "background", 4.5),
rolePair(roles, "mutedForeground", "background", 4.5),
rolePair(roles, "foreground", "surface", 4.5),
rolePair(roles, "chromeForeground", "chrome", 4.5),
rolePair(roles, "primaryForeground", "primary", 4.5),
rolePair(roles, "accentForeground", "accent", 4.5),
rolePair(roles, "successForeground", "success", 4.5),
rolePair(roles, "warningForeground", "warning", 4.5),
rolePair(roles, "dangerForeground", "danger", 4.5),
rolePair(roles, "focus", "background", 3),
rolePair(roles, "focus", "surface", 3),
];
const result = {
schemaVersion: 1,
generator: { name: "StyleSeed Palette Engine", version: VERSION, colorSpace: "OKLCH", targetGamut: "sRGB" },
input: { keyColor, mode, character, harmony, temperature },
normalizedKey: {
hex: keyColor,
oklch: { l: Number(key.l.toFixed(4)), c: Number(key.c.toFixed(4)), h: Number(keyHue.toFixed(2)) },
},
decisions: {
character: `${config.label} character controls lightness/chroma before hue harmony.`,
accent: { hue: Number(accentChoice.hue.toFixed(2)), offset: accentChoice.offset, method: harmony, avoidsStatusCollisionBy: Number(accentChoice.semanticDistance.toFixed(2)) },
primaryAdjustedForContrast: primary.adjusted,
accentAdjustedForContrast: accent.adjusted,
allocation: { dominant: "60% canvas and surfaces", secondary: "30% chrome, type, and supporting structure", accent: "10% primary/accent emphasis combined" },
},
ramps: { primary: makeRamp(keyHue, primaryChroma), accent: makeRamp(accentChoice.hue, accentChroma) },
roles,
contrast: contrastChecks,
valid: contrastChecks.every((item) => item.pass),
assetBrief: {
anchors: [background, primary.hex, accent.hex],
hierarchy: "background dominant; primary identifies the product/action; accent is rare supporting emphasis",
avoid: ["equal-area competing accents", "rainbow category decoration", "text baked into generated imagery"],
},
reasoning: [
"Character is chosen before harmony: lightness and chroma drive perceived calm or intensity more reliably than hue geometry alone.",
"The key hue is preserved while chroma is reduced to the sRGB gamut boundary instead of clipping RGB channels.",
`The ${harmony} accent candidate is scored for separation from the key and reserved success, warning, and danger hues.`,
"Reference colors are mapped through semantic roles; components should never consume raw ramp values directly.",
"Every text, action, status, and focus pair is checked after generation; failing fills are moved in lightness while preserving hue identity.",
],
};
return { ...result, css: tokenCss(result) };
}
export { contrast, hexToOklch, normalizeHex, oklchToHex, tokenCss as generatePaletteCss };
+12
View File
@@ -0,0 +1,12 @@
import palettes from "./palettes.json";
export * from "./generator.mjs";
export type PaletteRecipe = (typeof palettes)[number];
export type PaletteRecipeId = PaletteRecipe["id"];
export const PALETTE_RECIPES = palettes;
export const PALETTE_BY_ID = Object.fromEntries(
palettes.map((palette) => [palette.id, palette]),
) as Record<PaletteRecipeId, PaletteRecipe>;
@@ -0,0 +1,234 @@
[
{
"id": "quiet-mineral",
"name": "Quiet mineral",
"mode": "light",
"bestFor": "Calm consumer products, health, benefits, and personal utilities",
"recipeBias": ["calm-consumer", "native-mobile"],
"roles": {
"background": "#F3F0E8",
"surface": "#FFFDF8",
"chrome": "#DCE7E0",
"foreground": "#19211F",
"mutedForeground": "#56635F",
"chromeForeground": "#19211F",
"border": "#BFC9C2",
"primary": "#276B5E",
"primaryForeground": "#FFFFFF",
"accent": "#D56A45",
"accentForeground": "#211713",
"focus": "#155EEF",
"success": "#1E6F50",
"successForeground": "#FFFFFF",
"warning": "#8A5700",
"warningForeground": "#FFFFFF",
"danger": "#B42318",
"dangerForeground": "#FFFFFF"
},
"usage": "Let warm neutrals carry most of the canvas. Reserve green for the primary action and current-state reassurance; keep coral below ten percent.",
"assetBrief": { "anchors": ["#F3F0E8", "#276B5E", "#D56A45"], "avoid": ["neon blue", "rainbow gradients", "blue-purple AI glow"] }
},
{
"id": "deep-lime-studio",
"name": "Deep lime studio",
"mode": "dark",
"bestFor": "Creative work, focused productivity, and high-craft prototypes",
"recipeBias": ["creative-professional", "expressive-brand"],
"roles": {
"background": "#0B0D0F",
"surface": "#15191D",
"chrome": "#262C31",
"foreground": "#F5F4ED",
"mutedForeground": "#A8AFAB",
"chromeForeground": "#F5F4ED",
"border": "#465057",
"primary": "#B8FF5A",
"primaryForeground": "#10140C",
"accent": "#7AA7FF",
"accentForeground": "#0B1020",
"focus": "#B8FF5A",
"success": "#75E6A4",
"successForeground": "#0B1A10",
"warning": "#FFC857",
"warningForeground": "#1B1300",
"danger": "#FF766E",
"dangerForeground": "#200704"
},
"usage": "Use lime for selection and one decisive action, never as body text. Layer chrome one step lighter than the canvas; let generated imagery remain low-luminance.",
"assetBrief": { "anchors": ["#0B0D0F", "#B8FF5A", "#7AA7FF"], "avoid": ["pure-white bloom", "multicolor neon", "lime on light backgrounds"] }
},
{
"id": "cobalt-instrument",
"name": "Cobalt instrument",
"mode": "light",
"bestFor": "Developer platforms, data products, and operational workbenches",
"recipeBias": ["developer-platform", "enterprise-workbench"],
"roles": {
"background": "#F1F5FA",
"surface": "#FFFFFF",
"chrome": "#101828",
"foreground": "#101828",
"mutedForeground": "#475467",
"chromeForeground": "#F9FAFB",
"border": "#C7D1E0",
"primary": "#175CD3",
"primaryForeground": "#FFFFFF",
"accent": "#6941C6",
"accentForeground": "#FFFFFF",
"focus": "#175CD3",
"success": "#067647",
"successForeground": "#FFFFFF",
"warning": "#934F00",
"warningForeground": "#FFFFFF",
"danger": "#B42318",
"dangerForeground": "#FFFFFF"
},
"usage": "Use neutral layers for evidence and cobalt for action/selection. Violet belongs to secondary categorization, not a second primary action.",
"assetBrief": { "anchors": ["#101828", "#175CD3", "#F1F5FA"], "avoid": ["cyan terminal glow", "decorative gradients", "low-contrast gray text"] }
},
{
"id": "warm-clay-commerce",
"name": "Warm clay commerce",
"mode": "light",
"bestFor": "Commerce, hospitality, booking, and human service brands",
"recipeBias": ["commerce-operator", "calm-consumer"],
"roles": {
"background": "#FFF8F2",
"surface": "#FFFFFF",
"chrome": "#2B201B",
"foreground": "#2B201B",
"mutedForeground": "#6B5549",
"chromeForeground": "#FFF8F2",
"border": "#DCCBC0",
"primary": "#A64005",
"primaryForeground": "#FFFFFF",
"accent": "#6441C4",
"accentForeground": "#FFFFFF",
"focus": "#1D5FD0",
"success": "#187451",
"successForeground": "#FFFFFF",
"warning": "#8A5700",
"warningForeground": "#FFFFFF",
"danger": "#B42318",
"dangerForeground": "#FFFFFF"
},
"usage": "Let product imagery and warm paper carry identity. Clay marks purchase intent; violet is reserved for saved or personalized context.",
"assetBrief": { "anchors": ["#FFF8F2", "#A64005", "#2B201B"], "avoid": ["orange sale walls", "high-saturation red urgency", "generic purple gradient"] }
},
{
"id": "civic-blue",
"name": "Civic blue",
"mode": "light",
"bestFor": "Public services, regulated applications, and consequential workflows",
"recipeBias": ["public-service", "enterprise-workbench"],
"roles": {
"background": "#F3F5F7",
"surface": "#FFFFFF",
"chrome": "#003078",
"foreground": "#0B0C0C",
"mutedForeground": "#4C6272",
"chromeForeground": "#FFFFFF",
"border": "#B1B4B6",
"primary": "#1D5F91",
"primaryForeground": "#FFFFFF",
"accent": "#00703C",
"accentForeground": "#FFFFFF",
"focus": "#B45F06",
"success": "#00703C",
"successForeground": "#FFFFFF",
"warning": "#8A5700",
"warningForeground": "#FFFFFF",
"danger": "#B42318",
"dangerForeground": "#FFFFFF"
},
"usage": "Use blue for institution and primary action, green only for confirmed success, and amber focus with a visible outline. Pair every status with text.",
"assetBrief": { "anchors": ["#003078", "#F3F5F7", "#00703C"], "avoid": ["pastel minimalism", "glass navigation", "color-only status"] }
},
{
"id": "editorial-ink",
"name": "Editorial ink",
"mode": "light",
"bestFor": "Research, journalism, reports, and authoritative reading",
"recipeBias": ["editorial-authority", "public-service"],
"roles": {
"background": "#F5F1E8",
"surface": "#FFFCF6",
"chrome": "#111111",
"foreground": "#111111",
"mutedForeground": "#5B564E",
"chromeForeground": "#FFFFFF",
"border": "#C9C0B2",
"primary": "#8F2C21",
"primaryForeground": "#FFFFFF",
"accent": "#1D4E9E",
"accentForeground": "#FFFFFF",
"focus": "#1D4E9E",
"success": "#176B45",
"successForeground": "#FFFFFF",
"warning": "#805200",
"warningForeground": "#FFFFFF",
"danger": "#A12B22",
"dangerForeground": "#FFFFFF"
},
"usage": "Use ink and paper for the reading field. Red marks editorial emphasis sparingly; blue owns links and focus.",
"assetBrief": { "anchors": ["#F5F1E8", "#111111", "#8F2C21"], "avoid": ["fake newspaper texture", "sepia photos", "card-grid chrome"] }
},
{
"id": "signal-coral",
"name": "Signal coral",
"mode": "light",
"bestFor": "Expressive launches, social products, and consumer discovery",
"recipeBias": ["expressive-brand", "native-mobile"],
"roles": {
"background": "#FFF3EC",
"surface": "#FFFFFF",
"chrome": "#1A1423",
"foreground": "#1A1423",
"mutedForeground": "#645A6C",
"chromeForeground": "#FFFFFF",
"border": "#D8C9D0",
"primary": "#C83D2C",
"primaryForeground": "#FFFFFF",
"accent": "#5B3EC8",
"accentForeground": "#FFFFFF",
"focus": "#5B3EC8",
"success": "#19724E",
"successForeground": "#FFFFFF",
"warning": "#875400",
"warningForeground": "#FFFFFF",
"danger": "#A92924",
"dangerForeground": "#FFFFFF"
},
"usage": "Let coral own the hook and selected moment. Violet supports spatial or media context; never let both compete as primary actions.",
"assetBrief": { "anchors": ["#FFF3EC", "#C83D2C", "#5B3EC8"], "avoid": ["pink-purple gradient wash", "rainbow icon chips", "coral body text"] }
},
{
"id": "nocturne-violet",
"name": "Nocturne violet",
"mode": "dark",
"bestFor": "Media, AI, experimental professional tools, and immersive utilities",
"recipeBias": ["creative-professional", "developer-platform"],
"roles": {
"background": "#0D0B16",
"surface": "#171327",
"chrome": "#2A2341",
"foreground": "#F6F2FF",
"mutedForeground": "#B3A9C9",
"chromeForeground": "#F6F2FF",
"border": "#554A70",
"primary": "#A98BFF",
"primaryForeground": "#160F28",
"accent": "#4BE0C3",
"accentForeground": "#06251F",
"focus": "#D1C2FF",
"success": "#65D6A2",
"successForeground": "#062118",
"warning": "#F4BF55",
"warningForeground": "#241700",
"danger": "#FF8078",
"dangerForeground": "#2A0705"
},
"usage": "Use violet for primary control and mint for creation/progress. Keep media dark enough to preserve chrome and avoid synthetic AI-glow overload.",
"assetBrief": { "anchors": ["#0D0B16", "#A98BFF", "#4BE0C3"], "avoid": ["electric blue haze", "purple gradient headlines", "white bloom behind text"] }
}
]
@@ -0,0 +1,93 @@
{
"schemaVersion": 3,
"engineVersion": "4.0.0",
"generatedFrom": [
"PRODUCT-PRINCIPLES.md",
"CRAFT-BASELINE.md",
"RULESETS.md",
"ADAPTERS.md",
"APP-PLAYBOOKS.md",
"PAGE-TYPES.md",
"BRAND-RECIPES.md",
"PALETTE-RECIPES.md",
"color/palettes.json",
"PRESETS.md"
],
"core": "# StyleSeed Product Constitution\n\nStyleSeed is an **AI design-method engine**. Its primary job is to make a coding agent\nreason like a strong UI/UX designer and apply that reasoning consistently. Components,\nskins, scores, and screenshots support that job; they do not define it.\n\n## The fixed method, not one fixed look\n\nStyleSeed enforces a stable way of judging design. It does **not** force every product to\nlook like Toss, a SaaS dashboard, or the StyleSeed demo. A trustworthy consumer-finance\nhome, an observability console, an editorial story, and a product-detail page solve\ndifferent jobs and therefore need different design grammars.\n\nThe effective rule set is composed:\n\n```text\nCore judgment\n × one output grammar from RULESETS.md (built-in or reference-compiled)\n × one surface adapter from ADAPTERS.md\n × one domain playbook from APP-PLAYBOOKS.md\n × one page type from PAGE-TYPES.md\n × one brand recipe from BRAND-RECIPES.md\n × one semantic palette posture plus an optional key-color generation from PALETTE-RECIPES.md\n × optional aesthetic profile from PRESETS.md\n × bounded project tokens from STYLESEED.md\n= the rules for this screen\n```\n\n## Authority order\n\nWhen instructions disagree, use this order:\n\n1. **Core invariants** below.\n2. **Output grammar** — the functional visual language selected in `RULESETS.md`, or a\n project-local grammar compiled by `REFERENCE-COMPILER.md`.\n3. **Surface adapter** — the renderer contract and physical constraints in `ADAPTERS.md`.\n4. **Domain playbook** and **page/artifact type**.\n5. **Brand recipe** — a reusable morphology and component-selection contract from\n `BRAND-RECIPES.md`.\n6. **Palette system** — a maintained semantic posture plus deterministic key-color generation,\n role mapping, gamut handling, and contrast correction from `PALETTE-RECIPES.md`.\n7. **Aesthetic profile** — an optional coordinated restyle from `PRESETS.md`.\n8. **Design lock** — records selections and bounded project parameters.\n9. **Skins and components** — implementation material, not sources of judgment.\n10. **Score and visual verification** — evidence that the method was applied.\n\n`STYLESEED.md` is persistence, not permission. An arbitrary value in the lock never turns\na violation into a sound design decision. Unknown values fall back to the nearest maintained\ngrammar and the core defaults.\n\n## Core invariants\n\nThese apply to every grammar, profile, domain, page, skin, and agent:\n\n- One deliberate visual system per product: radius, spacing, elevation, icon language,\n typography, color roles, imagery, and motion agree.\n- One focal point per screen and a clear information hierarchy.\n- Color communicates role or meaning. One primary action remains identifiable even when\n semantic, categorical, or product colors are present.\n- Semantic tokens replace component-level hardcoded colors.\n- Spacing follows a repeatable scale; proximity communicates grouping.\n- Typography fits the surface and task, with readable measure, contrast, and hierarchy.\n- Data surfaces include useful loading, empty, and error states.\n- Controls remain operable: visible focus, sufficient targets, labels, reduced-motion\n support, and no dark patterns.\n- Motion fits the surface and never delays comprehension or action.\n- Distinctiveness comes from the product, its content, and its selected grammar — not a\n copied demo, generic indigo, repeated icon chips, emoji chrome, or template uniformity.\n\n## What the lock may select\n\nThe lock may select only inputs the engine understands:\n\n- domain, surface adapter, page/artifact type, and one output grammar;\n- one maintained brand recipe, one semantic palette posture, optional bounded key-color generation,\n one optional aesthetic profile, and one skin or project token implementation;\n- primary action/accent, type pairing, density, radius, elevation, imagery, and motion values\n inside the selected grammar's allowed ranges;\n- one product-specific signature move that still obeys the invariants;\n- a project-local reference grammar with provenance and confidence recorded by the compiler.\n\nThe lock may not invent a palette mode, waive accessibility, legalize mixed systems, or\noverride a core invariant. A reusable built-in grammar requires research, examples, and\nregression evaluation. A reference-derived grammar stays project-local until it meets that bar.\n\n## The product loop\n\n```text\nunderstand the job → choose or compile a grammar → lock bounded decisions\n→ build with judgment → score the implementation → visually verify rendered output\n→ present the result and evidence\n```\n\nThe build method is the product. Scoring and verification are auxiliary gates: they find\ndrift, but they never choose or rewrite the design philosophy after the fact.",
"craft": "# StyleSeed Compact Craft Baseline\n\nThis is the small, task-independent craft layer used by the Context Compiler. It preserves\nthe highest-leverage rules without injecting the full design handbook into every agent turn.\nThe selected output grammar, adapter, domain, page type, brand recipe, profile, and project lock narrow these\ndefaults. `PRODUCT-PRINCIPLES.md` remains the higher authority.\n\n## Coherence\n\n- Choose one coordinated family for radius, elevation, borders, icon style, typography, motion,\n control heights, and interaction states. Encode each family as semantic tokens and reuse it.\n- A coherent system may contain multiple component shapes and colors, but every variation must\n have a repeated role. Local decoration is not a role.\n- Preserve strengths and already-set project decisions. Do not restyle unrelated surfaces while\n fixing one screen.\n\n## Hierarchy and composition\n\n- Give every screen one dominant user decision or reading promise. Supporting content must recede\n through scale, position, contrast, density, or disclosure—not random color.\n- Proximity communicates grouping: space around a group should normally be at least twice the\n space within it. Repeated sections need deliberate variation in height, density, or composition.\n- Use real product content and evidence. Placeholder dashboards, fake metrics, stock chat panels,\n and equal card walls make otherwise clean work look generic.\n- Keep prose near 50–75 characters per line. Let data surfaces use width, but bound any reading\n column inside them.\n\n## Spacing and type\n\n- Start from `{4, 8, 12, 16, 24, 32, 40, 48, 64, 80, 96}` and use off-scale values only for a\n documented optical correction.\n- Default body text to 16px on general surfaces. Dense desktop UI may use 13–14px for metadata,\n table chrome, timestamps, or identifiers; decisions and explanatory copy stay readable.\n- Use no more than two type families and one intentional weight ramp. Use tabular numerals for\n money, tables, timers, and comparable metrics.\n- Tighten leading as type grows: body about 1.5, headings 1.2–1.35, display 1.0–1.2.\n\n## Components and interaction\n\n- Use the lightest separation that works: whitespace, then tone, then hairline, then shadow.\n Do not combine a visible border and floating shadow without a functional reason.\n- Buttons, inputs, and selects in one context share a height. Touch surfaces provide at least\n 44px targets; pointer-first dense desktop controls may be smaller when still operable.\n- Labels remain visible. Errors name the problem and recovery and never rely on color alone.\n- Use one icon family, fill mode, and stroke family. Do not use emoji as application chrome.\n- Loading, empty, error, success, disabled, and permission states preserve layout and provide a\n useful next action where the surface owns data or mutation.\n\n## Color, accessibility, and motion\n\n- Use semantic tokens. Keep one identifiable primary action while allowing stable semantic,\n categorical, or brand roles required by the selected grammar.\n- Body text targets WCAG AA contrast; large text and meaningful graphics meet their applicable\n threshold. Focus is visible, controls have names, and keyboard order follows visual order.\n- Motion uses one duration/easing family, communicates state or sequence, and never delays the\n first read or an action. Provide a complete reduced-motion result.\n- Inspect the real render at the target viewport. Source review cannot certify optical balance,\n font loading, crop, responsive transformation, or visual states.",
"grammars": {
"consumer-service": "### `consumer-service`\n\n- **Job:** understand personal state without anxiety and take one useful next action.\n- **Attention:** one dominant balance, status, benefit, or briefing; secondary services recede.\n- **Composition:** short contextual heading → dominant summary → small set of next actions →\n progressive detail. Mobile-first, thumb-reachable, explicit bottom navigation where needed.\n- **Density/type:** comfortable to airy; friendly sans; large plain-language numbers; short copy.\n- **Color/surface:** calm neutral base, one brand action color, semantic colors only for real\n status. Soft grouped surfaces are common but a card is used only when it groups a decision.\n- **Feedback:** immediate, reassuring, reversible; money and health values do not animate\n theatrically.\n- **Reject:** every service as equal card, promotional clutter above state, rainbow categories,\n cute language in serious moments, or copying Toss component-for-component.",
"operations-console": "### `operations-console`\n\n- **Job:** scan system or business state, compare changes, find exceptions, act efficiently.\n- **Attention:** one operational focal panel; supporting KPIs form hierarchy rather than a\n uniform card wall.\n- **Composition:** persistent navigation → scope/time controls → focal trend or queue →\n comparable metrics → actionable table/list. Detail lives below or on demand.\n- **Density/type:** comfortable to compact; neutral grotesk; tabular numerals; labels may be\n small but body and decisions remain readable on desktop.\n- **Color/surface:** restrained brand accent; categorical colors only for stable, repeated data\n semantics. Tone, alignment, and grouping carry more hierarchy than decoration.\n- **Feedback:** filters and mutations respond instantly; loading preserves layout; bulk action\n consequences are explicit.\n- **Reject:** same-weight KPI tiles everywhere, decorative gradients, mobile-tight type on a\n 1440px canvas, or charts without a decision they support.",
"technical-instrument": "### `technical-instrument`\n\n- **Job:** observe live state, isolate anomalies, and diagnose a system.\n- **Attention:** current incident, trace, monitor, or performance state dominates.\n- **Composition:** stable navigation and scope → live status/timeline → dense evidence table or\n trace → drill-down. Group by diagnostic relationship, not visual symmetry.\n- **Density/type:** compact to dense; sans for UI, mono only for identifiers, timestamps, code,\n and aligned numeric evidence.\n- **Color/surface:** neutral light or dark tonal ramp; one signal accent; status colors are\n semantic and sparse. Dark mode uses tonal levels and hairlines, not floating shadows.\n- **Feedback:** near-instant, non-blocking, time-aware; paused/live state is unmistakable.\n- **Reject:** decorative terminal cosplay, neon rainbow telemetry, excessive mono body copy,\n or animation that competes with changing data.",
"editorial-reading": "### `editorial-reading`\n\n- **Job:** understand, retain, and navigate a narrative or argument.\n- **Attention:** title/deck/byline or the opening visual establishes the reading promise.\n- **Composition:** strong title rhythm → bounded reading column → meaningful media/pull quote →\n related context after the narrative. Chrome recedes.\n- **Density/type:** airy around the story; 45–90 characters per line, normally near 60–70;\n comfortable body size/leading; serif is optional and role-specific, never an automatic theme.\n- **Color/surface:** ink and paper-like neutrals may be used without faking print; one quiet\n accent for links and editorial signals. Whitespace and type replace gratuitous cards.\n- **Feedback:** reading position, save, share, and footnotes are calm and unobtrusive.\n- **Reject:** forcing all content into cards, app-dashboard chrome around prose, overly wide\n measures, serif everywhere, or interaction patterns that interrupt reading.",
"commerce-conversion": "### `commerce-conversion`\n\n- **Job:** evaluate an offer, resolve uncertainty, select a variant, and commit.\n- **Attention:** product/service evidence leads; price, availability, primary CTA, and trust\n information remain easy to connect.\n- **Composition:** media → identity/price/proof → variants → primary action → delivery/returns →\n details and comparison. On mobile, keep the commitment action reachable without hiding terms.\n- **Density/type:** comfortable; product information is highly scannable; images are evidence,\n not decorative filler.\n- **Color/surface:** brand color supports the purchase action; ratings, discounts, stock, and\n errors use stable semantics rather than a promotional rainbow.\n- **Feedback:** variant and cart changes are immediate and reversible; costs and constraints\n appear before commitment.\n- **Reject:** urgency dark patterns, buried shipping/returns, competing CTAs, tiny variant\n targets, or a lifestyle mood that obscures the actual product.",
"institutional-service": "### `institutional-service`\n\n- **Job:** understand eligibility or obligation, provide accurate information, and complete a\n consequential task with confidence.\n- **Attention:** task title, current step, and required action dominate over branding.\n- **Composition:** plain-language intro → prerequisites → one step at a time → review → clear\n confirmation and recovery path.\n- **Density/type:** comfortable, highly legible, robust at zoom; labels and help stay adjacent\n to controls; long content uses bounded measure.\n- **Color/surface:** conservative semantic palette with high contrast; errors never rely on\n color alone; decorative color is rare.\n- **Feedback:** preserve entered data, explain errors, expose progress, and provide reference\n numbers/next steps after completion.\n- **Reject:** novelty over comprehension, ambiguous icons, low-contrast minimalism, hidden\n requirements, or motion that makes a serious workflow feel unstable.",
"expressive-marketing": "### `expressive-marketing`\n\n- **Job:** understand the proposition, believe the proof, and choose a next step.\n- **Attention:** one unmistakable promise paired with real product or brand evidence.\n- **Composition:** proposition → proof → differentiated mechanism → examples/outcomes → CTA.\n Section forms vary to create rhythm; repetition is deliberate, not template filler.\n- **Density/type:** airy with confident display hierarchy; body copy remains readable.\n- **Color/surface:** wider brand palette and expressive media are allowed when roles remain\n coherent and one action is primary.\n- **Feedback:** cinematic motion may support sequence, but first read and CTA work without it;\n reduced motion yields a complete page.\n- **Reject:** generic gradient headline, equal three-card feature rows, fake metrics, copied\n demo visuals, scroll-jacking, or motion used as a substitute for a proposition.",
"sequential-story": "### `sequential-story`\n\n- **Job:** make one idea understandable and worth continuing across a bounded visual sequence.\n- **Attention:** slide/frame one earns the next gesture; each following frame has one dominant\n message and a visible place in the sequence.\n- **Composition:** hook → context/why → evidence or mechanism → useful action → reframe/close.\n Alternate big type, evidence, image, and utility frames so the sequence has rhythm.\n- **Density/type:** designed for the adapter's viewing distance and dwell time; one message per\n frame; body copy is bounded and never shrunk to rescue an overloaded slide.\n- **Color/surface:** project grammar and brand tokens carry across all frames; emphasis roles\n remain stable. Continuity comes from a system, not identical templates.\n- **Imagery:** crops, captions, and sources are intentional; generated-image text/logos are\n replaced during deterministic rendering.\n- **Feedback/navigation:** folio, progress, swipe cue, and CTA fit the publishing surface without\n occupying its unsafe UI zones.\n- **Reject:** ten identical cards, a weak explanatory cover, one composition repeated on every\n frame, content that works only as a caption, missing source attribution, or platform crop loss."
},
"adapters": {
"product-ui": "## `product-ui`\n\n- **Canvas:** responsive viewports declared in the design lock; verify at least one narrow and\n one wide target when both are in scope.\n- **Primitives:** semantic HTML and project-native components. Preserve framework conventions,\n routes, state, and real content rather than replacing the application with a mock.\n- **States:** loading, empty, error, success, disabled, focus, and responsive navigation are part\n of the artifact when the screen owns those behaviors.\n- **Export:** source code plus reproducible dev/build commands and screenshot paths.\n- **QA:** run project checks, render the real route, inspect target viewports and important states,\n and record what could not be exercised.",
"social-carousel": "## `social-carousel`\n\nUse `sequential-story` unless another grammar clearly owns the content. The installed Claude\n`carousel-build` skill is the canonical companion when available:\n\n1. StyleSeed reads or compiles the grammar and writes brand/type/motion/content rules to\n `STYLESEED.md`.\n2. `carousel-build` reads that lock, then applies deterministic engineering constraints:\n 3:4 `1080×1440`, platform safe zones, crop behavior, 8px rhythm, type scale, gradient\n banding prevention, available font weights, and reproducible PIL rendering.\n3. Copy and publishing skills may add their own contracts without altering visual authority.\n4. `/ss-score` checks sequence coherence and grammar fit; `/ss-verify` opens every exported\n frame and checks crop, safe zone, typography, rhythm, false text, and continuity.\n\nRecommended lock additions:\n\n```markdown\n- Surface adapter: social-carousel\n- Artifact type: information-carousel\n- Canvas: 1080x1440\n- Sequence grammar: hook → why → evidence → action → reframe → CTA\n- Renderer: carousel-build\n- Safe zone contract: adapter:ADAPTERS.md#social-carousel-integration\n```\n\nDo not duplicate the renderer's rapidly changing platform measurements inside a visual grammar.\nThe adapter/companion owns them; StyleSeed owns the visual judgment applied within them.",
"slide-deck": "## `slide-deck`\n\n- **Canvas:** use the presentation renderer's declared aspect ratio and safe area. Assume distance\n viewing; body copy that works on a web page is usually too small or dense on a slide.\n- **Sequence:** one claim per slide, visible narrative progression, and deliberate alternation\n between statement, evidence, comparison, and action.\n- **Assets:** use real charts, diagrams, screenshots, and cited imagery. Never use a text-heavy\n card grid as a substitute for a presentation.\n- **Export:** editable deck plus rendered PDF or page images.\n- **QA:** render every slide, inspect overflow and contrast, and compare repeated masters,\n alignment, folios, and speaker-facing information.",
"document-report": "## `document-report`\n\n- **Canvas:** paginated output with explicit paper size, margins, headers/footers, and print-safe\n color. Reading measure and page breaks take priority over app-like chrome.\n- **Structure:** title and executive summary establish the decision; headings, figures, tables,\n notes, and appendices expose evidence at the right depth.\n- **Assets:** captions and sources remain attached to figures and tables. Repeated components use\n document styles rather than local formatting.\n- **Export:** editable source plus visually verified PDF.\n- **QA:** render every page and inspect widows/orphans, clipped tables, broken links, page numbers,\n accessibility structure, and cross-page consistency.",
"single-frame": "## `single-frame`\n\n- **Canvas:** declare exact dimensions, crop variants, safe zones, and intended viewing distance.\n- **Composition:** one dominant message and one supporting action or proof. The frame must work\n without surrounding caption text unless the publishing contract says otherwise.\n- **Assets:** logos, product imagery, and text are deterministic and legible. Generated imagery\n must not supply final logos or critical text.\n- **Export:** source plus final PNG/JPEG/SVG variants and an asset manifest.\n- **QA:** inspect at native size and thumbnail size, verify crop variants, contrast, text safety,\n and platform compression risk."
},
"domains": {
"fintech": "## 1. Fintech / Banking / Payments\n\n- **Color:** maximum restraint — the brand accent is reserved for *money in\n motion* (CTAs, positive trend, the active balance). Greens/reds only for\n up/down, never decoration. Trust reads as calm, not loud.\n- **Density:** medium-low. One number should dominate each card. Whitespace\n signals \"we're careful with your money.\"\n- **Typography:** numbers first — hero balance at 48px with 24px unit (2:1).\n Currency, dates, and labels recede.\n- **Motion:** **Spring** (Toss-style confident bounce on CTAs) or **Silk** for\n balances and sheets. Never bouncy on a number that represents real money\n changing — it reads as unstable.\n- **Signature patterns:** HeroCard (balance), transaction `ListItem` with status\n dot, KPI `StatCard` with trend, period toggle, donut for spend breakdown.\n- **Anti-patterns:** playful/rainbow palettes, gradients on amounts, fake\n precision (`$8,400.0000`), shadows that float cards \"off the page,\" motion that\n delays seeing a balance.\n- **Brand recipe:** `calm-consumer`; use `native-mobile` for a platform-first utility.\n- **Skin material:** custom brand tokens; Toss and Stripe remain optional token references.",
"saas": "## 2. SaaS / B2B Dashboard / Analytics\n\n- **Color:** disciplined grayscale with one accent for the primary action and\n selected state. Data viz gets a small, fixed categorical scale — not a new\n color per metric.\n- **Density:** high. Power users want information per pixel: tables, filters,\n multi-KPI rows. Density is a feature, not clutter — but keep rhythm.\n- **Typography:** balanced numbers + labels. Tables need tabular-nums and tight\n line-height; headings stay quiet.\n- **Motion:** **Snap** (Linear-style instant). Power users hate waiting on\n animation. Layout/FLIP for reordering, near-zero entrance.\n- **Signature patterns:** ChartCard (period toggle + bottom stats), dense KPI\n grid, filterable list/table, segmented control, RankedList.\n- **Anti-patterns:** decorative motion, oversized hero numbers that waste space,\n 6 accent colors in a chart legend, modal-heavy flows (prefer inline).\n- **Brand recipe:** `enterprise-workbench`; use `developer-platform` for technical evidence.\n- **Skin material:** custom brand tokens; Linear and Vercel remain optional token references.",
"ecommerce": "## 3. E-commerce / Retail\n\n- **Color:** product imagery is the hero — UI chrome stays neutral so photos pop.\n The accent drives one thing: **add-to-cart / buy**. Price gets weight, not color.\n- **Density:** medium. Browsing = generous product cards; PDP = focused, one CTA\n above the fold.\n- **Typography:** price prominent (2:1 with currency), product title bold, specs\n quiet. Imagery > text in the hierarchy.\n- **Motion:** **Spring** (energetic, Arc-style) for add-to-cart, quantity stepper,\n cart badge pop (`pop-in`, `confetti-pop` on purchase is fair). Hover lift on\n product cards.\n- **Signature patterns:** product card grid, cart badge, quantity stepper, sticky\n buy bar, price + strikethrough, ranked/featured rails.\n- **Anti-patterns:** burying the CTA, more than one primary action on a PDP,\n shouty discount colors everywhere (dilutes urgency), motion that blocks adding\n to cart.\n- **Brand recipe:** `commerce-operator` for merchant/product operations; `calm-consumer` for a\n lightweight consumer purchase flow.\n- **Skin material:** custom brand tokens; Arc and Toss remain optional token references.",
"social": "## 4. Social / Community / Feed\n\n- **Color:** energetic and warm — the accent can appear more often (likes,\n mentions, online dots). Still one accent, but a livelier hue.\n- **Density:** medium, content-led. Avatars and media drive the layout; chrome is\n minimal.\n- **Typography:** names bold, timestamps tiny and tertiary, body readable. Let\n user content (images, text) lead.\n- **Motion:** **Pulse** (alive, rhythmic) for likes/reactions (`like-burst`),\n live indicators (`pulse-beat`), and new-content arrival (`stagger-cascade`).\n- **Signature patterns:** feed list, avatar + name + time row, like/comment/share\n actions, like-burst, bottom-sheet composer, story rail.\n- **Anti-patterns:** heavy chrome that competes with user content, slow entrance\n on a feed (kills scroll), engagement bait colors, inconsistent avatar shapes.\n- **Brand recipe:** `native-mobile` for app-first feeds; `expressive-brand` for creator surfaces.\n- **Skin material:** custom warm accent; Arc remains an optional token reference.",
"content": "## 5. Content / Media / News / Blog / Docs\n\n- **Color:** near-monochrome; the accent is for links and one CTA. Reading is the\n product — color is a distraction.\n- **Density:** low in the reading column (measure ~60–75ch), denser in nav/index.\n- **Typography:** **typography is the design.** Strong type scale, comfortable\n line-height (1.5–1.65 for body), real hierarchy between H/body/caption.\n- **Motion:** **Silk** (smooth, continuous) — `reveal-blur`/`reveal-rise` on\n headlines, subtle. Nothing that interrupts reading.\n- **Signature patterns:** article hero, readable body column, table of contents,\n pull quotes, related-content rail, code blocks (for docs).\n- **Anti-patterns:** full-width body text, decorative motion mid-article, multiple\n accents, cramped line-height, autoplaying anything.\n- **Brand recipe:** `editorial-authority`.\n- **Skin material:** custom editorial tokens; Notion and Vercel remain optional token references.",
"productivity": "## 6. Productivity / Tools / Workspace\n\n- **Color:** quiet grayscale, one accent for primary action + active item.\n Calm so the user's *work* is the focus.\n- **Density:** high but organized — sidebars, panels, keyboard-first. Reward\n power use.\n- **Typography:** compact, tabular where needed, clear active/hover states.\n- **Motion:** **Snap** (instant, precise). Layout transitions for reorder; avoid\n anything that adds latency to a frequent action.\n- **Signature patterns:** sidebar + content + (optional) inspector, command\n palette, list/board toggle, inline edit, segmented control, keyboard hints.\n- **Anti-patterns:** slow motion on frequent actions, modal overload, decorative\n color, hiding power features behind too much progressive disclosure.\n- **Brand recipe:** `creative-professional` or `developer-platform` by task.\n- **Skin material:** custom brand tokens; Linear, Notion, and Vercel remain optional references.",
"health": "## 7. Health / Wellness / Fitness\n\n- **Color:** calm and reassuring — soft accent, vivid only for *metric rings /\n progress* on a calm base. Avoid alarming reds except for genuine alerts.\n- **Density:** low-medium. One clear focus per screen (today's rings, next\n action). Reduce cognitive load — users may be tired or stressed.\n- **Typography:** big friendly numbers (2:1), gentle labels, generous spacing.\n- **Motion:** **Float** (weightless, gentle) for reveals; **Pulse** only for live\n heartbeat/recording. Motion should feel calm, never urgent.\n- **Signature patterns:** activity rings, big-metric hero, streak/progress, large\n touch targets (≥44px, often bigger), weekly history.\n- **Anti-patterns:** dense data dumps, alarming colors for normal states, tiny\n targets, jittery motion, shame-y empty states.\n- **Brand recipe:** `calm-consumer`; use `native-mobile` for tracking and capture.\n- **Skin material:** custom soft accent; Toss remains an optional token reference.",
"education": "## 8. Education / Learning / Courses\n\n- **Color:** encouraging — accent marks progress and the next step. Use color to\n reward (completed = success tone), not to decorate.\n- **Density:** low per step (one concept at a time), denser in course index.\n- **Typography:** clear hierarchy, readable body, prominent \"what's next.\"\n- **Motion:** **Spring** for rewards/completion (`pop-in`, `confetti-pop` on\n finishing a module), `stagger-cascade` for lesson lists.\n- **Signature patterns:** progress bar/ring, step list with states, lesson card,\n next-action CTA, achievement/streak, empty→first-lesson onboarding.\n- **Anti-patterns:** showing the whole curriculum at once (overwhelm), unclear\n next step, punishing empty/incomplete states, no sense of progress.\n- **Brand recipe:** `calm-consumer` for learners; `editorial-authority` for reading-heavy courses.\n- **Skin material:** custom learning tokens; Notion and Arc remain optional references.",
"developer-tools": "## 9. Developer Tools / Infra / API\n\n- **Color:** dark-first, restrained, one accent for primary/active. Syntax colors\n are their own controlled scale.\n- **Density:** high — devs read dense screens fine. Monospace where it belongs\n (code, IDs, logs).\n- **Typography:** mono for code/identifiers, tight tabular numbers, quiet UI text.\n- **Motion:** **Snap** (instant, precise). Devs distrust slow/flashy UI. Minimal,\n functional only.\n- **Signature patterns:** code blocks with copy, logs/terminal, status badges,\n command palette, key-value config, dark base.\n- **Anti-patterns:** flashy motion (reads as unserious to devs), light-only\n themes, decorative gradients, hiding the CLI/copy affordance.\n- **Brand recipe:** `developer-platform`.\n- **Skin material:** custom technical tokens; Raycast, Vercel, and Linear remain optional references.",
"marketplace": "## 10. Marketplace / Listings (two-sided)\n\n- **Color:** trust + conversion — neutral chrome, accent for the primary action\n (book/contact/buy) and for ratings/verified signals.\n- **Density:** medium — scannable listing grid, focused detail page.\n- **Typography:** listing title bold, price/rating prominent, meta quiet.\n- **Motion:** **Silk** for transitions, hover lift on listing cards, `pop-in` for\n saved/favorited.\n- **Signature patterns:** listing card (image + title + price + rating), filters,\n map/list toggle, detail with sticky action, reviews, verified badge.\n- **Anti-patterns:** untrustworthy density (too much, too fast), weak rating/trust\n signals, more than one primary action, buried contact/CTA.\n- **Brand recipe:** `commerce-operator`.\n- **Skin material:** custom marketplace tokens; Stripe and Notion remain optional references.",
"booking": "## 11. Booking / Travel / Reservations\n\n- **Color:** confident and visual — imagery (places, rooms) leads; accent drives\n the booking step. Calm so users feel sure about committing money/time.\n- **Density:** low-medium, step-focused. Dates and availability must be obvious.\n- **Typography:** clear dates/times, price prominent, friendly labels.\n- **Motion:** **Float** / **Silk** — smooth, reassuring transitions between steps;\n `reveal-blur` on imagery. Confidence, not flash.\n- **Signature patterns:** date/range picker, availability calendar, multi-step\n booking with progress, map, price summary, confirmation.\n- **Anti-patterns:** hidden total/fees, unclear current step, jarring motion mid-\n booking, tiny date controls, anxiety-inducing scarcity spam.\n- **Brand recipe:** `commerce-operator`; use `native-mobile` for an app-first itinerary.\n- **Skin material:** custom travel tokens; Arc and Notion remain optional references.",
"ai-assistant": "## 12. AI / Chat / Assistant\n\n- **Color:** minimal chrome so the conversation is the focus; one accent for the\n send/primary action. Let content (the answer) lead.\n- **Density:** low chrome, high content. Generous reading width for responses.\n- **Typography:** readable body for answers, mono for code, quiet UI around the\n thread.\n- **Motion:** **Silk** — streaming/typing feel, smooth message entrance\n (`reveal-blur`/`stagger`), nothing that competes with reading the answer.\n- **Signature patterns:** message thread, streaming response, composer with\n send, prompt suggestions, copy-on-message, minimal top bar.\n- **Anti-patterns:** heavy chrome around the chat, flashy motion on every token,\n cramped reading width, burying the input, multiple accents.\n- **Brand recipe:** `creative-professional` for workbench assistants; `calm-consumer` for simple\n personal assistants.\n- **Skin material:** custom assistant tokens; Raycast and Notion remain optional references.\n\n---"
},
"pages": {
"dashboard": "## Dashboard / Home / Overview\n\n- **Job:** answer \"how are things?\" in 3 seconds, then let the user drill down.\n- **Structure:** information pyramid — one hero metric → a small KPI set →\n supporting list/chart. Vary section types (Rule 14/61): never four identical\n cards in a row.\n- **Hierarchy:** density increases as you scroll. Top = 48px hero number; bottom\n = 13–14px detailed rows.\n- **Patterns:** HeroCard, KPI grid (mixed: trend / progress / comparison),\n ChartCard, RankedList, BriefingCarousel for alerts.\n- **Anti-patterns:** wall of identical KPIs, no clear primary metric, charts with\n 6 legend colors, everything the same visual weight.\n- **Mobile:** single column, hero first, horizontal-scroll carousels for KPI sets,\n `mx-6` single cards / `px-6` grids.",
"form": "## Form / Create / Edit\n\n- **Job:** get accurate input with the least friction and the most confidence.\n- **Structure:** **single column**, logical grouping into `SectionCard`s, one\n clear primary action (bottom or sticky). Labels **above** fields, not beside.\n- **Hierarchy:** the field you're on > the next field > everything else. Primary\n action visually dominant; secondary/cancel quiet.\n- **Patterns:** labeled inputs, inline validation (validate on blur, not on every\n keystroke), grouped sections, sticky save bar, `wiggle` + helper text on error,\n clear required/optional marking.\n- **Anti-patterns:** multi-column forms (eye zig-zags), placeholder-as-label,\n validating before the user finishes, two primary buttons, error states with no\n recovery guidance, disabled submit with no explanation.\n- **Mobile:** full-width fields, ≥44px touch targets, numeric keyboards for number\n fields, sticky primary above the keyboard.",
"landing": "## Landing / Marketing / Home (public)\n\n- **Job:** in one screen, say what it is + why it matters + one next action.\n- **Structure:** hero (headline + subhead + single primary CTA) → proof\n (features/social proof) → CTA again. One conversion goal per page.\n- **Hierarchy:** headline dominates; CTA is the single brightest element; supporting\n text recedes. The accent belongs to the CTA.\n- **Patterns:** hero with one CTA, feature grid, social proof (logos/stats/quotes),\n before/after, comparison, closing CTA.\n- **Motion — this is the ONE surface where the Cinematic tier applies (DESIGN-LANGUAGE §43).**\n Unlike an app/dashboard, a brand page *should* use motion as craft: **scroll-LINKED reveals,\n pinned/sticky sections, sequential \"the product assembles as you scroll\" choreography, subtle\n parallax, a 3D/tilt hero or showcase card, an animated gradient/mesh or video background, rich\n hover** (magnetic/glow/lift). This is how family.co / stripe.com / linear.app read premium —\n don't apply dashboard restraint here. Guardrails still hold: purposeful (not jitter), 60fps\n (`transform`/`opacity` only), never blocks the first read or the CTA/LCP, `prefers-reduced-motion`\n leaves a complete static page, one motion language.\n- **Anti-patterns:** multiple competing CTAs, wall of text, every section the same rhythm,\n autoplaying *audio*, motion that **delays the headline or hides content until you scroll**,\n **scroll-JACKING** (hijacking scroll speed / trapping — different from scroll-linked, which is\n fine), six accent colors, no reduced-motion fallback.\n- **Mobile:** stack everything, keep the CTA reachable, don't shrink the headline\n into mush.",
"detail": "## Detail / Profile / Item\n\n- **Job:** show one thing deeply, with its primary action obvious.\n- **Structure:** identity header (title/image/status) → key facts → body/sections →\n one primary action (often sticky on mobile).\n- **Hierarchy:** the subject's name/title and its primary action win. Metadata is\n tertiary.\n- **Patterns:** hero/identity block, key-value facts, tabbed or sectioned body,\n sticky primary action, related items rail, status indicators.\n- **Anti-patterns:** burying the primary action, equal weight on everything, no\n clear \"what is this,\" metadata louder than the subject.\n- **Mobile:** sticky action bar, collapse long sections, single column.",
"list": "## List / Index / Browse / Search\n\n- **Job:** scan many items fast, find the right one, act.\n- **Structure:** optional filter/search bar → consistent rows/cards → clear\n per-item action or tap target. Consistency beats variety here.\n- **Hierarchy:** the item's identifying field (name/title) is boldest; status and\n meta are quieter; the value/amount is emphasized on the trailing edge.\n- **Patterns:** `ListItem` (title + status dot + trailing value), filterable list,\n segmented control, swipe actions on mobile, empty state, `stagger-cascade`\n entrance, skeleton while loading.\n- **Anti-patterns:** rows that vary wildly, no empty/loading state, status by color\n alone (pair with text/dot), tiny tap targets, pagination where infinite scroll\n fits (or vice-versa).\n- **Mobile:** full-width rows, swipe-to-act, ≥44px rows, sticky filter.",
"settings": "## Settings / Account / Preferences\n\n- **Job:** let the user find and change one setting with confidence, safely.\n- **Structure:** grouped `SectionCard`s by topic (profile / notifications /\n billing / danger), each setting a labeled row with its control on the trailing\n edge. Destructive actions isolated and clearly marked.\n- **Hierarchy:** flat and scannable — settings are equal-weight within a group;\n group titles orient. Danger zone visually separated.\n- **Patterns:** toggle rows, select rows, account header, billing card, **danger\n zone** (the one place a functional border + destructive tone is right),\n inline-save or explicit-save (be consistent).\n- **Anti-patterns:** destructive actions next to benign ones, unclear save model,\n settings with no labels, toggles whose state is ambiguous, no confirmation on\n irreversible actions.\n- **Mobile:** full-width rows, controls reachable with the thumb, ≥44px toggles.",
"onboarding": "## Onboarding / First-run / Empty\n\n- **Job:** get the user to their first win with minimal steps, never a dead end.\n- **Structure:** few steps with visible progress, one decision per step, a strong\n \"what's next.\" Empty states are onboarding in disguise — always offer the next\n action.\n- **Hierarchy:** the current step and its single action dominate; progress is\n visible but quiet.\n- **Patterns:** stepper/progress, one-question-per-screen, `EmptyState` (icon +\n title + description + action), `pop-in`/`confetti-pop` on completion, contextual\n tips, skip/defer where fair.\n- **Anti-patterns:** asking everything up front, empty screens with no next action,\n no sense of progress, punishing or shaming empty states, forcing setup before\n any value.\n- **Mobile:** one step per screen, big primary, progress at top.\n\n---"
},
"recipes": {
"calm-consumer": "## `calm-consumer`\n\n- **Best fit:** personal state, reassurance, benefits, lightweight health, and short recurring\n tasks. Strong with `consumer-service`; usable for a gentle `commerce-conversion`.\n- **Containment:** tonal groups and a few soft cards. One summary may float; secondary rows\n should not become an equal card wall.\n- **Geometry:** 12–20px outer radius, smaller nested radius, restrained shadow or tonal\n separation, comfortable 20–24px gutters.\n- **Type/icons:** friendly sans, plain-language values, simple line icons without repeated\n tinted icon chips.\n- **Controls/collections:** reachable primary action, short rows or grouped sections, pill\n controls only for true compact choices.\n- **Motion:** immediate and reassuring; spring may be restrained; consequential values do not\n count theatrically.\n- **Characteristic move:** one calm contextual briefing connected to the user's current state.\n- **Reject:** copying Toss layouts, every service as a rounded card, blue as an automatic brand,\n cute language in serious states, or chips as decoration.\n- **Lineage:** StyleSeed consumer-service research; brand examples are evidence, not sources to\n copy.",
"native-mobile": "## `native-mobile`\n\n- **Best fit:** focused mobile utilities, capture, communication, media, and one-handed tasks.\n Compatible with any grammar whose primary surface is a mobile app.\n- **Containment:** content is primary; navigation and controls recede into platform-familiar\n bars, sheets, lists, and grouped regions.\n- **Geometry:** platform-aware radii and materials, 16–20px screen gutters, touch targets at\n least 44px, no desktop card grid squeezed into a phone.\n- **Type/icons:** dynamic type and platform conventions; system symbols when licensed for the\n target platform, otherwise one consistent open icon family.\n- **Controls/collections:** few visible controls, secondary actions disclosed nearby, common\n gestures have visible alternatives, important actions remain reachable.\n- **Motion/responsive:** adapt to orientation, dark mode, text scaling, and device insets;\n transitions preserve spatial continuity.\n- **Characteristic move:** one content-first task with controls concentrated in the reachable\n middle or lower region.\n- **Reject:** decorative glass imitation, copying Apple assets, invisible gesture-only actions,\n tiny targets, or a web navbar pretending to be native.\n- **Lineage:** [Apple Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines).",
"enterprise-workbench": "## `enterprise-workbench`\n\n- **Best fit:** admin, analytics, operations, collaboration, and multi-step B2B work. Strong\n with `operations-console`.\n- **Containment:** persistent shell, aligned panels, toolbars, tables, and detail regions.\n Group by work relationship; use card grids sparingly.\n- **Geometry:** 0–8px radius, 1px boundaries or tonal layers, minimal floating shadow, 16–24px\n page rhythm on an explicit grid.\n- **Type/icons:** neutral UI sans, tabular numbers, compact labels, one functional icon family.\n- **Controls/collections:** rectangular controls, visible filters, bulk actions, dense rows,\n comparison tables, and preserved loading geometry.\n- **Motion/responsive:** fast state changes; panels reflow or collapse by task priority rather\n than merely shrinking.\n- **Characteristic move:** one operational focal panel connected directly to an actionable\n queue or evidence table.\n- **Reject:** identical KPI cards, oversized mobile typography on desktop, decorative\n gradients, hidden scope controls, or floating shadows on every panel.\n- **Lineage:** [IBM Carbon 2x Grid](https://carbondesignsystem.com/elements/2x-grid/overview/),\n [Microsoft Fluent 2](https://fluent2.microsoft.design/design-principles),\n [Atlassian foundations](https://atlassian.design/foundations).",
"developer-platform": "## `developer-platform`\n\n- **Best fit:** repositories, observability, infrastructure, APIs, and security. Strong with\n `technical-instrument`; usable for technical `operations-console`.\n- **Containment:** stable shell, compact toolbars, hairline-separated rows, code/evidence\n regions, and contextual drill-down.\n- **Geometry:** 4–8px radius, hairline borders, little or no shadow, compact 12–20px rhythm.\n- **Type/icons:** sans for UI; mono only for identifiers, timestamps, logs, commands, and aligned\n numeric evidence. Icons are small and functional.\n- **Controls/collections:** rectangular or lightly rounded controls, status-aware tables,\n timelines, command palettes, and copyable evidence.\n- **Motion/responsive:** near-instant, non-blocking, time-aware; live/paused state is explicit.\n- **Characteristic move:** one inspectable evidence region that connects status to diagnosis.\n- **Reject:** terminal cosplay, neon telemetry, mono body copy, rounded feature-card grids, or\n animation that competes with live data.\n- **Lineage:** [GitHub Primer foundations](https://primer.style/product/getting-started/foundations/)\n and [Primer pattern guidance](https://primer.style/product/contribute/design/).",
"commerce-operator": "## `commerce-operator`\n\n- **Best fit:** merchant admin, inventory, orders, fulfillment, customer support, and complex\n purchase operations. Strong with `operations-console` and `commerce-conversion`.\n- **Containment:** resource index → filters → actionable rows → contextual detail. Cards group\n merchant decisions, not every datum.\n- **Geometry:** 8–12px radius, clear boundaries, moderate density, restrained elevation for\n overlays and temporary context only.\n- **Type/icons:** highly scannable labels and values; product imagery is evidence; status text\n accompanies semantic color.\n- **Controls/collections:** filter bars, resource tables/lists, contextual actions, variant and\n fulfillment state, reversible mutations.\n- **Motion/responsive:** preserve selection and filters; mobile promotes the current task and\n moves secondary columns into detail.\n- **Characteristic move:** a resource row or order state exposes the next operational action\n without opening a decorative card.\n- **Reject:** promotional rainbow admin UI, buried costs or constraints, ambiguous statuses,\n equal-weight analytics tiles, or urgency dark patterns.\n- **Lineage:** [Shopify Polaris](https://polaris-react.shopify.com/) and StyleSeed commerce\n research. Reuse concepts, not Shopify trade dress.",
"public-service": "## `public-service`\n\n- **Best fit:** eligibility, applications, regulated forms, healthcare workflows, and civic\n services. Strong with `institutional-service`.\n- **Containment:** flat document flow, bounded reading measure, explicit sections, one step at a\n time, review, confirmation, and recovery.\n- **Geometry:** 0–4px radius, strong visible boundaries, no decorative shadow, generous vertical\n separation, high-contrast focus.\n- **Type/icons:** robust sans, plain language, adjacent labels/help, icons never replace critical\n words.\n- **Controls/collections:** rectangular buttons and inputs, clear legends, summaries and error\n links, preserved entered data, reference number on completion.\n- **Motion/responsive:** minimal and non-essential; layout survives zoom, reflow, text scaling,\n keyboard, and assistive technology.\n- **Characteristic move:** the current task and its requirements are more visually prominent\n than the organization brand.\n- **Reject:** low-contrast minimalism, novelty navigation, hidden prerequisites, rounded app\n cards, altered control meanings, or motion that makes the workflow feel unstable.\n- **Lineage:** [GOV.UK patterns](https://design-system.service.gov.uk/patterns/) and\n [community principles](https://design-system.service.gov.uk/community/community-principles/).",
"creative-professional": "## `creative-professional`\n\n- **Best fit:** creation, editing, asset management, media, and expert cross-platform tools.\n Compatible with `operations-console`, `technical-instrument`, and `sequential-story`.\n- **Containment:** focused canvas or artifact, quiet utility chrome, named tool groups, inspectors,\n and progressive disclosure.\n- **Geometry:** 4–8px radius, crisp boundaries, restrained layers, density adapts between\n pointer and touch.\n- **Type/icons:** rational, compact, internationalizable labels; icons support trained use but\n critical actions retain text or discoverable labels.\n- **Controls/collections:** toolbars, property panels, asset grids, contextual controls, and\n explicit selection state.\n- **Motion/responsive:** desktop and mobile scale independently while sharing one language;\n motion explains selection, mode, and spatial change.\n- **Characteristic move:** the user's work occupies the focal field while tools form a\n disciplined supporting frame.\n- **Reject:** decoration around the canvas, one scale stretched across all inputs, unlabeled\n mystery tools, or copying Adobe product chrome.\n- **Lineage:** [Adobe Spectrum principles](https://spectrum.adobe.com/page/principles/) and\n [platform scale](https://spectrum.adobe.com/page/platform-scale/).",
"editorial-authority": "## `editorial-authority`\n\n- **Best fit:** journalism, reports, research, policy, and documentation. Strong with\n `editorial-reading`; usable for evidence-heavy `expressive-marketing`.\n- **Containment:** type, whitespace, rules, captions, and bounded columns replace app cards.\n Chrome recedes after orientation.\n- **Geometry:** 0–4px radius, hairline rules, little or no shadow, generous section rhythm and\n 45–90 character reading measures.\n- **Type/icons:** deliberate display/body roles, serif optional and role-specific, captions and\n sources remain attached to evidence.\n- **Controls/collections:** calm inline actions, table of contents, footnotes, save/share,\n figures, pull quotes, and related context after the narrative.\n- **Motion/responsive:** reading position and disclosure only; narrow screens preserve hierarchy\n and source relationships rather than stacking arbitrary cards.\n- **Characteristic move:** an authoritative opening promise followed by inspectable evidence.\n- **Reject:** dashboard chrome around prose, every section in a card, overly wide measure, serif\n everywhere, fake print texture, or interruption-heavy interactions.\n- **Lineage:** StyleSeed editorial research and public-content accessibility guidance.",
"expressive-brand": "## `expressive-brand`\n\n- **Best fit:** campaigns, launches, portfolios, brand pages, posters, and social stories.\n Strong with `expressive-marketing` and `sequential-story`.\n- **Containment:** section form varies with the narrative; proof, product media, and display type\n create rhythm instead of a repeated feature-card template.\n- **Geometry:** project-specific and intentionally consistent; one signature geometry may be\n sharp, soft, or sculptural, but nested and control shapes stay coherent.\n- **Type/icons:** distinctive display hierarchy plus readable body; commissioned or licensed\n imagery carries identity more than generic icons.\n- **Controls/collections:** one identifiable CTA, product demonstrations, outcomes, and examples;\n repeated collections earn their repetition.\n- **Motion/responsive:** cinematic choreography is allowed when native scroll remains under user\n control and reduced motion yields a complete result.\n- **Characteristic move:** one product-specific visual mechanism that could not be swapped into\n an unrelated landing page.\n- **Reject:** generic gradient headlines, equal three-card rows, fake metrics, scroll-jacking,\n copied campaign compositions, or motion that substitutes for a proposition.\n- **Lineage:** independent brand/campaign research; compile supplied references with\n `ss-reference` when a particular visual language matters.\n\n## Legal and promotion boundary\n\n- Reference-family names document provenance; never present a recipe as official, endorsed, or\n pixel-compatible with those systems.\n- Do not redistribute protected logos, proprietary icons, fonts, illustrations, product copy,\n screenshots, or trademarked arrangements.\n- A project-local reference grammar remains the correct path for a specific brand. Promote it to\n a built-in recipe only after multiple independent sources and transfer tests prove that the\n morphology is reusable and not a clone."
},
"palettes": {
"quiet-mineral": "### quiet-mineral\n\n- Name: Quiet mineral\n- Mode: light\n- Best for: Calm consumer products, health, benefits, and personal utilities\n- Recipe bias: calm-consumer, native-mobile\n- Semantic roles: background=#F3F0E8 · surface=#FFFDF8 · chrome=#DCE7E0 · foreground=#19211F · mutedForeground=#56635F · chromeForeground=#19211F · border=#BFC9C2 · primary=#276B5E · primaryForeground=#FFFFFF · accent=#D56A45 · accentForeground=#211713 · focus=#155EEF · success=#1E6F50 · successForeground=#FFFFFF · warning=#8A5700 · warningForeground=#FFFFFF · danger=#B42318 · dangerForeground=#FFFFFF\n- Usage: Let warm neutrals carry most of the canvas. Reserve green for the primary action and current-state reassurance; keep coral below ten percent.\n- Generated-media anchors: #F3F0E8, #276B5E, #D56A45\n- Avoid in generated media: neon blue, rainbow gradients, blue-purple AI glow\n- Re-run deterministic contrast validation after any project override.",
"deep-lime-studio": "### deep-lime-studio\n\n- Name: Deep lime studio\n- Mode: dark\n- Best for: Creative work, focused productivity, and high-craft prototypes\n- Recipe bias: creative-professional, expressive-brand\n- Semantic roles: background=#0B0D0F · surface=#15191D · chrome=#262C31 · foreground=#F5F4ED · mutedForeground=#A8AFAB · chromeForeground=#F5F4ED · border=#465057 · primary=#B8FF5A · primaryForeground=#10140C · accent=#7AA7FF · accentForeground=#0B1020 · focus=#B8FF5A · success=#75E6A4 · successForeground=#0B1A10 · warning=#FFC857 · warningForeground=#1B1300 · danger=#FF766E · dangerForeground=#200704\n- Usage: Use lime for selection and one decisive action, never as body text. Layer chrome one step lighter than the canvas; let generated imagery remain low-luminance.\n- Generated-media anchors: #0B0D0F, #B8FF5A, #7AA7FF\n- Avoid in generated media: pure-white bloom, multicolor neon, lime on light backgrounds\n- Re-run deterministic contrast validation after any project override.",
"cobalt-instrument": "### cobalt-instrument\n\n- Name: Cobalt instrument\n- Mode: light\n- Best for: Developer platforms, data products, and operational workbenches\n- Recipe bias: developer-platform, enterprise-workbench\n- Semantic roles: background=#F1F5FA · surface=#FFFFFF · chrome=#101828 · foreground=#101828 · mutedForeground=#475467 · chromeForeground=#F9FAFB · border=#C7D1E0 · primary=#175CD3 · primaryForeground=#FFFFFF · accent=#6941C6 · accentForeground=#FFFFFF · focus=#175CD3 · success=#067647 · successForeground=#FFFFFF · warning=#934F00 · warningForeground=#FFFFFF · danger=#B42318 · dangerForeground=#FFFFFF\n- Usage: Use neutral layers for evidence and cobalt for action/selection. Violet belongs to secondary categorization, not a second primary action.\n- Generated-media anchors: #101828, #175CD3, #F1F5FA\n- Avoid in generated media: cyan terminal glow, decorative gradients, low-contrast gray text\n- Re-run deterministic contrast validation after any project override.",
"warm-clay-commerce": "### warm-clay-commerce\n\n- Name: Warm clay commerce\n- Mode: light\n- Best for: Commerce, hospitality, booking, and human service brands\n- Recipe bias: commerce-operator, calm-consumer\n- Semantic roles: background=#FFF8F2 · surface=#FFFFFF · chrome=#2B201B · foreground=#2B201B · mutedForeground=#6B5549 · chromeForeground=#FFF8F2 · border=#DCCBC0 · primary=#A64005 · primaryForeground=#FFFFFF · accent=#6441C4 · accentForeground=#FFFFFF · focus=#1D5FD0 · success=#187451 · successForeground=#FFFFFF · warning=#8A5700 · warningForeground=#FFFFFF · danger=#B42318 · dangerForeground=#FFFFFF\n- Usage: Let product imagery and warm paper carry identity. Clay marks purchase intent; violet is reserved for saved or personalized context.\n- Generated-media anchors: #FFF8F2, #A64005, #2B201B\n- Avoid in generated media: orange sale walls, high-saturation red urgency, generic purple gradient\n- Re-run deterministic contrast validation after any project override.",
"civic-blue": "### civic-blue\n\n- Name: Civic blue\n- Mode: light\n- Best for: Public services, regulated applications, and consequential workflows\n- Recipe bias: public-service, enterprise-workbench\n- Semantic roles: background=#F3F5F7 · surface=#FFFFFF · chrome=#003078 · foreground=#0B0C0C · mutedForeground=#4C6272 · chromeForeground=#FFFFFF · border=#B1B4B6 · primary=#1D5F91 · primaryForeground=#FFFFFF · accent=#00703C · accentForeground=#FFFFFF · focus=#B45F06 · success=#00703C · successForeground=#FFFFFF · warning=#8A5700 · warningForeground=#FFFFFF · danger=#B42318 · dangerForeground=#FFFFFF\n- Usage: Use blue for institution and primary action, green only for confirmed success, and amber focus with a visible outline. Pair every status with text.\n- Generated-media anchors: #003078, #F3F5F7, #00703C\n- Avoid in generated media: pastel minimalism, glass navigation, color-only status\n- Re-run deterministic contrast validation after any project override.",
"editorial-ink": "### editorial-ink\n\n- Name: Editorial ink\n- Mode: light\n- Best for: Research, journalism, reports, and authoritative reading\n- Recipe bias: editorial-authority, public-service\n- Semantic roles: background=#F5F1E8 · surface=#FFFCF6 · chrome=#111111 · foreground=#111111 · mutedForeground=#5B564E · chromeForeground=#FFFFFF · border=#C9C0B2 · primary=#8F2C21 · primaryForeground=#FFFFFF · accent=#1D4E9E · accentForeground=#FFFFFF · focus=#1D4E9E · success=#176B45 · successForeground=#FFFFFF · warning=#805200 · warningForeground=#FFFFFF · danger=#A12B22 · dangerForeground=#FFFFFF\n- Usage: Use ink and paper for the reading field. Red marks editorial emphasis sparingly; blue owns links and focus.\n- Generated-media anchors: #F5F1E8, #111111, #8F2C21\n- Avoid in generated media: fake newspaper texture, sepia photos, card-grid chrome\n- Re-run deterministic contrast validation after any project override.",
"signal-coral": "### signal-coral\n\n- Name: Signal coral\n- Mode: light\n- Best for: Expressive launches, social products, and consumer discovery\n- Recipe bias: expressive-brand, native-mobile\n- Semantic roles: background=#FFF3EC · surface=#FFFFFF · chrome=#1A1423 · foreground=#1A1423 · mutedForeground=#645A6C · chromeForeground=#FFFFFF · border=#D8C9D0 · primary=#C83D2C · primaryForeground=#FFFFFF · accent=#5B3EC8 · accentForeground=#FFFFFF · focus=#5B3EC8 · success=#19724E · successForeground=#FFFFFF · warning=#875400 · warningForeground=#FFFFFF · danger=#A92924 · dangerForeground=#FFFFFF\n- Usage: Let coral own the hook and selected moment. Violet supports spatial or media context; never let both compete as primary actions.\n- Generated-media anchors: #FFF3EC, #C83D2C, #5B3EC8\n- Avoid in generated media: pink-purple gradient wash, rainbow icon chips, coral body text\n- Re-run deterministic contrast validation after any project override.",
"nocturne-violet": "### nocturne-violet\n\n- Name: Nocturne violet\n- Mode: dark\n- Best for: Media, AI, experimental professional tools, and immersive utilities\n- Recipe bias: creative-professional, developer-platform\n- Semantic roles: background=#0D0B16 · surface=#171327 · chrome=#2A2341 · foreground=#F6F2FF · mutedForeground=#B3A9C9 · chromeForeground=#F6F2FF · border=#554A70 · primary=#A98BFF · primaryForeground=#160F28 · accent=#4BE0C3 · accentForeground=#06251F · focus=#D1C2FF · success=#65D6A2 · successForeground=#062118 · warning=#F4BF55 · warningForeground=#241700 · danger=#FF8078 · dangerForeground=#2A0705\n- Usage: Use violet for primary control and mint for creation/progress. Keep media dark enough to preserve chrome and avoid synthetic AI-glow overload.\n- Generated-media anchors: #0D0B16, #A98BFF, #4BE0C3\n- Avoid in generated media: electric blue haze, purple gradient headlines, white bloom behind text\n- Re-run deterministic contrast validation after any project override."
},
"profiles": {
"swiss": "### swiss\n\n- Coordinate: sharp · structured · compact · restrained · snap\n- Signature: asymmetric grid and typographic alignment\n- This profile does not permit: illegible tiny type or ornament-free sameness\n- Apply the coordinate coherently across radius, density, typography, palette temperature, elevation, motion, composition, and one signature move.",
"editorial": "### editorial\n\n- Coordinate: soft/sharp · airy · warm-muted · silk\n- Signature: one display-type moment\n- This profile does not permit: serif body on every product surface\n- Apply the coordinate coherently across radius, density, typography, palette temperature, elevation, motion, composition, and one signature move.",
"technical": "### technical\n\n- Coordinate: sharp · dense · cool · still\n- Signature: mono evidence and tonal layers\n- This profile does not permit: decorative terminal cosplay\n- Apply the coordinate coherently across radius, density, typography, palette temperature, elevation, motion, composition, and one signature move.",
"warm-dtc": "### warm-dtc\n\n- Coordinate: soft/pill · airy · warm-vivid · spring\n- Signature: tactile product/image moment\n- This profile does not permit: competing warm colors or pill-everything\n- Apply the coordinate coherently across radius, density, typography, palette temperature, elevation, motion, composition, and one signature move.",
"minimal-mono": "### minimal-mono\n\n- Coordinate: sharp/soft · airy · near-monochrome · snap/silk\n- Signature: one precise typographic gesture\n- This profile does not permit: missing hierarchy or invisible controls\n- Apply the coordinate coherently across radius, density, typography, palette temperature, elevation, motion, composition, and one signature move.",
"brutalist-lite": "### brutalist-lite\n\n- Coordinate: sharp · comfortable · high-contrast · snap\n- Signature: one hard structural move\n- This profile does not permit: broken states, mixed border weights, or inaccessible contrast\n- Apply the coordinate coherently across radius, density, typography, palette temperature, elevation, motion, composition, and one signature move."
},
"agents": {
"claude": "## Claude Code execution contract\n\n- Invoke StyleSeed skills with `/ss-*`.\n- Read this compiled bundle before implementation; do not load the full handbook unless a named ambiguity remains.\n- Use the selected renderer, run `/ss-score`, then inspect rendered output with `/ss-verify`.",
"codex": "## Codex execution contract\n\n- Invoke StyleSeed skills with `$ss-*` or the Skills picker.\n- Read this compiled bundle before implementation; do not load the full handbook unless a named ambiguity remains.\n- Run project checks, then `$ss-score`; render and inspect the actual artifact with `$ss-verify` before claiming completion.",
"cursor": "## Cursor execution contract\n\n- Use the installed StyleSeed skills from the skill picker or follow this bundle directly.\n- Keep decisions in project files, run the project checks, and inspect the real rendered artifact before delivery.",
"generic": "## Agent execution contract\n\n- Treat this compiled bundle as the active StyleSeed context.\n- Keep decisions in project files, run available project checks, and inspect the real rendered artifact before delivery."
}
}
@@ -0,0 +1,382 @@
#!/usr/bin/env node
import { createHash } from "node:crypto";
import {
existsSync,
mkdirSync,
readFileSync,
rmSync,
writeFileSync,
} from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { generatePalette } from "../color/generator.mjs";
const skillDir = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const catalog = JSON.parse(
readFileSync(resolve(skillDir, "references/catalog.json"), "utf8"),
);
function parseArgs(argv) {
const out = {};
for (let index = 0; index < argv.length; index += 1) {
const value = argv[index];
if (!value.startsWith("--")) throw new Error(`Unexpected argument: ${value}`);
const key = value.slice(2);
if (["list", "stdout", "check", "help"].includes(key)) {
out[key] = true;
continue;
}
const next = argv[index + 1];
if (!next || next.startsWith("--")) throw new Error(`Missing value for --${key}`);
out[key] = next;
index += 1;
}
return out;
}
function help() {
return `StyleSeed Context Compiler
Usage:
resolve-context.mjs --from-lock STYLESEED.md --agent codex
resolve-context.mjs --grammar <id> --adapter <id> [options]
Options:
--agent claude|codex|cursor|generic
--grammar <built-in id|reference:slug>
--adapter <id>
--domain <id|none>
--page <id|none>
--recipe <id|auto>
--palette <id|auto>
--key-color <hex> derive roles and ramps from this product color
--palette-character calm|balanced|vivid|deep
--palette-mode light|dark
--palette-harmony auto|tonal|adjacent|contrast
--surface-temperature neutral|warm|cool
--profile <id|none>
--fallback <built-in grammar id> required for reference grammars without lock fallback
--from-lock <path>
--project-root <path>
--out-dir <path> default: .styleseed
--stdout print bundle without writing
--check exit 2 when the existing bundle hash has drifted
--list print supported IDs
`;
}
function parseLock(path) {
if (!path || !existsSync(path)) return { text: "", values: {} };
const text = readFileSync(path, "utf8").trim();
const values = {};
const keys = {
"App domain": "domain",
"Surface adapter": "adapter",
"Page type": "page",
"Output grammar": "grammar",
"Grammar fallback": "fallback",
"Brand recipe": "recipe",
"Palette recipe": "palette",
"Key color": "keyColor",
"Primary action": "keyColor",
"Palette character": "paletteCharacter",
"Palette mode": "paletteMode",
"Palette harmony": "paletteHarmony",
"Surface temperature": "surfaceTemperature",
"Aesthetic profile": "profile",
};
for (const line of text.split(/\r?\n/)) {
const match = line.match(/^\s*-\s+([^:]+):\s*(.+?)\s*$/);
if (!match) continue;
const key = keys[match[1]];
if (key) values[key] = match[2].replace(/\s+#.*$/, "").trim();
}
return { text, values };
}
function choose(args, lock, key, fallback) {
return args[key] ?? lock.values[key] ?? fallback;
}
function requireId(group, id, label) {
if (id === "none") return null;
const value = catalog[group][id];
if (!value) {
throw new Error(
`Unknown ${label} "${id}". Supported: ${Object.keys(catalog[group]).join(", ")}`,
);
}
return value;
}
function digest(value) {
return createHash("sha256").update(value).digest("hex");
}
function sourceEntry(id, content) {
return { id, sha256: digest(content), bytes: Buffer.byteLength(content) };
}
const args = parseArgs(process.argv.slice(2));
if (args.help) {
console.log(help());
process.exit(0);
}
if (args.list) {
console.log(
JSON.stringify(
{
agents: Object.keys(catalog.agents),
grammars: Object.keys(catalog.grammars),
adapters: Object.keys(catalog.adapters),
domains: Object.keys(catalog.domains),
pages: Object.keys(catalog.pages),
recipes: ["auto", ...Object.keys(catalog.recipes)],
palettes: ["auto", ...Object.keys(catalog.palettes)],
profiles: ["none", ...Object.keys(catalog.profiles)],
},
null,
2,
),
);
process.exit(0);
}
const projectRoot = resolve(args["project-root"] ?? process.cwd());
const lockPath = resolve(projectRoot, args["from-lock"] ?? "STYLESEED.md");
const lock = parseLock(lockPath);
const agent = choose(args, lock, "agent", "generic");
const grammar = choose(args, lock, "grammar");
const adapter = choose(args, lock, "adapter");
const domain = choose(args, lock, "domain", "none");
const page = choose(args, lock, "page", "none");
const requestedRecipe = choose(args, lock, "recipe", "auto");
const requestedPalette = choose(args, lock, "palette", "auto");
const keyColor = args["key-color"] ?? lock.values.keyColor ?? null;
const paletteCharacter = args["palette-character"] ?? lock.values.paletteCharacter ?? null;
const paletteMode = args["palette-mode"] ?? lock.values.paletteMode ?? null;
const paletteHarmony = args["palette-harmony"] ?? lock.values.paletteHarmony ?? "auto";
const surfaceTemperature = args["surface-temperature"] ?? lock.values.surfaceTemperature ?? null;
const profile = choose(args, lock, "profile", "none");
const fallback = choose(args, lock, "fallback");
if (!grammar) throw new Error("Missing output grammar. Pass --grammar or use --from-lock.");
if (!adapter) throw new Error("Missing surface adapter. Pass --adapter or use --from-lock.");
if (!catalog.agents[agent]) {
throw new Error(`Unknown agent "${agent}". Supported: ${Object.keys(catalog.agents).join(", ")}`);
}
let grammarContent;
let grammarSource = `built-in:${grammar}`;
let recipeGrammar = grammar;
if (grammar.startsWith("reference:")) {
const slug = grammar.slice("reference:".length);
if (!/^[a-z0-9][a-z0-9-]*$/.test(slug)) throw new Error(`Invalid reference grammar slug: ${slug}`);
const rulePath = resolve(projectRoot, ".styleseed/rulesets", slug, "RULESET.md");
if (!existsSync(rulePath)) throw new Error(`Missing reference grammar: ${rulePath}`);
const referenceContent = readFileSync(rulePath, "utf8").trim();
const checksPath = resolve(projectRoot, ".styleseed/rulesets", slug, "checks.md");
let referenceChecks = "";
if (existsSync(checksPath)) {
referenceChecks = `\n\n## Reference grammar checks\n\n${readFileSync(checksPath, "utf8").trim()}`;
}
grammarSource = `project:${rulePath.slice(projectRoot.length + 1)}`;
if (!fallback) {
throw new Error("Reference grammars require --fallback or a Grammar fallback value in STYLESEED.md.");
}
recipeGrammar = fallback;
const fallbackContent = requireId("grammars", fallback, "fallback grammar");
grammarContent = `${fallbackContent}\n\n## Project-local reference grammar override\n\n${referenceContent}${referenceChecks}`;
} else {
grammarContent = requireId("grammars", grammar, "grammar");
}
const autoRecipeByGrammar = {
"consumer-service": "calm-consumer",
"operations-console": "enterprise-workbench",
"technical-instrument": "developer-platform",
"editorial-reading": "editorial-authority",
"commerce-conversion": "commerce-operator",
"institutional-service": "public-service",
"expressive-marketing": "expressive-brand",
"sequential-story": "creative-professional",
};
const recipe = requestedRecipe === "auto" ? autoRecipeByGrammar[recipeGrammar] : requestedRecipe;
if (!recipe) {
throw new Error(`No automatic brand recipe for grammar "${recipeGrammar}". Pass --recipe.`);
}
const autoPaletteByRecipe = {
"calm-consumer": "quiet-mineral",
"native-mobile": "quiet-mineral",
"enterprise-workbench": "cobalt-instrument",
"developer-platform": "cobalt-instrument",
"commerce-operator": "warm-clay-commerce",
"public-service": "civic-blue",
"creative-professional": "deep-lime-studio",
"editorial-authority": "editorial-ink",
"expressive-brand": "signal-coral",
};
const palette = requestedPalette === "auto" ? autoPaletteByRecipe[recipe] : requestedPalette;
if (!palette) {
throw new Error(`No automatic palette recipe for brand recipe "${recipe}". Pass --palette.`);
}
const adapterContent = requireId("adapters", adapter, "adapter");
const domainContent = requireId("domains", domain, "domain");
const pageContent = requireId("pages", page, "page");
const recipeContent = requireId("recipes", recipe, "brand recipe");
let paletteContent = requireId("palettes", palette, "palette recipe");
const profileContent = requireId("profiles", profile, "profile");
const paletteDefaultsByRecipe = {
"calm-consumer": { character: "calm", temperature: "neutral" },
"native-mobile": { character: "balanced", temperature: "neutral" },
"enterprise-workbench": { character: "balanced", temperature: "cool" },
"developer-platform": { character: "deep", temperature: "cool" },
"commerce-operator": { character: "balanced", temperature: "warm" },
"public-service": { character: "calm", temperature: "neutral" },
"creative-professional": { character: "vivid", temperature: "neutral" },
"editorial-authority": { character: "deep", temperature: "warm" },
"expressive-brand": { character: "vivid", temperature: "warm" },
};
const recipeMode = paletteContent.match(/^- Mode:\s*(light|dark)$/m)?.[1] ?? "light";
const paletteDefaults = paletteDefaultsByRecipe[recipe] ?? { character: "balanced", temperature: "neutral" };
const generatedPalette = keyColor ? generatePalette({
keyColor,
mode: paletteMode ?? recipeMode,
character: paletteCharacter ?? paletteDefaults.character,
harmony: paletteHarmony,
temperature: surfaceTemperature ?? paletteDefaults.temperature,
}) : null;
if (generatedPalette) {
paletteContent = [
paletteContent,
"",
"## Generated semantic palette override",
"",
`- Key color: ${generatedPalette.input.keyColor}`,
`- Mode: ${generatedPalette.input.mode}`,
`- Character: ${generatedPalette.input.character}`,
`- Harmony: ${generatedPalette.input.harmony}`,
`- Surface temperature: ${generatedPalette.input.temperature}`,
`- Semantic roles: ${Object.entries(generatedPalette.roles).map(([role, value]) => `${role}=${value}`).join(" · ")}`,
`- Contrast gates: ${generatedPalette.contrast.map((item) => `${item.foreground}/${item.background}=${item.ratio}:1`).join(" · ")}`,
"- Allocation: 60% canvas/surfaces · 30% chrome/type/structure · at most 10% primary and accent emphasis combined.",
"- This override replaces the recipe hex values while preserving its product posture and semantic restrictions.",
"- Components consume semantic roles. Raw ramp values remain reference tokens.",
].join("\n");
}
const selected = {
agent,
grammar,
grammarSource,
fallback: fallback ?? null,
adapter,
domain,
page,
recipe,
recipeSelection: requestedRecipe,
palette,
paletteSelection: requestedPalette,
paletteGeneration: generatedPalette ? generatedPalette.input : null,
profile,
};
const sections = [
["agent-execution", catalog.agents[agent]],
["core", catalog.core],
["grammar", grammarContent],
["adapter", adapterContent],
...(domainContent ? [["domain", domainContent]] : []),
...(pageContent ? [["page", pageContent]] : []),
["recipe", recipeContent],
["palette", paletteContent],
...(profileContent ? [["profile", profileContent]] : []),
...(lock.text ? [["lock", `## Project design lock\n\n${lock.text}`]] : []),
["craft", catalog.craft],
];
const bundle = [
"# StyleSeed Effective Rule Bundle",
"",
"<!-- Generated by ss-resolve. Do not hand-edit; update STYLESEED.md or resolver inputs. -->",
"",
`- Engine: ${catalog.engineVersion}`,
`- Agent: ${agent}`,
`- Output grammar: ${grammar}`,
`- Surface adapter: ${adapter}`,
`- Domain: ${domain}`,
`- Page type: ${page}`,
`- Brand recipe: ${recipe}${requestedRecipe === "auto" ? " (auto)" : ""}`,
`- Palette recipe: ${palette}${requestedPalette === "auto" ? " (auto)" : ""}`,
...(generatedPalette ? [`- Generated palette: ${generatedPalette.input.keyColor} · ${generatedPalette.input.mode} · ${generatedPalette.input.character} · ${generatedPalette.input.harmony}`] : []),
`- Aesthetic profile: ${profile}`,
"",
"Read this bundle before implementation. The agent execution contract is operational; method authority then runs core → grammar → adapter → domain/page → brand recipe → palette recipe → profile → lock → compact craft baseline, with the earlier method layer winning conflicts. Run the code gate and rendered visual gate.",
"",
...sections.flatMap(([, content]) => [content, "", "---", ""]),
].join("\n").replace(/\n---\n\s*$/, "\n");
const bundleHash = digest(bundle);
const sources = sections.map(([id, content]) => sourceEntry(id, content));
const manifest = {
schemaVersion: 1,
engineVersion: catalog.engineVersion,
generatedAt: new Date().toISOString(),
selection: selected,
bundle: {
path: ".styleseed/effective-rules.md",
sha256: bundleHash,
bytes: Buffer.byteLength(bundle),
},
sources,
};
const outDir = resolve(projectRoot, args["out-dir"] ?? ".styleseed");
const bundlePath = resolve(outDir, "effective-rules.md");
const manifestPath = resolve(outDir, "manifest.json");
const palettePath = resolve(outDir, "palette.json");
const paletteCssPath = resolve(outDir, "palette.css");
if (args.check) {
if (!existsSync(manifestPath)) {
console.error("StyleSeed context drift: manifest is missing.");
process.exit(2);
}
const previous = JSON.parse(readFileSync(manifestPath, "utf8"));
if (previous.bundle?.sha256 !== bundleHash) {
console.error(
`StyleSeed context drift: ${previous.bundle?.sha256 ?? "missing"} -> ${bundleHash}`,
);
process.exit(2);
}
console.log(`StyleSeed context current: ${bundleHash}`);
process.exit(0);
}
if (args.stdout) {
process.stdout.write(bundle);
process.exit(0);
}
mkdirSync(outDir, { recursive: true });
writeFileSync(bundlePath, bundle);
writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
if (generatedPalette) {
writeFileSync(palettePath, `${JSON.stringify(generatedPalette, null, 2)}\n`);
writeFileSync(paletteCssPath, `${generatedPalette.css}\n`);
} else {
rmSync(palettePath, { force: true });
rmSync(paletteCssPath, { force: true });
}
console.log(
`StyleSeed ${catalog.engineVersion}: ${grammar} × ${adapter} × ${domain} × ${page} × ${recipe} × ${palette} × ${profile}`,
);
console.log(`wrote ${bundlePath} (${Buffer.byteLength(bundle)} bytes, sha256:${bundleHash})`);
console.log(`wrote ${manifestPath}`);
if (generatedPalette) console.log(`wrote ${palettePath} and ${paletteCssPath}`);
+33
View File
@@ -0,0 +1,33 @@
---
name: ss-restyle
description: Apply one optional StyleSeed aesthetic profile without changing the selected output grammar, product job, or core design judgment.
argument-hint: "<profile> — swiss | editorial | technical | warm-dtc | minimal-mono | brutalist-lite | none"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# Apply an aesthetic profile
Read `PRODUCT-PRINCIPLES.md`, `RULESETS.md`, `PRESETS.md`, and `STYLESEED.md`. Profiles are
coordinated visual axes; output grammars organize attention, information, and action. Keep them
separate.
## Workflow
1. Validate that the lock has one output grammar. If not, run `/ss-setup` first.
2. Select exactly one profile from `PRESETS.md`, or `none`. Never stack profiles.
3. Apply its coordinated radius, density, type, palette temperature, elevation, motion,
composition accent, and signature move **inside the output grammar's allowed ranges**.
4. Preserve deliberate brand values and required fonts when compatible. If incompatible, the
output grammar and core invariants win; explain the conflict.
5. Update `Aesthetic profile` and affected bounded values in `STYLESEED.md`. Do not rewrite the
output grammar or a reference-compiled rule set.
6. Run `/ss-score` to ≥80 and `/ss-verify` if renderable. Report the complete effective rule set,
not just the profile name.
## Rules
- A profile is optional appearance coordination, not a design-method exemption.
- `technical` profile does not turn a commerce page into an observability console.
- `editorial` profile does not justify unreadable serif body in a transaction workflow.
- `brutalist-lite` still requires coherent states, contrast, and one border language.
- Use `/ss-dial` for one-axis changes and `/ss-reference` for a new evidence-derived language.
+100
View File
@@ -0,0 +1,100 @@
---
name: ss-review
description: Review UI code for design system compliance, accessibility, and best practices
argument-hint: "[file-path]"
allowed-tools: Read, Grep, Glob
---
# UI Design Review
Read `.styleseed/effective-rules.md` and `.styleseed/manifest.json`. If missing or stale, invoke
`/ss-resolve` or `$ss-resolve` from `STYLESEED.md` first. Review task fitness and grammar
coherence before framework conventions. For non-web artifacts, replace React/Tailwind-only
checks with the active adapter's render/export checks.
## When NOT to use
- For accessibility-only issues → use `/ss-a11y`
- For Nielsen UX heuristics → use `/ss-audit`
- For a quick automated check → use `/ss-lint`
- For non-UI code (data fetching, business rules)
Review the file: **$ARGUMENTS**
## Checklist
### 1. Design Token and Recipe Compliance
- [ ] No hardcoded hex colors (use semantic tokens: `text-foreground`, `bg-brand`, etc.)
- [ ] No hardcoded px spacing in Tailwind (use `p-6` not `p-[24px]`)
- [ ] Pattern geometry/elevation uses the selected recipe or explicit semantic variables
- [ ] No hardcoded universal `rounded-2xl + shadow + mx-6` language across unrelated recipes
### 2. Component Conventions
- [ ] Uses `data-slot` attribute
- [ ] Uses `cn()` for className merging
- [ ] Props typed with `React.ComponentProps<>`
- [ ] Supports `className` prop override
- [ ] Named export (not default export for components)
- [ ] No wrapper components that only add a className
### 3. Accessibility (a11y)
- [ ] Touch targets >= 44x44px for interactive elements
- [ ] `focus-visible` styles on all interactive elements
- [ ] Proper `aria-*` attributes where needed
- [ ] Color contrast meets WCAG AA (4.5:1 for text, 3:1 for large text)
- [ ] Animations respect `prefers-reduced-motion`
- [ ] Images have `alt` text
- [ ] Form inputs have associated labels
### 4. Surface Best Practices
- [ ] No horizontal overflow
- [ ] Touch-friendly spacing between interactive elements
- [ ] Mobile safe area insets handled when the adapter requires them
- [ ] Desktop density/type and non-web canvas/export rules follow the selected adapter
- [ ] Text sizes >= 12px for readability
- [ ] Scrollable containers have `-webkit-overflow-scrolling: touch`
### 5. Performance
- [ ] No unnecessary re-renders (stable references, memoization where needed)
- [ ] Images are lazy-loaded
- [ ] Heavy components are code-split
### 6. Typography
- [ ] Uses the locked type family and recipe-fit type roles
- [ ] Font sizes from the 14-step scale (10-48px, see CLAUDE.md)
- [ ] Proper font weights (400, 500, 600, 700)
- [ ] Display text (36-48px): `leading-none` + `tracking-[-0.02em]`
- [ ] Heading text (18-24px): `leading-snug` + `tracking-[-0.01em]`
- [ ] Body text (14-17px): `leading-normal` (no custom tracking)
- [ ] Caption uppercase (10-13px): `tracking-[0.05em]` or `tracking-wide`
- [ ] No `line-height: 1.5` on display/heading text (too loose)
### 7. Spacing Consistency
- [ ] Spacing uses one maintained token scale and the selected recipe's major rhythm
- [ ] Off-scale values have an optical, canvas, or platform reason
- [ ] Uses `size-*` shorthand instead of `w-* h-*`
- [ ] Uses `ms-*/me-*` instead of `ml-*/mr-*` (logical properties)
- [ ] Motion transitions use design tokens (`duration-[var(--duration-fast)]`)
### 8. Coherence (VISUAL-CRAFT.md §C0 — the "one choice per axis" laws)
> The biggest reason a UI reads as "AI-generated" isn't ugly parts — it's *mixed*
> parts. Check that each axis below uses ONE value system-wide; flag a mix as a real
> issue, not a nitpick.
- [ ] **One radius personality** — sharp (0-4px) OR soft (8-12px) OR pill, applied to every card/button/input/modal. No mixing (e.g. a `rounded-none` panel with `rounded-full` buttons).
- [ ] **One identifiable primary action** plus only the selected grammar's stable semantic,
categorical, or brand roles — no competing decorative emphasis hues.
- [ ] **No emoji as UI icons** (🚗🧺⭐ as list/nav/status/category markers) — they inject many uncontrolled hues; use one line-icon set in `currentColor`.
- [ ] **Status color = severity, not decoration** — a normal/OK/"보통" state is neutral grey (not colored); color marks only the minority of rows that need attention; same value → same color.
- [ ] **No decorative hues** — favorite stars, category dots, avatars use the accent or grey, not a new color each.
- [ ] **One shadow language** — same light direction, same scale/tint; not some black + some tinted, some up-lit + some down-lit.
- [ ] **One icon family / fill mode / stroke weight** across the file.
- [ ] **Nested-radius law** — an element inside a rounded container uses `inner = outer − padding`, not the same radius (which bulges).
- [ ] **Consistent control heights** — buttons, inputs, selects share a height set (e.g. 40px).
- [ ] Errors/states never rely on color alone (icon + text too).
## Output Format
Provide:
1. **Score**: Pass / Needs Improvement / Fail
2. **Issues**: List each violation with file:line reference
3. **Fixes**: Concrete code changes for each issue
+175
View File
@@ -0,0 +1,175 @@
---
name: ss-score
description: Score a visual artifact's implementation quality 0-100 against its composed StyleSeed rule set — category breakdown, evidence, and prioritized fixes.
argument-hint: "[file, directory, or artifact manifest]"
allowed-tools: Read, Grep, Glob, Bash
---
# Design Score
`/ss-review` tells you *what's wrong*. `/ss-score` tells you *how good it is
overall* and *what to fix first* — a single number plus a category breakdown, so
you can track UI quality like you track test coverage.
## When NOT to use
- For a quick pass/fail before committing → use `/ss-lint`
- For a full prose audit with fixes → use `/ss-review`
- For logic/config with no visual artifact — scoring is meaningless
## Step 0 — Resolve the effective rule set
Before scoring, read `.styleseed/effective-rules.md` and `.styleseed/manifest.json`. If they are
missing or `ss-resolve --check` reports drift, invoke `/ss-resolve` or `$ss-resolve` from the
project lock first. Only fall back to the source handbook when no project lock exists.
Score in authority order: core invariants first, then the exact output grammar, domain/page,
brand recipe, optional aesthetic profile, and bounded lock values. The lock cannot waive an invariant.
Unknown values are a resolver error; do not invent an exception.
The output must name the effective rule set, for example:
```text
Rule set: operations-console × SaaS × dashboard × enterprise-workbench × swiss
```
## What to score
Score the file (or each file in a directory) on **eight weighted categories** that
map to the design language. Total = 100.
| Category | Weight | Reads from |
|---|---|---|
| **Color discipline** | 16 | DESIGN-LANGUAGE §1, §18, §72 + VISUAL-CRAFT §C4 |
| **Hierarchy & typography** | 16 | §2, §3, §4, §16 + Font Size table + VISUAL-CRAFT §C2 |
| **Layout & rhythm** | 12 | §13, §14, §15, §61 + VISUAL-CRAFT §C1 |
| **Cards & elevation** | 10 | §7, §8, §12, §1 + VISUAL-CRAFT §C3 |
| **States & a11y** | 18 | §11, §70, §71, §72 + VISUAL-CRAFT §C3 |
| **Motion & interaction** | 6 | §24, §59 + `engine/motion` |
| **Coherence** | 12 | VISUAL-CRAFT §C0 (one choice per axis) |
| **Distinctiveness** | 10 | Golden Rules 14–16 + VISUAL-CRAFT §CC-9b (not generic/default/template) |
## How to score each category
For each category, start at full marks and **subtract** for violations you find by
reading the code. Be specific and evidence-based — cite the line.
**Color discipline (16)** — deduct for: accidental `#000`/`text-black` outside a profile or
grammar contract that explicitly uses hard black structurally (−4 each, cap −8); competing
decorative emphasis hues (−5); **emoji used as UI icons** (−5); **a normal/OK/"보통" state shown in a status color** instead of
neutral grey (−4); **status color on most/every row** (no severity hierarchy) (−4);
**decorative hues** (gold stars, rainbow category dots) instead of accent/grey (−3);
hardcoded hex where a semantic token exists (−2 each, cap −6); status conveyed by color
alone (−4); **the unlocked default indigo (`#5E6AD2`/`#4F46E5`) used as the accent** instead of
a chosen domain-fit color (−4).
**Distinctiveness (10)** — a coherent screen can still read "AI-generated." Deduct for: the
**icon-chip cliché** — a generic Lucide line-icon in an identical pale-tinted rounded-square,
repeated for every feature/step (−4, §CC-9b); the **StyleSeed demo layout copied verbatim**
(hero+chat / 3-step / feature-grid / pricing) with no product-specific identity (−4); **no focal
point** — an all-even grid of same-weight, centered, evenly-spaced cards (−3); the hero shows a
stock/placeholder visual instead of *this* product (−3); the **escape hatch as a new uniform**
(§CC-9c) — ghost 01/02/03 index numbers on every section, or identical uppercase-overline +
big-number cards repeated with no variation (−2); **distinctive-but-dated** (§CC-9d) — full
beige/paper page base, serif body text on a product surface, dark-heavy blocks that read
"brochure" not "2026 product" (−3). Cap −10.
**Hierarchy & typography (16)** — deduct for: number/unit not ~2:1 (−4); font
sizes off the Font Size table / `text-[var(--…)]` for size (−5); everything the
same weight, no clear primary (−5); cramped or wrong line-height on body (−3);
**body < 16px on a desktop/web B2B surface** (tight mobile scale on a wide screen) (−4 —
but dense-data chrome is exempt: chart ticks, mono SHAs/timestamps, table metadata at
12–13px are correct; and dashboard app-chrome h1 at 22–24px is correct, not a violation
of the marketing 40–56px headline scale).
**Layout & rhythm (12)** — deduct for: grouping that contradicts the selected grammar or recipe (−6):
`operations-console` needs explicit functional groups, while `editorial-reading` should not be
forced into cards; `enterprise-workbench` needs aligned panels/rows while `public-service`
needs flat step flow; arbitrary off-scale spacing (−3); same section type repeated without purpose
(−4); no discernible proximity rhythm (−3).
**Cards & elevation (10)** — deduct for mixed or task-inappropriate surface language. Hairlines,
flat grouping, tonal ramps, or restrained shadows are valid only when the selected grammar/profile
uses them coherently. Deduct mixed border/shadow languages (−4), visibly heavy or directionally
inconsistent shadows (−4), or missing group/surface separation where the grammar requires it (−5).
**States & a11y (18)** — deduct for: missing empty/loading/error state on a data
surface (−5 each, cap −10 — a static mockup or marketing landing with NO data surface is
**N/A**: skip these deductions, don't fail the category); contrast below 4.5:1 body / 3:1
large (−6); touch target < 44px on a touch surface (pointer-first desktop controls at
36–40px are fine) (−4); no visible focus / `outline:none` (−5); icon-only control
without `aria-label` (−3).
**Motion & interaction (6)** — deduct for: random/ad-hoc fades instead of a named
seed/keyword (−3); motion that delays content or blocks an action (−4); no
`prefers-reduced-motion` handling on custom motion (−3). **Scroll-linked/parallax/3D/animated-
gradient is SURFACE-DEPENDENT (§43):** on an app/dashboard/data/form surface it's forbidden
(−5); on a **marketing/landing/brand page it's ALLOWED (the Cinematic tier)** — there, do NOT
deduct for scroll-linked reveals, pinned sections, 3D hero, or animated backgrounds; only deduct
for **scroll-JACKING** (hijacking scroll / trapping) (−5), motion that hides content until scroll
or delays the headline/CTA (−4), or a missing `prefers-reduced-motion` fallback (−3). Judge by
page type first, then score.
**Coherence (12)** — the "one choice per axis" laws (VISUAL-CRAFT §C0). Deduct for
each axis that is *mixed* rather than unified across the file: mixed radius
personalities, e.g. sharp panel + pill buttons (−5); two+ competing accent hues used
for emphasis (−4); mixed shadow languages / light directions (−3); mixed icon
families, fill modes, or stroke weights (−3); same radius on a nested element instead
of `inner = outer − padding` (−2); inconsistent control heights for buttons/inputs
(−2). This is the category that most predicts "looks AI-generated" — weight evidence
of system-wide consistency, not per-component prettiness.
Clamp each category at 0. Sum to a total.
## Output format
```
## Design Score: 70 / 100 (src/app/Dashboard.tsx)
Rule set: operations-console × product-ui × SaaS × dashboard × enterprise-workbench × swiss
████████████████░░░░░░ C-
Color discipline 11/16 ▓▓▓░ competing orange+blue emphasis hues (l.28-34)
Hierarchy & typography 13/16 ▓▓▓▓ number/unit 1:1 on hero (l.18)
Layout & rhythm 9/12 ▓▓▓░ two identical KPI rows (l.22-31)
Cards & elevation 8/10 ▓▓░░ mixed border + floating-shadow language (l.22)
States & a11y 11/18 ▓▓░░ no empty/loading state; focus ring missing (l.55)
Motion & interaction 4/6 ▓▓▓░ default fade, not a named seed
Coherence 6/12 ▓▓░░ sharp cards (l.22) + pill buttons (l.48); 3 accent hues (§C0)
Distinctiveness 8/10 ▓▓▓░ all-even KPI grid weakens the operational focal panel
### Fix first (highest score gain)
1. Add empty + loading states to the orders list → +7 states (§71)
2. Unify radius (pick soft 8-12px) + collapse to one accent → +9 coherence+color (§C0, §2)
3. Drop the 1px borders, use tone + ≤8% shadow → +4 cards (§7)
Re-score after: ~92 / 100.
```
Use letter bands: 90+ A · 80-89 B · 70-79 C · 60-69 D · <60 F.
## Gate mode (use this as the Quality Gate before showing the user UI)
The Quality Gate (CLAUDE.md / AGENTS.md) is `/ss-score` run as a loop, not a one-off:
1. Score the just-generated UI.
2. If **< 80**, apply the "fix first" list (use `/ss-review` to make the edits), then **re-score**.
3. Repeat up to ~3×, or until ≥ 80.
4. Present the UI with the final score and a one-line "fixed: …".
The pass bar is a **floor, not a ceiling** — get to ≥ 80 and stop; don't chase 100. The point
is that no first-draft, obviously-incoherent UI reaches the user. Especially never ship below
80 with a rainbow status list, emoji icons, two accents, or missing states — those are the
exact tells the gate exists to catch.
## Rules
- **Read the file** — score from real evidence (line numbers), never guess.
- Order the "fix first" list by **score gain**, not by severity alone — the goal
is the fastest path to a better number.
- For a directory, print a one-line score per file, then the lowest-scoring file's
full breakdown.
- Don't auto-edit in plain scoring. `/ss-score` measures; `/ss-review` and `/ss-motion` fix.
In **Gate mode** (above) you do fix-and-re-score until the floor is met.
- As a *gate*, ≥ 80 is a floor before showing the user — but don't over-polish: chasing 95→100
to delay shipping is worse than shipping a clean 85.
+154
View File
@@ -0,0 +1,154 @@
---
name: ss-setup
description: Configure StyleSeed by selecting the output grammar, domain, page type, brand recipe, semantic palette recipe, optional aesthetic profile, and bounded brand tokens before scaffolding a first screen.
argument-hint: "(no arguments needed)"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash, WebFetch
---
# StyleSeed setup
StyleSeed setup chooses a **design method for the result**, not a favorite brand to imitate.
Use `/ss-resolve --list` (Claude Code) or `$ss-resolve --list` (Codex) to inspect the supported
grammar, adapter, domain, page, recipe, palette, and profile IDs without loading the full handbook.
## When not to use
- Project already has a valid `STYLESEED.md` → use `/ss-update`.
- User supplied references that are not represented by a built-in grammar → run
`/ss-reference` before setup, then select the compiled grammar.
- One component inside an established system → `/ss-component`.
The method, review, and reference compiler are framework-agnostic. The bundled component
scaffold currently targets React and Tailwind v4; on another stack configure the lock and
apply the method without pretending the scaffold is portable.
## Wizard — one decision at a time
### 1. Product job and surface
Ask what is being built, who uses it, and whether it is a mobile/desktop product, website,
social carousel, slide deck, document/report, or single-frame graphic. Select a surface adapter
from `ADAPTERS.md`, then infer domain and page/artifact type.
### 2. Output grammar
Recommend exactly one grammar from `RULESETS.md` and explain the job match in one sentence:
- `consumer-service`
- `operations-console`
- `technical-instrument`
- `editorial-reading`
- `commerce-conversion`
- `institutional-service`
- `expressive-marketing`
- `sequential-story`
- `reference:<slug>` when `/ss-reference` already compiled one
Do not recommend Toss as the universal default. It is one reference family for
`consumer-service`. If none fits and the user has references, route to `/ss-reference`.
### 3. Page type and domain bias
Confirm the concrete page (dashboard, form, landing, detail, list, settings, onboarding) and
read its domain × page intersection. This controls composition; the aesthetic profile does not.
### 4. Brand recipe
Recommend one morphology from `BRAND-RECIPES.md`. Use `auto` when the maintained grammar mapping
fits. Use an explicit recipe when the product needs a different geometry, containment,
navigation, control, or collection language. A recipe is not a company clone and does not
select colors.
### 5. Palette recipe
Recommend one semantic palette from `PALETTE-RECIPES.md`. Use `auto` when its maintained recipe
mapping fits. An explicit palette must still preserve semantic roles, surface/chrome separation,
status cues, and validated contrast. The recipe is a product posture, not a finite swatch list.
When the user supplies a key color, select perceptual character, light/dark environment, surface
temperature, and accent relationship; `$ss-resolve` then derives the actual OKLCH ramps and roles.
Palette selection is not permission to recolor every surface.
### 6. Optional aesthetic profile
Recommend one profile from `PRESETS.md` only when it strengthens the product. `none` is a good
default. A profile modifies coordinated visual axes but cannot replace the output grammar.
### 7. Brand and bounded axes
Lock a real brand color if supplied; otherwise start from the selected palette's primary role. For
a supplied key, recommend `calm|balanced|vivid|deep` from the product posture rather than asking for
an unbounded mood word. Then confirm light/dark mode, `neutral|warm|cool` surfaces, and
`auto|tonal|adjacent|contrast` accent relationship. Confirm font/language, density, radius,
elevation, imagery/data role, and motion inside the grammar's allowed ranges. Do not use generic
indigo or a stale purple mislabeled as Toss.
### 8. Write the design lock
Create `STYLESEED.md`:
```markdown
# StyleSeed — Design Lock
<!-- Selections persist here. This file cannot waive StyleSeed core invariants. -->
- App domain: fintech
- Surface: mobile-app
- Surface adapter: product-ui
- Page type: dashboard
- Output grammar: consumer-service
- Grammar path: built-in:engine/RULESETS.md
- Grammar fallback: consumer-service
- Reference confidence: n/a
- Brand recipe: calm-consumer
- Palette recipe: quiet-mineral
- Key color: #3182F6
- Palette character: calm
- Palette mode: light
- Palette harmony: auto
- Surface temperature: neutral
- Aesthetic profile: none
- Skin: custom
- Primary action: #3182F6
- Font: Pretendard
- Radius: soft
- Elevation: light=tonal grouping + restrained shadow · dark=tonal ramp + hairline
- Density: comfortable
- Motion: Spring restrained
- Imagery/data role: personal state first; charts only for a decision
- Signature move: one calm contextual briefing above the account summary
- Locked: YYYY-MM-DD
```
For a compiled grammar use its actual path and confidence. Reject unknown enum values rather
than treating the lock as an exemption.
### 9. Scaffold and prove
Compile the selected method before code:
```bash
node <installed-ss-resolve>/scripts/resolve-context.mjs \
--project-root . --from-lock STYLESEED.md --agent claude
```
Use `--agent codex` in Codex. The resolver writes `.styleseed/effective-rules.md` and a
hash-verifiable `.styleseed/manifest.json`. Read the effective bundle, not `llms-full.txt`.
If the user asked for a first screen, build from that bundle, run `/ss-score` to the gate floor,
and finish with `/ss-verify` when renderable. If visual rendering is unavailable, disclose that
it was skipped.
## Completion report
Report the selected grammar and why, page/domain intersection, brand recipe, palette recipe,
optional profile, lock path,
compiled bundle and manifest paths, files changed, score, and visual verification status.
Mention `/ss-reference` as the path for future references that need their own grammar.
## Rules
- Ask one question at a time and recommend a concrete default.
- Output grammar is required; aesthetic profile is optional.
- Brand recipe is required; `auto` resolves to a concrete maintained recipe.
- Palette recipe is required; `auto` resolves to a contrast-verified semantic palette.
- A skin is tokens, not design judgment.
- Never fetch a brand `DESIGN.md` and treat its palette as a complete rule set.
- Never scaffold an unscored first page or claim visual verification without a screenshot.
+146
View File
@@ -0,0 +1,146 @@
---
name: ss-studio
description: Turn a product brief and optional references into three distinct creative directions, a human-selected StyleSeed interaction plan, generated image/video asset jobs, a working UI prototype, and a verified prototype-first showcase reel. Use for client concepts, app interaction exploration, trendy but coherent UI direction, reference discovery and synthesis, or any request that needs more than one static screen.
---
# Build a directed interactive concept
Run the full Studio pipeline. Do not reduce it to a moodboard, a static image, or a set of arbitrary
motion effects.
## Start the run
Read `STUDIO-PIPELINE.md`, `PRODUCT-PRINCIPLES.md`, and the resolved project rules first. If the
project has no valid `STYLESEED.md`, run setup and resolve before Studio.
Initialize a durable run:
```bash
node <skill-dir>/scripts/studio-run.mjs init \
--project-root . \
--name "<project or concept>" \
--brief "<product job and desired interaction>" \
--surface mobile-app \
--platform web
```
The command prints the run directory under `.styleseed/studio/`. Use the artifact schemas in
`references/artifact-contract.md`. Use `references/provider-adapters.md` only when media generation
or recording is required.
## 1. Scout by role
Classify supplied and discovered references as `structure`, `navigation`, `signature`, `motion`, or
`asset-language`. Capture source URL/path, date, visible observation, transferable principle,
confidence, and rights note. Never claim visual evidence for a reference that was not actually seen.
Do not ask the user to collect a generic moodboard. Find only the missing roles. Keep product UI,
marketing presentation, and generated media separate unless the brief explicitly connects them.
## 2. Produce three directions
Write exactly three entries in `directions.json`: `native`, `signature`, and `experimental`. Keep
the product job and content fixed; vary at least two structural axes. Every direction must include:
- composition and focal logic;
- navigation chrome versus content canvas;
- one semantic palette recipe, type, and material roles;
- generated asset strategy;
- motion and continuity logic;
- one product-specific signature move;
- output grammar, brand recipe, trade-offs, implementation cost, and risk.
Advance only after the directions validate:
```bash
node <skill-dir>/scripts/studio-run.mjs advance --project-root . --run <id> --stage directed
```
## 3. Require a selection
Show the three directions together. Record the user's selection and rationale. Do not average them
or quietly choose the easiest one.
```bash
node <skill-dir>/scripts/studio-run.mjs select \
--project-root . --run <id> --direction <direction-id> \
--by "<reviewer>" --rationale "<decision>"
```
## 4. Compile scenes and media jobs
Write `scenes.json`, `assets.json`, and `video.json` from the selected direction.
- An interaction scene defines trigger, states, continuity, enter/exit, feedback, interruption,
reduced-motion behavior, and renderer targets.
- An asset job defines capability, prompt, inputs, output, provenance, rights note, fallback, and
consuming scene.
- A video plan starts with real prototype recordings. Mark generative shots explicitly; never use
them to fake an interaction that does not work.
Map capability to an available provider only at execution time. If the needed provider is absent,
leave the job `blocked` and report the exact missing capability.
Record provider execution without hand-editing the run:
```bash
node <skill-dir>/scripts/studio-run.mjs media \
--project-root . --run <id> --job <job-id> --status complete \
--provider <tool/model> --output <project-relative-path> \
--provenance "<model · date · source inputs>"
```
## 5. Generate, build, and record
Generate raster assets only for imagery, texture, illustration, footage, or product material. Keep
UI geometry, icons, and final copy code-native and accessible. Copy final generated files into the
run directory and preserve prompts and provenance.
Build the selected direction as a working prototype. Implement its primary navigation, signature
scene, cancel/back behavior, and reduced-motion fallback. Record the actual prototype after it
passes the code and pixel gates. Optional generated footage may be composited as labeled media.
Store prototype and recording paths through the CLI, then advance to `built`:
```bash
node <skill-dir>/scripts/studio-run.mjs output \
--project-root . --run <id> --prototype <route-or-path>
node <skill-dir>/scripts/studio-run.mjs advance \
--project-root . --run <id> --stage built
node <skill-dir>/scripts/studio-run.mjs output \
--project-root . --run <id> --recording <project-relative-path>
```
## 6. Verify and deliver
Run StyleSeed score and visual verification, then inspect temporal evidence: start/mid/end frames,
interrupt/cancel behavior, and reduced motion. Record `code`, `visual`, `temporal`, and `human` gate
statuses plus evidence paths in `verification.json`.
Record each gate explicitly. A human pass requires a named reviewer:
```bash
node <skill-dir>/scripts/studio-run.mjs gate \
--project-root . --run <id> --gate temporal --status pass \
--evidence <path> --note "start, mid, end, cancel, and reduced motion inspected"
node <skill-dir>/scripts/studio-run.mjs gate \
--project-root . --run <id> --gate human --status pass \
--reviewer "<name>" --evidence <path> --note "selected result accepted"
```
```bash
node <skill-dir>/scripts/studio-run.mjs advance --project-root . --run <id> --stage verified
node <skill-dir>/scripts/studio-run.mjs status --project-root . --run <id>
```
Deliver the complete run folder, runnable prototype, actual recording, and unresolved risks. A
polished reel by itself is not a completed Studio run.
## Non-negotiables
- Keep exactly one selected design direction and one coherent product language.
- Human selection precedes expensive generation and implementation.
- Do not clone protected brand assets, copy, or trademarked arrangements.
- Do not fabricate reference observations, provider outputs, file paths, or verification passes.
- Do not let generated imagery carry essential UI text or interaction semantics.
- Do not mark a run verified without seeing the pixels and the temporal result.
@@ -0,0 +1,4 @@
interface:
display_name: "StyleSeed Studio"
short_description: "Turn briefs into directed UI prototypes and motion reels"
default_prompt: "Use $ss-studio to turn this product brief into three creative directions with semantic palette recommendations, a human-selected interactive prototype, generated image/video jobs, and a verified prototype-first showcase reel."
@@ -0,0 +1,135 @@
# Studio artifact contract
Use these fields exactly. Extra task-specific fields are allowed, but required fields may not be
renamed.
## `references.json`
```json
{
"items": [{
"id": "R1",
"role": "structure | navigation | signature | motion | asset-language",
"source": "URL or path",
"observedAt": "ISO-8601",
"observation": "visible fact",
"principle": "transferable decision",
"confidence": "high | medium | low",
"rights": "usage/provenance note"
}]
}
```
## `directions.json`
`directions` contains exactly one `native`, one `signature`, and one `experimental` direction.
```json
{
"directions": [{
"id": "signature",
"lane": "signature",
"name": "user-facing name",
"promise": "one-sentence product experience",
"grammar": "built-in or reference grammar id",
"recipe": "brand recipe id",
"palette": "palette recipe id",
"composition": "focal and spatial logic",
"navigationChrome": "chrome/canvas relationship and states",
"typeAndMaterial": "type, color, surface, and image material",
"assetDirection": "what media is generated and why",
"motionDirection": "continuity and feedback logic",
"signatureMove": "one product-owned interaction",
"tradeoffs": ["..."],
"cost": "low | medium | high",
"risk": "low | medium | high"
}]
}
```
## `selection.json`
```json
{
"selectedDirectionId": "signature",
"decisionBy": "reviewer name",
"decidedAt": "ISO-8601",
"rationale": "why this direction fits the job"
}
```
## `scenes.json`
```json
{
"scenes": [{
"id": "open-focus",
"trigger": "tap focus card",
"from": "home-rest",
"to": "focus-detail",
"continuity": ["selected card", "title"],
"enter": ["detail controls"],
"exit": ["secondary feed"],
"feedback": "selected card lifts into the content plane",
"interrupt": "back or reverse gesture restores the source card",
"reducedMotion": "instant state swap plus focus movement",
"rendererTargets": ["web"]
}]
}
```
## `assets.json`
```json
{
"jobs": [{
"id": "A1",
"role": "ambient hero texture",
"kind": "raster | vector | video | audio",
"capability": "raster-generate",
"provider": "provider/tool id or unassigned",
"prompt": "complete reproducible prompt",
"inputs": [],
"output": "relative path or null",
"status": "planned | running | complete | blocked | rejected",
"provenance": "model/tool/date or pending",
"rights": "client usage and source note",
"fallback": "code-native or alternate media treatment",
"consumingScene": "scene id"
}]
}
```
## `video.json`
```json
{
"mode": "prototype-first",
"shots": [{
"id": "V1",
"sourceType": "prototype-recording | generated-media",
"scene": "scene id",
"durationMs": 2400,
"source": "relative path or null",
"status": "planned | complete | blocked",
"notes": "camera, crop, caption, or compositing instruction"
}]
}
```
## `verification.json`
```json
{
"gates": {
"code": "pending | pass | fail | blocked",
"visual": "pending | pass | fail | blocked",
"temporal": "pending | pass | fail | blocked",
"human": "pending | pass | fail | blocked"
},
"evidence": [{"gate": "visual", "path": "relative path", "note": "what it proves"}],
"reviewer": "name or null",
"acceptedAt": "ISO-8601 or null",
"risks": []
}
```
@@ -0,0 +1,48 @@
# Media and recording provider adapters
Select an adapter by capability. Tool names can change; the run contract must remain stable.
## Raster generation
Use for photography, illustration, texture, scene material, or image compositing. Do not render
final interface typography or accessible controls into the bitmap.
Required evidence:
- complete prompt and all reference-image roles;
- provider/model identifier and generation date;
- input and output paths copied into the run;
- review status and usage-rights note;
- a code-native fallback when the asset is nonessential.
## Video generation
Use for ambient footage, product-world imagery, texture motion, or an explicitly narrative asset.
Do not substitute a generated clip for a real clickable UI state transition.
Required evidence:
- prompt, input still/video, duration, aspect ratio, and intended consuming shot;
- provider/model identifier;
- output copied into the run and labeled `generated-media`;
- temporal review for warping, unreadable text, accidental UI, and loop seams.
## Prototype recording
Record the real app or browser prototype at its locked viewport. Capture each signature scene from
a stable start state and include interruption/back behavior. Store the raw recording before any
showcase edit.
Required evidence:
- route/build identifier and viewport;
- interaction script and input method;
- raw recording path;
- extracted start/mid/end frames;
- reduced-motion capture when the scene materially changes.
## Reel composition
Compose only after the prototype passes. The shot manifest remains authoritative. A reel can mix
prototype recordings and generated media, but every shot must retain its `sourceType`. Do not apply
editing that makes the product appear to support an interaction it does not support.
@@ -0,0 +1,356 @@
#!/usr/bin/env node
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { resolve } from "node:path";
const STAGES = ["briefed", "directed", "selected", "planned", "built", "verified"];
const ROLES = new Set(["structure", "navigation", "signature", "motion", "asset-language"]);
const LANES = new Set(["native", "signature", "experimental"]);
const GATES = ["code", "visual", "temporal", "human"];
const GATE_STATUSES = new Set(["pending", "pass", "fail", "blocked"]);
const MEDIA_STATUSES = new Set(["planned", "running", "complete", "blocked", "rejected"]);
function fail(message, code = 1) {
console.error(`Studio run error: ${message}`);
process.exit(code);
}
function parseArgs(argv) {
const [command, ...rest] = argv;
const options = {};
for (let i = 0; i < rest.length; i += 1) {
const token = rest[i];
if (!token.startsWith("--")) fail(`unexpected argument ${token}`);
const key = token.slice(2);
const value = rest[i + 1];
if (!value || value.startsWith("--")) fail(`missing value for --${key}`);
options[key] = value;
i += 1;
}
return { command, options };
}
function slugify(value) {
return value
.normalize("NFKD")
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-+|-+$/g, "")
.slice(0, 48) || "studio-run";
}
function now() {
return new Date().toISOString();
}
function readJson(path) {
try {
return JSON.parse(readFileSync(path, "utf8"));
} catch (error) {
fail(`cannot read ${path}: ${error.message}`);
}
}
function writeJson(path, value) {
writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`);
}
function projectRoot(options) {
return resolve(options["project-root"] || process.cwd());
}
function runDir(options) {
const id = options.run;
if (!id) fail("--run is required");
return resolve(projectRoot(options), ".styleseed", "studio", id);
}
function requireRun(options) {
const dir = runDir(options);
const path = resolve(dir, "run.json");
if (!existsSync(path)) fail(`run not found: ${dir}`);
return { dir, path, run: readJson(path) };
}
function requiredString(value, label, failures) {
if (typeof value !== "string" || !value.trim()) failures.push(`${label} is required`);
}
function validateDirection(direction, index, failures) {
const prefix = `directions[${index}]`;
for (const key of [
"id", "lane", "name", "promise", "grammar", "recipe", "palette", "composition",
"navigationChrome", "typeAndMaterial", "assetDirection", "motionDirection", "signatureMove",
"cost", "risk",
]) requiredString(direction?.[key], `${prefix}.${key}`, failures);
if (!LANES.has(direction?.lane)) failures.push(`${prefix}.lane is invalid`);
if (!Array.isArray(direction?.tradeoffs) || direction.tradeoffs.length === 0) {
failures.push(`${prefix}.tradeoffs must contain at least one item`);
}
}
function validateTarget(dir, run, target) {
const failures = [];
if (!STAGES.includes(target)) failures.push(`unknown target stage ${target}`);
const briefPath = resolve(dir, "brief.md");
if (!existsSync(briefPath) || readFileSync(briefPath, "utf8").trim().length < 40) {
failures.push("brief.md must contain a concrete product brief");
}
if (STAGES.indexOf(target) >= STAGES.indexOf("directed")) {
const references = readJson(resolve(dir, "references.json"));
if (!Array.isArray(references.items)) failures.push("references.json items must be an array");
else references.items.forEach((item, index) => {
requiredString(item.id, `references[${index}].id`, failures);
if (!ROLES.has(item.role)) failures.push(`references[${index}].role is invalid`);
for (const key of ["source", "observedAt", "observation", "principle", "confidence", "rights"])
requiredString(item[key], `references[${index}].${key}`, failures);
});
const directions = readJson(resolve(dir, "directions.json"));
if (!Array.isArray(directions.directions) || directions.directions.length !== 3) {
failures.push("directions.json must contain exactly three directions");
} else {
directions.directions.forEach((direction, index) => validateDirection(direction, index, failures));
const lanes = new Set(directions.directions.map((direction) => direction.lane));
for (const lane of LANES) if (!lanes.has(lane)) failures.push(`missing ${lane} direction`);
const ids = new Set(directions.directions.map((direction) => direction.id));
if (ids.size !== 3) failures.push("direction ids must be unique");
}
}
if (STAGES.indexOf(target) >= STAGES.indexOf("selected")) {
const selection = readJson(resolve(dir, "selection.json"));
const directions = readJson(resolve(dir, "directions.json")).directions || [];
requiredString(selection.selectedDirectionId, "selection.selectedDirectionId", failures);
requiredString(selection.decisionBy, "selection.decisionBy", failures);
requiredString(selection.decidedAt, "selection.decidedAt", failures);
requiredString(selection.rationale, "selection.rationale", failures);
if (!directions.some((direction) => direction.id === selection.selectedDirectionId)) {
failures.push("selection does not match a direction id");
}
}
if (STAGES.indexOf(target) >= STAGES.indexOf("planned")) {
const scenes = readJson(resolve(dir, "scenes.json"));
if (!Array.isArray(scenes.scenes) || scenes.scenes.length === 0) failures.push("at least one interaction scene is required");
else scenes.scenes.forEach((scene, index) => {
for (const key of ["id", "trigger", "from", "to", "feedback", "interrupt", "reducedMotion"])
requiredString(scene[key], `scenes[${index}].${key}`, failures);
for (const key of ["continuity", "enter", "exit", "rendererTargets"])
if (!Array.isArray(scene[key])) failures.push(`scenes[${index}].${key} must be an array`);
});
const assets = readJson(resolve(dir, "assets.json"));
if (!Array.isArray(assets.jobs)) failures.push("assets.json jobs must be an array");
else assets.jobs.forEach((job, index) => {
for (const key of ["id", "role", "kind", "capability", "provider", "prompt", "status", "provenance", "rights", "fallback", "consumingScene"])
requiredString(job[key], `assets[${index}].${key}`, failures);
if (!Array.isArray(job.inputs)) failures.push(`assets[${index}].inputs must be an array`);
if (!MEDIA_STATUSES.has(job.status)) failures.push(`assets[${index}].status is invalid`);
if (job.status === "complete") requiredString(job.output, `assets[${index}].output`, failures);
});
const video = readJson(resolve(dir, "video.json"));
if (video.mode !== "prototype-first") failures.push("video.mode must be prototype-first");
if (!Array.isArray(video.shots) || !video.shots.some((shot) => shot.sourceType === "prototype-recording")) {
failures.push("video plan must contain at least one prototype-recording shot");
}
}
if (STAGES.indexOf(target) >= STAGES.indexOf("built")) {
requiredString(run.outputs?.prototype, "run.outputs.prototype", failures);
}
if (STAGES.indexOf(target) >= STAGES.indexOf("verified")) {
requiredString(run.outputs?.recording, "run.outputs.recording", failures);
const verification = readJson(resolve(dir, "verification.json"));
for (const gate of GATES) {
if (verification.gates?.[gate] !== "pass") failures.push(`verification gate ${gate} must pass`);
}
if (!Array.isArray(verification.evidence) || verification.evidence.length < 4) {
failures.push("verification needs evidence for all four gates");
}
requiredString(verification.reviewer, "verification.reviewer", failures);
requiredString(verification.acceptedAt, "verification.acceptedAt", failures);
}
return failures;
}
function init(options) {
for (const key of ["name", "brief", "surface", "platform"]) if (!options[key]) fail(`--${key} is required`);
const root = projectRoot(options);
const baseId = slugify(options.name);
let id = baseId;
let suffix = 2;
while (existsSync(resolve(root, ".styleseed", "studio", id))) id = `${baseId}-${suffix++}`;
const dir = resolve(root, ".styleseed", "studio", id);
mkdirSync(resolve(dir, "assets", "generated"), { recursive: true });
mkdirSync(resolve(dir, "evidence", "frames"), { recursive: true });
mkdirSync(resolve(dir, "evidence", "recordings"), { recursive: true });
const createdAt = now();
writeJson(resolve(dir, "run.json"), {
schemaVersion: 1,
id,
title: options.name,
createdAt,
updatedAt: createdAt,
stage: "briefed",
surface: options.surface,
platform: options.platform,
outputs: { prototype: null, recording: null },
});
writeFileSync(resolve(dir, "brief.md"), `# ${options.name}\n\n${options.brief.trim()}\n`);
writeJson(resolve(dir, "references.json"), { items: [] });
writeJson(resolve(dir, "directions.json"), { directions: [] });
writeJson(resolve(dir, "selection.json"), { selectedDirectionId: null, decisionBy: null, decidedAt: null, rationale: null });
writeJson(resolve(dir, "scenes.json"), { scenes: [] });
writeJson(resolve(dir, "assets.json"), { jobs: [] });
writeJson(resolve(dir, "video.json"), { mode: "prototype-first", shots: [] });
writeJson(resolve(dir, "verification.json"), {
gates: Object.fromEntries(GATES.map((gate) => [gate, "pending"])),
evidence: [], reviewer: null, acceptedAt: null, risks: [],
});
console.log(dir);
}
function select(options) {
const { dir, path, run } = requireRun(options);
for (const key of ["direction", "by", "rationale"]) if (!options[key]) fail(`--${key} is required`);
const directedFailures = validateTarget(dir, run, "directed");
if (directedFailures.length) fail(`cannot select before directions pass:\n- ${directedFailures.join("\n- ")}`);
const directions = readJson(resolve(dir, "directions.json")).directions;
if (!directions.some((direction) => direction.id === options.direction)) fail(`unknown direction ${options.direction}`);
writeJson(resolve(dir, "selection.json"), {
selectedDirectionId: options.direction,
decisionBy: options.by,
decidedAt: now(),
rationale: options.rationale,
});
run.stage = "selected";
run.updatedAt = now();
writeJson(path, run);
console.log(`${run.id}: selected ${options.direction}`);
}
function output(options) {
const { path, run } = requireRun(options);
if (!options.prototype && !options.recording) fail("pass --prototype and/or --recording");
if (options.prototype) run.outputs.prototype = options.prototype;
if (options.recording) run.outputs.recording = options.recording;
run.updatedAt = now();
writeJson(path, run);
console.log(`${run.id}: outputs updated`);
}
function media(options) {
const { dir, path, run } = requireRun(options);
for (const key of ["job", "status"]) if (!options[key]) fail(`--${key} is required`);
if (!MEDIA_STATUSES.has(options.status)) {
fail(`--status must be one of ${[...MEDIA_STATUSES].join(", ")}`);
}
const assetsPath = resolve(dir, "assets.json");
const assets = readJson(assetsPath);
const job = assets.jobs?.find((item) => item.id === options.job);
if (!job) fail(`media job not found: ${options.job}`);
if (options.status === "complete") {
for (const key of ["provider", "output", "provenance"]) {
if (!options[key] && !job[key]) fail(`complete media job requires --${key}`);
}
}
job.status = options.status;
if (options.provider) job.provider = options.provider;
if (options.output) job.output = options.output;
if (options.provenance) job.provenance = options.provenance;
job.updatedAt = now();
writeJson(assetsPath, assets);
run.updatedAt = now();
writeJson(path, run);
console.log(`${run.id}: media ${job.id} -> ${job.status}`);
}
function gate(options) {
const { dir, path, run } = requireRun(options);
for (const key of ["gate", "status"]) if (!options[key]) fail(`--${key} is required`);
if (!GATES.includes(options.gate)) fail(`--gate must be one of ${GATES.join(", ")}`);
if (!GATE_STATUSES.has(options.status)) {
fail(`--status must be one of ${[...GATE_STATUSES].join(", ")}`);
}
if (options.gate === "human" && options.status === "pass" && !options.reviewer) {
fail("human pass requires --reviewer");
}
const verificationPath = resolve(dir, "verification.json");
const verification = readJson(verificationPath);
verification.gates[options.gate] = options.status;
if (options.evidence) {
verification.evidence.push({
gate: options.gate,
path: options.evidence,
note: options.note || `${options.gate} ${options.status}`,
recordedAt: now(),
});
}
if (options.reviewer) verification.reviewer = options.reviewer;
if (options.gate === "human" && options.status === "pass") verification.acceptedAt = now();
writeJson(verificationPath, verification);
run.updatedAt = now();
writeJson(path, run);
console.log(`${run.id}: gate ${options.gate} -> ${options.status}`);
}
function advance(options) {
const { dir, path, run } = requireRun(options);
const target = options.stage;
if (!STAGES.includes(target)) fail(`--stage must be one of ${STAGES.join(", ")}`);
const currentIndex = STAGES.indexOf(run.stage);
const targetIndex = STAGES.indexOf(target);
if (targetIndex !== currentIndex + 1) fail(`advance must be sequential: ${run.stage} -> ${STAGES[currentIndex + 1] || "complete"}`);
if (target === "selected") fail("use the select command for the human selection gate");
const failures = validateTarget(dir, run, target);
if (failures.length) fail(`cannot advance to ${target}:\n- ${failures.join("\n- ")}`);
run.stage = target;
run.updatedAt = now();
writeJson(path, run);
console.log(`${run.id}: ${target}`);
}
function validate(options) {
const { dir, run } = requireRun(options);
const target = options.target || run.stage;
const failures = validateTarget(dir, run, target);
if (failures.length) fail(`${target} validation failed:\n- ${failures.join("\n- ")}`, 2);
console.log(`${run.id}: ${target} contract valid`);
}
function status(options) {
const { dir, run } = requireRun(options);
const selection = readJson(resolve(dir, "selection.json"));
const assets = readJson(resolve(dir, "assets.json"));
const video = readJson(resolve(dir, "video.json"));
const verification = readJson(resolve(dir, "verification.json"));
console.log(JSON.stringify({
id: run.id,
stage: run.stage,
surface: run.surface,
platform: run.platform,
selectedDirection: selection.selectedDirectionId,
mediaJobs: assets.jobs.length,
mediaComplete: assets.jobs.filter((job) => job.status === "complete").length,
prototypeShots: video.shots.filter((shot) => shot.sourceType === "prototype-recording").length,
gates: verification.gates,
outputs: run.outputs,
path: dir,
}, null, 2));
}
const { command, options } = parseArgs(process.argv.slice(2));
if (command === "init") init(options);
else if (command === "select") select(options);
else if (command === "output") output(options);
else if (command === "media") media(options);
else if (command === "gate") gate(options);
else if (command === "advance") advance(options);
else if (command === "validate") validate(options);
else if (command === "status") status(options);
else fail("command must be init, select, output, media, gate, advance, validate, or status");
+76
View File
@@ -0,0 +1,76 @@
---
name: ss-tokens
description: Generate an accessible semantic palette from a key color, or view, add, and modify StyleSeed design tokens. Use when a user supplies a brand color, asks which colors combine well, needs light/dark theme roles, or needs token files for implementation.
argument-hint: "[action: generate|list|add|update] [token-type: color|spacing|shadow|radius|typography]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# Design Token Manager
## When NOT to use
- For applying tokens in components → use `/ss-component` or `/ss-pattern`
- For finding token violations in existing code → use `/ss-lint`
- For non-CSS token systems (Figma, native iOS/Android) — Tailwind v4 / CSS variables only
Action: **$0** | Token type: **$1**
Arguments: $ARGUMENTS
## Token File Locations
| Type | JSON Source | CSS Implementation |
|------|-----------|-------------------|
| Colors | `tokens/colors.json` | `css/theme.css` `:root` + `@theme inline` |
| Typography | `tokens/typography.json` | `css/fonts.css` + `css/base.css` |
| Spacing | `tokens/spacing.json` | Tailwind utilities (no custom CSS needed) |
| Radius | `tokens/radii.json` | `css/theme.css` `@theme inline` |
| Shadows | `tokens/shadows.json` | `css/theme.css` `:root` |
## Instructions
### `generate color` — Derive the system from one key color
Do not pick a second color by eye or copy a preset. Run the shared StyleSeed generator:
```bash
node <styleseed-root>/engine/color/generate-palette.mjs \
--key-color "#276B5E" \
--mode light \
--character calm \
--harmony auto \
--temperature neutral \
--out .styleseed/palette.json
```
Supported controls are `light|dark` mode, `calm|balanced|vivid|deep` character,
`auto|tonal|adjacent|contrast` harmony, and `neutral|warm|cool` surface temperature.
The generator preserves the key hue, maps chroma into sRGB without channel clipping, builds
11-step OKLCH primary/accent ramps, scores the accent against the key and reserved status hues,
maps primitives to semantic roles, and adjusts fill lightness until text/action/focus pairs pass.
Use `--format css` for CSS variables or JSON for an auditable result. Never mark the palette
valid unless `valid` is true and every item in `contrast` passes. In `STYLESEED.md`, persist
`Key color`, `Palette character`, `Palette mode`, `Palette harmony`, and `Surface temperature`,
then run `$ss-resolve`; the resolver emits the same `.styleseed/palette.json` and `palette.css`.
### `list` — Show current tokens
Read and display the requested token file in a formatted table.
### `add` — Add new token
1. Add the token to the JSON source file (`tokens/*.json`)
2. Add the CSS custom property to `css/theme.css` under `:root`
3. If it needs a Tailwind utility, add to the `@theme inline` block
4. If it has a dark mode variant, add to the `.dark` block
### `update` — Modify existing token
1. Update the value in the JSON source file
2. Update the CSS custom property in `theme.css`
3. Check all components for direct usage that might need updating
## Rules
- Always keep JSON and CSS in sync
- Use semantic names, not descriptive names (`--success` not `--green-500`)
- Colors should support both light and dark modes
- New tokens must be added to BOTH the JSON source AND the CSS implementation
- Treat preset recipes as maintained defaults, not the limit of available colors.
- Character and role allocation are stronger design controls than complementary/triadic geometry alone.
+184
View File
@@ -0,0 +1,184 @@
---
name: ss-update
description: Update StyleSeed engine in your project — analyzes what's outdated and updates safely
argument-hint: "(no arguments needed)"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# StyleSeed Update Assistant
## When NOT to use
- For first-time setup → use `/ss-setup`
- For just one new component or skin — copy that file manually
- For projects that have heavily diverged from upstream — manual diff review first
- Updating the engine is separate from re-designing your UI. Steps 1–5 update engine files only;
if you want an old generic build re-done to the new standard, that's **Step 6 (Retrofit)**.
Automatically detect and update StyleSeed files in the current project.
## Reassure the user first
Updating is **safe and reversible**. Updates are additive — new rules,
components, skins, and skills get added; your `theme.css`, your components, and
your app code are never overwritten, and design rules only ever get added (never
changed in a breaking way). A big version jump looks like a lot changed, but
it's almost all additions. **Do NOT warn the user that the build will break**
unless you actually find a changed component/import API. Tell them: commit first,
copy the new rules + skills, run a build, and `git reset --hard` if anything is
off — they can't permanently break their project.
## Instructions
### Step 1: Detect Current Setup
Scan the project to find where StyleSeed files are:
```bash
# Find DESIGN-LANGUAGE.md
find . -name "DESIGN-LANGUAGE.md" -not -path "*/node_modules/*"
# Find CLAUDE.md
find . -name "CLAUDE.md" -not -path "*/node_modules/*"
# Find skills (ss-* is current; ui-*/ux-* are legacy names to migrate from)
find . -path "*/.claude/skills/ss-*" -o -path "*/.claude/skills/ui-*" -o -path "*/.claude/skills/ux-*" | head -20
# Find theme.css
find . -name "theme.css" -not -path "*/node_modules/*"
# Find .cursorrules
find . -name ".cursorrules"
```
Report what was found and where.
### Step 2: Check StyleSeed Version
**Fast check first** — compare the local version to the published one without cloning:
```bash
# local marker (may be absent on older installs)
cat engine/VERSION 2>/dev/null || cat VERSION 2>/dev/null || echo "unknown"
# latest published version + what's new
curl -s https://styleseed-demo.vercel.app/version.json
```
If the local version already matches `version.json`'s `version`, tell the user they're
up to date and stop. Otherwise report `whatsNew` and continue.
Then clone/pull to actually diff the files:
```bash
if [ -d "/tmp/styleseed" ]; then
cd /tmp/styleseed && git pull
else
git clone https://github.com/bitjaru/styleseed.git /tmp/styleseed
fi
```
Compare:
- `engine/VERSION` (or `version.json`) vs the local copy — the source of truth
- DESIGN-LANGUAGE.md rule count + Table of Contents
- Skills present in `.claude/skills/` vs upstream (don't hardcode a count — list the diff)
- Whether `CLAUDE.md`, `AGENTS.md`, and `.cursorrules` exist (ship all three)
- New engine docs (VISUAL-CRAFT.md, APP-PLAYBOOKS.md, PAGE-TYPES.md, BRAND-RECIPES.md)
### Step 3: Report & Ask
Show the user what needs updating:
```
StyleSeed Update Report:
Current state:
- DESIGN-LANGUAGE.md: [location] — [old/current version indicator]
- Skills: [count] found (latest: 12)
- Golden Rules: [yes/no]
- .cursorrules: [yes/no]
Recommended updates:
1. ✅ [safe] Update skills (X → 12)
2. ✅ [safe] Add .cursorrules
3. ⚠️ [review] Update DESIGN-LANGUAGE.md ([old line count] → [new line count])
4. ⚠️ [merge] Add Golden Rules to CLAUDE.md (won't overwrite existing content)
Shall I proceed? (I'll ask before each ⚠️ item)
```
### Step 4: Execute Updates
For each update, in order:
**Always safe (do without asking):**
- Copy skills: `cp -r /tmp/styleseed/engine/.claude/skills/ .claude/skills/`
- Copy .cursorrules (if not exists): `cp /tmp/styleseed/engine/.cursorrules .cursorrules`
**Ask before doing:**
For DESIGN-LANGUAGE.md:
- Show diff summary: how many new rules, what sections added
- Ask: "Update DESIGN-LANGUAGE.md? (Y/N)"
- If yes: copy to the detected location
For CLAUDE.md (Golden Rules):
- Check if Golden Rules section already exists
- If not: ask "Add Golden Rules section to your CLAUDE.md? This adds 10 lines at the top. Your existing content stays untouched."
- If yes: insert Golden Rules after the first heading
**Never touch:**
- theme.css — say "Your theme.css (skin) is untouched."
- components/ — say "Your components are untouched. Run `/ss-lint` to check compliance."
**Recompile the project context:**
- If `STYLESEED.md` exists, run the installed `ss-resolve/scripts/resolve-context.mjs` with
`--project-root . --from-lock STYLESEED.md --agent <agent>`.
- Run the same command with `--check` and require a zero exit status.
- Report the new bundle hash from `.styleseed/manifest.json`; do not point the user at
`llms-full.txt`.
### Step 5: Summary
```
Update complete!
✅ Skills: 21 (added X new)
✅ .cursorrules: added
✅ DESIGN-LANGUAGE.md: updated to latest
✅ Golden Rules: added to CLAUDE.md
✅ Effective context: recompiled and hash-checked
Not touched:
- theme.css (your skin)
- components/ (your code)
Next: run /ss-lint on your pages to check for rule violations.
```
### Step 6: Retrofit existing UI (optional but recommended) — "re-do a generic old build"
Updating the rules doesn't re-design screens you already built with an older StyleSeed. If the
user says their existing UI still looks generic/"AI-made" (default indigo, icon-chip cliché,
tight desktop type, no focal point, no design lock), offer to **retrofit it to the new standard**.
This is the migration path for anyone who built before the distinctiveness rules existed:
1. **Write a design lock if missing.** Check for `STYLESEED.md` at the project root. If absent,
run **Quick Setup** (CLAUDE.md) *now* with the user — pin **mood** (edges/feel/density/tone),
a **domain-fit key color** (NOT the default indigo), a **chosen font**, and the **surface**
(mobile vs desktop type scale). Write the lock. Existing generic builds almost always never
had a lock — this is the biggest fix.
2. **Re-score the key screens.** Run **`/ss-score`** on the main pages. The new rubric flags
exactly the old-build tells: default-indigo accent, the icon-chip cliché (§CC-9b), body <16px
on desktop, no focal point, demo layout copied verbatim, missing states.
3. **Apply the fixes.** Run **`/ss-review`** (or `/ss-review --fix`) screen by screen to retint to
the locked key color, replace the uniform icon chips, bump the desktop type scale, and create a
focal point. Re-score to **≥ 80**. Do the highest-traffic screen first.
4. **Report the before/after score** so the upgrade is visible (e.g. "landing 63 → 88").
Frame it honestly: the rules got stronger, so a screen that passed the old bar may score lower
now — that's the point; fixing it is what makes it stop looking AI-made.
## Important
- NEVER overwrite theme.css
- NEVER overwrite a project-specific CLAUDE.md — only MERGE the Golden Rules section
- NEVER overwrite components without explicit user approval
- Always show what will change before changing it
- If unsure, ask the user
+134
View File
@@ -0,0 +1,134 @@
---
name: ss-verify
description: The VISUAL gate — render a UI or visual artifact through its surface adapter, inspect the actual pixels, then fix and re-render until it passes the composed StyleSeed rule set.
argument-hint: "[route, file, artifact manifest, or export directory]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# Verify (look at it, don't just read it)
Read `.styleseed/effective-rules.md` and `.styleseed/manifest.json`; invoke `/ss-resolve` or
`$ss-resolve` first when they are missing or stale. Judge pixels against that compiled method.
A lock value cannot excuse a core failure, and a recipe/profile cannot replace the output grammar.
`/ss-score` reads the **code** and scores it. But some of the worst "AI-made" tells never appear
in source — they only exist in **pixels**: a hero that doesn't actually dominate, a lower third
of dead whitespace, cramped cards, a web font that silently failed to load and fell back to
Times, two colors that *look* like two accents once rendered, text that's unreadable on its real
background. A human sees these in half a second; a code-reading gate misses all of them.
`/ss-verify` closes that gap: it **renders the UI, screenshots it, and you look at the image** —
then score the same StyleSeed gate against what you see, fix, and re-render. This is the gate
that most predicts whether a real user will say "this looks designed."
Run it as the **final** gate after `/ss-score` passes — code-clean is necessary but not
sufficient; pixel-clean is the real bar.
## When NOT to use
- Nothing renderable yet (pure logic/config, or a component with no host page) → use `/ss-score`.
- No way to render at all (no browser, no Playwright, headless blocked) → say so, fall back to
`/ss-score`, and tell the user the visual gate was skipped. **Never claim you verified visually
if you didn't actually see a screenshot.**
- A quick pre-commit pass → `/ss-lint`. `/ss-verify` is heavier (it boots a renderer).
## Step 1 — Render it through the active adapter
For `social-carousel`, `slide-deck`, `document-report`, or `single-frame`, use the companion
renderer and open every required exported frame/page at readable resolution. Verify dimensions,
crop/safe zones, font availability, asset placement, and the export manifest. Do not force a
browser workflow onto a PIL, slide, PDF, or image renderer.
For `product-ui`, get a real screenshot in priority order:
**A. Running project (Next / Vite / etc.) — the normal case.**
1. Start the dev server in the background (`npm run dev` / `pnpm dev` / framework command); wait
for the ready line and capture the port.
2. Screenshot the route with headless Chromium via Playwright. If the project has `playwright`
in `node_modules`, use it; else use a globally cached Chromium. Minimal script:
```js
import { chromium } from "playwright"; // or an absolute path into node_modules
const b = await chromium.launch();
const c = await b.newContext({ viewport: SURFACE, deviceScaleFactor: 2 });
const p = await c.newPage();
await p.goto(URL, { waitUntil: "networkidle" });
await p.evaluate(() => document.fonts.ready); // don't shoot before fonts load
await p.waitForTimeout(400);
await p.screenshot({ path: OUT, fullPage: true });
await b.close();
```
**Surface viewports:** mobile `{width:390,height:844}` · desktop `{width:1440,height:900}`.
Pick from the lock's `Surface`, or `--surface`.
3. If a browser MCP (claude-in-chrome) is available instead, navigate + screenshot with that.
**B. Static HTML file** → open it directly with `file://…` and screenshot (same script).
**C. Isolated component** (no host page) → render it into a minimal throwaway page that imports
the component with realistic props, then screenshot that.
**Then actually READ the screenshot back** (Read the PNG). You must *see* it. Shoot at
`deviceScaleFactor: 2` so text is crisp enough to judge.
## Step 2 — Score what you SEE (the visual gate)
Look at the image and run the StyleSeed gate **perceptually**. These are the checks that need
eyes, not source:
```
□ Squint test — blur your focus / imagine it at 50%. Does it still read "AI-generated"?
(bland gradient, pill button + generic sans, icon-chip row, even flat grid) → FAIL
□ Focal — does ONE element actually dominate at a glance? If your eye lands nowhere,
or on an all-even grid, the focal point failed regardless of what code intended
□ Balance — dead whitespace (a lower third of empty), or cramped/colliding elements?
Is the visual weight distributed, or all top-left / all-centered?
□ Fonts loaded — is the intended typeface actually rendering, or a Times/Arial fallback?
(a silent font-load fail is a top "looks cheap" tell — invisible in code)
□ One accent (seen) — count the hues you actually SEE. Two things competing for "the color" = FAIL,
even if the code named one token
□ Contrast (seen) — any text you have to strain to read on its real rendered background?
Light-grey-on-white labels, low-contrast on a colored/照片 panel
□ Rhythm/optics — are edges aligned, gaps consistent, cards optically even? Off-by-a-few-px
misalignments that read as "sloppy" but pass a code check
□ Type scale fit — on desktop, does the body text look too small for the canvas? does the hero
feel undersized? (the surface-scale tell, judged by eye)
□ Grammar fit — does the screen visually serve the selected grammar's user job, attention
model, composition, density, action hierarchy, and characteristic tells?
□ Recipe fit — do geometry, containment, controls, collections, navigation, density, and
motion visibly match the selected recipe rather than the old universal soft-card look?
Would the same layout still appear if the product changed? If yes, FAIL
□ Motion (if any) — capture before/after or a mid-transition frame; is it purposeful, or the
"cheap fade/bounce on everything" tell? does it block the first read?
```
## Step 3 — Render states or sequence variants too
The happy-path screenshot hides the most common real-world failure: **no empty / loading / error
state.** Where the surface has a data view, render those variants (a query param, a mock, a
forced prop, or temporarily emptying the data) and screenshot each. A blank white void for "no
data" is a fail you can only catch by *looking* at the empty state. (Static marketing pages with
no data surface → N/A, note it.)
For sequential artifacts, inspect the cover/first frame, every content frame, and close/CTA as
a set: continuity, progression, one message per frame, repeated-template fatigue, source labels,
folios, and safe-zone survival. For documents/decks, inspect every page/slide plus a representative
thumbnail or overview view.
## Step 4 — Fix, re-render, repeat
For each visual failure, fix the code, then **re-render and look again** — don't assume the fix
worked from the diff (the whole point is that code ≠ pixels). Loop up to ~3×. Present only when
the screenshot passes, with the final image, the effective rule set, a one-line "fixed: …", and
the gate result.
## Rules
- **You must actually see the rendered artifact.** No render, no visual verdict — fall back to `/ss-score`
and say the visual gate was skipped. Never fabricate "looks good."
- **Re-render after every fix.** The reason this skill exists is that source and pixels diverge;
verifying a visual fix by reading the diff defeats it.
- **Both gates, in order:** `/ss-score` (code) first to catch structural issues cheaply, then
`/ss-verify` (pixels) as the final bar. `/ss-build` runs code-gate in its loop; finish a
renderable screen with `/ss-verify`.
- **Clean up:** stop the dev server you started; delete any throwaway harness/mock files.
- **Shoot at 2×** and at the locked surface's viewport — judging a desktop app on a 390px shot
(or vice-versa) invalidates the type-scale and balance checks.
@@ -0,0 +1,114 @@
---
name: styleseed-design-review
description: Reviews UI/frontend code and tells you exactly why it "looks AI-generated" — then how to fix it. Use it when a React/Tailwind/HTML interface looks off, generic, or unfinished, when you want a design score before shipping, or when asked to make UI look more professional, polished, or "designed, not generated." Self-contained; based on the open-source StyleSeed design engine.
license: MIT (https://github.com/bitjaru/styleseed/blob/main/LICENSE)
---
# StyleSeed Design Review
## Overview
A UI reads as "AI-generated" not because the components are ugly, but because the **parts
don't agree with each other** — mixed corner radii, three accent colors, pure-black text,
no hierarchy, missing states, robotic copy. This skill reviews a UI file (or a whole
directory) against a concrete design rubric, scores it 0–100, and returns a prioritized
fix list. It reviews and recommends; it never edits or deletes without you asking.
Full rule set (74 rules) and components: https://github.com/bitjaru/styleseed
## When to use
- A React / Tailwind / HTML UI "looks off," generic, or unfinished and you can't say why.
- You want a design score / pre-ship check.
- The user asks to make UI "look professional / polished / designed, not AI-generated."
- After generating UI, to verify it before shipping.
## How to review
Read the file(s). Score these **seven categories** (total 100); start each at full marks
and subtract for violations you can cite by line. Be specific and evidence-based.
### 1. Coherence — 20 (the #1 "AI-generated" tell)
One choice per axis, applied everywhere. Deduct for each **mixed** axis:
- mixed corner radii — e.g. a sharp card with pill buttons (−6)
- two or more accent colors used for emphasis (−5)
- **emoji used as UI icons** (🚗🧺⭐ as list/nav/status/category markers) — injects many uncontrolled hues; use one line-icon set in currentColor (−6)
- mixed shadow languages / light directions (−3)
- mixed icon families, fill modes, or stroke weights (−3)
- inconsistent control heights (buttons/inputs differ) (−3)
### 2. Color discipline — 16
- pure black (`#000` / `text-black`) text — the refined black is ~`#2A2A2A` (−4 each, cap −8)
- hardcoded hex where a semantic token exists (−2 each, cap −6)
- **a normal / OK / default ("보통") state shown in a status color** instead of neutral grey (−4)
- **status color on most/every row** (no severity hierarchy — color should mark the minority that needs attention) (−4)
- **decorative hues** — gold stars, rainbow category dots, a different color per card — instead of accent/grey (−3)
- status conveyed by color alone, no icon/text (−4)
- contrast below WCAG AA (4.5:1 body, 3:1 large/UI) (−6)
### 3. Hierarchy & typography — 16
- number and its unit not ~2:1 (48px number / 24px unit) (−4)
- everything the same size and weight, no clear primary (−5)
- arbitrary font sizes; no scale (−4)
- wrong line-height (loose on display, cramped on body) (−3)
### 4. Layout & spacing — 12
- content on a bare page background, not in cards (−6)
- off-grid spacing (7/13/19px instead of an 8px scale) (−3)
- the gap *around* a group not larger than the gap *inside* it (−3)
- the same section type repeated in a row (−4)
### 5. States — 12
- missing empty / loading / error state on a data surface (−5 each, cap −10)
- empty state with no next action; error that blames instead of helping (−4)
### 6. UX writing — 12
- buttons that don't name the action ("Submit" / "OK" instead of "Send $2,400") (−4)
- error copy that blames or uses system-speak ("Invalid input", "An error occurred") (−4)
- two terms for one concept (delete vs remove); filler words ("please", "successfully") (−2)
### 7. Motion & polish — 12
- ad-hoc fades instead of one consistent, named feel (−3)
- motion that delays content or blocks an action (−4)
- no `prefers-reduced-motion` handling on custom motion (−3)
- a single hard black shadow instead of a layered, low-opacity, tinted one (−2)
Clamp each category at 0; sum to a total. Bands: 90+ A · 80–89 B · 70–79 C · 60–69 D · <60 F.
## Output format
```
## Design Score: 72 / 100 (src/Dashboard.tsx) C
Coherence 13/20 sharp cards (l.22) + pill buttons (l.48); 3 accent hues
Color discipline 12/16 #000 headings (l.12, 40)
Hierarchy & type 15/16 number/unit 1:1 on hero (l.18)
Layout & spacing 10/12 two identical KPI rows (l.22-31)
States 7/12 no empty/loading state on the orders list
UX writing 8/12 "Submit" button (l.55); "Invalid input" (l.61)
Motion & polish 10/12 one hard black shadow (l.22)
### Fix first (highest score gain)
1. Unify radius (pick soft 8–12px) + collapse to one accent → +11 coherence/color
2. Add empty + loading states to the orders list → +7 states
3. Rename "Submit" → "Send $2,400"; "Invalid input" → "Check the card number" → +6 copy
Re-score after: ~90 / 100.
```
## Rules
- Review from real evidence (cite line numbers); never guess.
- Order the fix list by **score gain**, not severity alone — fastest path to a better number.
- For a directory: one-line score per file, then the lowest file's full breakdown.
- **Don't auto-edit.** This skill measures and recommends. Apply fixes only when asked.
- Use it as a **quality gate**: review right after generating UI, apply the fix list, and
re-review until the score clears ~80 *before showing the user* — no first-draft, incoherent
UI (rainbow status lists, emoji icons, two accents, missing states) should reach them. The
bar is a floor, not a ceiling: clear 80 and ship; don't chase 100 to delay.
---
Based on **StyleSeed** — an open-source (MIT) design engine that gives Claude Code, Cursor,
and Codex design judgment so AI-built UI stops looking generated. Full 74-rule reference,
components, brand skins, and motion: https://github.com/bitjaru/styleseed
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-a11y
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-audit
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-build
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-component
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-copy
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-dial
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-feedback
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-flow
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-lint
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-motion
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-page
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-pattern
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-reference
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-resolve
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-restyle
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-review
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-score
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-setup
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-studio
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-tokens
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-update
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/ss-verify
+1
View File
@@ -0,0 +1 @@
../../.agents/skills/styleseed-design-review
+340
View File
@@ -0,0 +1,340 @@
# StyleSeed Effective Rule Bundle
<!-- Generated by ss-resolve. Do not hand-edit; update STYLESEED.md or resolver inputs. -->
- Engine: 4.0.0
- Agent: claude
- Output grammar: operations-console
- Surface adapter: product-ui
- Domain: booking
- Page type: dashboard
- Brand recipe: enterprise-workbench
- Palette recipe: signal-coral
- Generated palette: #FF6966 · light · balanced · auto
- Aesthetic profile: warm-dtc
Read this bundle before implementation. The agent execution contract is operational; method authority then runs core → grammar → adapter → domain/page → brand recipe → palette recipe → profile → lock → compact craft baseline, with the earlier method layer winning conflicts. Run the code gate and rendered visual gate.
## Claude Code execution contract
- Invoke StyleSeed skills with `/ss-*`.
- Read this compiled bundle before implementation; do not load the full handbook unless a named ambiguity remains.
- Use the selected renderer, run `/ss-score`, then inspect rendered output with `/ss-verify`.
---
# StyleSeed Product Constitution
StyleSeed is an **AI design-method engine**. Its primary job is to make a coding agent
reason like a strong UI/UX designer and apply that reasoning consistently. Components,
skins, scores, and screenshots support that job; they do not define it.
## The fixed method, not one fixed look
StyleSeed enforces a stable way of judging design. It does **not** force every product to
look like Toss, a SaaS dashboard, or the StyleSeed demo. A trustworthy consumer-finance
home, an observability console, an editorial story, and a product-detail page solve
different jobs and therefore need different design grammars.
The effective rule set is composed:
```text
Core judgment
× one output grammar from RULESETS.md (built-in or reference-compiled)
× one surface adapter from ADAPTERS.md
× one domain playbook from APP-PLAYBOOKS.md
× one page type from PAGE-TYPES.md
× one brand recipe from BRAND-RECIPES.md
× one semantic palette posture plus an optional key-color generation from PALETTE-RECIPES.md
× optional aesthetic profile from PRESETS.md
× bounded project tokens from STYLESEED.md
= the rules for this screen
```
## Authority order
When instructions disagree, use this order:
1. **Core invariants** below.
2. **Output grammar** — the functional visual language selected in `RULESETS.md`, or a
project-local grammar compiled by `REFERENCE-COMPILER.md`.
3. **Surface adapter** — the renderer contract and physical constraints in `ADAPTERS.md`.
4. **Domain playbook** and **page/artifact type**.
5. **Brand recipe** — a reusable morphology and component-selection contract from
`BRAND-RECIPES.md`.
6. **Palette system** — a maintained semantic posture plus deterministic key-color generation,
role mapping, gamut handling, and contrast correction from `PALETTE-RECIPES.md`.
7. **Aesthetic profile** — an optional coordinated restyle from `PRESETS.md`.
8. **Design lock** — records selections and bounded project parameters.
9. **Skins and components** — implementation material, not sources of judgment.
10. **Score and visual verification** — evidence that the method was applied.
`STYLESEED.md` is persistence, not permission. An arbitrary value in the lock never turns
a violation into a sound design decision. Unknown values fall back to the nearest maintained
grammar and the core defaults.
## Core invariants
These apply to every grammar, profile, domain, page, skin, and agent:
- One deliberate visual system per product: radius, spacing, elevation, icon language,
typography, color roles, imagery, and motion agree.
- One focal point per screen and a clear information hierarchy.
- Color communicates role or meaning. One primary action remains identifiable even when
semantic, categorical, or product colors are present.
- Semantic tokens replace component-level hardcoded colors.
- Spacing follows a repeatable scale; proximity communicates grouping.
- Typography fits the surface and task, with readable measure, contrast, and hierarchy.
- Data surfaces include useful loading, empty, and error states.
- Controls remain operable: visible focus, sufficient targets, labels, reduced-motion
support, and no dark patterns.
- Motion fits the surface and never delays comprehension or action.
- Distinctiveness comes from the product, its content, and its selected grammar — not a
copied demo, generic indigo, repeated icon chips, emoji chrome, or template uniformity.
## What the lock may select
The lock may select only inputs the engine understands:
- domain, surface adapter, page/artifact type, and one output grammar;
- one maintained brand recipe, one semantic palette posture, optional bounded key-color generation,
one optional aesthetic profile, and one skin or project token implementation;
- primary action/accent, type pairing, density, radius, elevation, imagery, and motion values
inside the selected grammar's allowed ranges;
- one product-specific signature move that still obeys the invariants;
- a project-local reference grammar with provenance and confidence recorded by the compiler.
The lock may not invent a palette mode, waive accessibility, legalize mixed systems, or
override a core invariant. A reusable built-in grammar requires research, examples, and
regression evaluation. A reference-derived grammar stays project-local until it meets that bar.
## The product loop
```text
understand the job → choose or compile a grammar → lock bounded decisions
→ build with judgment → score the implementation → visually verify rendered output
→ present the result and evidence
```
The build method is the product. Scoring and verification are auxiliary gates: they find
drift, but they never choose or rewrite the design philosophy after the fact.
---
### `operations-console`
- **Job:** scan system or business state, compare changes, find exceptions, act efficiently.
- **Attention:** one operational focal panel; supporting KPIs form hierarchy rather than a
uniform card wall.
- **Composition:** persistent navigation → scope/time controls → focal trend or queue →
comparable metrics → actionable table/list. Detail lives below or on demand.
- **Density/type:** comfortable to compact; neutral grotesk; tabular numerals; labels may be
small but body and decisions remain readable on desktop.
- **Color/surface:** restrained brand accent; categorical colors only for stable, repeated data
semantics. Tone, alignment, and grouping carry more hierarchy than decoration.
- **Feedback:** filters and mutations respond instantly; loading preserves layout; bulk action
consequences are explicit.
- **Reject:** same-weight KPI tiles everywhere, decorative gradients, mobile-tight type on a
1440px canvas, or charts without a decision they support.
---
## `product-ui`
- **Canvas:** responsive viewports declared in the design lock; verify at least one narrow and
one wide target when both are in scope.
- **Primitives:** semantic HTML and project-native components. Preserve framework conventions,
routes, state, and real content rather than replacing the application with a mock.
- **States:** loading, empty, error, success, disabled, focus, and responsive navigation are part
of the artifact when the screen owns those behaviors.
- **Export:** source code plus reproducible dev/build commands and screenshot paths.
- **QA:** run project checks, render the real route, inspect target viewports and important states,
and record what could not be exercised.
---
## 11. Booking / Travel / Reservations
- **Color:** confident and visual — imagery (places, rooms) leads; accent drives
the booking step. Calm so users feel sure about committing money/time.
- **Density:** low-medium, step-focused. Dates and availability must be obvious.
- **Typography:** clear dates/times, price prominent, friendly labels.
- **Motion:** **Float** / **Silk** — smooth, reassuring transitions between steps;
`reveal-blur` on imagery. Confidence, not flash.
- **Signature patterns:** date/range picker, availability calendar, multi-step
booking with progress, map, price summary, confirmation.
- **Anti-patterns:** hidden total/fees, unclear current step, jarring motion mid-
booking, tiny date controls, anxiety-inducing scarcity spam.
- **Brand recipe:** `commerce-operator`; use `native-mobile` for an app-first itinerary.
- **Skin material:** custom travel tokens; Arc and Notion remain optional references.
---
## Dashboard / Home / Overview
- **Job:** answer "how are things?" in 3 seconds, then let the user drill down.
- **Structure:** information pyramid — one hero metric → a small KPI set →
supporting list/chart. Vary section types (Rule 14/61): never four identical
cards in a row.
- **Hierarchy:** density increases as you scroll. Top = 48px hero number; bottom
= 13–14px detailed rows.
- **Patterns:** HeroCard, KPI grid (mixed: trend / progress / comparison),
ChartCard, RankedList, BriefingCarousel for alerts.
- **Anti-patterns:** wall of identical KPIs, no clear primary metric, charts with
6 legend colors, everything the same visual weight.
- **Mobile:** single column, hero first, horizontal-scroll carousels for KPI sets,
`mx-6` single cards / `px-6` grids.
---
## `enterprise-workbench`
- **Best fit:** admin, analytics, operations, collaboration, and multi-step B2B work. Strong
with `operations-console`.
- **Containment:** persistent shell, aligned panels, toolbars, tables, and detail regions.
Group by work relationship; use card grids sparingly.
- **Geometry:** 0–8px radius, 1px boundaries or tonal layers, minimal floating shadow, 16–24px
page rhythm on an explicit grid.
- **Type/icons:** neutral UI sans, tabular numbers, compact labels, one functional icon family.
- **Controls/collections:** rectangular controls, visible filters, bulk actions, dense rows,
comparison tables, and preserved loading geometry.
- **Motion/responsive:** fast state changes; panels reflow or collapse by task priority rather
than merely shrinking.
- **Characteristic move:** one operational focal panel connected directly to an actionable
queue or evidence table.
- **Reject:** identical KPI cards, oversized mobile typography on desktop, decorative
gradients, hidden scope controls, or floating shadows on every panel.
- **Lineage:** [IBM Carbon 2x Grid](https://carbondesignsystem.com/elements/2x-grid/overview/),
[Microsoft Fluent 2](https://fluent2.microsoft.design/design-principles),
[Atlassian foundations](https://atlassian.design/foundations).
---
### signal-coral
- Name: Signal coral
- Mode: light
- Best for: Expressive launches, social products, and consumer discovery
- Recipe bias: expressive-brand, native-mobile
- Semantic roles: background=#FFF3EC · surface=#FFFFFF · chrome=#1A1423 · foreground=#1A1423 · mutedForeground=#645A6C · chromeForeground=#FFFFFF · border=#D8C9D0 · primary=#C83D2C · primaryForeground=#FFFFFF · accent=#5B3EC8 · accentForeground=#FFFFFF · focus=#5B3EC8 · success=#19724E · successForeground=#FFFFFF · warning=#875400 · warningForeground=#FFFFFF · danger=#A92924 · dangerForeground=#FFFFFF
- Usage: Let coral own the hook and selected moment. Violet supports spatial or media context; never let both compete as primary actions.
- Generated-media anchors: #FFF3EC, #C83D2C, #5B3EC8
- Avoid in generated media: pink-purple gradient wash, rainbow icon chips, coral body text
- Re-run deterministic contrast validation after any project override.
## Generated semantic palette override
- Key color: #FF6966
- Mode: light
- Character: balanced
- Harmony: auto
- Surface temperature: warm
- Semantic roles: background=#FAF2EA · surface=#FFFCF9 · chrome=#EADFD6 · foreground=#0D0B08 · mutedForeground=#544F4A · chromeForeground=#0D0B08 · border=#C4B8AE · primary=#B1282E · primaryForeground=#FFFBF8 · accent=#3154BA · accentForeground=#FFFBF8 · focus=#3154BA · success=#006425 · successForeground=#FFFBF8 · warning=#6E4B00 · warningForeground=#FFFBF8 · danger=#902824 · dangerForeground=#FFFBF8
- Contrast gates: foreground/background=17.74:1 · mutedForeground/background=7.31:1 · foreground/surface=19.23:1 · chromeForeground/chrome=15:1 · primaryForeground/primary=6.35:1 · accentForeground/accent=6.57:1 · successForeground/success=7.16:1 · warningForeground/warning=7.64:1 · dangerForeground/danger=8.11:1 · focus/background=6.1:1 · focus/surface=6.61:1
- Allocation: 60% canvas/surfaces · 30% chrome/type/structure · at most 10% primary and accent emphasis combined.
- This override replaces the recipe hex values while preserving its product posture and semantic restrictions.
- Components consume semantic roles. Raw ramp values remain reference tokens.
---
### warm-dtc
- Coordinate: soft/pill · airy · warm-vivid · spring
- Signature: tactile product/image moment
- This profile does not permit: competing warm colors or pill-everything
- Apply the coordinate coherently across radius, density, typography, palette temperature, elevation, motion, composition, and one signature move.
---
## Project design lock
# StyleSeed — Design Lock
<!-- Selections persist here. This file cannot waive StyleSeed core invariants. -->
- App domain: booking
- Surface: desktop-app
- Surface adapter: product-ui
- Page type: dashboard
- Output grammar: operations-console
- Grammar path: built-in:engine/RULESETS.md
- Grammar fallback: operations-console
- Reference confidence: n/a
- Brand recipe: enterprise-workbench
- Palette recipe: signal-coral
- Key color: #FF6966
- Palette character: balanced
- Palette mode: light
- Palette harmony: auto
- Surface temperature: warm
- Aesthetic profile: warm-dtc
- Skin: custom
- Primary action: #FF6966
- Font: Pretendard
- Radius: soft
- Elevation: light=warm tonal grouping + restrained shadow · dark=n/a
- Density: comfortable
- Motion: Spring restrained
- Imagery/data role: slot availability and automation state first; decoration only around the single hook moment
- Signature move: one coral "다음 오픈 슬롯" briefing strip above the branch/theme selector
- Locked: 2026-08-12
---
# StyleSeed Compact Craft Baseline
This is the small, task-independent craft layer used by the Context Compiler. It preserves
the highest-leverage rules without injecting the full design handbook into every agent turn.
The selected output grammar, adapter, domain, page type, brand recipe, profile, and project lock narrow these
defaults. `PRODUCT-PRINCIPLES.md` remains the higher authority.
## Coherence
- Choose one coordinated family for radius, elevation, borders, icon style, typography, motion,
control heights, and interaction states. Encode each family as semantic tokens and reuse it.
- A coherent system may contain multiple component shapes and colors, but every variation must
have a repeated role. Local decoration is not a role.
- Preserve strengths and already-set project decisions. Do not restyle unrelated surfaces while
fixing one screen.
## Hierarchy and composition
- Give every screen one dominant user decision or reading promise. Supporting content must recede
through scale, position, contrast, density, or disclosure—not random color.
- Proximity communicates grouping: space around a group should normally be at least twice the
space within it. Repeated sections need deliberate variation in height, density, or composition.
- Use real product content and evidence. Placeholder dashboards, fake metrics, stock chat panels,
and equal card walls make otherwise clean work look generic.
- Keep prose near 50–75 characters per line. Let data surfaces use width, but bound any reading
column inside them.
## Spacing and type
- Start from `{4, 8, 12, 16, 24, 32, 40, 48, 64, 80, 96}` and use off-scale values only for a
documented optical correction.
- Default body text to 16px on general surfaces. Dense desktop UI may use 13–14px for metadata,
table chrome, timestamps, or identifiers; decisions and explanatory copy stay readable.
- Use no more than two type families and one intentional weight ramp. Use tabular numerals for
money, tables, timers, and comparable metrics.
- Tighten leading as type grows: body about 1.5, headings 1.2–1.35, display 1.0–1.2.
## Components and interaction
- Use the lightest separation that works: whitespace, then tone, then hairline, then shadow.
Do not combine a visible border and floating shadow without a functional reason.
- Buttons, inputs, and selects in one context share a height. Touch surfaces provide at least
44px targets; pointer-first dense desktop controls may be smaller when still operable.
- Labels remain visible. Errors name the problem and recovery and never rely on color alone.
- Use one icon family, fill mode, and stroke family. Do not use emoji as application chrome.
- Loading, empty, error, success, disabled, and permission states preserve layout and provide a
useful next action where the surface owns data or mutation.
## Color, accessibility, and motion
- Use semantic tokens. Keep one identifiable primary action while allowing stable semantic,
categorical, or brand roles required by the selected grammar.
- Body text targets WCAG AA contrast; large text and meaningful graphics meet their applicable
threshold. Focus is visible, controls have names, and keyboard order follows visual order.
- Motion uses one duration/easing family, communicates state or sequence, and never delays the
first read or an action. Provide a complete reduced-motion result.
- Inspect the real render at the target viewport. Source review cannot certify optical balance,
font loading, crop, responsive transformation, or visual states.
+88
View File
@@ -0,0 +1,88 @@
{
"schemaVersion": 1,
"engineVersion": "4.0.0",
"generatedAt": "2026-08-12T08:50:29.133Z",
"selection": {
"agent": "claude",
"grammar": "operations-console",
"grammarSource": "built-in:operations-console",
"fallback": "operations-console",
"adapter": "product-ui",
"domain": "booking",
"page": "dashboard",
"recipe": "enterprise-workbench",
"recipeSelection": "enterprise-workbench",
"palette": "signal-coral",
"paletteSelection": "signal-coral",
"paletteGeneration": {
"keyColor": "#FF6966",
"mode": "light",
"character": "balanced",
"harmony": "auto",
"temperature": "warm"
},
"profile": "warm-dtc"
},
"bundle": {
"path": ".styleseed/effective-rules.md",
"sha256": "2083401efe8a28ef4acd27512793759f9b36b5d9ddf9e64a8b6e5b144476d5c9",
"bytes": 17782
},
"sources": [
{
"id": "agent-execution",
"sha256": "5706f16dd770b76a5e92216812c29f69de43b3d6d3ead1e26f8d2b09a3209cc9",
"bytes": 283
},
{
"id": "core",
"sha256": "24827276966fe35364a661b1ea84130cf7222ead19de2bf4b9a071d4ea9da869",
"bytes": 4794
},
{
"id": "grammar",
"sha256": "e0439317e2e1c0722e391e9645b21978818f0d14dd07633385792f8e5a44b962",
"bytes": 1011
},
{
"id": "adapter",
"sha256": "7b5b5c34b0b235dca329e6384ccb94c66ee65a348bbe7142277ae7bbda3c13b0",
"bytes": 714
},
{
"id": "domain",
"sha256": "45a6da9f8f5db085b272ee2da4d47cf4efe82e6a5637d1ee81412f6a97035074",
"bytes": 941
},
{
"id": "page",
"sha256": "dad3ba4be04cf4ce9cb7457fc0fe22dac9d45c70618650a667b08fd1fa72a42a",
"bytes": 785
},
{
"id": "recipe",
"sha256": "0b472aa9cccada93e1c5c0260070bbfcda76a75d7de61e2cb22938c39981aaf8",
"bytes": 1304
},
{
"id": "palette",
"sha256": "02679ae78f83cae648b1be42215bdc1b2c8c7ad2782a76283104a71f37bf52f0",
"bytes": 2189
},
{
"id": "profile",
"sha256": "606ac370ecb5b0cd18820d395d23423790d517a587ccd5fff89ad82d82c2d75a",
"bytes": 331
},
{
"id": "lock",
"sha256": "f6899655011ad314f36441ce3c22625e77e28c8cf69ff2f8d9a3e8f914be94d5",
"bytes": 1033
},
{
"id": "craft",
"sha256": "9f8b9c38d3ec1dc6d476a149b7c3502b27c51cbb55bce397a696b44335a22d21",
"bytes": 3564
}
]
}
+42
View File
@@ -0,0 +1,42 @@
:root {
--ss-background: #FAF2EA;
--ss-surface: #FFFCF9;
--ss-chrome: #EADFD6;
--ss-foreground: #0D0B08;
--ss-muted-foreground: #544F4A;
--ss-chrome-foreground: #0D0B08;
--ss-border: #C4B8AE;
--ss-primary: #B1282E;
--ss-primary-foreground: #FFFBF8;
--ss-accent: #3154BA;
--ss-accent-foreground: #FFFBF8;
--ss-focus: #3154BA;
--ss-success: #006425;
--ss-success-foreground: #FFFBF8;
--ss-warning: #6E4B00;
--ss-warning-foreground: #FFFBF8;
--ss-danger: #902824;
--ss-danger-foreground: #FFFBF8;
--ss-primary-50: #FFF6F5;
--ss-primary-100: #FFE4E1;
--ss-primary-200: #FFC8C3;
--ss-primary-300: #FFA09A;
--ss-primary-400: #EF736E;
--ss-primary-500: #D4514F;
--ss-primary-600: #BA3538;
--ss-primary-700: #9A1F25;
--ss-primary-800: #780011;
--ss-primary-900: #4F0008;
--ss-primary-950: #2A0002;
--ss-accent-50: #F5F8FF;
--ss-accent-100: #E2EBFF;
--ss-accent-200: #C6D7FF;
--ss-accent-300: #A0BCFF;
--ss-accent-400: #739AFA;
--ss-accent-500: #567DE2;
--ss-accent-600: #3F64C8;
--ss-accent-700: #2D4DA8;
--ss-accent-800: #1A3486;
--ss-accent-900: #091B64;
--ss-accent-950: #020144;
}
+189
View File
@@ -0,0 +1,189 @@
{
"schemaVersion": 1,
"generator": {
"name": "StyleSeed Palette Engine",
"version": "1.0.0",
"colorSpace": "OKLCH",
"targetGamut": "sRGB"
},
"input": {
"keyColor": "#FF6966",
"mode": "light",
"character": "balanced",
"harmony": "auto",
"temperature": "warm"
},
"normalizedKey": {
"hex": "#FF6966",
"oklch": {
"l": 0.7082,
"c": 0.184,
"h": 24.11
}
},
"decisions": {
"character": "Balanced character controls lightness/chroma before hue harmony.",
"accent": {
"hue": 266.11,
"offset": -118,
"method": "auto",
"avoidsStatusCollisionBy": 118.11
},
"primaryAdjustedForContrast": false,
"accentAdjustedForContrast": false,
"allocation": {
"dominant": "60% canvas and surfaces",
"secondary": "30% chrome, type, and supporting structure",
"accent": "10% primary/accent emphasis combined"
}
},
"ramps": {
"primary": {
"50": "#FFF6F5",
"100": "#FFE4E1",
"200": "#FFC8C3",
"300": "#FFA09A",
"400": "#EF736E",
"500": "#D4514F",
"600": "#BA3538",
"700": "#9A1F25",
"800": "#780011",
"900": "#4F0008",
"950": "#2A0002"
},
"accent": {
"50": "#F5F8FF",
"100": "#E2EBFF",
"200": "#C6D7FF",
"300": "#A0BCFF",
"400": "#739AFA",
"500": "#567DE2",
"600": "#3F64C8",
"700": "#2D4DA8",
"800": "#1A3486",
"900": "#091B64",
"950": "#020144"
}
},
"roles": {
"background": "#FAF2EA",
"surface": "#FFFCF9",
"chrome": "#EADFD6",
"foreground": "#0D0B08",
"mutedForeground": "#544F4A",
"chromeForeground": "#0D0B08",
"border": "#C4B8AE",
"primary": "#B1282E",
"primaryForeground": "#FFFBF8",
"accent": "#3154BA",
"accentForeground": "#FFFBF8",
"focus": "#3154BA",
"success": "#006425",
"successForeground": "#FFFBF8",
"warning": "#6E4B00",
"warningForeground": "#FFFBF8",
"danger": "#902824",
"dangerForeground": "#FFFBF8"
},
"contrast": [
{
"foreground": "foreground",
"background": "background",
"ratio": 17.74,
"minimum": 4.5,
"pass": true
},
{
"foreground": "mutedForeground",
"background": "background",
"ratio": 7.31,
"minimum": 4.5,
"pass": true
},
{
"foreground": "foreground",
"background": "surface",
"ratio": 19.23,
"minimum": 4.5,
"pass": true
},
{
"foreground": "chromeForeground",
"background": "chrome",
"ratio": 15,
"minimum": 4.5,
"pass": true
},
{
"foreground": "primaryForeground",
"background": "primary",
"ratio": 6.35,
"minimum": 4.5,
"pass": true
},
{
"foreground": "accentForeground",
"background": "accent",
"ratio": 6.57,
"minimum": 4.5,
"pass": true
},
{
"foreground": "successForeground",
"background": "success",
"ratio": 7.16,
"minimum": 4.5,
"pass": true
},
{
"foreground": "warningForeground",
"background": "warning",
"ratio": 7.64,
"minimum": 4.5,
"pass": true
},
{
"foreground": "dangerForeground",
"background": "danger",
"ratio": 8.11,
"minimum": 4.5,
"pass": true
},
{
"foreground": "focus",
"background": "background",
"ratio": 6.1,
"minimum": 3,
"pass": true
},
{
"foreground": "focus",
"background": "surface",
"ratio": 6.61,
"minimum": 3,
"pass": true
}
],
"valid": true,
"assetBrief": {
"anchors": [
"#FAF2EA",
"#B1282E",
"#3154BA"
],
"hierarchy": "background dominant; primary identifies the product/action; accent is rare supporting emphasis",
"avoid": [
"equal-area competing accents",
"rainbow category decoration",
"text baked into generated imagery"
]
},
"reasoning": [
"Character is chosen before harmony: lightness and chroma drive perceived calm or intensity more reliably than hue geometry alone.",
"The key hue is preserved while chroma is reduced to the sRGB gamut boundary instead of clipping RGB channels.",
"The auto accent candidate is scored for separation from the key and reserved success, warning, and danger hues.",
"Reference colors are mapped through semantic roles; components should never consume raw ramp values directly.",
"Every text, action, status, and focus pair is checked after generation; failing fills are moved in lightness while preserving hue identity."
],
"css": ":root {\n --ss-background: #FAF2EA;\n --ss-surface: #FFFCF9;\n --ss-chrome: #EADFD6;\n --ss-foreground: #0D0B08;\n --ss-muted-foreground: #544F4A;\n --ss-chrome-foreground: #0D0B08;\n --ss-border: #C4B8AE;\n --ss-primary: #B1282E;\n --ss-primary-foreground: #FFFBF8;\n --ss-accent: #3154BA;\n --ss-accent-foreground: #FFFBF8;\n --ss-focus: #3154BA;\n --ss-success: #006425;\n --ss-success-foreground: #FFFBF8;\n --ss-warning: #6E4B00;\n --ss-warning-foreground: #FFFBF8;\n --ss-danger: #902824;\n --ss-danger-foreground: #FFFBF8;\n --ss-primary-50: #FFF6F5;\n --ss-primary-100: #FFE4E1;\n --ss-primary-200: #FFC8C3;\n --ss-primary-300: #FFA09A;\n --ss-primary-400: #EF736E;\n --ss-primary-500: #D4514F;\n --ss-primary-600: #BA3538;\n --ss-primary-700: #9A1F25;\n --ss-primary-800: #780011;\n --ss-primary-900: #4F0008;\n --ss-primary-950: #2A0002;\n --ss-accent-50: #F5F8FF;\n --ss-accent-100: #E2EBFF;\n --ss-accent-200: #C6D7FF;\n --ss-accent-300: #A0BCFF;\n --ss-accent-400: #739AFA;\n --ss-accent-500: #567DE2;\n --ss-accent-600: #3F64C8;\n --ss-accent-700: #2D4DA8;\n --ss-accent-800: #1A3486;\n --ss-accent-900: #091B64;\n --ss-accent-950: #020144;\n}"
}
+28
View File
@@ -0,0 +1,28 @@
# StyleSeed — Design Lock
<!-- Selections persist here. This file cannot waive StyleSeed core invariants. -->
- App domain: booking
- Surface: desktop-app
- Surface adapter: product-ui
- Page type: dashboard
- Output grammar: operations-console
- Grammar path: built-in:engine/RULESETS.md
- Grammar fallback: operations-console
- Reference confidence: n/a
- Brand recipe: enterprise-workbench
- Palette recipe: signal-coral
- Key color: #FF6966
- Palette character: balanced
- Palette mode: light
- Palette harmony: auto
- Surface temperature: warm
- Aesthetic profile: warm-dtc
- Skin: custom
- Primary action: #FF6966
- Font: Pretendard
- Radius: soft
- Elevation: light=warm tonal grouping + restrained shadow · dark=n/a
- Density: comfortable
- Motion: Spring restrained
- Imagery/data role: slot availability and automation state first; decoration only around the single hook moment
- Signature move: one coral "다음 오픈 슬롯" briefing strip above the branch/theme selector
- Locked: 2026-08-12
+143
View File
@@ -0,0 +1,143 @@
{
"version": 1,
"skills": {
"ss-a11y": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-a11y/SKILL.md",
"computedHash": "0541d7f573ddff7f2a6188268b4659858af25acd5c86e770bce1e0b9eea22552"
},
"ss-audit": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-audit/SKILL.md",
"computedHash": "6e8a77c731d1752c17a8530dccd5b2ffa5b6d4a1422bd33802a041ab022a5686"
},
"ss-build": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-build/SKILL.md",
"computedHash": "c7287b3d7a3f315f661c7787dd7e35b9a51987eb1c1de0a915dbd68806d51cdd"
},
"ss-component": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-component/SKILL.md",
"computedHash": "7e559d0a55699d5babfc63340a62eae60fd91061d3c589cc6e3b2febd0a2f0ff"
},
"ss-copy": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-copy/SKILL.md",
"computedHash": "2c8eb72b8ad390375619b56119035b943f0ba981ddbb211af9c57ab80d5eeb74"
},
"ss-dial": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-dial/SKILL.md",
"computedHash": "51f82fbf0be8c29eb9e5c56a8dabd1450637cc2b8ec4d31c2dbb1a7fed2bab5a"
},
"ss-feedback": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-feedback/SKILL.md",
"computedHash": "9885be72c858199d014dc60cbba96bc132ae0f9e58705c7955e959268e10e0b0"
},
"ss-flow": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-flow/SKILL.md",
"computedHash": "6b4fc6b2bde3f734177a98a251b82eeb572f9b17c3d81ef1f9e1c6719b3d6dc9"
},
"ss-lint": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-lint/SKILL.md",
"computedHash": "1125649f60cfbb399326ce5b4eccf3cf4eaa0c60e8db4a74d9e68a19d889bb2a"
},
"ss-motion": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-motion/SKILL.md",
"computedHash": "990654c3747066d43934b1238a9fe3dbd3903e941c3a5736601769bcdc5e808e"
},
"ss-page": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-page/SKILL.md",
"computedHash": "ad340f6913964d54e9971cd164f0dfe3f58168e433898c750cb312081ed45a14"
},
"ss-pattern": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-pattern/SKILL.md",
"computedHash": "7eaad687f8c9a2a6a43946cd790af71ee2ff3e735d34d04b628763b99fda3503"
},
"ss-reference": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-reference/SKILL.md",
"computedHash": "2a92ee15e9f79b007b2366aa47672439a87c299c894f5b2bd4acece9db6e662d"
},
"ss-resolve": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-resolve/SKILL.md",
"computedHash": "6011306c70e9ef8d007a9f0c1a0ca675397cb3c90a5aa3a2f859c78a84bbd5bd"
},
"ss-restyle": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-restyle/SKILL.md",
"computedHash": "3648aa6e4e568877e9968309bd0ceab79634f71e91709c69006c47b1c05a1500"
},
"ss-review": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-review/SKILL.md",
"computedHash": "96cfb44284d962bbeb2dffa5a7763b57bbb19149716730dc7bb0d21c74812458"
},
"ss-score": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-score/SKILL.md",
"computedHash": "ee9398097184baf8007f9ff7a2ac929c510d5baa1a292ba157c666c743fee1ac"
},
"ss-setup": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-setup/SKILL.md",
"computedHash": "f5502fe1b2dda2c20ea25c0b1cd85842890093ee363c80d3d915aa883b6d80ad"
},
"ss-studio": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-studio/SKILL.md",
"computedHash": "5670618cc199beece617f4829aefdff780d7f4fb05920534757f145430bef85c"
},
"ss-tokens": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-tokens/SKILL.md",
"computedHash": "b024ef609f1d0dd3c72df0f95a781af3804bfd69cedda85a3bc40c66fb989611"
},
"ss-update": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-update/SKILL.md",
"computedHash": "04928f23f19d0eb34a6f74d17154a41a62c63c70c1f0ef63e12c75f3e16c1c79"
},
"ss-verify": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": ".agents/skills/ss-verify/SKILL.md",
"computedHash": "9b0183d767b1a4b155fda45fdffa78eff29dbbc983f4a5b640294468aafb6669"
},
"styleseed-design-review": {
"source": "bitjaru/styleseed",
"sourceType": "github",
"skillPath": "skills/styleseed-design-review/SKILL.md",
"computedHash": "b954d79816d5cf9492c484411d2892192c87ba13e9565cce4789fb19a984f25d"
}
}
}
+72 -48
View File
@@ -14,7 +14,7 @@ import './reservation.css'
type LoadingKey = 'branches' | 'themes' | 'detail' | 'times' | 'prepare' | 'submit' | null
const inputClass = 'w-full rounded-2xl border border-white/10 bg-white/[0.045] px-4 py-3.5 text-sm text-white outline-none transition placeholder:text-zinc-600 focus:border-amber-400/70 focus:bg-white/[0.07] focus:ring-4 focus:ring-amber-400/10 disabled:cursor-not-allowed disabled:opacity-40'
const inputClass = 'field-input'
function addDays(date: string, days: number) {
const value = new Date(`${date}T00:00:00Z`)
@@ -65,14 +65,14 @@ function Icon({ name, className = 'h-5 w-5' }: { name: string; className?: strin
function Step({ number, label, detail, state }: { number: string; label: string; detail: string; state: 'idle' | 'active' | 'done' }) {
return (
<div className={`relative flex gap-4 pb-9 last:pb-0 ${state === 'idle' ? 'opacity-40' : ''}`}>
<div className="relative z-10 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-white/15 bg-[#121212] text-xs font-semibold">
{state === 'done' ? <Icon name="check" className="h-4 w-4 text-amber-300" /> : number}
<div className="relative z-10 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-line bg-surface text-xs font-semibold text-ink">
{state === 'done' ? <Icon name="check" className="h-4 w-4 text-primary" /> : number}
</div>
<div className="pt-0.5">
<p className={`text-sm font-semibold ${state === 'active' ? 'text-amber-300' : 'text-white'}`}>{label}</p>
<p className="mt-1 text-xs leading-5 text-zinc-500">{detail}</p>
<p className={`text-sm font-semibold ${state === 'active' ? 'text-primary' : 'text-ink'}`}>{label}</p>
<p className="mt-1 text-xs leading-5 text-ink-muted">{detail}</p>
</div>
<div className="absolute bottom-1 left-[17px] top-10 w-px bg-white/10 last:hidden" />
<div className="absolute bottom-1 left-[17px] top-10 w-px bg-line last:hidden" />
</div>
)
}
@@ -293,6 +293,7 @@ function ReservationApp() {
}
const availableCount = times.filter((item) => item.available).length
const nextOpenSlot = times.find((item) => item.available)
const selectionDone = Boolean(selectedTheme)
const scheduleDone = Boolean(selectedTime && selectedPrice)
@@ -308,101 +309,124 @@ function ReservationApp() {
}
return (
<main className="min-h-screen bg-[#090909] text-zinc-100 selection:bg-amber-300 selection:text-black">
<main className="min-h-screen bg-canvas text-ink selection:bg-coral selection:text-coral-ink">
<div className="app-grid min-h-screen">
<aside className="border-b border-white/10 bg-[#0d0d0d] px-7 py-8 lg:border-b-0 lg:border-r lg:px-8 lg:py-10">
<aside className="border-b border-line-soft bg-chrome px-7 py-8 lg:border-b-0 lg:border-r lg:px-8 lg:py-10">
<div className="lg:sticky lg:top-10">
<div className="flex items-center gap-3">
<div className="flex h-11 w-11 items-center justify-center rounded-full border border-amber-300/30 bg-amber-300/10 text-amber-300">
<div className="flex h-11 w-11 items-center justify-center rounded-full bg-coral text-coral-ink">
<Icon name="key" />
</div>
<div>
<p className="font-display text-lg tracking-[0.16em] text-white">ESCAPE</p>
<p className="text-[10px] font-semibold tracking-[0.34em] text-zinc-600">RESERVE DESK</p>
<p className="text-lg font-bold tracking-[0.16em] text-ink">ESCAPE</p>
<p className="text-[10px] font-semibold tracking-[0.34em] text-ink-muted">RESERVE DESK</p>
</div>
</div>
<div className="mt-12 hidden lg:block">
<p className="mb-7 text-[10px] font-semibold uppercase tracking-[0.28em] text-zinc-600">Reservation flow</p>
<p className="mb-7 text-[10px] font-semibold uppercase tracking-[0.28em] text-ink-muted">Reservation flow</p>
<Step number="01" label="공간 선택" detail={selectedTheme ? `${selectedBranch?.name} · ${selectedTheme.name}` : '지점과 테마를 고르세요'} state={selectionDone ? 'done' : 'active'} />
<Step number="02" label="일정 선택" detail={selectedTime ? `${formatDate(date)} · ${selectedTime.time}` : '날짜와 가능한 시간을 고르세요'} state={scheduleDone ? 'done' : selectionDone ? 'active' : 'idle'} />
<Step number="03" label="예약자 확인" detail="정보 입력 · 캡차 토큰 · 접수" state={result?.success ? 'done' : scheduleDone ? 'active' : 'idle'} />
</div>
<div className="mt-12 hidden rounded-2xl border border-white/8 bg-white/[0.025] p-4 lg:block">
<div className="flex items-center gap-2 text-xs font-semibold text-zinc-300"><Icon name="shield" className="h-4 w-4 text-emerald-400" /> 민감 정보 보호</div>
<p className="mt-2 text-[11px] leading-5 text-zinc-600">이름, 연락처, 캡차 토큰은 파일에 저장하지 않고 예약 요청 시에만 사용합니다.</p>
<div className="mt-12 hidden rounded-2xl border border-line-soft bg-surface p-4 lg:block">
<div className="flex items-center gap-2 text-xs font-semibold text-ink"><Icon name="shield" className="h-4 w-4 text-success" /> 민감 정보 보호</div>
<p className="mt-2 text-[11px] leading-5 text-ink-muted">이름, 연락처, 캡차 토큰은 파일에 저장하지 않고 예약 요청 시에만 사용합니다.</p>
</div>
</div>
</aside>
<section className="min-w-0 px-5 py-8 sm:px-8 lg:px-12 lg:py-10 xl:px-16">
<header className="flex flex-col justify-between gap-5 border-b border-white/10 pb-8 sm:flex-row sm:items-end">
<header className="flex flex-col justify-between gap-5 border-b border-line-soft pb-8 sm:flex-row sm:items-end">
<div>
<p className="text-[10px] font-semibold uppercase tracking-[0.32em] text-amber-300">Booking automation</p>
<h1 className="font-display mt-3 text-4xl tracking-tight text-white sm:text-5xl">DaHyeon's Test Project 161</h1>
<p className="mt-3 max-w-xl text-sm leading-6 text-zinc-500">실시간 잔여 시간 확인부터 무통장 입금 예약 접수까지 한 화면에서 진행합니다.</p>
<p className="text-[10px] font-semibold uppercase tracking-[0.32em] text-primary">Booking automation</p>
<h1 className="mt-3 text-3xl font-bold tracking-tight text-ink sm:text-4xl">방을 고르고, 탈출을 예약하세요.</h1>
<p className="mt-3 max-w-xl text-sm leading-6 text-ink-muted">실시간 잔여 시간 확인부터 무통장 입금 예약 접수까지 한 화면에서 진행합니다.</p>
</div>
<div className="flex flex-wrap items-center gap-2">
<div className="flex rounded-full border border-white/10 bg-black/20 p-1" aria-label="예약 모드">
<button onClick={() => switchMode(false)} className={`rounded-full px-3 py-2 text-[11px] font-semibold transition ${!autoMode ? 'bg-white text-black' : 'text-zinc-500 hover:text-white'}`}>수동 예약</button>
<button onClick={() => switchMode(true)} className={`rounded-full px-3 py-2 text-[11px] font-semibold transition ${autoMode ? 'bg-amber-300 text-black' : 'text-zinc-500 hover:text-white'}`}>자동 예약</button>
<div className="flex rounded-full border border-line-soft bg-surface p-1" aria-label="예약 모드">
<button onClick={() => switchMode(false)} className={`rounded-full px-3 py-2 text-[11px] font-semibold transition ${!autoMode ? 'bg-ink text-surface' : 'text-ink-muted hover:text-ink'}`}>수동 예약</button>
<button onClick={() => switchMode(true)} className={`rounded-full px-3 py-2 text-[11px] font-semibold transition ${autoMode ? 'bg-primary text-primary-tint' : 'text-ink-muted hover:text-ink'}`}>자동 예약</button>
</div>
<button onClick={() => changeBranch(branchNum)} disabled={!branchNum || loading !== null} className="inline-flex h-10 items-center justify-center gap-2 rounded-full border border-white/10 px-4 text-xs font-semibold text-zinc-400 transition hover:border-white/25 hover:text-white disabled:opacity-30">
<button onClick={() => changeBranch(branchNum)} disabled={!branchNum || loading !== null} className="inline-flex h-10 items-center justify-center gap-2 rounded-full border border-line px-4 text-xs font-semibold text-ink-muted transition hover:border-ink hover:text-ink disabled:opacity-30">
<Icon name="refresh" className="h-3.5 w-3.5" /> 목록 새로고침
</button>
</div>
</header>
{error && (
<div role="alert" className="mt-6 flex items-start justify-between gap-4 rounded-2xl border border-red-400/20 bg-red-400/8 px-4 py-3 text-sm text-red-200">
<span>{error}</span><button onClick={() => setError('')} className="text-red-300/60 hover:text-red-200">닫기</button>
<div role="alert" className="mt-6 flex items-start justify-between gap-4 rounded-2xl border border-danger/25 bg-danger/8 px-4 py-3 text-sm text-danger">
<span>{error}</span><button onClick={() => setError('')} className="font-semibold text-danger/60 hover:text-danger">닫기</button>
</div>
)}
{result && (
<div className={`mt-6 rounded-3xl border p-5 ${result.success ? 'border-emerald-400/25 bg-emerald-400/8' : 'border-red-400/25 bg-red-400/8'}`}>
<div className={`mt-6 rounded-2xl border p-5 ${result.success ? 'border-success/25 bg-success/8' : 'border-danger/25 bg-danger/8'}`}>
<div className="flex items-start gap-3">
<div className={`mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full ${result.success ? 'bg-emerald-300 text-black' : 'bg-red-300 text-black'}`}><Icon name={result.success ? 'check' : 'shield'} className="h-4 w-4" /></div>
<div><p className="font-semibold text-white">{result.success ? '예약 접수 완료' : '예약 접수 실패'}</p><p className="mt-1 text-sm text-zinc-400">{result.message}</p>{result.reservationNum && <p className="mt-2 font-mono text-xs text-zinc-500">예약 번호 {result.reservationNum}</p>}</div>
{result.confirmationUrl && <a href={result.confirmationUrl} target="_blank" rel="noreferrer" className="ml-auto inline-flex items-center gap-2 rounded-full border border-emerald-300/25 px-4 py-2 text-xs font-semibold text-emerald-200 hover:bg-emerald-300/10">확인 페이지 <Icon name="external" className="h-3.5 w-3.5" /></a>}
<div className={`mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-surface ${result.success ? 'bg-success' : 'bg-danger'}`}><Icon name={result.success ? 'check' : 'shield'} className="h-4 w-4" /></div>
<div><p className="font-semibold text-ink">{result.success ? '예약 접수 완료' : '예약 접수 실패'}</p><p className="mt-1 text-sm text-ink-muted">{result.message}</p>{result.reservationNum && <p className="mt-2 font-mono text-xs text-ink-muted">예약 번호 {result.reservationNum}</p>}</div>
{result.confirmationUrl && <a href={result.confirmationUrl} target="_blank" rel="noreferrer" className="ml-auto inline-flex items-center gap-2 rounded-full border border-success/30 px-4 py-2 text-xs font-semibold text-success hover:bg-success/10">확인 페이지 <Icon name="external" className="h-3.5 w-3.5" /></a>}
</div>
</div>
)}
<div className="mt-8 grid gap-6 xl:grid-cols-[minmax(0,1.12fr)_minmax(340px,0.88fr)]">
<div className="space-y-6">
<div className="flex items-center gap-4 overflow-hidden rounded-2xl border border-primary-soft bg-primary-tint py-3 pl-4 pr-5" aria-label="다음 오픈 슬롯 안내">
<span className="h-9 w-1 shrink-0 rounded-full bg-coral" aria-hidden="true" />
{nextOpenSlot ? (
<>
<div className="min-w-0">
<p className="text-[10px] font-semibold uppercase tracking-[0.26em] text-primary">Next open slot</p>
<p className="mt-0.5 truncate text-sm text-ink"><span className="font-semibold">{formatDate(date)}</span> · 예약 가능 {availableCount}개</p>
</div>
<span className="ml-auto shrink-0 rounded-xl bg-coral px-3.5 py-2 text-base font-bold tabular-nums text-coral-ink">{nextOpenSlot.time}</span>
</>
) : times.length > 0 ? (
<div>
<p className="text-[10px] font-semibold uppercase tracking-[0.26em] text-primary">Next open slot</p>
<p className="mt-0.5 text-sm text-ink">이 날짜는 모두 마감이에요. 다른 날짜를 확인해보세요.</p>
</div>
) : (
<div>
<p className="text-[10px] font-semibold uppercase tracking-[0.26em] text-primary">Next open slot</p>
<p className="mt-0.5 text-sm text-ink-muted">지점과 테마를 선택하면 가장 빠른 오픈 슬롯을 알려드려요.</p>
</div>
)}
</div>
<section className="panel-card p-5 sm:p-6">
<div className="mb-5 flex items-center gap-3"><span className="step-badge">01</span><div><h2 className="text-base font-semibold text-white">지점과 테마</h2><p className="mt-0.5 text-xs text-zinc-600">실시간으로 운영 중인 목록을 가져옵니다.</p></div></div>
<div className="mb-5 flex items-center gap-3"><span className="step-badge">01</span><div><h2 className="text-base font-semibold text-ink">지점과 테마</h2><p className="mt-0.5 text-xs text-ink-muted">실시간으로 운영 중인 목록을 가져옵니다.</p></div></div>
<div className="grid gap-4 sm:grid-cols-2">
<label className="space-y-2"><span className="field-label"><Icon name="pin" className="h-3.5 w-3.5" /> 지점</span><select aria-label="지점" value={branchNum} onChange={(event) => changeBranch(Number(event.target.value))} disabled={loading === 'branches'} className={inputClass}><option value={0}>{loading === 'branches' ? '불러오는 중…' : '지점을 선택하세요'}</option>{branches.map((branch) => <option value={branch.num} key={branch.num}>{branch.name}</option>)}</select></label>
<label className="space-y-2"><span className="field-label"><Icon name="key" className="h-3.5 w-3.5" /> 테마</span><select aria-label="테마" value={themeInfoNum} onChange={(event) => changeTheme(Number(event.target.value))} disabled={!branchNum || loading === 'themes'} className={inputClass}><option value={0}>{loading === 'themes' ? '불러오는 중…' : '테마를 선택하세요'}</option>{themes.map((theme) => <option value={theme.infoNum} key={theme.infoNum}>{theme.name}</option>)}</select></label>
</div>
{detail && selectedTheme && (
<div className="theme-preview mt-5 overflow-hidden rounded-2xl border border-white/8 bg-black/25">
<div className="relative min-h-44 overflow-hidden bg-zinc-900">
{detail.imageUrl && <img src={detail.imageUrl} alt="" className="absolute inset-0 h-full w-full object-cover opacity-55" />}
<div className="absolute inset-0 bg-gradient-to-t from-black via-black/45 to-transparent" />
<div className="relative flex min-h-44 flex-col justify-end p-5"><div className="flex flex-wrap gap-2"><span className="tag">{detail.genre || '장르 정보 없음'}</span><span className="tag">난이도 {detail.level || '—'}</span><span className="tag">{detail.playTime || '—'}분</span></div><h3 className="font-display mt-3 text-3xl text-white">{detail.name}</h3></div>
<div className="theme-preview mt-5 overflow-hidden rounded-2xl border border-line-soft">
<div className="relative min-h-44 overflow-hidden bg-ink">
{detail.imageUrl && <img src={detail.imageUrl} alt="" className="absolute inset-0 h-full w-full object-cover opacity-70" />}
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/35 to-transparent" />
<div className="relative flex min-h-44 flex-col justify-end p-5"><div className="flex flex-wrap gap-2"><span className="tag">{detail.genre || '장르 정보 없음'}</span><span className="tag">난이도 {detail.level || '—'}</span><span className="tag">{detail.playTime || '—'}분</span></div><h3 className="mt-3 text-2xl font-bold text-white">{detail.name}</h3></div>
</div>
</div>
)}
</section>
<section className={`panel-card p-5 transition sm:p-6 ${!selectedTheme ? 'opacity-45' : ''}`}>
<div className="mb-5 flex items-center justify-between gap-3"><div className="flex items-center gap-3"><span className="step-badge">02</span><div><h2 className="text-base font-semibold text-white">날짜와 시간</h2><p className="mt-0.5 text-xs text-zinc-600">회색 시간은 이미 마감되었습니다.</p></div></div>{times.length > 0 && <span className="rounded-full bg-emerald-400/10 px-3 py-1 text-[11px] font-semibold text-emerald-300">예약 가능 {availableCount}</span>}</div>
<label className="block max-w-xs space-y-2"><span className="field-label"><Icon name="calendar" className="h-3.5 w-3.5" /> 예약 날짜</span><input aria-label="예약 날짜" type="date" value={date} min={detail?.serverToday} max={maxDate} onChange={(event) => changeDate(event.target.value)} disabled={!detail || loading === 'detail'} className={`${inputClass} color-scheme-dark`} /></label>
<div className="mb-5 flex items-center justify-between gap-3"><div className="flex items-center gap-3"><span className="step-badge">02</span><div><h2 className="text-base font-semibold text-ink">날짜와 시간</h2><p className="mt-0.5 text-xs text-ink-muted">흐린 시간은 이미 마감되었습니다.</p></div></div>{times.length > 0 && <span className={`rounded-full px-3 py-1 text-[11px] font-semibold ${availableCount > 0 ? 'bg-success/10 text-success' : 'bg-chrome text-ink-muted'}`}>예약 가능 {availableCount}</span>}</div>
<label className="block max-w-xs space-y-2"><span className="field-label"><Icon name="calendar" className="h-3.5 w-3.5" /> 예약 날짜</span><input aria-label="예약 날짜" type="date" value={date} min={detail?.serverToday} max={maxDate} onChange={(event) => changeDate(event.target.value)} disabled={!detail || loading === 'detail'} className={inputClass} /></label>
<div className="mt-5 grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5">
{loading === 'times' ? Array.from({ length: 10 }, (_, index) => <div key={index} className="h-12 animate-pulse rounded-xl bg-white/5" />) : times.length > 0 ? times.map((slot) => <button key={slot.num} disabled={(!slot.available && !autoMode) || loading === 'prepare'} onClick={() => chooseTime(slot)} className={`time-slot ${!slot.available && autoMode ? 'time-slot-closed' : ''} ${timeNum === slot.num ? 'time-slot-selected' : ''}`} title={!slot.available && autoMode ? '자동 예약용 사전 선택' : undefined}><span>{slot.time}</span>{slot.saleText && <small>{slot.saleText}</small>}</button>) : <p className="col-span-full py-5 text-center text-xs text-zinc-600">테마와 날짜를 선택하면 시간표가 표시됩니다.</p>}
{loading === 'times' ? Array.from({ length: 10 }, (_, index) => <div key={index} className="h-12 animate-pulse rounded-xl bg-chrome" />) : times.length > 0 ? times.map((slot) => <button key={slot.num} disabled={(!slot.available && !autoMode) || loading === 'prepare'} onClick={() => chooseTime(slot)} className={`time-slot ${!slot.available && autoMode ? 'time-slot-closed' : ''} ${timeNum === slot.num ? 'time-slot-selected' : ''}`} title={!slot.available && autoMode ? '자동 예약용 사전 선택' : undefined}><span>{slot.time}</span>{slot.saleText && <small>{slot.saleText}</small>}</button>) : <p className="col-span-full py-5 text-center text-xs text-ink-muted">테마와 날짜를 선택하면 시간표가 표시됩니다.</p>}
</div>
{autoMode && times.some((slot) => !slot.available) && <p className="mt-3 text-[10px] leading-4 text-amber-300/60">자동 모드에서는 아직 열리지 않은 회색 슬롯도 사전 선택할 수 있습니다. 목표 슬롯 ID와 공식 가격만 준비하며 즉시 예약하지 않습니다.</p>}
{autoMode && times.some((slot) => !slot.available) && <p className="mt-3 text-[10px] leading-4 text-warning">자동 모드에서는 아직 열리지 않은 흐린 슬롯도 사전 선택할 수 있습니다. 목표 슬롯 ID와 공식 가격만 준비하며 즉시 예약하지 않습니다.</p>}
</section>
</div>
<div className="space-y-6">
<section className={`panel-card p-5 transition sm:p-6 ${!scheduleDone ? 'opacity-45' : ''}`}>
<div className="mb-5 flex items-center gap-3"><span className="step-badge">03</span><div><h2 className="text-base font-semibold text-white">예약자 정보</h2><p className="mt-0.5 text-xs text-zinc-600">입금자명과 동일하게 작성하세요.</p></div></div>
<div className="mb-5 flex items-center gap-3"><span className="step-badge">03</span><div><h2 className="text-base font-semibold text-ink">예약자 정보</h2><p className="mt-0.5 text-xs text-ink-muted">입금자명과 동일하게 작성하세요.</p></div></div>
<div className="space-y-4">
<label className="block space-y-2"><span className="field-label"><Icon name="user" className="h-3.5 w-3.5" /> 예약자명</span><input value={name} onChange={(event) => setName(event.target.value)} disabled={!scheduleDone} placeholder="홍길동" autoComplete="name" className={inputClass} /></label>
<label className="block space-y-2"><span className="field-label">휴대폰 번호</span><input value={phone} onChange={(event) => setPhone(formatPhone(event.target.value))} disabled={!scheduleDone} placeholder="010-0000-0000" inputMode="tel" autoComplete="tel" className={inputClass} /></label>
@@ -411,22 +435,22 @@ function ReservationApp() {
</section>
<section className={`panel-card overflow-hidden transition ${!scheduleDone ? 'opacity-45' : ''}`}>
<div className="border-b border-white/8 p-5 sm:p-6"><div className="flex items-center justify-between gap-3"><div className="flex items-center gap-3"><span className="flex h-9 w-9 items-center justify-center rounded-full bg-violet-400/10 text-violet-300"><Icon name="shield" className="h-4 w-4" /></span><div><h2 className="text-sm font-semibold text-white">캡차 인증</h2><p className="mt-0.5 text-[11px] text-zinc-600">브라우저에서 직접 인증 후 토큰을 붙여넣으세요.</p></div></div><button onClick={openCaptcha} disabled={!selectedTheme} className="inline-flex items-center gap-1.5 rounded-full border border-violet-300/20 px-3 py-2 text-[11px] font-semibold text-violet-200 hover:bg-violet-300/10 disabled:opacity-30">브라우저 열기 <Icon name="external" className="h-3 w-3" /></button></div></div>
<div className="p-5 sm:p-6"><textarea aria-label="캡차 토큰" value={captchaToken} onChange={(event) => { const value = event.target.value; setCaptchaToken(value); setCaptchaPastedAtMs(value.trim() ? Date.now() : null) }} disabled={!scheduleDone} rows={3} placeholder="g-recaptcha-response 토큰을 여기에 붙여넣기" spellCheck={false} className={`${inputClass} resize-none font-mono text-xs leading-5`} /><div className="mt-2 flex items-start justify-between gap-3 text-[10px] leading-4 text-zinc-600"><p>토큰은 짧은 시간 동안만 유효하며 한 번만 사용할 수 있습니다. 브라우저에서도 앱과 같은 날짜·시간을 선택하세요.</p>{captchaToken && <span className="shrink-0 rounded-full bg-emerald-300/10 px-2 py-1 text-emerald-300">메모리 전용</span>}</div></div>
<div className="border-b border-line-soft p-5 sm:p-6"><div className="flex items-center justify-between gap-3"><div className="flex items-center gap-3"><span className="flex h-9 w-9 items-center justify-center rounded-full bg-accent/10 text-accent"><Icon name="shield" className="h-4 w-4" /></span><div><h2 className="text-sm font-semibold text-ink">캡차 인증</h2><p className="mt-0.5 text-[11px] text-ink-muted">브라우저에서 직접 인증 후 토큰을 붙여넣으세요.</p></div></div><button onClick={openCaptcha} disabled={!selectedTheme} className="inline-flex items-center gap-1.5 rounded-full border border-accent/30 px-3 py-2 text-[11px] font-semibold text-accent hover:bg-accent/10 disabled:opacity-30">브라우저 열기 <Icon name="external" className="h-3 w-3" /></button></div></div>
<div className="p-5 sm:p-6"><textarea aria-label="캡차 토큰" value={captchaToken} onChange={(event) => { const value = event.target.value; setCaptchaToken(value); setCaptchaPastedAtMs(value.trim() ? Date.now() : null) }} disabled={!scheduleDone} rows={3} placeholder="g-recaptcha-response 토큰을 여기에 붙여넣기" spellCheck={false} className={`${inputClass} resize-none font-mono text-xs leading-5`} /><div className="mt-2 flex items-start justify-between gap-3 text-[10px] leading-4 text-ink-muted"><p>토큰은 짧은 시간 동안만 유효하며 한 번만 사용할 수 있습니다. 브라우저에서도 앱과 같은 날짜·시간을 선택하세요.</p>{captchaToken && <span className="shrink-0 rounded-full bg-success/10 px-2 py-1 font-semibold text-success">메모리 전용</span>}</div></div>
</section>
{autoMode && <AutomationPanel request={autoRequest} captchaToken={captchaToken} captchaPastedAtMs={captchaPastedAtMs} onTokenConsumed={() => { setCaptchaToken(''); setCaptchaPastedAtMs(null) }} onResult={setResult} />}
<section className="rounded-3xl border border-amber-300/20 bg-gradient-to-br from-amber-300/12 to-amber-500/[0.03] p-5 sm:p-6">
<div className="flex items-start justify-between gap-5"><div><p className="text-[10px] font-semibold uppercase tracking-[0.26em] text-amber-300/70">Final check</p><h2 className="font-display mt-2 text-2xl text-white">예약 요약</h2></div><p className="text-xl font-semibold text-amber-200">{formatPrice(selectedPrice?.totalPrice)}</p></div>
<dl className="mt-5 grid grid-cols-[80px_1fr] gap-y-2.5 border-y border-white/8 py-4 text-xs"><dt className="text-zinc-600">테마</dt><dd className="text-right text-zinc-300">{selectedBranch?.name ?? '—'} · {selectedTheme?.name ?? '—'}</dd><dt className="text-zinc-600">일정</dt><dd className="text-right text-zinc-300">{date ? formatDate(date) : '—'} {selectedTime?.time ?? ''}</dd><dt className="text-zinc-600">인원</dt><dd className="text-right text-zinc-300">{person ? `${person}명` : '—'}</dd><dt className="text-zinc-600">결제</dt><dd className="text-right text-zinc-300">무통장입금</dd></dl>
<label className="mt-4 flex cursor-pointer items-start gap-3 text-[11px] leading-5 text-zinc-500"><input type="checkbox" checked={agreed} onChange={(event) => setAgreed(event.target.checked)} disabled={!scheduleDone} className="mt-0.5 h-4 w-4 accent-amber-300" /><span>개인정보 수집·이용, 결제 주의사항 및 예약 규정에 모두 동의합니다.</span></label>
{!autoMode ? <><button onClick={submitReservation} disabled={!scheduleDone || loading === 'submit'} className="mt-5 flex w-full items-center justify-center gap-2 rounded-2xl bg-amber-300 px-5 py-4 text-sm font-bold text-black transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-zinc-800 disabled:text-zinc-600">{loading === 'submit' ? '예약 접수 중…' : '예약 접수하기'} <Icon name="arrow" className="h-4 w-4" /></button><p className="mt-3 text-center text-[10px] text-zinc-600">버튼을 누르면 실제 예약이 1회 접수됩니다.</p></> : <p className="mt-5 rounded-xl border border-amber-300/12 bg-amber-300/5 px-3 py-3 text-center text-[10px] leading-4 text-amber-200/70">자동 예약 카드에서 서버시간과 토큰 상태를 확인한 뒤 무장하세요.</p>}
<section className="rounded-2xl border border-primary-soft bg-surface p-5 sm:p-6">
<div className="flex items-start justify-between gap-5"><div><p className="text-[10px] font-semibold uppercase tracking-[0.26em] text-primary">Final check</p><h2 className="mt-2 text-xl font-bold text-ink">예약 요약</h2></div><p className="text-xl font-bold tabular-nums text-primary">{formatPrice(selectedPrice?.totalPrice)}</p></div>
<dl className="mt-5 grid grid-cols-[80px_1fr] gap-y-2.5 border-y border-line-soft py-4 text-xs"><dt className="text-ink-muted">테마</dt><dd className="text-right text-ink">{selectedBranch?.name ?? '—'} · {selectedTheme?.name ?? '—'}</dd><dt className="text-ink-muted">일정</dt><dd className="text-right text-ink">{date ? formatDate(date) : '—'} {selectedTime?.time ?? ''}</dd><dt className="text-ink-muted">인원</dt><dd className="text-right text-ink">{person ? `${person}명` : '—'}</dd><dt className="text-ink-muted">결제</dt><dd className="text-right text-ink">무통장입금</dd></dl>
<label className="mt-4 flex cursor-pointer items-start gap-3 text-[11px] leading-5 text-ink-muted"><input type="checkbox" checked={agreed} onChange={(event) => setAgreed(event.target.checked)} disabled={!scheduleDone} className="mt-0.5 h-4 w-4 accent-primary" /><span>개인정보 수집·이용, 결제 주의사항 및 예약 규정에 모두 동의합니다.</span></label>
{!autoMode ? <><button onClick={submitReservation} disabled={!scheduleDone || loading === 'submit'} className="mt-5 flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-5 py-4 text-sm font-bold text-primary-tint transition hover:bg-primary-strong disabled:cursor-not-allowed disabled:bg-chrome disabled:text-ink-muted">{loading === 'submit' ? '예약 접수 중…' : '예약 접수하기'} <Icon name="arrow" className="h-4 w-4" /></button><p className="mt-3 text-center text-[10px] text-ink-muted">버튼을 누르면 실제 예약이 1회 접수됩니다.</p></> : <p className="mt-5 rounded-xl border border-primary-soft bg-primary-tint px-3 py-3 text-center text-[10px] leading-4 text-primary">자동 예약 카드에서 서버시간과 토큰 상태를 확인한 뒤 무장하세요.</p>}
</section>
</div>
</div>
<footer className="mt-10 flex flex-col justify-between gap-3 border-t border-white/8 pt-5 text-[10px] text-zinc-700 sm:flex-row"><p>ESCAPE / RESERVE · Personal booking utility</p><p>예약 확정은 공식 안내 문자와 입금 완료 여부를 기준으로 확인하세요.</p></footer>
<footer className="mt-10 flex flex-col justify-between gap-3 border-t border-line-soft pt-5 text-[10px] text-ink-muted sm:flex-row"><p>ESCAPE / RESERVE · Personal booking utility</p><p>예약 확정은 공식 안내 문자와 입금 완료 여부를 기준으로 확인하세요.</p></footer>
</section>
</div>
</main>
+30 -30
View File
@@ -67,16 +67,16 @@ function formatDuration(milliseconds: number) {
function Metric({ label, value, tone = 'normal' }: { label: string; value: string; tone?: 'normal' | 'good' | 'warn' }) {
return (
<div className="rounded-xl border border-white/8 bg-black/20 px-3 py-2.5">
<p className="text-[9px] uppercase tracking-[0.18em] text-zinc-600">{label}</p>
<p className={`mt-1 font-mono text-xs ${tone === 'good' ? 'text-emerald-300' : tone === 'warn' ? 'text-amber-300' : 'text-zinc-300'}`}>{value}</p>
<div className="rounded-xl border border-line-soft bg-canvas px-3 py-2.5">
<p className="text-[9px] uppercase tracking-[0.18em] text-ink-muted">{label}</p>
<p className={`mt-1 font-mono text-xs ${tone === 'good' ? 'text-success' : tone === 'warn' ? 'text-warning' : 'text-ink'}`}>{value}</p>
</div>
)
}
function SampleGraph({ estimate }: { estimate: ClockEstimate }) {
const accepted = estimate.samples.filter((sample) => sample.accepted).slice(-60)
if (accepted.length < 2) return <div className="flex h-28 items-center justify-center text-[10px] text-zinc-700">표본을 수집하는 중입니다.</div>
if (accepted.length < 2) return <div className="flex h-28 items-center justify-center text-[10px] text-ink-muted">표본을 수집하는 중입니다.</div>
const width = 600
const height = 112
const maxRtt = Math.max(1, ...accepted.map((sample) => sample.rttMs))
@@ -88,17 +88,17 @@ function SampleGraph({ estimate }: { estimate: ClockEstimate }) {
}).join(' ')
return (
<div className="overflow-hidden rounded-xl border border-white/8 bg-black/30 p-2">
<div className="overflow-hidden rounded-xl border border-line-soft bg-canvas p-2">
<svg viewBox={`0 0 ${width} ${height}`} className="h-28 w-full" role="img" aria-label="최근 서버시간 표본 그래프">
<line x1="0" x2={width} y1={height / 2} y2={height / 2} stroke="rgba(255,255,255,.08)" />
<line x1="0" x2={width} y1={height / 2} y2={height / 2} stroke="rgba(13,11,8,.12)" />
{accepted.map((sample, index) => {
const barWidth = Math.max(2, width / accepted.length - 2)
const barHeight = sample.rttMs / maxRtt * height * 0.35
return <rect key={sample.id} x={index * width / accepted.length} y={height - barHeight} width={barWidth} height={barHeight} fill="rgba(52,211,153,.16)" />
return <rect key={sample.id} x={index * width / accepted.length} y={height - barHeight} width={barWidth} height={barHeight} fill="rgba(49,84,186,.22)" />
})}
<polyline points={points} fill="none" stroke="rgb(252 211 77)" strokeWidth="2" vectorEffect="non-scaling-stroke" />
<polyline points={points} fill="none" stroke="var(--color-primary)" strokeWidth="2" vectorEffect="non-scaling-stroke" />
</svg>
<div className="flex justify-between px-1 text-[9px] text-zinc-700"><span>노란선: 오프셋 편차</span><span>초록막대: RTT</span></div>
<div className="flex justify-between px-1 text-[9px] text-ink-muted"><span>붉은 선: 오프셋 편차</span><span>파란 막대: RTT</span></div>
</div>
)
}
@@ -256,18 +256,18 @@ export default function AutomationPanel({
return (
<section className="panel-card overflow-hidden" aria-label="자동 예약 및 서버시간">
<div className="border-b border-white/8 p-5 sm:p-6">
<div className="border-b border-line-soft p-5 sm:p-6">
<div className="flex flex-wrap items-start justify-between gap-3">
<div>
<p className="text-[10px] font-semibold uppercase tracking-[0.26em] text-amber-300/70">Precision clock</p>
<h2 className="mt-1 text-base font-semibold text-white">관측 서버시간</h2>
<p className="mt-1 text-[10px] leading-4 text-zinc-600">HTTP Date는 초 단위이며 아래 값은 RTT 보정 추정치와 신뢰구간입니다.</p>
<p className="text-[10px] font-semibold uppercase tracking-[0.26em] text-primary">Precision clock</p>
<h2 className="mt-1 text-base font-semibold text-ink">관측 서버시간</h2>
<p className="mt-1 text-[10px] leading-4 text-ink-muted">HTTP Date는 초 단위이며 아래 값은 RTT 보정 추정치와 신뢰구간입니다.</p>
</div>
<button onClick={toggleMonitor} disabled={busy === 'monitor' || armed} className={`rounded-full border px-3 py-2 text-[11px] font-semibold transition ${clock?.monitoring ? 'border-emerald-300/25 bg-emerald-300/10 text-emerald-200' : 'border-white/10 text-zinc-400 hover:text-white'} disabled:opacity-40`}>
<button onClick={toggleMonitor} disabled={busy === 'monitor' || armed} className={`rounded-full border px-3 py-2 text-[11px] font-semibold transition ${clock?.monitoring ? 'border-success/30 bg-success/10 text-success' : 'border-line text-ink-muted hover:text-ink'} disabled:opacity-40`}>
{busy === 'monitor' ? '측정 중…' : clock?.monitoring ? '모니터 중지' : '모니터 시작'}
</button>
</div>
<p className="mt-5 font-mono text-xl tracking-tight text-white sm:text-2xl" aria-label="관측 서버시간 값">{formatClock(liveServerTimeMs)}</p>
<p className="mt-5 font-mono text-xl tracking-tight text-ink sm:text-2xl" aria-label="관측 서버시간 값">{formatClock(liveServerTimeMs)}</p>
<div className="mt-4 grid grid-cols-2 gap-2 sm:grid-cols-4">
<Metric label="offset" value={`${(clock?.offsetMs ?? 0).toFixed(1)}ms`} tone={qualityTone} />
<Metric label="raw offset" value={`${(clock?.rawOffsetMs ?? 0).toFixed(1)}ms`} />
@@ -291,9 +291,9 @@ export default function AutomationPanel({
recommendedCorrectionMs: 0, calibrationReady: false, calibrationApplied: false,
calibrationSettings: CLOCK_CALIBRATION_DEFAULTS, remoteIp: '', quality: 'unavailable', samples: [],
}} /></div>
{clock?.warning && <p className="mt-2 text-[10px] leading-4 text-amber-300/70">{clock.warning} 품질이 낮아도 마지막 유효 추정값으로 1회 실행합니다.</p>}
<div className="mt-3 flex justify-end"><button onClick={() => setSettingsOpen((value) => !value)} disabled={armed} className="rounded-full border border-white/10 px-3 py-2 text-[10px] font-semibold text-zinc-400 hover:text-white disabled:opacity-40">정밀 보정 설정</button></div>
{settingsOpen && <div className="mt-3 rounded-xl border border-white/10 bg-black/25 p-4">
{clock?.warning && <p className="mt-2 text-[10px] leading-4 text-warning">{clock.warning} 품질이 낮아도 마지막 유효 추정값으로 1회 실행합니다.</p>}
<div className="mt-3 flex justify-end"><button onClick={() => setSettingsOpen((value) => !value)} disabled={armed} className="rounded-full border border-line px-3 py-2 text-[10px] font-semibold text-ink-muted hover:text-ink disabled:opacity-40">정밀 보정 설정</button></div>
{settingsOpen && <div className="mt-3 rounded-xl border border-line-soft bg-canvas p-4">
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
{([
['scanWindowMs', '경계 탐색 범위 (ms)', 100, 450],
@@ -305,32 +305,32 @@ export default function AutomationPanel({
['maxProbeRttMs', '최대 허용 RTT (ms)', 100, 1500],
['maintenanceIntervalSec', '안정화 후 재검증 (초)', 5, 120],
['sampleWindowSize', '표본 보관 수', 60, 600],
] as const).map(([key, label, min, max]) => <label key={key} className="space-y-1"><span className="text-[9px] font-semibold text-zinc-500">{label}</span><input type="number" min={min} max={max} value={clockSettings[key]} onChange={(event) => setClockSettings((current) => ({ ...current, [key]: Number(event.target.value) }))} className="w-full rounded-lg border border-white/10 bg-black/30 px-3 py-2 font-mono text-xs text-white outline-none focus:border-amber-300/50" /></label>)}
] as const).map(([key, label, min, max]) => <label key={key} className="space-y-1"><span className="text-[9px] font-semibold text-ink-muted">{label}</span><input type="number" min={min} max={max} value={clockSettings[key]} onChange={(event) => setClockSettings((current) => ({ ...current, [key]: Number(event.target.value) }))} className="w-full rounded-lg border border-line bg-surface px-3 py-2 font-mono text-xs text-ink outline-none focus:border-accent" /></label>)}
</div>
<div className="mt-3 flex flex-wrap items-center justify-between gap-3 text-[10px] text-zinc-500"><div className="flex gap-4"><label className="flex items-center gap-2"><input type="checkbox" checked={clockSettings.enabled} onChange={(event) => setClockSettings((current) => ({ ...current, enabled: event.target.checked }))} />초 경계 정밀 측정</label><label className="flex items-center gap-2"><input type="checkbox" checked={clockSettings.autoApply} onChange={(event) => setClockSettings((current) => ({ ...current, autoApply: event.target.checked }))} />검증 후 자동 적용</label></div><div className="flex gap-2"><button onClick={() => setClockSettings({ ...CLOCK_CALIBRATION_DEFAULTS })} className="rounded-lg border border-white/10 px-3 py-2">기본값</button><button onClick={saveClockSettings} disabled={busy !== null} className="rounded-lg bg-amber-300 px-3 py-2 font-bold text-black disabled:opacity-40">설정 적용</button></div></div>
<p className="mt-3 text-[9px] leading-4 text-zinc-600">최소 경계 수와 편차 조건을 모두 통과한 경우에만 추천 보정을 자동 적용합니다. 설정은 앱 메모리에만 유지됩니다.</p>
<div className="mt-3 flex flex-wrap items-center justify-between gap-3 text-[10px] text-ink-muted"><div className="flex gap-4"><label className="flex items-center gap-2"><input type="checkbox" checked={clockSettings.enabled} onChange={(event) => setClockSettings((current) => ({ ...current, enabled: event.target.checked }))} className="accent-primary" />초 경계 정밀 측정</label><label className="flex items-center gap-2"><input type="checkbox" checked={clockSettings.autoApply} onChange={(event) => setClockSettings((current) => ({ ...current, autoApply: event.target.checked }))} className="accent-primary" />검증 후 자동 적용</label></div><div className="flex gap-2"><button onClick={() => setClockSettings({ ...CLOCK_CALIBRATION_DEFAULTS })} className="rounded-lg border border-line px-3 py-2 text-ink-muted hover:text-ink">기본값</button><button onClick={saveClockSettings} disabled={busy !== null} className="rounded-lg bg-primary px-3 py-2 font-bold text-primary-tint disabled:opacity-40">설정 적용</button></div></div>
<p className="mt-3 text-[9px] leading-4 text-ink-muted">최소 경계 수와 편차 조건을 모두 통과한 경우에만 추천 보정을 자동 적용합니다. 설정은 앱 메모리에만 유지됩니다.</p>
</div>}
</div>
<div className="border-b border-white/8 p-5 sm:p-6">
<div className="border-b border-line-soft p-5 sm:p-6">
<div className="flex items-center justify-between gap-3">
<div><h3 className="text-sm font-semibold text-white">시간 테스트</h3><p className="mt-1 text-[10px] text-zinc-600">3초 뒤 HEAD 요청으로 스케줄러와 도착 오차를 측정합니다.</p></div>
<button onClick={runTimingTest} disabled={busy === 'test' || armed} className="rounded-full border border-white/10 px-3 py-2 text-[11px] font-semibold text-zinc-300 hover:border-white/25 hover:text-white disabled:opacity-40">{busy === 'test' ? '테스트 중…' : '3초 테스트'}</button>
<div><h3 className="text-sm font-semibold text-ink">시간 테스트</h3><p className="mt-1 text-[10px] text-ink-muted">3초 뒤 HEAD 요청으로 스케줄러와 도착 오차를 측정합니다.</p></div>
<button onClick={runTimingTest} disabled={busy === 'test' || armed} className="rounded-full border border-line px-3 py-2 text-[11px] font-semibold text-ink-muted hover:border-ink hover:text-ink disabled:opacity-40">{busy === 'test' ? '테스트 중…' : '3초 테스트'}</button>
</div>
{timingTest && <div className="mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4"><Metric label="arrival error" value={`${timingTest.arrivalErrorMs >= 0 ? '+' : ''}${timingTest.arrivalErrorMs.toFixed(1)}ms`} tone={Math.abs(timingTest.arrivalErrorMs) <= timingTest.uncertaintyMs ? 'good' : 'warn'} /><Metric label="timer jitter" value={`${timingTest.schedulerJitterMs >= 0 ? '+' : ''}${timingTest.schedulerJitterMs.toFixed(1)}ms`} /><Metric label="RTT" value={`${timingTest.rttMs.toFixed(1)}ms`} /><Metric label="socket" value={timingTest.reusedSocket ? 'reused' : 'new'} /></div>}
</div>
<div className="p-5 sm:p-6">
<div className="flex items-start justify-between gap-4"><div><h3 className="text-sm font-semibold text-white">단일 요청 자동 예약</h3><p className="mt-1 text-[10px] leading-4 text-zinc-600">목표 서버 도착 시각에 토큰 1개를 소비해 정확히 한 번 제출합니다.</p></div><span className={`rounded-full px-2.5 py-1 text-[9px] font-semibold uppercase tracking-wider ${armed ? 'bg-amber-300/15 text-amber-200' : autoState.status === 'succeeded' ? 'bg-emerald-300/15 text-emerald-200' : autoState.status === 'failed' ? 'bg-red-300/15 text-red-200' : 'bg-white/5 text-zinc-500'}`}>{autoState.status}</span></div>
<div className="flex items-start justify-between gap-4"><div><h3 className="text-sm font-semibold text-ink">단일 요청 자동 예약</h3><p className="mt-1 text-[10px] leading-4 text-ink-muted">목표 서버 도착 시각에 토큰 1개를 소비해 정확히 한 번 제출합니다.</p></div><span className={`rounded-full px-2.5 py-1 text-[9px] font-semibold uppercase tracking-wider ${armed ? 'bg-coral text-coral-ink' : autoState.status === 'succeeded' ? 'bg-success/10 text-success' : autoState.status === 'failed' ? 'bg-danger/10 text-danger' : 'bg-chrome text-ink-muted'}`}>{autoState.status}</span></div>
<div className="mt-4 grid gap-3 sm:grid-cols-[1fr_140px]">
<label className="space-y-2"><span className="text-[10px] font-semibold text-zinc-500">실행 시각 (KST, ms)</span><input type="datetime-local" step="0.001" value={targetInput} onChange={(event) => setTargetInput(event.target.value)} disabled={armed} className="w-full rounded-xl border border-white/10 bg-black/25 px-3 py-3 font-mono text-xs text-white outline-none focus:border-amber-300/50 disabled:opacity-50" /></label>
<label className="space-y-2"><span className="text-[10px] font-semibold text-zinc-500">도착 오프셋 (ms)</span><input type="number" min="-5000" max="5000" step="1" value={userOffsetMs} onChange={(event) => setUserOffsetMs(Math.max(-5_000, Math.min(5_000, Number(event.target.value))))} disabled={armed} className="w-full rounded-xl border border-white/10 bg-black/25 px-3 py-3 font-mono text-xs text-white outline-none focus:border-amber-300/50 disabled:opacity-50" /></label>
<label className="space-y-2"><span className="text-[10px] font-semibold text-ink-muted">실행 시각 (KST, ms)</span><input type="datetime-local" step="0.001" value={targetInput} onChange={(event) => setTargetInput(event.target.value)} disabled={armed} className="w-full rounded-xl border border-line bg-surface px-3 py-3 font-mono text-xs text-ink outline-none focus:border-accent disabled:opacity-50" /></label>
<label className="space-y-2"><span className="text-[10px] font-semibold text-ink-muted">도착 오프셋 (ms)</span><input type="number" min="-5000" max="5000" step="1" value={userOffsetMs} onChange={(event) => setUserOffsetMs(Math.max(-5_000, Math.min(5_000, Number(event.target.value))))} disabled={armed} className="w-full rounded-xl border border-line bg-surface px-3 py-3 font-mono text-xs text-ink outline-none focus:border-accent disabled:opacity-50" /></label>
</div>
<div className="mt-3 grid grid-cols-2 gap-2"><Metric label="countdown" value={formatDuration(countdownMs)} tone={countdownMs > 0 ? 'good' : 'warn'} /><Metric label="token at target" value={Number.isFinite(tokenAgeAtTargetMs) ? formatDuration(tokenAgeAtTargetMs) : '토큰 없음'} tone={tokenReady ? 'good' : 'warn'} /></div>
<div className="mt-3 rounded-xl border border-white/8 bg-black/20 p-3 text-[10px] leading-5 text-zinc-500"><div className="flex justify-between gap-3"><span>토큰</span><span className={tokenReady ? 'text-emerald-300' : 'text-amber-300'}>{captchaToken ? `${captchaToken.slice(0, 6)}••••${captchaToken.slice(-4)} · ${formatDuration(tokenAgeMs)}` : '입력되지 않음'}</span></div>{autoState.snapshot && <><div className="flex justify-between gap-3"><span>고정 스냅샷</span><span className="text-right text-zinc-300">{autoState.snapshot.themeName} · {autoState.snapshot.date} {autoState.snapshot.timeLabel} · {autoState.snapshot.person}명</span></div><div className="flex justify-between gap-3"><span>예정 발송</span><span className="font-mono text-zinc-300">{autoState.timeline?.plannedSendAtMs ? formatClock(autoState.timeline.plannedSendAtMs) : '계산 중'}</span></div></>}</div>
<div className="mt-3 rounded-xl border border-line-soft bg-canvas p-3 text-[10px] leading-5 text-ink-muted"><div className="flex justify-between gap-3"><span>토큰</span><span className={tokenReady ? 'font-semibold text-success' : 'font-semibold text-warning'}>{captchaToken ? `${captchaToken.slice(0, 6)}••••${captchaToken.slice(-4)} · ${formatDuration(tokenAgeMs)}` : '입력되지 않음'}</span></div>{autoState.snapshot && <><div className="flex justify-between gap-3"><span>고정 스냅샷</span><span className="text-right text-ink">{autoState.snapshot.themeName} · {autoState.snapshot.date} {autoState.snapshot.timeLabel} · {autoState.snapshot.person}명</span></div><div className="flex justify-between gap-3"><span>예정 발송</span><span className="font-mono text-ink">{autoState.timeline?.plannedSendAtMs ? formatClock(autoState.timeline.plannedSendAtMs) : '계산 중'}</span></div></>}</div>
{autoState.timeline?.actualSendAtMs && <div className="mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4"><Metric label="actual send" value={formatClock(autoState.timeline.actualSendAtMs).split(' ').at(-1) ?? '—'} /><Metric label="arrival error" value={autoState.timeline.arrivalErrorMs === undefined ? '—' : `${autoState.timeline.arrivalErrorMs >= 0 ? '+' : ''}${autoState.timeline.arrivalErrorMs.toFixed(1)}ms`} /><Metric label="response RTT" value={autoState.timeline.rttMs === undefined ? '—' : `${autoState.timeline.rttMs.toFixed(1)}ms`} /><Metric label="HTTP / socket" value={`${autoState.timeline.httpStatus ?? '—'} / ${autoState.timeline.reusedSocket ? 'reused' : 'new'}`} /></div>}
{(error || autoState.message) && <p role="alert" className={`mt-3 rounded-xl border px-3 py-2 text-[10px] leading-4 ${error || autoState.status === 'failed' ? 'border-red-300/15 bg-red-300/5 text-red-200' : 'border-emerald-300/15 bg-emerald-300/5 text-emerald-200'}`}>{error || autoState.message}</p>}
<div className="mt-4 grid grid-cols-2 gap-2">{armed ? <button onClick={disarm} disabled={autoState.status === 'firing'} className="col-span-2 rounded-xl border border-red-300/20 py-3 text-xs font-semibold text-red-200 hover:bg-red-300/8 disabled:opacity-40">자동 예약 해제</button> : <button onClick={arm} disabled={busy === 'arm' || !request || !tokenReady} className="col-span-2 rounded-xl bg-amber-300 py-3 text-xs font-bold text-black hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-zinc-800 disabled:text-zinc-600">{busy === 'arm' ? '무장 중…' : '자동 예약 무장'}</button>}</div>
{(error || autoState.message) && <p role="alert" className={`mt-3 rounded-xl border px-3 py-2 text-[10px] leading-4 ${error || autoState.status === 'failed' ? 'border-danger/25 bg-danger/8 text-danger' : 'border-success/25 bg-success/8 text-success'}`}>{error || autoState.message}</p>}
<div className="mt-4 grid grid-cols-2 gap-2">{armed ? <button onClick={disarm} disabled={autoState.status === 'firing'} className="col-span-2 rounded-xl border border-danger/30 py-3 text-xs font-semibold text-danger hover:bg-danger/8 disabled:opacity-40">자동 예약 해제</button> : <button onClick={arm} disabled={busy === 'arm' || !request || !tokenReady} className="col-span-2 rounded-xl bg-primary py-3 text-xs font-bold text-primary-tint hover:bg-primary-strong disabled:cursor-not-allowed disabled:bg-chrome disabled:text-ink-muted">{busy === 'arm' ? '무장 중…' : '자동 예약 무장'}</button>}</div>
</div>
</section>
)
+39 -15
View File
@@ -1,7 +1,34 @@
@import "tailwindcss";
/* StyleSeed generated semantic palette (.styleseed/palette.json · key #FF6966 · light · balanced) */
@theme {
--font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
--font-sans: 'Pretendard Variable', Pretendard, 'Noto Sans KR', ui-sans-serif, system-ui,
-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--color-canvas: #FAF2EA;
--color-surface: #FFFCF9;
--color-chrome: #EADFD6;
--color-ink: #0D0B08;
--color-ink-muted: #544F4A;
--color-line: #C4B8AE;
--color-line-soft: #E3D9CF;
--color-primary: #B1282E;
--color-primary-strong: #9A1F25;
--color-primary-soft: #FFE4E1;
--color-primary-tint: #FFF6F5;
--color-primary-deep: #4F0008;
--color-coral: #FF6966;
--color-coral-ink: #2A0002;
--color-accent: #3154BA;
--color-accent-soft: #E2EBFF;
--color-accent-tint: #F5F8FF;
--color-success: #006425;
--color-warning: #6E4B00;
--color-danger: #902824;
}
@layer base {
@@ -20,18 +47,15 @@
html {
min-width: 320px;
min-height: 100%;
background: #f8fafc;
background: var(--color-canvas);
}
body {
min-width: 320px;
min-height: 100vh;
margin: 0;
background:
radial-gradient(circle at top, rgba(56, 189, 248, 0.16), transparent 34%),
radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 28%),
#f8fafc;
color: #0f172a;
background: var(--color-canvas);
color: var(--color-ink);
}
#root {
@@ -53,14 +77,14 @@
code {
border-radius: 0.375rem;
border: 1px solid rgba(148, 163, 184, 0.35);
background: #f1f5f9;
border: 1px solid var(--color-line-soft);
background: var(--color-surface);
padding: 0.125rem 0.375rem;
color: #0f172a;
color: var(--color-ink);
}
* {
scrollbar-color: #94a3b8 #e2e8f0;
scrollbar-color: var(--color-line) var(--color-chrome);
}
*::-webkit-scrollbar {
@@ -69,16 +93,16 @@
}
*::-webkit-scrollbar-track {
background: #e2e8f0;
background: var(--color-chrome);
}
*::-webkit-scrollbar-thumb {
border: 2px solid #e2e8f0;
border: 2px solid var(--color-chrome);
border-radius: 9999px;
background: #94a3b8;
background: var(--color-line);
}
*::-webkit-scrollbar-thumb:hover {
background: #64748b;
background: var(--color-ink-muted);
}
}
+72 -49
View File
@@ -1,31 +1,15 @@
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Noto+Sans+KR:wght@400;500;600;700&display=swap');
:root {
color-scheme: dark;
font-family: 'Noto Sans KR', ui-sans-serif, system-ui, sans-serif;
}
body {
background: #090909;
}
.font-display {
font-family: 'DM Serif Display', 'Noto Sans KR', serif;
}
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
.app-grid {
display: grid;
grid-template-columns: 1fr;
background:
radial-gradient(circle at 86% 2%, rgb(251 191 36 / 0.07), transparent 25rem),
#090909;
background: var(--color-canvas);
}
.panel-card {
border: 1px solid rgb(255 255 255 / 0.085);
border-radius: 1.5rem;
background: linear-gradient(145deg, rgb(255 255 255 / 0.042), rgb(255 255 255 / 0.018));
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.025), 0 24px 70px rgb(0 0 0 / 0.18);
border: 1px solid var(--color-line-soft);
border-radius: 1rem;
background: var(--color-surface);
}
.step-badge {
@@ -36,9 +20,9 @@ body {
align-items: center;
justify-content: center;
border-radius: 999px;
border: 1px solid rgb(252 211 77 / 0.22);
background: rgb(252 211 77 / 0.07);
color: rgb(252 211 77 / 0.85);
border: 1px solid var(--color-primary-soft);
background: var(--color-primary-tint);
color: var(--color-primary);
font-size: 0.65rem;
font-weight: 700;
}
@@ -47,53 +31,89 @@ body {
display: flex;
align-items: center;
gap: 0.4rem;
color: rgb(161 161 170);
color: var(--color-ink-muted);
font-size: 0.7rem;
font-weight: 600;
}
.tag {
border: 1px solid rgb(255 255 255 / 0.15);
border: 1px solid rgb(255 255 255 / 0.3);
border-radius: 999px;
background: rgb(0 0 0 / 0.35);
background: rgb(0 0 0 / 0.45);
padding: 0.25rem 0.6rem;
color: rgb(228 228 231);
color: #fffbf8;
font-size: 0.65rem;
backdrop-filter: blur(10px);
}
.field-input {
width: 100%;
border: 1px solid var(--color-line);
border-radius: 0.75rem;
background: var(--color-surface);
padding: 0.875rem 1rem;
font-size: 0.875rem;
color: var(--color-ink);
outline: none;
transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.field-input::placeholder {
color: var(--color-ink-muted);
opacity: 0.55;
}
.field-input:focus {
border-color: var(--color-accent);
box-shadow: 0 0 0 4px var(--color-accent-soft);
}
.field-input:disabled {
cursor: not-allowed;
opacity: 0.45;
background: var(--color-canvas);
}
.time-slot {
min-height: 3rem;
border: 1px solid rgb(255 255 255 / 0.09);
border-radius: 0.85rem;
background: rgb(255 255 255 / 0.035);
color: rgb(212 212 216);
border: 1px solid var(--color-line-soft);
border-radius: 0.75rem;
background: var(--color-surface);
color: var(--color-ink-muted);
font-size: 0.75rem;
font-weight: 600;
transition: 160ms ease;
font-variant-numeric: tabular-nums;
transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.time-slot:hover:not(:disabled) {
border-color: rgb(252 211 77 / 0.35);
background: rgb(252 211 77 / 0.08);
color: white;
border-color: var(--color-coral);
background: var(--color-primary-tint);
color: var(--color-primary);
}
.time-slot:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
.time-slot:disabled {
cursor: not-allowed;
text-decoration: line-through;
color: rgb(82 82 91);
color: var(--color-line);
background: transparent;
}
.time-slot-selected {
border-color: rgb(252 211 77 / 0.7);
background: rgb(252 211 77);
color: black;
.time-slot-selected,
.time-slot-selected:hover:not(:disabled) {
border-color: var(--color-coral);
background: var(--color-coral);
color: var(--color-coral-ink);
}
.time-slot-closed {
border-style: dashed;
color: rgb(161 161 170);
color: var(--color-ink-muted);
text-decoration: none;
}
@@ -101,16 +121,19 @@ body {
display: block;
margin-top: 0.1rem;
font-size: 0.55rem;
opacity: 0.65;
}
.color-scheme-dark {
color-scheme: dark;
opacity: 0.7;
}
select option {
background: #171717;
color: #f4f4f5;
background: var(--color-surface);
color: var(--color-ink);
}
@media (prefers-reduced-motion: reduce) {
.field-input,
.time-slot {
transition: none;
}
}
@media (min-width: 1024px) {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

After

Width:  |  Height:  |  Size: 81 KiB