Design Phase Redesign
Architecture: Design Phase Redesign
Context Scope
- Capability identity:
apps/wiki/content/docs/project/specs/cli/design-phase-redesign. The capability replaces the Baselinedesign-phaseskill with a graph that turns brand evidence into committed, quality-checked UI code in the real app. - Actors and outcome: the operating agent runs the gates; the user judges brand boards, compositions, and variant rounds;
delivery-phaseconsumes the committed UI. The outcome is UI that iterates inside the real app and reaches delivery as code, not as images or throwaway HTML (Q1, Q6). - In scope: the
design-phasegraph inwearedevpunks/skills; vendored upstream design skills and their provenance; removal ofgpt-tasteandimprove-mobile-frontend; thefrontendpack catalog; thedelivery-phaserule for Design-Owned UI Code; Baseline sync, changelog, and wiki pages. - Non-goals: the Expo component library choice (parked, Q11); changes to Finder's
prototype-phaseor Matt'sprototype(Q2); a new image tool runtime in the CLI (Q13). - Spec: sibling
SPEC.mdin this folder (codes mapped in Spec Traceability).
Canonical Terms
The terms come from the published glossary and Glossary Q29: Variant Round, Variant, Verdict, Promote, Design-Owned UI Code, Brand Kit, Composition, Motion Plan, Quality Gate, shadcn-Primitive Directive.
- A Variant Round contains 3 to 5 Variants. Promote follows exactly one
keepVerdict and produces Design-Owned UI Code. Each Composition has at most one Motion Plan. - Axioms: every variant lives in the real app on the real route;
delivery-phasenever reimplements Design-Owned UI Code; no variant reaches the verdict before it passes the quality gate, and none is promoted before a full break-ui pass; image generation never silently falls back; approval is never inferred from artifact existence.
Sources
| Source | Role | Exact location anchor | Immutable revision or content hash |
|---|---|---|---|
| S1 | Grill status and closure | apps/wiki/content/docs/project/grilling/design-phase-redesign-grill-status.md#phase-state | commit 7824b8edd044; sha256 ab5e801ab1e37547… |
| S2 | Grill decision log | apps/wiki/content/docs/project/grilling/design-phase-redesign-grill-log.md Q1–Q28, Glossary Q29 | commit 7824b8edd044; sha256 f99b8eaa6ff2de89… |
| S3 | Published glossary | apps/wiki/content/docs/project/domains/design-phase-redesign-glossary.mdx | commit 7824b8edd044; sha256 43a39e90f1d3258b… |
| S4 | Current design-phase skill | wearedevpunks/skills skills/phases/design-phase/** | e3b774bbeef6 |
| S5 | Emil Kowalski skills | emilkowalski/skills skills/{prototype,break-ui,mobile-native,emil-design-eng,find-animation-opportunities,animate,animate-expo,review-animations} | 2d228630ba14 |
| S6 | taste-skill | Leonxlnx/taste-skill skills/{brandkit,redesign-skill,taste-skill,imagegen-frontend-web,imagegen-frontend-mobile,image-to-code-skill,output-skill} | f624f37a8c65 |
| S7 | shadcn skill | shadcn-ui/ui skills/shadcn/{SKILL,design-system,design-system-page}.md | af983e842ab3 |
| S8 | CLI pack catalog and install trigger | apps/cli/src/data/catalog/{packs,skills}.ts; apps/cli/src/registry/shape.ts:surfaceApplies | branch base a871c29e7 |
Source Disposition
| Item | Disposition | Replacement or reason | Source |
|---|---|---|---|
Gate approval | superseded | Folded into verdict + promote | Q5 |
Gate prototype (delegates to $prototype) | superseded | variant-round with the adapted Emil prototype | Q1, Q2 |
Image fallback to $prototype | superseded | Codex ladder, then block | Q13 |
| Expo component base | parked | Owner: user; resume when Expo design work starts | Q11 |
stitch-design-taste skill | rejected | DESIGN.md template owned by design-phase | Q9 |
Whole System
Question: which owners change, and how does design output reach delivery?
Conclusion: design-phase writes into the target app and its handoff. delivery-phase reads the committed UI. All skill text lives in the skills repo; this repo owns the catalog and distribution (Q6, Q26).
Architecture Blocks
| Selector | Owner | Authority and mutation rights | Accepted boundary | Constraint and evidence |
|---|---|---|---|---|
| ARC-001 design-phase graph | skills repo skills/phases/design-phase | SKILL.md bootstrap, flat phases/ with router.md and one file per gate: intake, grill, brand, design-system, compose, motion-plan, variant-round, quality-gate, verdict, promote, backlog, delivery-handoff. Files approval.md and prototype.md are removed. AUTHORING-HANDOFF.md records authoring. Invocation stays explicit-only | Router selects exactly one gate from current evidence | write-graph-based-skills structure; Q4, Q5 |
| ARC-002 Design handoff | design-phase | One durable handoff beside SPEC.md in the resolved spec folder. When no spec exists yet, the folder is reserved by create-spec folder-naming, as for ARCHITECTURE.md. Holds gate outcomes, round counter, verdicts, Motion Plan ledger, artifact index. Images become durable through repo-asset-management | Router reads it on every entry, including cold resume | Q27, Q16. Illustrative: file name DESIGN-HANDOFF.md |
| ARC-003 Brand and design-system references | design-phase/references | DESIGN.md template in Google Stitch DESIGN.md format. The brand gate runs brandkit; the design-system gate fills the template, then runs shadcn design-system.md Steps 3–7 in the existing app, or shadcn init without --template when components.json is absent. Expo writes a NativeWind theme config | Brand skips when fresh brand artifacts exist | Q8, Q9, Q10, Q11, Q12 |
| ARC-004 Image generation reference | design-phase/references | Ladder: own image tool when the agent is Codex → T3 delegate_task to provider codex → codex exec when installed → block with reason. No fallback to code or HTML | Used by brand and compose | Q13 |
| ARC-005 shadcn-Primitive Directive | design-phase/references | Text appended to every image brief: compose screens from shadcn primitives and the accepted DESIGN.md tokens. Vendored imagegen skills stay close to upstream | compose brief | Q15, Q14 |
| ARC-006 Variant engine | vendored Emil prototype (adapted) | Builds 3 variants by default, cap 5, each on a named divergence axis, on the real route behind a dev-only ?variant= switch on the working branch. Verdict vocabulary riff, combine, keep, reject. The isolated /prototypes/<slug> rule is replaced | Called only by variant-round and promote | Q1, Q2, Q3 |
| ARC-007 Variant-round and quality-gate skill set | design-phase gates | variant-round: shadcn components, design-taste-frontend (always), image-to-code, emil-design-eng, animate or animate-expo, mobile-native (web), redesign-existing-projects only on existing-UI intent. quality-gate: light break-ui, mobile-native checklist, review-animations, copy lens, Motion Plan conformance; pass/fail per variant | Only passing variants reach the verdict | Q17–Q23 |
| ARC-008 Copy lens reference | design-phase/references | Taste v2 references/copy.md rules plus the imagegen "Copy AI tells" list. full-output-enforcement stays a separate guard against truncated code | Used by compose and quality-gate | Q22 |
| ARC-009 Vendored skills and provenance | skills repo skills/agnostic/frontend/*, skills/frameworks/expo/animate-expo | Emil at one shared pin: prototype, break-ui + CATALOG.md, mobile-native, emil-design-eng, find-animation-opportunities, refreshed animate, animate-expo, review-animations. taste-skill: brandkit, refreshed redesign-existing-projects, full-output-enforcement. shadcn: shadcn with rules/, design-system.md, design-system-page.md, scripts/. "Initial Response" greetings removed; each UPSTREAM.md records its edits; the provenance test checks the stated diff. gpt-taste and improve-mobile-frontend removed with tests and references | Upstream refresh re-applies recorded edits | Q24, Q25, Q22 |
| ARC-010 Frontend pack catalog | apps/cli/src/data/catalog/{packs,skills}.ts | design-phase moves from planning to frontend. frontend lists every design skill above, including shadcn. animate-expo stays in expo. Catalog entries exist for each vendored skill and none for removed skills | The frontend surface pack installs when nextjs or react is detected | Q26; S8 |
| ARC-011 Delivery rule | skills repo delivery-phase, implement-spec | Design-Owned UI Code is accepted input. Delivery adds logic, data, and the rest of the requirement; it changes design-owned files only to fix a defect and records each change | delivery-handoff brief names the promote commit | Q6 |
| ARC-012 Baseline distribution | apps/cli sync, root BASELINE_CHANGELOG.md, apps/wiki | Skills commit on skills main → bun run sync:skills with matching receipt SHA → baseline Unreleased notes → wiki Harness pages for design-phase and skill packs | Release classification selects baseline | Root CLAUDE.md shared-skills rule; Q26 |
Critical Flows and Boundaries
FLOW-001 Design run
Question: in which order do gates run, and where does the user stop the run?
- FLOW-001-STEP-001: intake records surface (web or Expo), existing-UI intent, routes,
components.json, DESIGN.md, theme, brand artifacts, and screenshots, with confidence (Q18, Q11). - FLOW-001-STEP-002: a lean
requirements-grillcloses scope units and constraints. Unchanged from the current skill (S4). - FLOW-001-STEP-003: brandkit boards through ARC-004; the user accepts them (Q8, Q28).
- FLOW-001-STEP-004: DESIGN.md, then theme and component variants (ARC-003); browser check; shown without a stop (Q12).
- FLOW-001-STEP-005: web and mobile compositions per scope unit with DESIGN.md, ARC-005, and ARC-008; the user accepts them (Q14).
- FLOW-001-STEP-006:
find-animation-opportunitieswrites Motion Plan entries asproposed; accepted entries becomeaccepted(Q16). - FLOW-001-STEP-007: full break-ui, rewrite in place, remove the switch, keep worst-case fixtures dev-only, commit, write the approved artifact contract (Q7).
- FLOW-001-STEP-008: link the promote commit and artifacts to existing backlog items, or return new scope to
requirements-phase. Unchanged rule (S4). - FLOW-001-STEP-009: the brief states that UI is committed and delivery adds logic only (ARC-011); stop for explicit
$delivery-phaseinvocation.
Conclusion: the user stops the run three times (brand, compose, verdict). Every other gate validates itself and returns to the router (Q28).
FLOW-002 Variant loop
Question: how does iteration stay inside the design flow?
- FLOW-002-STEP-001: build the round's variants (ARC-006, ARC-007), increment the round counter in ARC-002, set Motion Plan entries to
built(Q3, Q4). - FLOW-002-STEP-002: quality gate per variant; conforming Motion Plan entries become
verified(Q21, Q23). - FLOW-002-STEP-003: the user gives the verdict on passing variants only.
keepis the approval (Q5).
Conclusion: keep → promote is the only path to code, so later edits never leave the design flow. A reject returns to the router, which applies the re-entry rule: compose when the layout changes, otherwise variant-round (Q4).
FLOW-003 Image generation ladder
FLOW-003-STEP-001 agent is Codex? → use own image tool
FLOW-003-STEP-002 inside T3? → delegate_task(provider: codex) with the image brief
FLOW-003-STEP-003 `codex exec` installed? → run it with the image brief
FLOW-003-STEP-004 none → gate outcome blocked, reason recorded in ARC-002Conclusion: every image either comes from Codex or the gate blocks visibly (Q13).
FLOW-004 Later visual change and delivery consumption
- FLOW-004-STEP-001: a later visual change re-enters
design-phase. The router selectscomposewhen the layout changes, otherwisevariant-round(Q4). - FLOW-004-STEP-002:
delivery-phasestarts from the promote commit, treats Design-Owned UI Code as accepted input, and records any defect fix to it (ARC-011, Q6).
FLOW-005 Skill source to Baseline
FLOW-005-STEP-001 skills main: vendor (ARC-009), graph (ARC-001), rule (ARC-011), tests → commit, push
FLOW-005-STEP-002 harness-intelligence: bun run sync:skills → receipt SHA = skills main HEAD
FLOW-005-STEP-003 catalog (ARC-010), BASELINE_CHANGELOG Unreleased, wiki pages (ARC-012)
Conclusion: skill text never starts in apps/cli/skills; the sync receipt proves which skills commit the CLI ships (root CLAUDE.md shared-skills rule).
Accepted Detail Coverage
| Question + exact entry/evidence anchor | Exact accepted choice | Provided rationale / alternatives | Architecture selector | System constraint served |
|---|---|---|---|---|
| Q1 | Real app, real route, working branch, dev-only ?variant=; no standalone HTML, prototype branch, or isolated route | Current HTML and branch output rejected | ARC-006, FLOW-002 | Variants are already production-shaped code |
| Q2 | Emil prototype adapted; verdicts riff/keep/combine/reject; Matt's prototype unused by design-phase | Emil's variant loop preferred | ARC-006, ARC-009 | One variant engine |
| Q3 | Default 3, cap 5; mobile and desktop widths | Emil's cap | ARC-006 | Comparable rounds |
| Q4 | Explicit loop; round counter and ledger in handoff; re-entry at compose or variant-round | not recorded | FLOW-002, FLOW-004-STEP-001, ARC-002 | Iteration survives cold resume |
| Q5 | approval gate removed; keep = approval; promote writes contract | Avoid a second approval ask | ARC-001, FLOW-002-STEP-003 | No inferred approval |
| Q6 | design-phase commits UI; delivery adds logic, edits design files only for recorded defect fixes | User-directed boundary change | ARC-011, FLOW-004-STEP-002 | No UI reimplementation |
| Q7 | Full break-ui → rewrite in place → remove switch → keep fixtures dev-only → commit + contract | not recorded | FLOW-001-STEP-007 | Regression fixtures persist |
| Q8 | brandkit first via Codex; skip when fresh; human accept | Brand defines the design | ARC-003, FLOW-001-STEP-003 | Identity before screens |
| Q9 | design-phase DESIGN.md template, Google Stitch format; no stitch-design-taste | shadcn only reads DESIGN.md | ARC-003 | One DESIGN.md author |
| Q10 | shadcn component base; Steps 3–7 in existing app; shadcn init without --template when components.json absent | Step 1 makes a new app | ARC-003, FLOW-001-STEP-004 | Theme lands in the real app |
| Q11 | Expo: NativeWind theme config; component base parked | "not an issue right now" | ARC-003; Parked Work | Expo support without a library decision |
| Q12 | design-system validates and shows without a stop | not recorded | FLOW-001-STEP-004 | Fewer human stops |
| Q13 | Codex ladder: own tool → T3 delegate_task → codex exec → block | No silent fallback | ARC-004, FLOW-003 | Images never disappear silently |
| Q14 | Web + mobile imagegen by default; brief has DESIGN.md, directive, copy lens; human accept | not recorded | FLOW-001-STEP-005 | Both surfaces designed |
| Q15 | Directive is a design-phase reference appended to briefs | Keep imagegen near upstream | ARC-005 | Images map to shadcn code |
| Q16 | find-animation-opportunities after compose; ledger proposed → accepted → built → verified | "STATEFULLY" | ARC-002, FLOW-001-STEP-006, FLOW-002 | Motion is tracked to proof |
| Q17 | design-taste-frontend always active | User override of scope line | ARC-007 | Taste on every surface |
| Q18 | redesign-existing-projects only on existing-UI intent | not recorded | ARC-007, FLOW-001-STEP-001 | Intent-scoped redesign |
| Q19 | mobile-native mandatory for responsive web; remove improve-mobile-frontend | Keep Emil's | ARC-007, ARC-009 | One mobile authority |
| Q20 | variant-round skill composition | not recorded | ARC-007 | Complete craft set |
| Q21 | Light break-ui per variant; full before promote; pass = no open breaks, decisions closed, fixture dev-only | Cost balance | ARC-007, FLOW-002-STEP-002, FLOW-001-STEP-007 | Every element passes break-ui |
| Q22 | Copy lens = taste copy.md + Copy AI tells; keep full-output-enforcement | output-skill does not check copy | ARC-008, ARC-009 | Copy checked; no truncated code |
| Q23 | Quality gate check set; only passing variants reach the verdict | not recorded | ARC-007, FLOW-002-STEP-002 | User judges only sound variants |
| Q24 | Vendor list at shared Emil pin; greetings removed; UPSTREAM.md edits; provenance test checks diff | Skills run autonomously in a phase | ARC-009 | Predictable child-skill runs |
| Q25 | Remove gpt-taste, improve-mobile-frontend | Duplicates | ARC-009 | No dead skills |
| Q26 | design-phase + all design skills incl. shadcn in frontend; animate-expo stays in expo | not recorded | ARC-010 | Skills install together |
| Q27 | Handoff beside SPEC.md; images via repo-asset-management | not recorded | ARC-002 | Durable, discoverable state |
| Q28 | Human stops: brand, compose, verdict | not recorded | FLOW-001 | Bounded user effort |
| Glossary Q29 | Canonical terms and axioms | "prototype" ambiguity | Canonical Terms | One vocabulary |
Spec Traceability
- State: complete. Every current OUT and AC code in the sibling
SPEC.mdmaps below.
| Spec code / section selector | Architecture selectors | Accepted grill Q / exact log-entry evidence anchors | Coverage explanation |
|---|---|---|---|
OUT-001 (SPEC #out-001) | ARC-001, FLOW-001 | Q4, Q5 | Graph structure and gate set |
OUT-002 (SPEC #out-002) | ARC-006 | Q1 | Real-route variant engine |
OUT-003 (SPEC #out-003) | FLOW-002, FLOW-004-STEP-001, ARC-002 | Q3, Q4, Q5 | Loop, verdicts, re-entry, round counter |
OUT-004 (SPEC #out-004) | ARC-003, FLOW-001-STEP-003, FLOW-001-STEP-004 | Q8, Q9, Q10, Q11, Q12 | Brand then DESIGN.md then theme |
OUT-005 (SPEC #out-005) | ARC-004, ARC-005, ARC-008, FLOW-003, FLOW-001-STEP-005 | Q13, Q14, Q15, Q22 | Codex ladder and composition briefs |
OUT-006 (SPEC #out-006) | FLOW-001-STEP-006, FLOW-002-STEP-001, FLOW-002-STEP-002 | Q16 | Motion Plan ledger states |
OUT-007 (SPEC #out-007) | ARC-007 | Q17, Q18, Q19, Q20 | Variant-round skill set |
OUT-008 (SPEC #out-008) | ARC-007, ARC-008, FLOW-002-STEP-002 | Q21, Q22, Q23 | Quality gate before verdict |
OUT-009 (SPEC #out-009) | FLOW-001-STEP-007, ARC-011, FLOW-004-STEP-002 | Q6, Q7 | Promote commit and delivery boundary |
OUT-010 (SPEC #out-010) | ARC-002 | Q27, Q16 | Durable handoff beside SPEC.md |
OUT-011 (SPEC #out-011) | ARC-009 | Q24, Q25, Q22 | Vendored set, provenance, removals |
OUT-012 (SPEC #out-012) | ARC-010, ARC-012, FLOW-005 | Q26 | Pack catalog and distribution |
AC-001 (SPEC #ac-001) | ARC-001 | Q5 | Gate files present; approval/prototype gates absent |
AC-002 (SPEC #ac-002) | ARC-001, FLOW-001 | Q4 | Graph audit |
AC-003 (SPEC #ac-003) | ARC-006 | Q1 | No HTML, branch, or isolated route |
AC-004 (SPEC #ac-004) | FLOW-002, ARC-006 | Q3, Q4 | Verdict routes; variant count |
AC-005 (SPEC #ac-005) | FLOW-004-STEP-001, ARC-002 | Q4 | Re-entry and cold resume |
AC-006 (SPEC #ac-006) | FLOW-001-STEP-003, ARC-004 | Q8, Q28 | Brand gate |
AC-007 (SPEC #ac-007) | ARC-003, FLOW-001-STEP-004 | Q9, Q10, Q11, Q12 | Design-system gate |
AC-008 (SPEC #ac-008) | ARC-004, FLOW-003 | Q13 | Image ladder |
AC-009 (SPEC #ac-009) | FLOW-001-STEP-005, ARC-005, ARC-008 | Q14, Q15 | Compose briefs |
AC-010 (SPEC #ac-010) | FLOW-001-STEP-006, FLOW-002-STEP-001, FLOW-002-STEP-002 | Q16 | Motion Plan transitions |
AC-011 (SPEC #ac-011) | ARC-007 | Q17, Q18, Q19, Q20 | Skill conditions |
AC-012 (SPEC #ac-012) | ARC-007, FLOW-002-STEP-002, FLOW-001-STEP-007 | Q21, Q23 | Quality gate and full break-ui |
AC-013 (SPEC #ac-013) | FLOW-001-STEP-007, FLOW-001-STEP-009 | Q7 | Promote output |
AC-014 (SPEC #ac-014) | ARC-011, FLOW-004-STEP-002 | Q6 | Delivery rule |
AC-015 (SPEC #ac-015) | ARC-002 | Q27 | Handoff location |
AC-016 (SPEC #ac-016) | ARC-009 | Q24, Q25 | Vendored set and removals |
AC-017 (SPEC #ac-017) | ARC-009 | Q24 | Provenance test |
AC-018 (SPEC #ac-018) | ARC-010 | Q26 | Pack catalog |
AC-019 (SPEC #ac-019) | ARC-012, FLOW-005 | Q26 | Sync, changelog, wiki |
Flow Failure Coverage
| Lens | Evidence / unknown / justified not applicable | Guarantee at stake | Material unresolved gap |
|---|---|---|---|
| Entry points and path convergence | Explicit-only invocation; every entry, resume, and later visual change goes through router (ARC-001, FLOW-004-STEP-001, Q4) | One rule set per entry | None |
| Critical execution paths | FLOW-001 order and three human stops (Q28) | Brand before screens before code | None |
| State ownership and authority | ARC-002 owned by design-phase; Design-Owned UI Code owned by design until promote, then accepted delivery input (ARC-011) | No double authorship | None |
| Transaction and side-effect boundaries | Promote is the one commit boundary (Q7). Unknown: whether variant rounds also commit is not recorded; variants stay dev-only behind ?variant= | Switch never ships | None (non-material) |
| Concurrency and stale state | One run per scope unit; the router re-derives from current artifacts and staleness rules (S4). Concurrent runs on one route: not recorded | Fresh evidence | None (non-material) |
| Idempotency and retries | Brand skips when fresh (Q8); gates reuse fresh artifacts; the round counter increments only in FLOW-002-STEP-001 | Re-run does not duplicate a round | None |
| Partial failure and recovery | Image ladder blocks visibly (FLOW-003-STEP-004); a failing variant returns to variant-round; a failed promote leaves the kept variant behind the switch | No silent fallback | None |
| Execution lifetime and durability | Handoff and ledger beside SPEC.md; images via repo-asset-management (Q27) | Cold resume | None |
| Lifecycle and dependency transitions | Removal of gpt-taste, improve-mobile-frontend, approval.md, prototype.md with references and tests; upstream refresh re-applies UPSTREAM.md edits (Q24, Q25); frontend installs only on nextjs/react (S8) | No dangling references | None |
| Completion and observability | Gate handoffs with outcome; promote commit + artifact contract; Motion Plan verified; sync receipt SHA (FLOW-005-STEP-002) | Distinguish built, verified, promoted | None |
Parked Work and Non-material Unknowns
| Question / source | Disposition and scope consequence | Owner / resume trigger | Why current guarantees remain closed |
|---|---|---|---|
| Q11 Expo component base | Parked; Expo gets a NativeWind theme only | User; first Expo design run | Theme output is accepted without a component library |
| Q13 Codex child image tool | User-asserted, unverified runtime behavior | Implementer; first brand run | The ladder blocks visibly when it fails |
| Variant-round commits | Not recorded | Implementer; write-graph-based-skills authoring | Promote remains the only required commit |
Validation
- Decision/source/glossary reconciliation: Q1–Q28 and Glossary Q29 match S1–S3 at commit
7824b8edd044; status closure and glossary terms agree. - Exact-detail cross-level coverage: every accepted Q has a row in Accepted Detail Coverage.
- Relative links, selector targets, visual source/order checks: grill links use
#q<N>heading anchors; every ARC/FLOW/STEP selector has an explicit<a id>. - Spec-code → architecture → grill coverage: complete for OUT-001..OUT-012 and AC-001..AC-019.
- Mermaid parsing/rendering: all three diagrams rendered to SVG with
@mermaid-js/mermaid-cli@11(mmdc), 2026-10-16. - Existing spec agreement:
cli/IP-273-design-phase-asset-evidencekeeps durable asset and backlog rules that ARC-002 and FLOW-001-STEP-008 reuse; its prototype routing is superseded by FLOW-002. - Remaining limits: the non-material unknowns above.