@12ui/design 0.2.55 → 0.2.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/SKILL.md +1 -1
  2. package/dist/cli-arguments.d.ts.map +1 -1
  3. package/dist/cli-arguments.js +1 -0
  4. package/dist/cli-arguments.js.map +1 -1
  5. package/dist/cli-conversion-derivation.d.ts +2 -1
  6. package/dist/cli-conversion-derivation.d.ts.map +1 -1
  7. package/dist/cli-conversion-derivation.js +9 -1
  8. package/dist/cli-conversion-derivation.js.map +1 -1
  9. package/dist/cli-convert-command.js +1 -1
  10. package/dist/cli-convert-command.js.map +1 -1
  11. package/dist/cli-draft-command.d.ts +11 -0
  12. package/dist/cli-draft-command.d.ts.map +1 -1
  13. package/dist/cli-draft-command.js +10 -1
  14. package/dist/cli-draft-command.js.map +1 -1
  15. package/dist/cli-help/design.d.ts +1 -1
  16. package/dist/cli-help/design.d.ts.map +1 -1
  17. package/dist/cli-help/design.js +7 -1
  18. package/dist/cli-help/design.js.map +1 -1
  19. package/dist/cli-help/index.d.ts +1 -1
  20. package/dist/cli-improve-command.d.ts.map +1 -1
  21. package/dist/cli-improve-command.js +252 -68
  22. package/dist/cli-improve-command.js.map +1 -1
  23. package/dist/cli-next-command.d.ts.map +1 -1
  24. package/dist/cli-next-command.js +44 -4
  25. package/dist/cli-next-command.js.map +1 -1
  26. package/dist/cli-usage.js +1 -1
  27. package/dist/improve-conversion-attempts.d.ts +92 -0
  28. package/dist/improve-conversion-attempts.d.ts.map +1 -0
  29. package/dist/improve-conversion-attempts.js +88 -0
  30. package/dist/improve-conversion-attempts.js.map +1 -0
  31. package/dist/improve-conversion-stage.d.ts +7 -0
  32. package/dist/improve-conversion-stage.d.ts.map +1 -1
  33. package/dist/improve-conversion-stage.js +197 -30
  34. package/dist/improve-conversion-stage.js.map +1 -1
  35. package/dist/improve-convert-resilience.d.ts +125 -0
  36. package/dist/improve-convert-resilience.d.ts.map +1 -1
  37. package/dist/improve-convert-resilience.js +165 -1
  38. package/dist/improve-convert-resilience.js.map +1 -1
  39. package/dist/improve-delivery-stages.d.ts.map +1 -1
  40. package/dist/improve-delivery-stages.js +1 -0
  41. package/dist/improve-delivery-stages.js.map +1 -1
  42. package/dist/improve-dom-diff.d.ts +2 -0
  43. package/dist/improve-dom-diff.d.ts.map +1 -1
  44. package/dist/improve-dom-diff.js +7 -0
  45. package/dist/improve-dom-diff.js.map +1 -1
  46. package/dist/improve-dom-gate.d.ts +7 -0
  47. package/dist/improve-dom-gate.d.ts.map +1 -1
  48. package/dist/improve-dom-gate.js +13 -0
  49. package/dist/improve-dom-gate.js.map +1 -1
  50. package/dist/improve-generation-stages.d.ts +3 -0
  51. package/dist/improve-generation-stages.d.ts.map +1 -1
  52. package/dist/improve-generation-stages.js +24 -7
  53. package/dist/improve-generation-stages.js.map +1 -1
  54. package/dist/improve-kit-assets.d.ts +129 -0
  55. package/dist/improve-kit-assets.d.ts.map +1 -0
  56. package/dist/improve-kit-assets.js +333 -0
  57. package/dist/improve-kit-assets.js.map +1 -0
  58. package/dist/improve-kit-readme.d.ts +11 -2
  59. package/dist/improve-kit-readme.d.ts.map +1 -1
  60. package/dist/improve-kit-readme.js +192 -26
  61. package/dist/improve-kit-readme.js.map +1 -1
  62. package/dist/improve-kit-stall.d.ts +67 -0
  63. package/dist/improve-kit-stall.d.ts.map +1 -0
  64. package/dist/improve-kit-stall.js +159 -0
  65. package/dist/improve-kit-stall.js.map +1 -0
  66. package/dist/improve-kit-status.d.ts +69 -0
  67. package/dist/improve-kit-status.d.ts.map +1 -0
  68. package/dist/improve-kit-status.js +145 -0
  69. package/dist/improve-kit-status.js.map +1 -0
  70. package/dist/improve-options.d.ts +10 -1
  71. package/dist/improve-options.d.ts.map +1 -1
  72. package/dist/improve-options.js +62 -15
  73. package/dist/improve-options.js.map +1 -1
  74. package/dist/improve-plan-annotated-render.d.ts +33 -0
  75. package/dist/improve-plan-annotated-render.d.ts.map +1 -0
  76. package/dist/improve-plan-annotated-render.js +175 -0
  77. package/dist/improve-plan-annotated-render.js.map +1 -0
  78. package/dist/improve-plan-annotator.d.ts +2 -1
  79. package/dist/improve-plan-annotator.d.ts.map +1 -1
  80. package/dist/improve-plan-annotator.js +21 -45
  81. package/dist/improve-plan-annotator.js.map +1 -1
  82. package/dist/improve-raster-layers-section.d.ts +21 -0
  83. package/dist/improve-raster-layers-section.d.ts.map +1 -0
  84. package/dist/improve-raster-layers-section.js +45 -0
  85. package/dist/improve-raster-layers-section.js.map +1 -0
  86. package/dist/improve-reset.d.ts +122 -0
  87. package/dist/improve-reset.d.ts.map +1 -0
  88. package/dist/improve-reset.js +141 -0
  89. package/dist/improve-reset.js.map +1 -0
  90. package/dist/improve-run-summary.d.ts +35 -0
  91. package/dist/improve-run-summary.d.ts.map +1 -0
  92. package/dist/improve-run-summary.js +134 -0
  93. package/dist/improve-run-summary.js.map +1 -0
  94. package/dist/improve-stage-shared.d.ts +5 -0
  95. package/dist/improve-stage-shared.d.ts.map +1 -1
  96. package/dist/improve-stage-shared.js.map +1 -1
  97. package/dist/improve-stop-handler.d.ts +73 -0
  98. package/dist/improve-stop-handler.d.ts.map +1 -0
  99. package/dist/improve-stop-handler.js +126 -0
  100. package/dist/improve-stop-handler.js.map +1 -0
  101. package/dist/improve-terminal-event.d.ts +118 -0
  102. package/dist/improve-terminal-event.d.ts.map +1 -0
  103. package/dist/improve-terminal-event.js +81 -0
  104. package/dist/improve-terminal-event.js.map +1 -0
  105. package/dist/improve-workspace.d.ts +15 -0
  106. package/dist/improve-workspace.d.ts.map +1 -1
  107. package/dist/improve-workspace.js +3 -0
  108. package/dist/improve-workspace.js.map +1 -1
  109. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  110. package/dist/legacy-skill-catalog.js +20 -0
  111. package/dist/legacy-skill-catalog.js.map +1 -1
  112. package/dist/redesign-capture.d.ts +16 -0
  113. package/dist/redesign-capture.d.ts.map +1 -1
  114. package/dist/redesign-capture.js +49 -3
  115. package/dist/redesign-capture.js.map +1 -1
  116. package/dist/run-journal-unfinished.d.ts +56 -0
  117. package/dist/run-journal-unfinished.d.ts.map +1 -0
  118. package/dist/run-journal-unfinished.js +126 -0
  119. package/dist/run-journal-unfinished.js.map +1 -0
  120. package/dist/run-journal.d.ts +25 -1
  121. package/dist/run-journal.d.ts.map +1 -1
  122. package/dist/run-journal.js +15 -1
  123. package/dist/run-journal.js.map +1 -1
  124. package/open-design.json +2 -2
  125. package/package.json +1 -1
  126. package/skills/12ui-design/SKILL.md +2 -0
  127. package/skills/12ui-design/improve.md +67 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12ui/design",
3
- "version": "0.2.55",
3
+ "version": "0.2.56",
4
4
  "type": "module",
5
5
  "description": "The canonical 12ui CLI, SDK, MCP server, and visual interface design skills",
6
6
  "main": "dist/index.js",
@@ -79,4 +79,6 @@ Use improve when one existing interface should get better end to end. Use draft
79
79
  12ui improve <url|image.png> --direction "<detailed style and goal>"
80
80
  12ui improve <url> --target <image.png|layerdoc.json>
81
81
 
82
+ The kit's README says what to keep and what to do if a stage stalled; read it before touching code.
83
+
82
84
  Only if needed, read `improve.md` for the full modes.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Use `improve` to make one existing interface better or pull a built page back to an approved design. It emits a target and implementation kit; it never edits the owning repository.
4
4
 
5
+ Generating a design is two commands, not one: the first draws candidates and stops, you look at them, and `--pick <slot>` finishes the run. Bringing your own design with `--target` is one command.
6
+
5
7
  ## Modes
6
8
 
7
9
  For a live page, pass its URL. The CLI captures the page and extracts a selector-verified DOM document in one local browser context. The plan maps design changes into the page's own selectors.
@@ -24,15 +26,28 @@ Never name emptiness or thin content as a defect. Models fabricate UI to fill it
24
26
 
25
27
  ## Candidates and picking
26
28
 
27
- Generate several real alternatives with `--candidates`; inspect them, then select one with `--pick`. The default is four candidates and pick A.
29
+ Generate several real alternatives with `--candidates` (2 to 16, default 4); inspect them, then select one with `--pick`. The floor is 2 because a draft draws alternatives to choose between — to work from a single design you already have, pass `--target` instead, which skips draft and pick.
30
+
31
+ `--pick` has no default. Run without it and the command stops after the draw, prints where the candidates are and the exact command that continues, and buys no conversion — converting a candidate nobody chose spends money on a guess, and a conversion cannot be cancelled once it starts. Two commands, and you look at the PNGs in between:
28
32
 
29
- 12ui improve <url> --candidates 4 --pick B --out-dir <kit-dir>
33
+ 12ui improve <url> --out-dir <kit-dir>
34
+ 12ui improve <url> --out-dir <kit-dir> --from pick --pick B
30
35
 
31
- The kit keeps every candidate. Re-pick without buying capture or draft again:
36
+ Pass `--pick` up front only when the choice is already made (a scripted run that takes whatever the draw gives). The kit keeps every candidate, so re-picking never buys capture or draft again:
32
37
 
33
38
  12ui improve <url> --out-dir <kit-dir> --from pick --pick C
34
39
 
35
- Picking is free. The new winner still needs its target conversion and plan; their stable keys replay any already-settled work instead of buying it twice.
40
+ Picking is free. The new winner still needs its target conversion and plan; their stable keys replay any already-settled work instead of buying it twice. Re-picking does discard the conversion the old winner paid for: there is no cancel, so that conversion keeps running and keeps billing, and its id is recorded in `improve.json` under `abandonedConversions` and shown in the kit's README.
41
+
42
+ ### Buying again: `--fresh` vs `--redraw`
43
+
44
+ `--fresh` re-buys **one conversion of the same settled winner** under a new idempotency key, records the abandoned conversion identity, and leaves capture, draft and pick untouched. It is for a stuck conversion of a design you still want.
45
+
46
+ `--redraw` re-buys **the whole draw**: it discards draft, pick, convert and plan, moves `candidates/` aside to `candidates.previous/`, and draws new candidates. It costs a full draft, so use it only when none of the candidates is worth picking.
47
+
48
+ 12ui improve <url> --out-dir <kit-dir> --redraw --direction "<new direction>"
49
+
50
+ `--redraw` is the one flag allowed to change what the draw is: `--direction`, `--candidates` and `--retain` may differ from what the kit recorded, and the new values are written down before the draft runs. Every other flag still has to match the record. Any conversion the redraw discards is appended to `abandonedConversions`, because it keeps running and keeps billing.
36
51
 
37
52
  ## Kit
38
53
 
@@ -45,6 +60,52 @@ Picking is free. The new winner still needs its target conversion and plan; thei
45
60
 
46
61
  URL plans pass only with at least 60% plausible DOM-side coverage after content, spatial, and neighbour matching. If the gate blocks, use `plan/GATE.md` to inspect the mismatch. The target HTML and LayerDoc remain a sidecar source of truth, but do not treat an unsafe selector mapping as an inline patch.
47
62
 
63
+ ## Using the kit
64
+
65
+ Read `README.md` first. It carries the run's honest status, the assets table for this kit, and the recovery commands when a stage did not settle. The table's ship column is the instruction: copy the files marked ship, keep one of any alternate resolution, and read the references without shipping them.
66
+
67
+ Plates and cutouts arrive at full resolution and run over a megabyte. Pick one resolution per layer and optimise the PNG — or convert it to WebP where the repository already uses one — before committing, keeping the filename stem so the plan still matches.
68
+
69
+ ### Asset roles
70
+
71
+ - clean plate (`clean-N`): the backdrop with the foreground artwork removed. Use it as the background layer, at full strength. A conversion can emit several: only the base plate is the page's background, and the README marks every other one an alternate backdrop — use it only if you omit the layer it removed as well.
72
+ - cutout (`cutout-N`): the foreground artwork as an alpha PNG. This is the imagery. Copy it into the repo and place it at its bounds; never redraw it in CSS.
73
+ - upscaled plate / upscaled region (`upscaled-*`): a higher-resolution copy of a plate or region for crisp rendering; pick one resolution, do not ship both.
74
+ - source crop (`crop-N`): the layer cropped straight out of the source image; prefer that layer's cutout when one exists.
75
+ - `winner.png`: the whole design; the reference for every visual decision.
76
+
77
+ ### Raster first
78
+
79
+ When the target LayerDoc declares a raster layer, copy its file into the repository and reference it. Never approximate an existing asset with CSS. A hero can be a single plate or a single cutout, and the plan lists them before tokens for that reason. Keep any scrim light — at most 35% opacity — and state in your report why one is used.
80
+
81
+ ### When a stage stalls
82
+
83
+ Wait to the bound the CLI prints; never stop a conversion inside its typical window. `--convert-stall-seconds` bounds each hosted wait the convert stage makes, including the free fixed-layout derivation; it defaults to twice the model's typical wall (480s standard and pro, 300s fast). At the bound the CLI either derives fixed-layout HTML free from a LayerDoc that did land, or — when nothing landed and there is nothing to derive — records the abandoned conversion and dispatches exactly one fresh one.
84
+
85
+ That retry is the kit's, not the run's. Resuming with `--from convert` re-attaches to the newest conversion the kit already bought rather than buying another; a kit that has spent its retry refuses to dispatch again and says how many conversions it has bought; and `--convert-model pro` gets no automatic retry at all, because no measured typical wall justifies one. `--fresh` is the deliberate way to buy one more.
86
+
87
+ Past that, `plan/STALL.md` names the stage, the hosted run, any abandoned conversions, and the recovery, each command annotated with what it spends:
88
+
89
+ 12ui improve <same input> --out-dir <kit> --from convert # resumes; settled stages replay
90
+ 12ui convert <kit>/winner.png --output html # buys one conversion
91
+ 12ui improve <url> --target <kit>/winner.png # buys one fused target conversion
92
+
93
+ The third form is offered for a URL input only. Do not approximate the design in CSS from the PNG while a stage is incomplete; resume or convert first.
94
+
95
+ A stopped run writes the same `STALL.md` and README as a stalled one, at whatever stage it had reached (a signal that arrives after the last requested stage settled writes no `STALL.md` — that run is complete), and closes the kit's `journal.jsonl` with a terminal event naming the stop or the stall. `12ui next <kit>` reads that event and still reports the hosted run as live, because it is: stopping the CLI does not stop the conversion, and there is no cancel — an abandoned conversion runs to completion and bills. Its id is recorded in `improve.json` under `abandonedConversions`. A conversion the stopped run was still waiting on is not abandoned: `--fresh` and the stall retry write their idempotency key to `conversionAttempts` before dispatching, so `STALL.md` names the run the resume attaches to and `--from convert` re-attaches to it instead of buying another. SIGKILL is the exception: it runs no handler, so the kit is not written and the journal's last progress line is the record.
96
+
97
+ ### When the coverage gate blocks
98
+
99
+ `plan/GATE.md` replaces `plan-annotated.md` and `token-patch.css` when the captured page and the target are too far apart to anchor. Nothing is missing: the target, its assets, and the raster layers to carry are all still in the kit, and `GATE.md` lists them. Read it, carry the raster layers, and re-capture the page in the state the target depicts before asking for an anchored plan again.
100
+
101
+ ### Fidelity self-check
102
+
103
+ Before committing, screenshot the page and put it beside `winner.png`. Health checks — legibility, console, tests — do not answer whether the design landed.
104
+
105
+ ### Never discard
106
+
107
+ `winner.png`; every cutout and plate the assets table names; all real content, data, controls, routes, and tests.
108
+
48
109
  ## Replay and pricing
49
110
 
50
111
  Stages run capture, draft, pick, convert, then plan. Resume with `--from` and `--to`; settled stages replay and never buy again. Run `--dry-run` first for a zero-network, per-stage ceiling.
@@ -55,9 +116,10 @@ Current ceilings are $0.001 for corpus search, $0.001 for the hosted plan, $0.06
55
116
 
56
117
  ### Improve in place
57
118
 
58
- Run against the existing page with no reference. State the intended style precisely, inspect the candidates, then apply the selector-anchored plan in the owning repository.
119
+ Run against the existing page with no reference. State the intended style precisely. The first command stops at the draw; look at the candidate PNGs, then pick one and let it finish, and apply the selector-anchored plan in the owning repository.
59
120
 
60
121
  12ui improve <url> --direction "<detailed style-anchored direction>" --repo <repo> --out-dir <kit-dir>
122
+ 12ui improve <url> --repo <repo> --out-dir <kit-dir> --from pick --pick <slot>
61
123
 
62
124
  ### Restore after build
63
125