Loading...
Loading...
Brand-aware design system generator that acts as Head of Brand. Translates abstract brand language into a mathematically-validated, implementation-ready design system, writes creative-brief.md as the source of truth for all UI/UX in a project, and optionally compiles it to framework tokens (Tailwind v4 @theme, v3 preset, or plain CSS custom properties). Standalone skill (like bug-hunting and hotfix — no full pipeline required). Trigger on "/brand-design", "design system", "creative brief", "define the brand", "brand identity", "set up UI tokens", "export design tokens", "tailwind theme from brand", or when starting UI work without an existing design authority.
npx skill4agent add rfxlamia/pocketto brand-designcreative-brief.mdcreative-brief.mdCheck: does docs/pocket/rule/creative-brief.md exist?
→ NO : DISCOVERY MODE → run Steps 1–7 in full
→ YES : REFINE MODE → jump to the Refine Mode Flow (bottom)READMEpackage.json.css<style>GATE 1: Do NOT proceed past Step 1 without answers to Q1–Q5. (Q6–Q7 are optional.)
No assumptions about brand personality. Ask, wait, then continue.
GATE 2: Do NOT write creative-brief.md until the user has confirmed the HTML preview.
The preview is the alignment contract. "Type OK to finalize" must happen first.
GATE 3: Do NOT skip contrast-ratio validation. NO color pair is exempt.
Every text/background pair is calculated. < 4.5:1 (normal) or < 3:1 (large)
→ auto-adjust Lightness until valid before it can appear in the brief.
GATE 4 (Refine): Do NOT overwrite the brief without regenerating AND re-confirming the preview.
Refine mode is not a fast-path around Gate 2 — it is Gate 2 again, scoped.| Step | Reference you MUST load first | Without it you would… |
|---|---|---|
| Step 2 | | guess colors/type from vibes instead of the rule table |
| Step 3 | | estimate contrast and scale instead of computing them |
| Step 4 | | invent component states instead of the 5-state template |
| Step 4 (copy) | | write tone-mismatched micro-copy |
| Step 5 | | hand-roll an inconsistent preview |
| Step 8 | | improvise token names/targets instead of the fixed mapping |
Q1: Brand name & one-liner — what is being built?
Q2: Who is the target user?
Q3: 3–5 adjectives describing brand personality
Q4: "After using this product, the user should feel ___"
Q5: Platform context — web app, dashboard, marketing site, mobile?
Q6: Any existing assets? (logo color, font already chosen?) [optional]
Q7: Visual references or inspirations? [optional]⛔ STOP. Loadnow. This step is rule-based, never guessed. If you have not loaded it, you cannot translate. Load it, then continue.references/semantic-map.md
INPUT (from interview) → OUTPUT (visual parameter)
"Professional, Trustworthy" → Hue: navy/blue (240–260°), radius 4–6px, geometric sans
Platform: dashboard → Modular scale ratio 1.25 (Major Third)
Brand register: formal → CTA copy style: "Daftar Sekarang", not "Ayo Gabung!"semantic-map.md⛔ STOP. Loadnow. You will compute, not estimate. The reference holds the OKLCH manipulation steps, the WCAG relative-luminance + contrast formula, and the modular-scale formula. Load it before any number is written.references/math-toolkit.md
⛔ STOP. Loadnow (for the state template) andreferences/atomic-states.md(for the micro-copy). Both are mandatory for this step.references/copy-guidelines.md
Atoms: Button (Primary / Secondary / Ghost) · Input/Text Field · Badge/Tag · Link
States: Default | Hover | Focus | Disabled | Error
Per state, output: OKLCH color values · border · box-shadow · cursor · focus ringatomic-states.mdcopy-guidelines.md⛔ STOP. Loadnow. Populate the template; do not hand-author a preview. This guarantees the swatches, contrast badges, type ramp, atom-state grid, and copy samples all render in the agreed layout.references/html-preview-template.md
docs/pocket/rule/creative-brief-preview.htmlPreview generated at docs/pocket/rule/creative-brief-preview.html
Open in a browser and confirm:
- Does the palette match what you imagined?
- Does the tone feel right?
- Anything to change?
Type OK to finalize, or describe what needs adjustment.creative-brief.mddocs/pocket/rule/creative-brief.md# Creative Brief — [Brand Name]
## Brand Persona
- Character: ...
- Tone of Voice: ...
- Emotional Goal: ...
## Color System (OKLCH)
### Primary
- oklch(45% 0.2 250) — Contrast vs white: 7.2:1 ✅ WCAG AAA
- Hover: oklch(40% 0.2 250)
### Neutrals / Semantic Colors
- success / warning / error / info — each with contrast ratio noted
## Typography Scale
- Base: 16px | Ratio: 1.25 (Major Third)
- xs: 10px | sm: 13px | base: 16px | md: 20px | lg: 25px | xl: 31px | 2xl: ...
## Atoms
### Button — Primary
| State | Background | Text | Border | Shadow |
|----------|------------|------------|--------|--------|
| Default | oklch(...) | oklch(...) | none | ... |
| Hover | oklch(...) | oklch(...) | ... | ... |
| Focus | oklch(...) | oklch(...) | ring | ... |
| Disabled | oklch(...) | oklch(...) | none | none |
| Error | oklch(...) | oklch(...) | ... | ... |
(repeat for Secondary, Ghost, Input, Badge, Link)
## Copy Guidelines
- CTA style: ...
- Error messages: ...
- Placeholder text: ...
## Molecules (examples)
- Search Bar = Input + Button
- Form Group = Label + Input + Error TextSessionStart.claude/rules/brand-design.md.claude/settings.json.claude/rules/brand-design.mdYou MUST load docs/pocket/rule/creative-brief.md whenever you are
planning or developing UI/UX. This file is the design system authority
for this project. No UI decision should be made without consulting it..claude/hooks/session-start.sh$CLAUDE_PROJECT_DIRset -emkdir -p .claude/hooks
cat > .claude/hooks/session-start.sh <<'SCRIPT'
#!/usr/bin/env bash
# Brand-design enforcement: auto-load the creative brief at session start.
# Prints nothing and exits 0 when no brief exists, so non-brand projects are unaffected.
BRIEF="$CLAUDE_PROJECT_DIR/docs/pocket/rule/creative-brief.md"
if [ -f "$BRIEF" ]; then
cat <<'EOF'
[brand-design] This project has a creative brief at docs/pocket/rule/creative-brief.md.
It is the design-system authority. Before planning or developing ANY UI/UX, load and obey it.
No color, type, spacing, or component decision may be made without consulting the brief.
EOF
fi
exit 0
SCRIPT
chmod +x .claude/hooks/session-start.sh.claude/settings.jsonsettings.local.jsonjqstartup|resume|clearcompactjq.hooks.SessionStartSETTINGS=.claude/settings.json
CMD='$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh'
[ -f "$SETTINGS" ] || echo '{}' > "$SETTINGS"
tmp=$(mktemp)
jq --arg cmd "$CMD" '
.hooks //= {} | .hooks.SessionStart //= [] |
if any(.hooks.SessionStart[]; .hooks[]?.command == $cmd)
then .
else .hooks.SessionStart += [{
matcher: "startup|resume|clear",
hooks: [{ type: "command", command: $cmd }]
}]
end
' "$SETTINGS" > "$tmp" && mv "$tmp" "$SETTINGS"{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|clear",
"hooks": [
{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh" }
]
}
]
}
}settings.json⛔ STOP. Loadnow before detecting a target or writing any token file. The mapping (brief section → token name), the per-target file formats, and the idempotent wiring rules all live there — improvising them defeats the point.references/token-export.md
bg-primary-500var(--color-primary-500)creative-brief.md@themeThis project uses [Tailwind v4 / Tailwind v3 / plain CSS].
I can compile the brief into [<css-dir>/brand.theme.css / tailwind.brand.preset.js /
tokens.css] so brand values are available as [utilities + CSS variables / utilities /
CSS variables] instead of being hand-copied from the brief.
Generate it? (yes / skip)docs/pocket/rule/creative-brief.md1. Load the existing creative-brief.md (and the preview if present).
2. Ask: "What do you want to refine — color, typography, tone, components, or all?"
3. Re-run ONLY the relevant steps. Reload that step's mandatory reference(s) first —
the Mandatory Reference Protocol applies in refine mode too.
4. Regenerate docs/pocket/rule/creative-brief-preview.html.
5. GATE 4: prompt the user to confirm the preview again (verbatim prompt from Step 5).
Do NOT overwrite the brief until confirmed.
6. Overwrite creative-brief.md and update the preview HTML. Re-run Step 7's enforcement
setup only where something is missing: the `jq` registration and the rule-file/hook writes
are idempotent, so re-running them is safe and will not duplicate the hook entry.
7. Check whether a generated token file exists (Step 8 output): look for
`brand.theme.css`, `tailwind.brand.preset.js`, or `tokens.css` at the canonical paths
from `references/token-export.md`, or grep for the GENERATED header if the path was
customized. If found, regenerate it from the updated brief — load
`references/token-export.md` first. A refined brief with a stale token file is a
split-brain; never leave one behind. If no token file exists, offer Step 8 as usual.| Reference | When to Load (mandatory at that step) |
|---|---|
| Step 2: translating adjectives/platform → visual parameters |
| Step 3: OKLCH palette, WCAG contrast, modular type scale |
| Step 4: 5-state template + output format for each atom |
| Step 4: tone-of-voice rules and micro-copy per persona |
| Step 5: building the self-contained preview |
| Step 8: target detection, token mapping, generated-file + wiring rules |
token-export.md