design-directions
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-10-06
- Stars
- ★ 0
- Forks
- 0
03 SKILL.md 正文
Design directions (reference)
$KIT is the plugin root: appbox.yaml → kit_root if present, else
${CLAUDE_PLUGIN_ROOT} (Claude Code) or the folder two levels above this file (Codex /
pasted prompt).
Since v0.6, phase 2 is skills/prototype: the founder picks a direction by switching
between them in a clickable prototype of their whole app. This skill stays as the
direction reference (the archetype table, how to derive the other mode, the tokens
v2 shape) that visual-designer follows, and for a quick re-skin of an existing app
(Steps 2 and 3 below). It is not a setup phase: it never writes SCREENS.md and never
touches progress.design, which the prototype phase owns.
People can't choose a design system from adjectives. Show them their own app in three coats of paint, and let them point.
Step 1: pick 3 directions from the archetype library
Choose the three archetypes below that best fit appbox.yaml (target user,
retention mechanic, sensitive data). Make them genuinely different. Every
direction ships both a light and a dark palette (the app follows the phone's
setting); pick which one each mockup shows first by the archetype's home mode.
| Archetype | Feel | Good for | Type pairing | Radius | Motion (tokens) |
|---|---|---|---|---|---|
| Calm | Airy, soft neutrals, one muted accent (home: light) | Wellbeing, journaling, finance | Humanist sans (Figtree / Hanken Grotesk / Onest) | 16–24 | Slow fades: standard 260ms, gentle springs, press scale 0.98 |
| Athletic dark | Near-black field, warm off-white ink, one hot accent (home: dark) | Fitness, performance, pro tools | Condensed grotesk + mono numerals (Archivo / Barlow Semi Condensed / Big Shoulders + JetBrains Mono / Azeret Mono) | 12 | Snappy: fast 120ms, stiff springs (damping 22, stiffness 320) |
| Playful | Saturated brand colour, chunky shapes, confetti moments (home: light) | Gamified habits, savings, kids-adjacent | Rounded sans (Fredoka / Nunito) | 20–28 | Springy where you touch: presses and chips on springs damping ~9–12, press scale 0.95, Celebration on the payoff. Content still arrives on a curve that doesn't overshoot |
| Editorial | Serif headlines, generous whitespace, paper tones (home: light) | Content, reading, learning | Serif + sans (Newsreader / Source Serif 4 / Literata / Petrona + Public Sans / the system sans) | 4–8 | Minimal: fades only, no springs |
| Clinical | White/blue, dense information, high trust (home: light) | Health data, B2B, admin | System sans (SF Pro / Roboto) | 8 | Almost none: fast fades |
| Neo-brutal | Hard borders, flat blocks, loud type (home: either) | Creator tools, youth, novelty | Display grotesk (Bricolage Grotesque / Familjen Grotesk / Syne) | 0 | Hard cuts: instant durations, no easing flourish |
The type pairings are starting points, not the answer: pick the face from the
product's world. The kit's type library, $KIT/scripts/proto/fonts.json, is where to
look first: about 45 families, each checked as SIL Open Font License 1.1 with no
Reserved Font Name (so the app can bundle them), tagged with a personality (humanist,
grotesk, geometric, condensed, rounded, serif display, serif text, mono), the roles it
suits and its weights, plus ready pairings (Young Serif + Albert Sans, Petrona +
Schibsted Grotesk, Besley + Public Sans, Funnel Display + Funnel Sans, Sora + Fragment
Mono, Bodoni Moda + Jost, Big Shoulders + Azeret Mono, the Red Hat superfamily, Golos
Text + Martian Mono...). A direction whose display face is in the library also gets
the prototype's Type knob: the founder can swap it for another pairing with the
same personality, live. Every family this table names is in the library (or built in);
prototype.py fonts checks that, so add a family to fonts.json before suggesting it
here. prototype.py check and the app's gates fail the families every
generated app reaches for (Inter, Roboto as a loaded font, Open Sans, Lato, Montserrat,
Fraunces, Geist, Space Grotesk, Instrument, Plus Jakarta, Mona Sans, Recoleta, Arial,
Helvetica). The phone's own system font is always fine. They also fail pure-grey
neutrals, an accent that is the stock AI violet, and an easing curve that overshoots
(scripts/check_design.py).
Colour by construction: derive the palette, don't hand-tune it. Choose two things per direction, an accent (the hue that means something in the product's world) and a neutral hue (usually the accent's, or a warm or cool step off it), and let the kit build both modes:
python3 "$KIT/scripts/palette.py" derive --accent "#BE400C" --neutral-hue 60
It prints {"light": {...}, "dark": {...}} with every key below. Each colour is a tone
of an HCT tonal palette (Google's colour space for Material You, scripts/hct.py), and
tone is the lightness contrast is measured from, so the pairs the validator checks are
set roughly 50 tones apart: they pass check_contrast.py on the first try, for any hue.
In a prototype spec, skip the hexes entirely: give the direction "palette": {"accent": "#BE400C", "neutralHue": 60} (optionally "neutralChroma", 4–24, default 6, for
greyer or more tinted neutrals) and prototype.py derives the colours itself; any
key you still set in tokens.color overrides just that colour. palette.py ramp
prints the tonal palettes when you want to see the steps.
What it does for you is what this section used to ask you to do by hand: it keeps the
accent's hue and shifts its lightness per mode (darker on a pale ground, lighter
on a dark one); dark surfaces step up in lightness as they elevate (bg < surface <
surfaceRaised) because shadows vanish on dark grounds; neutrals are tinted toward the
neutral hue, never pure grey. An accent on the stock AI violet is turned a few degrees
away and derive says so: if that happens, pick a hue with a reason instead. Hand
colours (a brand's exact hex) are still allowed, and the same validator holds them to
the same rules.
Step 2: show the three coats of paint (re-skin only)
If design/prototype.json exists, replace its directions with the three new ones and
run python3 "$KIT/scripts/prototype.py" check then render: the founder switches
looks on their real screens, which beats any mockup. Otherwise write one
self-contained HTML file, design/directions.html:
- Three phone frames (390×844) side by side, stacked on narrow screens.
- Each frame shows the user's core-loop screen from
docs/product/BRIEF.md, with realistic sample content in their domain, not lorem ipsum. Below it, show a strip with the primary button, a card, a list row, an input, a chip row, a skeleton line, an empty state and a toast: the kit's real components. - A light/dark toggle per frame (and one global): each direction's palettes are
CSS custom properties on the frame (
.a[data-mode="dark"] { --bg: ... }), so the toggle proves both palettes, not just the flattering one. - Motion preview in CSS from the direction's motion tokens: the button scales to
pressScaleon:activewith thefastduration, the list rows enter with a staggered fade + 8px rise (entercurve,deliberateduration), the skeleton shimmers on theloopcurve, the toast slides in, and a "Celebrate" button fires a CSS confetti burst for playful directions. Wrap it all in@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }, the same promise the app makes. - Label each one with its archetype name and one line on why it fits.
- Only inline CSS/JS and Google Fonts. No build step.
Show it to the user. If your environment can publish or preview HTML, use that. Otherwise give them the file path to open. Then ask (structured): "Which direction?" with the options A / B / C / "Mix: I'll describe".
Step 3: write design/tokens.json (tokens v2)
This is the single source of truth. The renderer generates mobile/lib/tokens.ts
(both palettes + types), themes app.json (splash background per mode) and draws a
placeholder icon from it. Start from the kit's template/design/tokens.json and
change values; keep every key. For the colours, palette.py derive --accent <hex> --neutral-hue <deg> --into design/tokens.json replaces color and leaves the rest.
{
"name": "athletic-dark",
"version": 2,
"mode": "dark",
"color": {
"light": {
"bg": "#F7F6F3", "surface": "#FFFFFF", "surfaceRaised": "#FFFFFF", "control": "#EFEDE8",
"border": "#DAD7D0", "ink": "#16171A", "inkDim": "#4A4D55", "inkFaint": "#62656D",
"accent": "#BE400C", "onAccent": "#FFFFFF", "success": "#1B7F55", "warning": "#A15C00",
"danger": "#C0283F", "shadow": "#1A1A1A"
},
"dark": {
"bg": "#0C0D0F", "surface": "#16181C", "surfaceRaised": "#1D2025", "control": "#16181C",
"border": "#2E3238", "ink": "#EDE9E0", "inkDim": "#B8B4AA", "inkFaint": "#9A968D",
"accent": "#FF6B2C", "onAccent": "#0C0D0F", "success": "#3DDC97", "warning": "#FFB020",
"danger": "#FF6B6B", "shadow": "#000000"
}
},
"font": { "display": "Archivo", "body": "System", "mono": "Menlo" },
"type": {
"display": { "font": "display", "size": 40, "lineHeight": 46, "weight": "700", "letterSpacing": -0.8, "maxScale": 1.3 },
"title": { "font": "display", "size": 28, "lineHeight": 34, "weight": "700", "letterSpacing": -0.4, "maxScale": 1.4 },
"heading": { "font": "display", "size": 20, "lineHeight": 26, "weight": "600", "letterSpacing": -0.2, "maxScale": 1.6 },
"body": { "font": "body", "size": 16, "lineHeight": 23, "weight": "400", "letterSpacing": 0, "maxScale": 2.0 },
"secondary": { "font": "body", "size": 14, "lineHeight": 20, "weight": "400", "letterSpacing": 0, "maxScale": 2.0 },
"meta": { "font": "body", "size": 12, "lineHeight": 16, "weight": "600", "letterSpacing": 0.6, "maxScale": 1.6, "uppercase": true },
"mono": { "font": "mono", "size": 14, "lineHeight": 20, "weight": "500", "letterSpacing": 0, "maxScale": 1.6 }
},
"motion": {
"duration": { "instant": 90, "fast": 140, "standard": 220, "screen": 320, "deliberate": 480, "ambient": 1400 },
"easing": { "standard": [0.2, 0, 0, 1], "enter": [0.05, 0.7, 0.1, 1], "exit": [0.3, 0, 0.8, 0.15], "loop": [0.45, 0, 0.55, 1] },
"spring": { "snappy": { "damping": 22, "stiffness": 320, "mass": 1 }, "gentle": { "damping": 20, "stiffness": 180, "mass": 1 }, "bouncy": { "damping": 12, "stiffness": 220, "mass": 1 } },
"pressScale": 0.97
},
"elevation": { "none": {...}, "card": {...}, "raised": {...}, "overlay": {...} },
"opacity": { "disabled": 0.45, "pressed": 0.12, "scrim": 0.45, "muted": 0.7 },
"size": { "xs": 12, "sm": 14, "md": 16, "lg": 20, "xl": 28, "xxl": 40 },
"space": { "xs": 4, "sm": 8, "md": 16, "lg": 24, "xl": 32, "xxl": 48 },
"radius": { "sm": 8, "md": 12, "lg": 20, "pill": 999 },
"icon": { "glyph": "A" },
"minTapTarget": 48
}
modeis the fallback when the phone reports no preference (and the icon's palette).maxScalecaps Dynamic Type per role (never below 1): body text must be allowed to grow a lot; a 40pt display line less so.easingvalues are cubic-bezier control points;loopmust be symmetric (it runs the skeleton shimmer back and forth).- A named
fontfamily (not built in) gets each weight its type roles use registered in the app'slib/fonts.tsin the scaffold phase, or it silently falls back. motion.springdrives the feel end to end: the prototype turns each spring into a CSSlinear()curve (screen changes, sheets, presses) and the app hands the same numbers to Reanimated, so tune damping here, not per animation.- Optional
atmospheresets the direction's default light:{"mode": "none" | "glow" | "field", "intensity": "low" | "medium" | "high", "grain": true, "surface": "solid" | "glass"}. Leave it out for a soft glow with grain on solid surfaces. The founder can change it in the prototype, and freeze writes the result (with the light colours and their contrast-safe alpha) back intoatmosphere. - The v1 shape (one flat
colormap) still works but locks the app to one mode.
Rules, all enforced by the validator, in each mode:
ink,inkDimandinkFainteach clear 4.5:1 onbg,surface,surfaceRaisedandcontrol.onAccentclears 4.5:1 onaccent.accentclears 3:1 onbgandsurface(tab tint, focus ring, icons).success/warning/dangerclear 3:1 onbgandsurface;dangerclears 4.5:1 (error text uses it). They always ship with an icon or text too.- Both palettes have exactly the same keys.
Validate:
python3 "$KIT/scripts/check_contrast.py" design/tokens.json
A derived palette passes as it comes. If a hand-set colour fails, adjust its lightness (in the mode it names) until it passes, or derive it. Don't drop the requirement. Show the user the before/after only if the change is visible.
Set appbox.yaml → design.direction: <name>. Leave progress.design as it is.
Then re-render so the app picks the tokens up: run the same render.py command the
scaffold used (values from appbox.yaml, without --force). Existing files are
skipped; mobile/lib/tokens.ts, the app.json theme and the brand icons are
regenerated from the new tokens. Run cd mobile && npm run gates and open the app
before calling the re-skin done.
04 同仓库更多 Skills
ship
Release checklist for getting a build to testers or the stores. Runs the risk gate first (refuses while a risk item is open) and walks the owner through the compliance checklist. Covers the version bump, EAS build and submit, OTA updates and when they're safe, changelog, store listing, privacy nutrition label / data safety form, the Accessibility Nutrition Labels, and the account-deletion requirement. Guidance-level; it never handles signing secrets. Use when asked to ship, release, submit to TestFlight / App Store / Play, or push an OTA update.
routines
Put the project's recurring rituals on a schedule, with the owner's consent. Weekly north-star report, monthly market watch, dependency triage, Supabase advisor sweep, reflect and harness-optimize. Uses Claude Code Routines (cloud cron) where they fit, and documents the Codex / local cron equivalent. Use when asked to automate, schedule or "keep the project moving on its own", or after setup finishes.
reflect
Consolidate what recent sessions learned into the project's long-term memory (.agents/memory). Use at the end of a substantial session, after a correction from the user, after a painful debugging session, when the session-start healthcheck says reflect is overdue or a pending-reflection seed is waiting, or when MEMORY.md exceeds its budget.
pr-review
Review a pull request on the owner's behalf and fix what's safe to fix. Runs the deterministic gates first, then correctness/security, design-system, accessibility and analytics review passes, verifies each blocking finding, applies safe fixes, re-checks, and ends with a plain-English verdict. Use when a PR is opened, when asked to review a PR, a branch or a pasted diff, or before merging anything.
north-star-report
Weekly product-analytics and reliability readout. Pulls the funnel of the brief's 5 north-star events from PostHog, finds the biggest drop-offs and errors, checks each SLO in docs/slo.yaml against its error budget, compares with last week, and proposes (then, with a yes, files) tickets that target them. Use weekly, when the session-start line says it's overdue, when the backlog is empty, or when asked "how is the app doing?".
next
Decide the single next best thing to work on, with two alternates. Reads setup progress, work in progress, open PRs and failing CI, the backlog (GitHub Issues or Linear), overdue harness rituals, product decisions parked until now, and north-star analytics if PostHog is connected. Use when someone asks "what next?", "what should I work on?", at the start of a session, or after a PR merges.