stitch2 0.15.2 → 0.15.3

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.
package/README.md CHANGED
@@ -83,7 +83,7 @@ file that already exists. From there the agent spends its effort on the design.
83
83
  - **Skills** for agents (`skills/`): `stitch2` (the design workflow, principles, typography, components,
84
84
  versions), `stitch2-design-md` (building the design system), `stitch2-alternatives` (fresh-eyes versions and
85
85
  testing skill changes), `stitch2-consistency` (verifying and fixing
86
- consistency), `stitch2-i18n` (screens in every language), `stitch2-app-sync` (keeping the app and the designs in step: design first, then the app) and,
86
+ consistency), `stitch2-i18n` (screens in every language), `stitch2-copy` (writing the text: a brief, plain words, the reader's outcome), `stitch2-translate` (translating by meaning, with a glossary from the product, a review by error type and a check in context), `stitch2-app-sync` (keeping the app and the designs in step: design first, then the app) and,
87
87
  optional, `stitch2-import-from-google-stitch` (drafting screens in Google Stitch through its MCP server).
88
88
 
89
89
  ## Setup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitch2",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "A design canvas, layout and type checks, component consistency and screen versioning for agent-built UI, on Google's DESIGN.md format.",
5
5
  "license": "MIT",
6
6
  "author": "ifokeev",
@@ -46,7 +46,8 @@ References, read before the first screen:
46
46
  variant). Assemble it from the components; plain markup only where none
47
47
  applies, with token classes, `.type-<level>` classes for text, the spacing scale, and the states DESIGN.md
48
48
  defines. When the config has `i18n`, mark every product string with its message key (`data-t`, see
49
- **stitch2-i18n**). Never add classes to a component to change how it looks, and never write a colour value (hex,
49
+ **stitch2-i18n**). Write the text as **stitch2-copy** says (the reader's outcome, plain words, the product's terms),
50
+ and translate it with **stitch2-translate**. Never add classes to a component to change how it looks, and never write a colour value (hex,
50
51
  `rgb()`, `hsl()`): only DESIGN.md's colours, as token classes or `var(--<prefix>-<name>)`.
51
52
  5. **Check** `stitch2 check <path> --shots --strict`. Fix every error (overflow, wrapped labels, content under
52
53
  fixed bars, fixed bars overlapping each other, tap targets, contrast, cramped text) and every warning about type (`type-*`), hand-built
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: stitch2-copy
3
+ description: Write the words on screens and landing pages so they say what the product does for the reader, in plain language a translator can carry into any language. Use when writing or rewriting a screen's text, a landing page, onboarding, empty states or buttons, when the user says the copy is weak, generic, too technical or "not selling", and before translating (stitch2-translate starts from this source).
4
+ ---
5
+
6
+ # Copy with stitch2
7
+
8
+ The words are part of the design. A screen can pass every layout check and still fail because its text is vague,
9
+ written for the wrong reader, or impossible to translate well. This skill writes the **source** text; translating
10
+ it is stitch2-translate.
11
+
12
+ ## 1. The brief: design/COPY.md
13
+
14
+ Write it once per product, before the text, and keep it next to DESIGN.md. It is short:
15
+
16
+ - **Reader.** Who opens this page and what they want done today, in their words ("know what to lift and log it
17
+ without fuss"), not in the product's ("a training management platform"). A page has one main reader; others
18
+ (developers, self-hosters, partners) get their own section further down, written for them.
19
+ - **Promise.** One sentence: what the product does for that reader. Every headline on the page serves it.
20
+ - **Proof.** Real, specific facts that back the promise: numbers, names, what happens on screen. No round fake
21
+ numbers.
22
+ - **Voice.** Three words for how it sounds, and what it is not ("calm, direct, practical; never hype, never
23
+ slang").
24
+ - **Words.** The product's terms, one per concept, as the UI uses them (*set*, *routine*, *program*), and the words
25
+ it never uses. stitch2-translate turns this into a glossary per language.
26
+ - **Section intents.** For a landing page, one line per section: what the reader should understand or do after
27
+ it. The intent travels with the strings to the translators.
28
+
29
+ ## 2. Writing rules
30
+
31
+ Sources: Google developer style guide (*Write for a global audience*), Nielsen Norman Group (people scan: 79% of
32
+ users scan, 16% read word by word), Mozilla's marketing style guides, Material and Apple writing guidance.
33
+
34
+ - **Lead with the reader's outcome**, then how the product gets there. "Know what to lift today" before "a
35
+ progression engine".
36
+ - **Concrete beats clever.** Name the thing on the screen ("last time's weight sits next to every set") instead of
37
+ an abstraction ("data-driven insights"). A headline should still make sense with the page's design removed.
38
+ - **One idea per sentence; short sentences.** They scan better and translate better.
39
+ - **Plain words.** *use*, not *leverage*; *start*, not *commence*. No idioms, puns, phrasal verbs or cultural
40
+ references in the source: the translator has to rebuild them, and usually cannot.
41
+ - **Second person, active voice, present tense.** "You log a set", "gymgym fills in the weight".
42
+ - **Sentence case** for headings and buttons. A button is a verb and its object ("Start training", "Send
43
+ answers").
44
+ - **No hype.** Not *seamless, powerful, ultimate, revolutionary, effortless, journey, unlock, supercharge*; no
45
+ exclamation marks. Proof replaces adjectives.
46
+ - **Technical words only for the reader who uses them.** Licences, hosting, protocols and stack belong in the
47
+ section for developers, and even there say what they mean for the reader ("your data stays in your database")
48
+ before naming the technology.
49
+ - **Write for translation.** Keep each sentence whole in one string (never split a sentence across keys or build
50
+ it by concatenation); use placeholders for numbers and names, with plural forms; avoid words with two meanings
51
+ in context (*set* the noun vs the verb). See stitch2-i18n for keys and placeholders.
52
+
53
+ ### A landing page
54
+
55
+ - **Hero**: an eyebrow (what it is, or its strongest fact), a title of up to about eight words with the outcome,
56
+ a lead of one or two sentences with how and why to trust it, one primary action and at most one secondary.
57
+ - **Sections**: eyebrow = the topic (one or two words); title = the benefit; lead = how it works, in product
58
+ terms. Feature cards: title = what the reader gets, text = what happens on screen.
59
+ - **Lists** (checklists, "also included"): parallel grammar, each item a short claim the reader can check.
60
+ - **Calls to action** repeat the same verb for the same action across the page.
61
+
62
+ ### In the product
63
+
64
+ Labels are nouns, buttons are verbs, hints say what happens next, empty states say what this place is for and
65
+ offer the first action, errors say what happened and what to do. Reuse the app's existing words before inventing
66
+ new ones.
67
+
68
+ ## 3. Process
69
+
70
+ 1. Write or update the brief.
71
+ 2. **Read the strings in order.** `stitch2 i18n <screen> --json` lists a screen's keys; read the source text top
72
+ to bottom as one story, without the design. Mark every sentence that is vague, technical for the reader,
73
+ repeats another, or would not survive translation.
74
+ 3. Rewrite in the source messages (the app's files: one copy of every string). Keep keys whose meaning stays;
75
+ a string whose meaning changes gets its new text under the same key only if every place that uses it wants
76
+ the new meaning.
77
+ 4. Self-review with the checklist below, then `stitch2 check <screen> --shots` for fit.
78
+ 5. **Cold read.** Give a fresh agent only the page's strings (no brief, no design) and ask: what is this product,
79
+ who is it for, what would you do next? If the answer misses the promise, the page does not say it yet. A
80
+ `stitch2 sandbox` folder keeps the fresh agent from seeing your reasoning.
81
+ 6. Then translate with stitch2-translate: the brief's section intents are its context.
82
+
83
+ ## Checklist
84
+
85
+ - [ ] The hero says what the product does for the main reader, in their words.
86
+ - [ ] Every section title is a benefit; every lead says how, concretely.
87
+ - [ ] No hype words, no exclamation marks, no idioms or puns.
88
+ - [ ] Technical terms only in the section for the readers who use them.
89
+ - [ ] One term per concept, the same as the UI.
90
+ - [ ] Sentences short, whole in one string, with placeholders for numbers.
91
+ - [ ] Buttons are verb + object, the same verb for the same action.
92
+ - [ ] The cold read names the promise.
93
+
@@ -110,6 +110,12 @@ Use logical properties so layouts flip by themselves: `ms-*`/`me-*`, `ps-*`/`pe-
110
110
  `text-start`, `rounded-s-*`. Icons that point (back, next, chevrons, progress) get `rtl:-scale-x-100`;
111
111
  icons that show objects (a dumbbell, a clock) and numbers, charts and media controls do not flip.
112
112
 
113
+ ## Writing and translating the words
114
+
115
+ This skill makes every language fit. What the text says, and how well each language says it, is
116
+ **stitch2-copy** (the source) and **stitch2-translate** (meaning, not words: a glossary from the app, the
117
+ language's conventions, a review pass by error type, then this skill's check in context).
118
+
113
119
  ## Hand over
114
120
 
115
121
  Tell the user which languages you checked, what you changed to make each fit (layout, word, component), and
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: stitch2-translate
3
+ description: Translate a product's screens and landing pages by meaning, as a native writer of each language would put it, not word for word — with a glossary taken from the product, the language's own conventions, a review pass that marks errors by type and severity, and a check in context. Use when adding or updating translations, when a language reads like a translation (calques, wrong terms, odd tone), when the user complains about a language, or after stitch2-copy changes the source.
4
+ ---
5
+
6
+ # Translating with stitch2
7
+
8
+ A good translation says what the source *means* and has the effect it is meant to have, in words a native
9
+ speaker would choose. "Avoid literal translation at all costs" (Mozilla's localization style guide). For product
10
+ UI that means the product's own terms, every time; for marketing it means transcreation: the headline may change
11
+ its words entirely to keep its point.
12
+
13
+ Machine and model translation in one pass is fluent but literal. It does better when it prepares like a human
14
+ translator does and then revises against named errors: preparing keywords, topic and examples first (MAPS, He et
15
+ al. 2023, arXiv:2305.04118), translating, then estimating errors and refining (TEaR, Feng et al. 2024,
16
+ arXiv:2402.16379), with errors marked by MQM type and severity (GEMBA-MQM, Kocmi & Federmann 2023,
17
+ arXiv:2310.13988), and with separate roles for translator, localizer and reviewer (TransAgents, Wu et al. 2024,
18
+ arXiv:2405.11804). This skill is that process.
19
+
20
+ ## 0. Before translating
21
+
22
+ - **The source is good.** If the source is vague or full of idioms, fix it first (stitch2-copy): a translation
23
+ cannot be better than what it says.
24
+ - **The brief** (design/COPY.md): reader, promise, voice, section intents. Every string is translated knowing
25
+ what it is for.
26
+
27
+ ## 1. Prepare, per language
28
+
29
+ 1. **Glossary from the product.** Before writing a word, read how the app already says the core concepts in this
30
+ language (the locale's messages: set, rep, rest, workout, routine, program, history…; search the message files
31
+ for the source terms). Write them into design/COPY.md under the language. The landing page uses the app's
32
+ words; when the app's own terms collide (one word for two concepts), fix the collision in the app first and
33
+ note the decision.
34
+ 2. **Language conventions** (references/locales.md): form of address used by the app (detect it from existing
35
+ strings: *du*/*Sie*, *tu*/*vous*, *ты*/*вы*), quotation marks, spaces before punctuation, dashes, number
36
+ formatting, capitalization.
37
+ 3. **Context per string.** Where it appears (hero title, button, chip, checklist item), how much room it has
38
+ (`stitch2 i18n <screen> --json` lists keys per screen; the renders show the space), and the intent from the
39
+ brief.
40
+
41
+ ## 2. Draft as a native writer
42
+
43
+ - Read the whole section in the source first; translate the section, not string by string.
44
+ - Ask, as Mozilla's guide does: what does this mean, what is the author trying to say, how would I say that in my
45
+ language? Then write it the way a good local fitness, finance or tech site (whatever the product is) would.
46
+ - Headlines and slogans: transcreate. Keep the point and the length class (short stays short), drop the source's
47
+ wording when it does not work. Write two or three options and keep the best.
48
+ - UI strings: the glossary term, the language's usual verb for the action ("Войти", "Anmelden"), the same form of
49
+ address everywhere.
50
+ - Keep placeholders, plural categories (CLDR) and markup slots; never concatenate.
51
+ - Units, numbers and dates come from the locale; product names, brands and code stay as written.
52
+
53
+ ## 3. Review: mark errors, then fix
54
+
55
+ Review as a **separate pass**, ideally a separate agent that sees the source, the draft, the glossary and the
56
+ conventions, but not the drafter's reasoning. Mark every problem with an MQM category and severity
57
+ (references/review.md), for example:
58
+
59
+ ```
60
+ site.hero.title ru "Знайте, что поднимать." fluency/unnatural (calque of "Know what to lift") major
61
+ ```
62
+
63
+ The questions that catch most errors:
64
+
65
+ - Would a native copywriter ever write this sentence? If it only makes sense to someone who knows the English, it
66
+ is a calque.
67
+ - Does it say exactly what the source means, nothing added, nothing lost?
68
+ - Is every product concept the glossary term? Is the form of address the app's?
69
+ - Punctuation, quotes, spaces and numbers as the language writes them?
70
+
71
+ Fix every critical and major error and review again, until a pass finds none. A back-translation can confirm the
72
+ meaning; it is never a target for style.
73
+
74
+ ## 4. In context
75
+
76
+ 1. `stitch2 check <screen> --locales <l> --shots`: nothing cut, wrapped badly or overlapping (stitch2-i18n has the
77
+ fixes, in order).
78
+ 2. Read the render top to bottom in the language. Headlines that broke onto an orphan word, a term that changed
79
+ between two sections, a tone that changed: fix in the messages.
80
+
81
+ ## 5. Hand over
82
+
83
+ Say which languages you reviewed in context, the terminology decisions (with the collisions you fixed), and which
84
+ strings deserve a native speaker's read before a launch: headlines and anything legal. Be honest about the
85
+ languages you are less sure of.
86
+
87
+ ## References
88
+
89
+ - references/locales.md: conventions per language.
90
+ - references/review.md: the error types and severities, and the review output.
91
+
@@ -0,0 +1,40 @@
1
+ # Conventions per language
2
+
3
+ The defaults for consumer products; when the product already uses another form of address, keep the product's.
4
+ Numbers, dates and units come from `Intl` in the app; in prose, write them the way the language does.
5
+
6
+ | Language | Address | Quotes | Punctuation and spacing | Numbers | Notes |
7
+ |---|---|---|---|---|---|
8
+ | English (en) | you | “ ” | sentence case; serial comma by house style | 1,324.5 | the source: plain, no idioms |
9
+ | German (de) | du in consumer apps, Sie in banking and B2B | „ “ | nouns capitalised; compounds closed (Pausentimer) | 1.324,5 | avoid Denglisch where a German word is usual; keep accepted loanwords (Coach, Workout) |
10
+ | French (fr) | tu or vous by product; be consistent | « » with narrow no-break spaces | narrow no-break space before ; : ! ? and inside « » | 1 324,5 | sentence case; avoid anglicismes (séance, série, répétition) |
11
+ | Spanish (es) | tú | « » or “ ” | ¿ ¡ open questions and exclamations | 1324,5 / 1.324,5 | neutral Spanish for Spain and Latin America; avoid regional slang |
12
+ | Italian (it) | tu | « » or “ ” | sentence case | 1.324,5 | allenamento, serie, ripetizioni, recupero |
13
+ | Portuguese, Portugal (pt) | tu (or você) by product | « » or “ ” | sentence case | 1324,5 | ginásio, ecrã, telemóvel, registar — never the Brazilian forms |
14
+ | Portuguese, Brazil (pt-BR) | você | “ ” | sentence case | 1.324,5 | academia, tela, celular, registrar |
15
+ | Polish (pl) | ty (imperative 2nd person singular) | „ ” | sentence case | 1324,5 | seria, powtórzenia, przerwa; avoid noun chains |
16
+ | Turkish (tr) | sen (or siz) by product | “ ” | sentence case; suffixes after numbers and names with an apostrophe (Strong’dan) | 1.324,5 | vowel harmony in suffixes after placeholders needs care: prefer phrasing without a suffix on {name} |
17
+ | Russian (ru) | вы (lowercase) | «ёлочки», „лапки“ inside | spaced em dash —; no Title Case; ё where it matters | 1 324,5 (no-break space) | lifter vocabulary: подход, повторение (повтор), отдых, разминка, жим лёжа; no calques (see below) |
18
+ | Ukrainian (uk) | ви | « » | apostrophe ’ inside words (м’язи) | 1 324,5 | not Russian with Ukrainian letters: own vocabulary (підхід, повторення, відпочинок, тренування) |
19
+ | Hungarian (hu) | te in consumer apps | „ ” | sentence case | 1 324,5 | word order differs a lot: rebuild the sentence |
20
+ | Arabic (ar) | neutral second person, masculine as default where unavoidable | « » or ” “ | Arabic comma ، and question mark ؟; right to left | Western digits by product choice | Modern Standard Arabic, plain; mirror arrows |
21
+ | Hindi (hi) | आप | “ ” | । as full stop | 1,324.5 (Indian grouping for large numbers) | gym words are often English in Devanagari (सेट, रेप्स, वर्कआउट): use what Indian fitness apps use |
22
+ | Thai (th) | neutral, no polite particles in UI | “ ” | no spaces between words; a space ends a phrase | 1,324.5 | short; avoid long noun phrases |
23
+ | Korean (ko) | 해요체 (polite informal) in consumer apps | “ ” | spaces between words (띄어쓰기) | 1,324.5 | consistent ending style across the product |
24
+ | Chinese, Simplified (zh) | 你 | “ ” | full-width punctuation ,。:;?! | 1,324.5 | a space between Chinese and Latin letters or numbers is house style: keep the product's |
25
+
26
+ ## Calques to catch (Russian examples; every language has its own)
27
+
28
+ | Source | Literal (wrong) | Natural |
29
+ |---|---|---|
30
+ | Know what to lift. | Знайте, что поднимать. | Всегда знаете, какой вес брать. |
31
+ | Keep every rep. | Сохраните каждое повторение. | Ни один подход не потеряется. |
32
+ | A coach that reads your training. | Тренер, который читает ваши тренировки. | Тренер, который знает ваши тренировки. |
33
+ | Get gymgym | Получить gymgym | Как начать |
34
+ | Use ours, or run your own. | Пользуйтесь нашим или запустите свой. | Пользуйтесь нашим сервером или разверните свой. |
35
+ | at a glance | с первого взгляда | всё на одном экране |
36
+
37
+ Signs of a calque: the sentence keeps English word order; a possessive on every noun (ваши, ваш, вашего); a verb
38
+ that only makes sense in English (*read* training, *keep* reps); nouns where the language prefers a verb; an
39
+ English idiom kept word for word.
40
+
@@ -0,0 +1,30 @@
1
+ # Review: error types and severity
2
+
3
+ Based on the MQM (Multidimensional Quality Metrics) typology, cut down to what product text needs. Mark each
4
+ error on the string it is in.
5
+
6
+ | Category | Subtypes | Example |
7
+ |---|---|---|
8
+ | Accuracy | mistranslation, omission, addition, untranslated | "rest timer" as "остаток времени" |
9
+ | Fluency | grammar, spelling, unnatural (calque), inconsistency within the string | "Знайте, что поднимать" |
10
+ | Terminology | not the glossary term, two terms for one concept | routine as "программа" here and "тренировка" there |
11
+ | Style | register or form of address unlike the product, tone unlike the brief, wordy | "вы" in a "ты" product; marketing hype |
12
+ | Locale conventions | punctuation, quotes, spacing, numbers, dates, capitalization | "Hello : world" spacing in fr, Title Case in ru |
13
+ | Design | does not fit, breaks a line badly, wrong plural form | (stitch2 check finds most) |
14
+
15
+ Severity:
16
+
17
+ - **critical**: says something false or harmful (wrong price, wrong action on a button, legal or medical
18
+ mistake), or unreadable.
19
+ - **major**: a reader notices: unnatural, wrong term, wrong tone, meaning shifted.
20
+ - **minor**: a careful reader notices: punctuation, a slightly better word exists.
21
+
22
+ Output, one line per error, then a verdict:
23
+
24
+ ```
25
+ <key> <locale> "<text>" <category>/<subtype> <severity> <why, and the fix>
26
+ verdict: <locale> n critical, n major, n minor
27
+ ```
28
+
29
+ A language ships when its last pass has no critical or major errors.
30
+