feat(design): voice tokens — copy style for the agent#4
Merged
Conversation
stream-ui is rendered by an agent, so component copy is part of the design system alongside colors/typography. Adds a `voice:` section to DESIGN.md with six tokens: formality, density, capitalization, emoji, errorTone, ctaStyle. Each has a prose entry with a concrete do/don't example. Voice is a namespaced extension (unknown-but-preserved per the spec — linter accepts it, emits no CSS vars). The agent reads DESIGN.md at cold start and honors the guidance in streamed copy. Verified with a live probe: prompt: "primary CTA for saving, plus error alert if save fails" → button: "Save" (short-verb CTA ✓) → alert: "Couldn't save — name is required." (matter-of-fact ✓) Agent's own narration cited "matter-of-fact copy", "short-verb CTA", "sentence-case labels" — the voice tokens are reaching the system prompt and shaping output.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
voice:to DESIGN.md — a namespaced extension that guides the agent's copy, not just its colors. stream-ui streams UI from model output, so button labels, alert text, empty-state prose and error messages are part of the design system.Six tokens:
formality: conversational— contractions ok, second person ok, no "please click here"density: concise— one sentence where one sentence works, no preamblecapitalization: sentence-case—Save changes, notSave Changesemoji: sparingly— status ticks only; never in errors or CTAserrorTone: matter-of-fact—Couldn't save — name is required, notOops! 😔ctaStyle: short-verb—Save,Add item, neverClick here to save your profileEach has a prose block with do/don't examples. The agent reads DESIGN.md verbatim at cold start, so these flow into streamed specs automatically.
Test plan
Live probe against the running agent:
bun run lint:design→ 0/0/1 (voice is preserved as unknown-but-valid)bun run lint·typecheck·test(97/97) ·buildall green"primary CTA for saving, plus error alert if save fails""Save"(short-verb ✓)"Couldn't save — name is required."(matter-of-fact ✓)lint:design) passes