$npx -y skills add educlopez/ui-craft --skill finalizePre-ship gate — runs detector, verifies brief and tokens, applies the 10-pass finish bar, ranks findings by feedback hierarchy. Use when the user wants to ship, merge, or finalize a surface and needs a verdict (READY / NOT READY / BLOCKED) before committing. Invoke when the user
| 1 | <!-- HARNESS MIRROR — do not edit here. Canonical source: skills/ or commands/. After editing source, copy into cli/assets/<harness>/ and repo-root harness mirrors. --> |
| 2 | |
| 3 | **Context:** this sub-skill is one lens of the broader `ui-craft` skill. If the `ui-craft` skill is also installed, read its SKILL.md first for Discovery + Anti-Slop + Craft Test, then apply the specific lens below. |
| 4 | |
| 5 | Load the `ui-craft` skill. This command produces findings only — do NOT edit code. |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## Step 1 — Brief check (gate) |
| 10 | |
| 11 | Look for `.ui-craft/brief.md`. |
| 12 | |
| 13 | - Absent: STOP. Output: "No brief found. Run `/brief` first. `/finalize` requires a design brief to distinguish intentional decisions from findings." Do not proceed. |
| 14 | - Present: load it. Extract principles (numbered, in conflict-resolution order). These are the override registry for Steps 4–5. |
| 15 | |
| 16 | --- |
| 17 | |
| 18 | ## Step 2 — Detector |
| 19 | |
| 20 | Run `npx ui-craft-detect` on the target the user described (or current working surface if no argument). |
| 21 | |
| 22 | Capture all output. Every Critical detector finding maps directly to a block-ship finding in the report. Preserve detector source labels. |
| 23 | |
| 24 | --- |
| 25 | |
| 26 | ## Step 3 — Token check |
| 27 | |
| 28 | Quick three-question audit (no deep read required): |
| 29 | |
| 30 | 1. Are all three token layers present (primitives → semantic → component)? |
| 31 | 2. Are both light and dark modes explicitly authored (not inverted)? |
| 32 | 3. Are all seven token categories represented (color, spacing, radius, shadow, typography, motion, z-index)? |
| 33 | |
| 34 | Any "no": flag as Major. Do not block ship. Append a recommendation: "Run `/tokens` to close the gap at [category]." |
| 35 | |
| 36 | --- |
| 37 | |
| 38 | ## Step 3b — Craft-intent check (full surfaces only) |
| 39 | |
| 40 | Applies only when the target is a complete surface (dashboard, landing, auth, settings shell, portfolio) — skip for single components. |
| 41 | |
| 42 | 1. **Signature bet present?** Scan for exactly one memorable decision from `references/craft-intent.md` §3 (product / auth / marketing lists). Zero → **Major** ("no signature — surface is competent but anonymous; run `/bolder` or `/polish`"). Two or more competing → **Major** ("signature bets stack — keep the strongest, cut the rest"). |
| 43 | 2. **Variance matches surface?** Layout risk visibly inconsistent with the surface's DESIGN_VARIANCE default (e.g. experimental asymmetry on an auth form, or a landing that is one centered symmetric column) → **Major**, unless the brief or spec records the deviation. |
| 44 | 3. **Craft Read recorded?** If a `.ui-craft/spec.md` section or session declared a Craft Read, verify the built surface matches it (theme, variance, signature). Mismatch → **Major** with the specific delta. |
| 45 | |
| 46 | These findings are Major, never Critical — they gate NOT READY, not BLOCKED. |
| 47 | |
| 48 | --- |
| 49 | |
| 50 | ## Step 4 — Finish bar |
| 51 | |
| 52 | Load `references/finish-bar.md`. Run all 10 passes in document order. Do not reorder. |
| 53 | |
| 54 | **Knob behavior (apply before running):** |
| 55 | |
| 56 | - `CRAFT_LEVEL ≤ 6` AND user did not explicitly invoke `/finalize`: run Passes 1, 6, 8 only; mark remaining as N/A (knob-gated). |
| 57 | - `CRAFT_LEVEL ≥ 7` OR user explicitly invoked `/finalize`: run all 10 passes. |
| 58 | - `MOTION_INTENSITY ≤ 3`: Pass 7 = motion-gap audit only; do not fail on absent entrance animations. |
| 59 | - `VISUAL_DENSITY ≥ 8` AND brief documents compressed rhythm: Pass 4 accepts compressed spacing values. |
| 60 | |
| 61 | **For each pass:** |
| 62 | |
| 63 | - Collect findings. |
| 64 | - Assign severity per the severity map in `finish-bar.md` (Critical / Major / Minor). |
| 65 | - If a finding conflicts with a recorded principle in `brief.md`: downgrade to "Deferred per brief" and cite the exact principle. If no brief principle covers it, it remains a finding regardless. |
| 66 | - Record file:line when available. |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | ## Step 5 — Feedback hierarchy filter |
| 71 | |
| 72 | Load `references/review.md` Feedback Hierarchy section. |
| 73 | |
| 74 | Group all findings (detector + token + finish-bar) into three tiers: |
| 75 | |
| 76 | - **Value** — does the surface solve the problem the brief defines? |
| 77 | - **Ease of Use** — can the user accomplish the primary task? |
| 78 | - **Delight** — is it polished? |
| 79 | |
| 80 | If any Value findings exist: surface them first in the report and add a standing recommendation to defer all Delight findings until Value findings are resolved. This prevents polish work masking broken functionality. |
| 81 | |
| 82 | --- |
| 83 | |
| 84 | ## Step 6 — Output |
| 85 | |
| 86 | Print this report. Do not add preamble. |
| 87 | |
| 88 | ``` |
| 89 | ## Finalize report — <surface name> |
| 90 | |
| 91 | **Ship verdict:** READY / NOT READY / BLOCKED |
| 92 | |
| 93 | > BLOCKED = any Critical finding present. |
| 94 | > NOT READY = any Major finding present, no Critical. |
| 95 | > READY = zero Critical, zero Major (Minor explicitly accepted). |
| 96 | |
| 97 | ### Block-ship findings (must fix before merge) |
| 98 | - [Pass / detector source] — [finding] — [file:line if available] |
| 99 | |
| 100 | ### Major findings (fix or |