writing-user-facing-text
Skill2 starsChanged 49 days agoMITView on GitHub
Writes and wires any text people see in Teitunnel (UI labels, buttons, errors, Doctor findings, plan steps, notifications, menus) through the locales/en.json catalog, the generated text::msg functions in Rust and t() in React, with plurals, placeholders, per-platform wording and Teitunnel's voice. Use whenever a change adds or edits a user-visible string, in Rust or TypeScript.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adding-cli-commandsSkill
- adding-doctor-checksSkill
- adding-ipc-commandsSkill
- adding-mcp-toolsSkill
- building-uiSkill
- changing-cloudflare-resourcesSkill
- reviewing-pull-requestsSkill
- verifying-changesSkill
- writing-docsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Every sentence a person sees comes from locales/en.json, so the app can be translated and the voice stays consistent.
- Distinctive: line 62
Write a whole sentence as one message with placeholders.
- Distinctive: line 91
No exclamation marks, "Oops", emoji or marketing tone.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing user-facing text
Every sentence a person sees comes from locales/en.json, so the app can be translated and
the voice stays consistent. English is never assembled in code.
Where text lives
- UI text: top-level keys (
"routes": { "empty": { "title": "No routes yet" } }), read witht("routes.empty.title"). Text produced in Rust (errors, Doctor, plan steps, menus, notifications, CLI-facing messages from core): under
"core".crates/core/build.rsgenerates one function per message intext::msg, with exactly the message's placeholders as arguments, so a wrong key or missing argument fails to compile:"core": { "doctor": { "dnsMissing": { "title": "{hostname} has no DNS record" } } }becomes
msg::doctor::dns_missing::title(hostname) -> Text.
In Rust
Return a Text, never a String meant for a person. Errors map each variant to its
message (engine/planner.rs):
impl UserText for PlanError {
fn text(&self) -> Text {
match self {
Self::NoZone(hostname) => msg::error::plan::no_zone(hostname),
Self::RouteExists(hostname) => msg::error::plan::route_exists(hostname),
// …
}
}
}- Errors implement
UserText; theirDisplay(English, for logs) comes from it. - A new
core.error.*message also needs an entry inapps/desktop/src/lib/error-help.tssaying how the app helps (fix,link,inputorretry);error-help.test.tsfails until it has one. - Technical values (hostnames, paths, codes) are arguments;
msg::rawwraps text shown as it is. - The UI translates a
Textwithtranslate(). The core renders it itself only for native menus, notifications and the CLI.
In React
import { t } from "@/lib/i18n";
<Button>{t("routes.empty.add")}</Button>- Module-level maps hold message keys (
MessageKey) and callt()at render, never at import. - Write a whole sentence as one message with placeholders; never concatenate fragments.
aria-labels, placeholders, tooltips and toasts are text too.
Plurals and placeholders
- Placeholders are
{name}. Keep their names in every language. - Counts use CLDR plural suffixes with
{count}:"routes_one": "{count} route","routes_other": "{count} routes". In Rust the generated function takescount: u64first.
Per-platform wording
A message that names something macOS-specific (this Mac, Finder, the keychain, System
Settings, the menu bar, ⌘, Homebrew) needs Windows and Linux wordings as sibling keys:
"key@windows" and "key@linux" ("this PC", "File Explorer", "Credential Manager",
"Settings", "Ctrl"). The catalog test fails when one is missing.
Voice
Follow DESIGN §10:
- Title case for buttons, menu items and window, sheet and dialog titles ("Add Route", "Check Again"); sentence case for everything else ("No routes yet").
- An action that asks for more before acting ends with "…" ("Delete…").
- Say what happened, why, and what to do next: "Couldn't create app.teispace.com. A record with this name already exists (A 203.0.113.4). Replace it or choose another name."
- Describe outcomes, not internals: "app.teispace.com now points to localhost:3000", not "Ingress updated". Use the product's terms: Route, Domain, Tunnel, Connector, Quick Share, Doctor, Activity.
- No exclamation marks, "Oops", emoji or marketing tone.
- Hostnames in examples use a real-looking domain such as
teispace.com.
Check
pnpm --filter @teitunnel/desktop test -- i18n # catalog checks: keys, placeholders, platforms
pnpm --filter @teitunnel/desktop i18n:missing <lang> # a translation's missing keys
cargo build -p teitunnel-core # regenerates text::msgThen pnpm verify.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

