Design Phase Redesign
Spec: Design Phase Redesign
Context
The Baseline design-phase skill produces standalone HTML prototypes on a throwaway branch, iterates once, loses image work when no image tool exists, and leaves later visual edits outside the design flow. This spec replaces it with a graph that goes from brand identity to committed, quality-checked UI code in the real app, built mostly from shadcn components. delivery-phase then adds logic to that code.
Terms follow the design-phase redesign glossary.
brand ─▶ design-system ─▶ compose ─▶ motion-plan ─▶ ┌▶ variant-round ─▶ quality-gate ─▶ verdict ─┐
(HUMAN) (HUMAN) └───────────── riff / combine ◀──────────────┤
keep ─▶ promote ─▶ backlog ─▶ delivery-handoffNon-Goals
- Choosing the Expo component library (parked).
- Changing Finder's
prototype-phaseor Matt'sprototypeskill. - Adding an image tool runtime to the CLI.
- Vendoring taste-skill
stitch-design-taste.
Requirements and Outcomes
OUT-001: design-phase is a durable workflow graph
design-phase follows the write-graph-based-skills structure: bootstrap SKILL.md, flat phases/ with router.md and the gates intake, grill, brand, design-system, compose, motion-plan, variant-round, quality-gate, verdict, promote, backlog, delivery-handoff, and an AUTHORING-HANDOFF.md. It stays explicit-only.
Architecture: OUT-001 mapping; ARC-001, FLOW-001.
OUT-002: variants live in the real app
Every variant is code in the real app, on the real route, on the working branch, behind a dev-only ?variant= switch. design-phase produces no standalone HTML, no prototype/<slug> branch, and no isolated prototype route.
Architecture: OUT-002 mapping; ARC-006.
OUT-003: the variant loop iterates until keep
Each Variant Round builds 3 variants by default (cap 5), each checked at mobile and desktop widths. The Verdict is riff, combine, keep, or reject; riff and combine start a new round; keep is the approval and leads to promote. The round counter persists for cold resume. A later visual change re-enters at compose when the layout changes, otherwise at variant-round.
Architecture: OUT-003 mapping; FLOW-002, FLOW-004-STEP-001, ARC-002.
OUT-004: brand defines the design system
The brand gate runs brandkit first and the user accepts the boards; it skips when fresh brand artifacts exist. The design-system gate fills a design-phase DESIGN.md template in Google Stitch format, then applies shadcn design-system.md Steps 3–7 in the existing app (shadcn init without --template when components.json is absent). Expo gets a NativeWind theme config. The gate validates in a browser and does not stop for the user.
Architecture: OUT-004 mapping; ARC-003, FLOW-001-STEP-003, FLOW-001-STEP-004.
OUT-005: compositions come from Codex image generation
brand and compose generate images through the ladder: own tool when the agent is Codex, T3 delegate_task to provider codex, codex exec when installed, else block with a recorded reason. compose uses both imagegen-frontend-web and imagegen-frontend-mobile unless the user names one surface. Every brief carries DESIGN.md, the shadcn-Primitive Directive, and the copy lens. The user accepts the compositions.
Architecture: OUT-005 mapping; ARC-004, ARC-005, ARC-008, FLOW-003, FLOW-001-STEP-005.
OUT-006: motion is planned and tracked
After compose, find-animation-opportunities writes a durable Motion Plan per composition with entry states proposed, accepted, built, verified. variant-round builds accepted entries with animate or animate-expo; quality-gate verifies them.
Architecture: OUT-006 mapping; FLOW-001-STEP-006, FLOW-002-STEP-001, FLOW-002-STEP-002.
OUT-007: variant rounds compose the agreed craft skills
variant-round uses shadcn components, design-taste-frontend (always), image-to-code, emil-design-eng, animate or animate-expo, mobile-native for responsive web, and redesign-existing-projects only when the user clearly intends to improve existing UI.
Architecture: OUT-007 mapping; ARC-007.
OUT-008: only quality-checked variants reach the user
quality-gate runs light break-ui, the mobile-native checklist, review-animations, the copy lens, and Motion Plan conformance on every variant, and records pass/fail. Only passing variants reach the Verdict. Promote requires a full break-ui pass.
Architecture: OUT-008 mapping; ARC-007, ARC-008, FLOW-002-STEP-002.
OUT-009: promote commits Design-Owned UI Code that delivery extends
Promote runs full break-ui, rewrites the kept variant in place, removes the switch, keeps worst-case fixtures dev-only, commits, and writes the approved artifact contract. delivery-phase treats the committed UI as accepted input, adds logic and data, and changes design-owned files only to fix a defect it records.
Architecture: OUT-009 mapping; FLOW-001-STEP-007, ARC-011, FLOW-004-STEP-002.
OUT-010: design state is durable
One design handoff lives beside SPEC.md in the resolved spec folder and holds gate outcomes, round counter, verdicts, Motion Plan, and artifact index. Images become durable through repo-asset-management. The router reads it on every entry.
Architecture: OUT-010 mapping; ARC-002.
OUT-011: the vendored skill set matches the agreed primitives
The skills repo vendors, at one shared Emil pin, prototype (adapted to the real route), break-ui, mobile-native, emil-design-eng, find-animation-opportunities, and refreshed animate, animate-expo, review-animations; from taste-skill brandkit, refreshed redesign-existing-projects, and full-output-enforcement; from shadcn the shadcn skill. Emil "Initial Response" greetings are removed and every edit is recorded in UPSTREAM.md. gpt-taste and improve-mobile-frontend are removed.
Architecture: OUT-011 mapping; ARC-009.
OUT-012: the frontend pack ships design-phase and its skills
design-phase moves from the planning pack to frontend. frontend lists every design skill, including shadcn; animate-expo stays in expo. The Baseline ships the skills commit through sync:skills, with baseline changelog notes and wiki pages.
Architecture: OUT-012 mapping; ARC-010, ARC-012, FLOW-005.
Acceptance Criteria
- AC-001:
skills/phases/design-phasecontainsSKILL.md,AUTHORING-HANDOFF.md, andphases/with exactlyrouter.mdplus the 12 gate files of OUT-001;approval.mdandprototype.mdare absent; frontmatter keepsdisable-model-invocation: true.- Covers: OUT-001
- Architecture: AC-001
- AC-002: the
write-graph-based-skillsaudit phase passes fordesign-phase: every gate defines guard, inputs, bounded action, invariants, completion evidence, exits, and durable handoff, and every router route resolves to one gate or stop.- Covers: OUT-001
- Architecture: AC-002
- AC-003:
design-phaseand the adaptedprototypecontain no instruction to create a standalone HTML file, aprototype/<slug>branch, or a/prototypes/<slug>route;variant-roundrequires the real route with a dev-only?variant=switch.- Covers: OUT-002
- Architecture: AC-003
- AC-004:
verdictroutesriffandcombinetovariant-round,keeptopromote, andrejectto the router;variant-rounddefaults to 3 variants with a cap of 5 and checks mobile and desktop widths.- Covers: OUT-003
- Architecture: AC-004
- AC-005: the router routes a later visual change to
composewhen the layout changes and tovariant-roundotherwise, and reads the round counter from the design handoff on cold resume.- Covers: OUT-003, OUT-010
- Architecture: AC-005
- AC-006:
brandrunsbrandkitthrough the image ladder, stops for user acceptance, and is skipped by the router when fresh brand artifacts exist.- Covers: OUT-004, OUT-005
- Architecture: AC-006
- AC-007:
design-phase/referencescontains a DESIGN.md template in Google Stitch format;design-systemfills it and applies shadcndesign-system.mdSteps 3–7 in the existing app, runsshadcn initwithout--templatewhencomponents.jsonis absent, writes a NativeWind theme config for Expo, and ends without a user stop.- Covers: OUT-004
- Architecture: AC-007
- AC-008: one image-generation reference states the four-step Codex ladder and the blocked outcome; no gate names a code or HTML fallback for images.
- Covers: OUT-005
- Architecture: AC-008
- AC-009:
composeuses both imagegen skills unless one surface is named, appends the shadcn-Primitive Directive reference and the copy lens reference to every brief, and stops for user acceptance.- Covers: OUT-005
- Architecture: AC-009
- AC-010:
motion-planrunsfind-animation-opportunitieson accepted compositions and records entries with the four states in the design handoff;variant-roundandquality-gateadvance them tobuiltandverified.- Covers: OUT-006
- Architecture: AC-010
- AC-011:
variant-roundnames every OUT-007 skill with its condition:design-taste-frontendunconditional,mobile-nativefor responsive web,redesign-existing-projectsonly on existing-UI intent,animate-expofor Expo.- Covers: OUT-007
- Architecture: AC-011
- AC-012:
quality-gatenames the five checks, records pass/fail per variant, and lets only passing variants reachverdict;promoterequires a fullbreak-uipass with no open breaks and every decision closed by the user.- Covers: OUT-008
- Architecture: AC-012
- AC-013:
promoteremoves the?variant=switch, keeps worst-case fixtures dev-only, commits, and writes the approved artifact contract;delivery-handoffnames the promote commit.- Covers: OUT-009
- Architecture: AC-013
- AC-014:
delivery-phaseandimplement-specstate that Design-Owned UI Code is accepted input, that delivery adds logic, and that a change to a design-owned file is allowed only as a recorded defect fix.- Covers: OUT-009
- Architecture: AC-014
- AC-015: the design handoff location is beside
SPEC.mdin the resolved spec folder, and visual assets go throughrepo-asset-management.- Covers: OUT-010
- Architecture: AC-015
- AC-016: every OUT-011 skill exists in the skills repo with
UPSTREAM.mdnaming source repo, commit, and every local edit; no vendored Emil skill contains an "Initial Response" section;gpt-tasteandimprove-mobile-frontendand their tests are absent and unreferenced.- Covers: OUT-011
- Architecture: AC-016
- AC-017: the skills repo test suite passes, including a provenance test that checks each recorded edit instead of byte identity.
- Covers: OUT-011
- Architecture: AC-017
- AC-018:
packs.tslistsdesign-phaseand all design skills, includingshadcn, infrontendand not inplanning;animate-expostays inexpo;skills.tshas an entry for every vendored skill and none for removed skills; CLI tests and type checks pass.- Covers: OUT-012
- Architecture: AC-018
- AC-019:
apps/cli/skillsmatches the pushed skillsmaincommit throughbun run sync:skills;BASELINE_CHANGELOG.mdhas reviewedUnreleasednotes; the Harness wiki pages for design-phase and skill packs describe the new flow.- Covers: OUT-012
- Architecture: AC-019
Constraints
- Skill text starts in
wearedevpunks/skillsonmain;apps/cli/skillsand.agents/skillschange only throughbun run sync:skills. - Emil upstream edits are limited to greeting removal and the
prototypereal-route rule; each is recorded inUPSTREAM.mdand re-applied on refresh. - Vendored imagegen skills stay close to upstream; shadcn guidance lives in a design-phase reference.
- Upstream pins:
emilkowalski/skills@2d228630ba14,Leonxlnx/taste-skill@f624f37a8c65,shadcn-ui/ui@af983e842ab3. - Gate text follows
writing-for-agents.
Dependency Readiness
No Stack Required.
Branch/Base Intent
Not applicable. Skills changes land on skills main per the root shared-skills rule; this repository's changes land on branch design-phase-redesign from main a871c29e7.
Architecture Source
- URL: https://github.com/wearedevpunks/harness-intelligence/blob/16c8a2fbc359c5905174df887ea09559f0860868/apps/wiki/content/docs/project/specs/cli/design-phase-redesign/ARCHITECTURE.md
- Commit:
16c8a2fbc359c5905174df887ea09559f0860868 - Path:
apps/wiki/content/docs/project/specs/cli/design-phase-redesign/ARCHITECTURE.md - Content identity: sha256
967842ff684e282a…
Accepted Technical Decisions
- Gate set and removal of
approval/prototypegates (Q4, Q5). - Variant engine: adapted Emil
prototype, real route,?variant=, 3 default, cap 5 (Q1–Q3). - DESIGN.md template in Google Stitch format; shadcn Steps 3–7; NativeWind for Expo (Q9–Q11).
- Image ladder through Codex; directive as a reference (Q13, Q15).
- Motion Plan states
proposed → accepted → built → verified(Q16). - Quality gate composition and break-ui pass definition (Q21–Q23).
- Design-Owned UI Code boundary (Q6).
- Pack placement and removals (Q25, Q26).
Accepted Testing Decisions
- A skills-repo contract test asserts the
design-phasegraph shape, gate exits, and absence of HTML/branch/isolated-route prototype instructions (AC-001, AC-003, AC-004). - The Emil provenance test changes from byte identity to recorded-edit checks (AC-016, AC-017).
- Tests for removed skills are deleted with the skills (AC-016).
- CLI catalog tests and type checks cover pack membership (AC-018).
Verification Seams
- Skills repo files and
node --test tests/*.test.mjs(AC-001, AC-003–AC-017). write-graph-based-skillsauditphase output (AC-002).apps/cli/src/data/catalog/{packs,skills}.ts, CLI test and type-check commands (AC-018).- Sync receipt SHA versus skills
mainHEAD;BASELINE_CHANGELOG.md; wikicheck:contentandcheck:health(AC-019).
Parked Decisions
- Expo component base (
react-native-reusables,expo-ui, or plain NativeWind). Owner: user. Resume trigger: first Expo design run (Q11).
Decision Log
| Decision | Evidence | Rationale |
|---|---|---|
| Variants in the real app | Q1 | HTML and branch prototypes never became product code |
| design-phase commits UI; delivery adds logic | Q6 | No UI reimplementation |
| Codex image ladder | Q13 | Images were silently dropped |
| Greeting removal | Q24 | Child skills run autonomously inside the phase |
frontend pack ownership | Q26 | Design skills install together |