with one click
with one click
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | sf-design-from-scratch |
| description | Design-system creation from existing UI. |
| argument-hint | [project | page | route | "tokens-only" | "with-playground"] |
Before resolving any ShipFlow-owned file, load $SHIPFLOW_ROOT/skills/references/canonical-paths.md ($SHIPFLOW_ROOT defaults to $HOME/shipflow). ShipFlow tools, shared references, skill-local references/*, templates, workflow docs, and internal scripts must resolve from $SHIPFLOW_ROOT, not from the project repo where the skill is running. Project artifacts and source files still resolve from the current project root unless explicitly stated otherwise.
Trace category: conditionnel.
Process role: source-de-chantier.
Before producing the final report, load $SHIPFLOW_ROOT/skills/references/chantier-tracking.md when this run is attached to a spec-first chantier. If exactly one active specs/*.md chantier is identified, append the current run to Skill Run History, update Current Chantier Flow when the run changes the chantier state, and include the compact Chantier block from $SHIPFLOW_ROOT/skills/references/reporting-contract.md. If no unique chantier is identified, do not write to any spec; report Chantier: non applicable or Chantier: non trace with the reason.
Because this skill can create broad follow-up work, evaluate the Chantier potentiel threshold from $SHIPFLOW_ROOT/skills/references/chantier-tracking.md. Create or route to a spec when the design-system migration spans multiple shared surfaces, product-critical pages, or non-local component changes.
Before producing the final report, load $SHIPFLOW_ROOT/skills/references/reporting-contract.md.
Default to report=user: concise, action-first, and focused on the resulting professional design system, files changed, validation, and the next real step. Use report=agent, handoff, verbose, or full-report only when another agent needs the inventory, token mapping, migration matrix, validation proof, or unresolved decisions.
sf-design-from-scratch creates a complete, professional design-system source of truth from an existing UI. It is for projects that have scattered fonts, colors, sizes, spacing, and motion values but no coherent centralized token layer.
It is not a general design router and it is not only a playground generator. The core job is:
existing UI evidence
-> visual inventory
-> complete constrained design-system architecture
-> central source of truth
-> bounded migration from literals to variables
-> validation
-> sf-design-playground and sf-audit-design-tokens follow-up
Accepted scope:
sf-design-playground after tokens existsf-audit-design-tokens after creationRejected scope:
sf-design routersf-audit-design, sf-audit-design-tokens, sf-audit-components, sf-audit-a11yDefault constraints protect professional coherence; they do not mean the system is incomplete:
| Domain | Default limit | Notes |
|---|---|---|
| Fonts | max 5 font roles or loaded families | Prefer 1-2 families and semantic roles such as --font-sans, --font-display, --font-mono. |
| Chromatic colors | max 3 chromatic families | Do not count required neutral, surface, border, text, overlay, success, warning, danger, or info support tokens as brand color families. |
| Font sizes | max 5 size tokens | Choose them with a coherent modular ratio, not linear increments. |
| Spacing | coherent scale | Prefer a 4px or 8px base and avoid one-off values. |
| Motion | semantic durations/easings | Example: --duration-fast, --duration-base, --ease-standard. |
Do not exceed these constraints without a targeted user decision. When the existing UI has more values, consolidate by usage frequency, visual role, and product importance.
A run is not complete just because a few variables exist. A professional design-system result must cover every core domain the project uses:
If a broad app cannot be fully migrated in one safe run, the token system still needs to be complete across its domains; only the replacement sweep is staged.
Do not invent font sizes one by one. Derive the kept typography tokens from a coherent modular scale:
1rem.1.125, 1.2, 1.25, 1.333, 1.414, 1.5, or 1.618.clamp(MIN_REM, X_REM + Y_VW, MAX_REM) with moderate vw (Y <= 3) and a real rem base so browser zoom still works.Read only the files needed to understand the current visual system:
BRANDING.md when presentRecord:
Produce a concise professional token plan before editing:
Canonical token source: [file]
Fonts kept: [<=5]
Chromatic families kept: [<=3]
Font sizes kept: [<=5]
Typography ratio: [1.125 / 1.2 / 1.25 / 1.333 / 1.414 / 1.5 / 1.618]
Fluid type: [none / headings / display+headings]
Spacing base: [4px / 8px / existing]
Migration batch: [files]
Questions: [only if needed]
If the choice changes the brand direction, ask the user. If it only consolidates obvious duplicates, proceed.
Create or update the canonical token source using the project stack:
ThemeData / constants only for Flutter projectsRequired token groups:
Replace obvious hardcoded literals with variables in a bounded first batch:
Do not attempt a whole-app sweep unless the spec is ready and the scope is explicitly bounded.
After tokens exist:
sf-design-playground when the user wants visual editing/previewsf-audit-design-tokens for deep token coherencesf-design when the token source exists but the remaining work is a site-wide page/component migration or visual non-regression proofsf-audit-components if component variants drift after tokenizationsf-audit-a11y if contrast, focus, motion, or target-size risks appearDo not stop silently.
/sf-spec <design-system title>.Run checks that match the project and changed surfaces.
For ShipFlow skill changes:
python3 tools/skill_budget_audit.py --skills-root skills --format markdown
"${SHIPFLOW_ROOT:-$HOME/shipflow}/tools/shipflow_sync_skills.sh" --check --skill sf-design-from-scratch
For web projects:
npm run build
npm run lint
Use available project scripts rather than inventing commands. If no script exists, report the gap.
Focused checks:
rg -n "#[0-9a-fA-F]{3,6}\\b|rgb\\(|rgba\\(|oklch\\(" src app pages components 2>/dev/null
rg -n "font-size:\\s*[0-9]|gap:\\s*[0-9]|padding:\\s*[0-9]|margin:\\s*[0-9]" src app pages components 2>/dev/null
rg -n "prefers-reduced-motion|data-theme|color-scheme|darkMode|theme" src app pages components 2>/dev/null
These rg checks are evidence, not automatic failures. A few literals can be acceptable when documented.
After creation, run or recommend:
/sf-audit-design-tokens
/sf-design-playground
/sf-design "migrer le site pour consommer les tokens design centralises sans changement visuel volontaire"
Stop and report blocked only when:
Every blocked report must include one of:
Question: the exact decision neededRoute: the owner skill and command to runNext: the spec/check/fix command that unblocks progressUse report=user by default:
## Design From Scratch: [project or surface]
Result: [implemented / partial / blocked / rerouted]
Token source: [file or none]
Design system: [fonts/colors/type/spacing/radius/motion/theme summary]
Migration: [files changed or none]
Checks: [passed / failed / skipped with reason]
Token implementation: [complete / partial / unknown]
Follow-up: [sf-design-playground / sf-audit-design-tokens / sf-design token migration / none]
## Chantier
[spec path | non trace: reason]
Reste a faire: [only if non-empty]
Prochaine etape: [only if non-empty]
Use report=agent for token inventory, value mapping, file-by-file migration details, validation logs, and unresolved design decisions.