synthesisui 0.16.141 → 0.16.145

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.
@@ -0,0 +1,226 @@
1
+ /**
2
+ * A SKILL DA PRIMEIRA CORRIDA, como o CLI a distribui.
3
+ *
4
+ * Mesmo motivo do `skill-import.ts`: o build é `tsc` e nada mais, então um `.md` precisaria de um
5
+ * passo de cópia que pode silenciosamente não rodar. Um módulo TypeScript não pode falhar em ser
6
+ * empacotado.
7
+ *
8
+ * ESTA É A FONTE. A cópia em `.claude/skills/` é o que o nosso editor lê, e o spec assere que as duas
9
+ * são idênticas - então divergência fica vermelha em vez de embarcar uma skill que descreve um fluxo
10
+ * que o produto não tem.
11
+ *
12
+ * E ela é instalada pelo `connect` junto com a de import, de propósito: uma skill que exige reiniciar
13
+ * o editor para aparecer é uma skill que ninguém usa na primeira corrida, que é a única em que ela
14
+ * serve (dono, 05/08).
15
+ */
16
+ export const INIT_SKILL = `---
17
+ name: sui-init
18
+ description: The first run - wire the agent, choose what to import, and hand back a system that is already optimised. Use when somebody has just installed SynthesisUI and has no system yet ("/sui-init", "set me up", "começar", "importar meu projeto"). Asks everything up front, measures while asking, and ends in four lines.
19
+ ---
20
+
21
+ # The first run
22
+
23
+ One conversation, and at the end they have a design system built out of their own code, with our
24
+ optimisations applied and a way back to the untouched version.
25
+
26
+ The purpose that decides every tie below: **read their repository and give it back as recipes with
27
+ visual, semantic and functional parity, without supposing and without inventing anything.**
28
+
29
+ \`CLAUDE.md\` rules. When the two disagree, this file is the one that is out of date.
30
+
31
+ ---
32
+
33
+ ## THE SHAPE OF THIS RUN, AND WHY IT IS THIS SHAPE
34
+
35
+ Four questions, asked before anything that needs an answer. Then silence, then four lines.
36
+
37
+ \`\`\`
38
+ 1 environment which agent they work in - and what that agent can actually get
39
+ 2 authorisation may we optimise after importing, and which parts
40
+ 3 project WHICH folder becomes the system (the only unavoidable choice)
41
+ 4 identity name, primary, theme - each already answered by the census
42
+ ---- nobody waits from here on ----
43
+ import v1 -> freeze v1 -> apply what they authorised -> four lines
44
+ 5 offer put the tokens back into their code
45
+ \`\`\`
46
+
47
+ **Every question is asked before the work, and the work starts during the questions.** A person who
48
+ answers four things in ninety seconds and then watches one bar has had a good four minutes; the same
49
+ person interrupted twice mid-silence has had a bad twenty (dono, 01/08).
50
+
51
+ **What runs in parallel, precisely.** The UNSCOPED census - \`npx synthesisui import --dry\` - needs no
52
+ answer and discovers the candidate projects, so start it the moment question 1 is on screen. The
53
+ SCOPED census needs question 3, and no amount of wishing makes it earlier. Do not promise more
54
+ parallelism than that: a progress bar waiting on a person is worse than a question.
55
+
56
+ ---
57
+
58
+ ## 1. ENVIRONMENT
59
+
60
+ Ask, because it changes what you install and it changes what you promise. Do not pretend the answers
61
+ are equivalent - they are not, and a Design System Lead spots that in one minute.
62
+
63
+ \`\`\`
64
+ Which agent do you work in?
65
+
66
+ Claude Code (recommended if you have it)
67
+ rules + 11 tools + THE CHECK: after every file write, a hook measures what you
68
+ wrote and hands the result back into the conversation. No other agent has this.
69
+ Cursor
70
+ rules (.cursor/rules) + the same 11 tools (.cursor/mcp.json). No post-write check -
71
+ Cursor has no hook that feeds context back, so the rules are read, not enforced.
72
+ Something else
73
+ rules in AGENTS.md, which most agents read. Tell me which one and I will say
74
+ honestly whether its tool format is one we know.
75
+ \`\`\`
76
+
77
+ **Never invent a config path.** If they name an agent whose format is not in that list, say so and
78
+ write \`AGENTS.md\` only. Writing a file into the wrong place is worse than not writing it: it looks
79
+ like support and delivers nothing.
80
+
81
+ Then wire it, once, with the command that is already idempotent:
82
+
83
+ \`\`\`
84
+ npx synthesisui@latest connect
85
+ \`\`\`
86
+
87
+ ## 2. AUTHORISATION - ONE QUESTION, THREE BOXES
88
+
89
+ Ask it HERE, before the import, because it is the only way the end can be four lines instead of a
90
+ negotiation.
91
+
92
+ \`\`\`
93
+ After I import, may I apply the deterministic fixes? Nothing here is AI - it is arithmetic,
94
+ and your untouched version stays frozen either way.
95
+
96
+ [x] tokens & contrast values that repeat become one named token; text that fails
97
+ contrast gets its INK changed, never its background
98
+ [x] spacing lengths off your own scale converge onto the step you named
99
+ [x] typography sizes and weights land on your own scale
100
+ \`\`\`
101
+
102
+ All three checked by default. Two things must be said in the same breath, because a default that
103
+ edits is only defensible with both:
104
+
105
+ - **v1 is frozen before anything is applied.** It is a published version, it never moves, and
106
+ restoring it is one click.
107
+ - **Value, never form.** Your axes, options, parts and layers are declarations - we do not touch
108
+ them. \`archetypeFidelity\` is excluded from this run on purpose: its fix once deleted the \`variant\`
109
+ and \`size\` a real \`Input\` declared (dono, 02/08).
110
+
111
+ If they decline all three: fine, and say what they are choosing - the system arrives exactly as
112
+ their code has it, and the optimisations wait on a button.
113
+
114
+ ## 3. PROJECT
115
+
116
+ By now the unscoped census has finished, so this is a list and not a question in the dark. The CLI
117
+ already ranks the candidates by how many tokens each declares - use its numbers, never your
118
+ impression.
119
+
120
+ \`\`\`
121
+ Where should the system come from?
122
+
123
+ packages/ui (recommended) 114 files · 47% of its values already named ·
124
+ 92 tokens of their own · every app imports it
125
+ the whole repo 2797 files · 36% · the average of one dark app and
126
+ two light ones, which is a diagnosis and not a system
127
+ apps/web-dashboard the heaviest consumer, if you want one app's vocabulary
128
+ \`\`\`
129
+
130
+ **Do not ask which styling they use.** We measure it, and better than they can answer it: the census
131
+ counts every form with a percentage and an example. Show it instead, and name what we cannot read:
132
+
133
+ \`\`\`
134
+ Measured across 2797 files: 46% Tailwind classes, 31% CSS Modules, 12% sx props.
135
+ I read all three. What I do not read yet: styled-jsx, 3% - and I will say so in the report.
136
+ \`\`\`
137
+
138
+ A wrong answer from them would override a right measurement from us. That is the whole reason this is
139
+ a statement and not a question.
140
+
141
+ ## 4. IDENTITY
142
+
143
+ Name, primary, default theme, canvas. Every one of them is already answered by the census - ask them
144
+ as separate selectable questions, recommendation first, evidence in one line. The full wording lives
145
+ in the \`sui-import-ds\` skill; do not reinvent it here, and do not ask anything it does not.
146
+
147
+ **Our kit is not a question.** A project with its own component library gets theirs alone.
148
+
149
+ ---
150
+
151
+ ## THE SILENT PART
152
+
153
+ Now nobody is asked anything. In order:
154
+
155
+ \`\`\`
156
+ 1 npx synthesisui import --scope <theirs> --usage <apps…> measures with the answers
157
+ 2 the reading anatomy, rules, roles
158
+ 3 send it their v1 exists
159
+ 4 POST /api/registry/ds/<slug>/optimize freeze v1, apply what they said yes to
160
+ { "categories": ["tokens", "spacing", "typography"] }
161
+ \`\`\`
162
+
163
+ Step 4 is ONE call on purpose: it freezes the base and applies the fixes in the same request, so
164
+ there is never a moment where an optimisation landed with no frozen version to go back to.
165
+
166
+ To show the numbers BEFORE applying - useful when they hesitated on question 2 - the same route
167
+ answers a probe and writes nothing:
168
+
169
+ \`\`\`
170
+ { "probe": true, "categories": ["tokens"] }
171
+ \`\`\`
172
+
173
+ If they authorised nothing, skip step 4 entirely. Do not call it with an empty list to be tidy: it
174
+ answers 400, and a 400 in a first run reads as a broken product.
175
+
176
+ ---
177
+
178
+ ## 5. THE FOUR LINES
179
+
180
+ This is the whole point of the run. Four lines, their numbers, no adjectives.
181
+
182
+ \`\`\`
183
+ SignalUI is yours - 275 components and 92 of your own tokens, read out of packages/ui.
184
+
185
+ v1 is frozen: your system exactly as your code has it today. It never moves.
186
+ v2 is what you are looking at - the same system with 118 deterministic fixes: contrast on
187
+ text only, lengths onto your own scale, near-identical colours unified.
188
+
189
+ Back to v1 is one click: /dashboard/mine/signalui/publish
190
+ \`\`\`
191
+
192
+ **What must never be in those lines:** how many files we scanned, how long it took, which readers
193
+ ran, what the ledger says. All of that is in the report and none of it is what somebody wants in the
194
+ first minute of owning a system.
195
+
196
+ **What must always be there:** the count of their components, the count of their own tokens, and the
197
+ way back.
198
+
199
+ ## 6. THE OFFER
200
+
201
+ One question, and only if there is something to offer - the doctor already knows the number.
202
+
203
+ \`\`\`
204
+ 340 hand-written values in your code have a token in your system now.
205
+ Want me to replace them? It only touches values your system names, and you read the diff.
206
+
207
+ npx synthesisui@latest doctor --fix
208
+ \`\`\`
209
+
210
+ If the number is zero, say nothing. An offer with no subject is noise, and this run ends better
211
+ short.
212
+
213
+ ---
214
+
215
+ ## WHAT THIS RUN NEVER DOES
216
+
217
+ - **Never asks a question the census answers.** Styling, coverage, which files exist, how many
218
+ components - those are measurements, and asking invites a wrong answer to beat a right one.
219
+ - **Never installs a file for an agent they did not name.** \`.cursor/\` in a repo that has no Cursor
220
+ is the first thing somebody deletes angrily.
221
+ - **Never applies an optimisation without a frozen v1**, and never reports one without the way back.
222
+ - **Never claims parity between agents.** The post-write check exists in one of them. Saying
223
+ otherwise is the kind of sentence that ends a trial.
224
+ - **Never ends long.** If the last screen needs scrolling, the run failed at the last step.
225
+ `;
226
+ export const INIT_SKILL_PATH = ".claude/skills/sui-init/SKILL.md";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.141",
3
+ "version": "0.16.145",
4
4
  "description": "Bring SynthesisUI design systems into any project - tokens, typed components, whole pages and an agent-ready CLAUDE.md manifest.",
5
5
  "type": "module",
6
6
  "bin": {