content-md 1.0.3 → 1.0.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.9
4
+
5
+ - **Bare `npx content-md init` sets something up.** In a repo with no tool config, 1.0.8 wrote nothing. Now it asks which tools you use, sets up the agent that's running it (Claude Code, Cursor or Codex), or falls back to Claude Code, Cursor and Codex, and says which.
6
+ - **Anonymous usage stats, on by default.** Which tool ran, the kind of screen, the stakes, whether lint flagged anything and which rules fired, the agent, version, OS and a random install id. Never copy, code, paths, repo or product names. Announced on first run and in `init`. Off with `npx content-md telemetry off`, `DO_NOT_TRACK=1` or `CONTENT_MD_TELEMETRY=0`, and always off in CI. `CONTENT_MD_TELEMETRY_DEBUG=1` prints events instead of sending them.
7
+ - **Example sharing, off unless you say yes.** `init` asks once. With it on, `lint_copy` sends the copy it checked, before and after, scrubbed of emails, links, long numbers, paths and keys.
8
+ - **`npx content-md feedback`** opens a prefilled GitHub issue. You choose whether to paste an example.
9
+
10
+ ## 1.0.8
11
+
12
+ - **The product's own style.** `read_product` now reports the product's own style habits (contractions, "you", full stops, case, length, per moment) from its strings, and `lint_copy` flags departures from them in a repo. New clause-join warning (a colon or semicolon stitching two clauses in short UI copy) and a trailing-"yet" note.
13
+ - **No hedged deletes.** `lint_copy` warns on "you can't restore it yourself" and similar: it tells the person someone else can. Say it can't be undone, or say who can restore it.
14
+ - **Tone rules 1.2:** calmer and less warm in worried moments and on success screens, checked against released apps.
15
+
16
+ ## 1.0.7
17
+
18
+ - **Copy is not evidence for copy.** A claim backed only by cited lines where its words sit inside a message string (a toast, a `t`...`` call, the old copy being replaced) is now rejected as bad evidence: cite the code that sets the state. In a held-out test, "Refund of {amount} processed" passed on 1.0.6 because the agent cited the old "Refund processed successfully" toast while the refund could still be pending. Status literals in code (`status = 'refunded'`) still count.
19
+
20
+ ## 1.0.6
21
+
22
+ From a held-out test on 11 new cases from five products.
23
+
24
+ - **"Processed", "issued", "completed" and "went through"** now get the started-is-not-finished warning on money claims, alongside "refunded", "charged" and "paid".
25
+ - **Keys stay put.** The instructions, `rules.md` and the skill say to keep string keys, ids and element names as given and change only the text. Agents had renamed `primary_cta` to `button`.
26
+ - **Soft deletes with no restore.** "Can't be undone" on a delete line whose file also soft-deletes is now a warning, not a failure: if the person can restore it, don't say it; if they can't, say it plainly. The skill says the same. 1.0.5 pushed agents into hedges like "you can't restore it yourself".
27
+
28
+ ## 1.0.5
29
+
30
+ From the 1.0.4 rerun on the same 30 cases. Under Claude Code's default tool search every run loaded content-md, but only 7 of 30 called `read_product`, the tool that cuts missing facts. Three traps still got through.
31
+
32
+ - **`read_product` comes first.** The `init` pointer and the skill name it first. In a repo, `get_guide` opens with a reminder to call it until it has run.
33
+ - **Conditional sends.** "We've emailed you" backed by a send behind an `if`, a `catch` or a `&&` still passes, with a `conditional-claim` warning: say when it happens, or don't promise it.
34
+ - **Started is not finished.** "Refunded", "charged" or "paid" backed by code that mentions pending, request, processing, a queue or a webhook gets the same warning: say it has started unless the code shows it done.
35
+ - **Soft deletes elsewhere in the file.** "Can't be undone" no longer passes on a delete line when the same file has a trash, soft delete, `deletedAt`, `paranoid` or restore.
36
+
37
+ ## 1.0.4
38
+
39
+ From a workflow eval: 30 cases across 10 open-source products, 270 runs. The product reader halved missing facts (18.6% to 9.6%). The old claim check flagged nothing in 83 calls. When a request contradicted the code, the agent found the code and still sided with the request about half the time.
40
+
41
+ - **The claim check reads the code.** `lint_copy` pulls every claim out of the copy: sent, emailed or notified; refunded or charged; deleted, in the trash, or can't be undone; restorable; timelines ("within 30 days", "5–10 business days", "instantly"); saved or published; who can see it. In a repo each claim needs `evidence: [{claim, where: "file:line"}]`. The cited lines are read: they must exist, sit inside the repo, and mention the claim's own words. A hard-delete function can't back "goes to Trash", and a line without "30" can't back "for 30 days". A claim with no evidence is blocked when it is about money, deletion, restore, timing or sending, and is a warning otherwise. Evidence of `"request"` is accepted but flagged: check the code, and if it disagrees, write from the code. Outside a repo, claims are listed as notes. Buttons and labels are not read as claims.
42
+ - **Already-good copy.** With `original`, a claim the rewrite adds that the original didn't make is flagged (`added-claim`). The instructions now say "no change" is a valid answer, and that a rewrite never adds a claim, promise or reassurance.
43
+ - **The request is a brief, not the truth.** The server instructions, `rules.md`, the Claude skill and the `init` pointer say: where the request and the code disagree, write from the code and tell the person what the request got wrong; where the code doesn't settle it, leave the claim out and ask. `read_product`'s `next` asks the agent to list the request's claims about the product and open the code for each.
44
+ - **Claude Code's default setup loads the tools.** `init --claude` adds a pointer to `CLAUDE.md` that names the tools and gives the tool-search query that loads them. The skill says the same. The README documents `ENABLE_TOOL_SEARCH=false`.
45
+ - The product reader (`read_product`) is unchanged apart from that one line.
46
+
3
47
  ## 1.0.3
4
48
 
5
49
  Fixes from auditing a real 13,000-line monorepo with 1.0.2.
package/README.md CHANGED
@@ -12,7 +12,7 @@ When your agent writes a button, an error, an empty state, a dialog or a notific
12
12
  2. **Look up the pattern.** `get_guide` has playbooks for 35 interface patterns (error, empty state, paywall, confirmation dialog, push notification and so on) and an index of 194 pattern rules, with a 1 to 3 self-scoring rubric.
13
13
  3. **Check the copy against what the product actually knows.** The writing rules include a state check. Before drafting, the agent lists what the system knows, what it does not know and who acts next. Copy must not claim more than that.
14
14
  4. **Audit promises, only when needed.** If a draft claims something beyond the state (a cause, an outcome, a timeline), the agent removes or softens that claim. If nothing goes beyond the state, the audit is skipped, because always-on auditing made good lines worse.
15
- 5. **Lint the draft.** `lint_copy` is deterministic. It catches template leaks, raw error codes, filler, generic buttons, blame words, "Are you sure", a body that repeats its headline, casing and length. It also has checks for habits that models fall into: "No X yet" headlines, copy that narrates where things appear on screen, invented causes, two sentences of the same length, and rewrites that change a short label for no reason.
15
+ 5. **Lint the draft, and back every claim.** `lint_copy` pulls every claim out of the copy: that something was sent, refunded or deleted, can be restored, takes N days, is saved, or is visible to someone. In a repo, each one needs a `file:line` in `evidence`. The tool reads those lines, and a claim they don't support is blocked. A claim backed only by the request is flagged, because a request can be wrong about the product. Pass `original` when rewriting, and any claim the original didn't make is flagged too. Beyond claims, `lint_copy` is deterministic. It catches template leaks, raw error codes, filler, generic buttons, blame words, "Are you sure", a body that repeats its headline, casing and length. It also has checks for habits that models fall into: "No X yet" headlines, copy that narrates where things appear on screen, invented causes, two sentences of the same length, and rewrites that change a short label for no reason.
16
16
  6. **Look at shipped copy, as optional evidence.** `find_reference` and `find_examples` return lines shipped products used for the same situation. They help the agent settle a doubt. They are not the default way to write (see results below).
17
17
  7. **Look up style-guide rules.** `find_rules` searches 413 rules from 16 public style guides, with do and don't examples.
18
18
 
@@ -46,7 +46,7 @@ content-md lint '{"pattern":"error","units":[{"element":"headline","text":"Error
46
46
 
47
47
  ```sh
48
48
  cd your-app
49
- npx content-md init # uses the tools this repo already has config for; or name them: --cursor --claude --codex --vscode --windsurf, or --all
49
+ npx content-md init # uses the tools this repo already has config for, or asks; or name them: --cursor --claude --codex --vscode --windsurf, or --all
50
50
  ```
51
51
 
52
52
  Restart the editor or agent afterwards. `init` is safe to run again, and `--dry-run` shows what it would write.
@@ -57,18 +57,48 @@ What it does, and what it leaves alone:
57
57
  - **It pins the version.** The server entry is `npx -y content-md@<version>`, so your editor never picks up a new release on its own. Run `init` again to move to a newer one.
58
58
  - **Shared instruction files get a short pointer, not a rulebook.** `AGENTS.md`, `.github/copilot-instructions.md` and `.windsurfrules` get a few lines in a marked block: when to call the tools, and that your repo's own rules win. `--rules` puts the full method there instead. Cursor and Claude Code get the full method in their own files (`.cursor/rules/content-md.mdc`, `.claude/skills/content-md/SKILL.md`), which load only for copy work.
59
59
  - **Your repo's copy rules come first.** `init` looks for them (copy, voice, tone or glossary sections in `AGENTS.md` or `CLAUDE.md`, and files like `docs/glossary.md` or `content-style.md`) and names them in what it writes, so the agent reads them and follows them wherever content-md differs.
60
- - **It only sets up tools the repo already uses.** With no flags it looks for `.cursor`, `.claude`, `CLAUDE.md`, `AGENTS.md`, `.vscode` and `.windsurfrules` in the repo. If it finds none, it writes nothing and tells you which flag to pass.
60
+ - **It sets up the tools the repo already uses.** With no flags it looks for `.cursor`, `.claude`, `CLAUDE.md`, `AGENTS.md`, `.vscode` and `.windsurfrules` in the repo. If it finds none, it asks which tools you use. When an agent runs it, it sets up that agent (Claude Code, Cursor or Codex, from their environment). Otherwise it sets up Claude Code, Cursor and Codex, and says so.
61
61
  - **The product brief gets its own file.** `save_product_brief` writes `.content-md/product.md`, not your agent instructions.
62
+ - **Claude Code defers MCP tools by default.** It keeps them behind tool search, and an agent that doesn't know they exist never loads them. So `init --claude` also adds a pointer to `CLAUDE.md` that names the tools and how to load them. To load every MCP tool up front instead, start Claude Code with `ENABLE_TOOL_SEARCH=false`.
62
63
  - **`npx content-md remove`** takes out everything `init` added. Add `--global` to clean the home-folder entries too.
63
64
 
64
65
  | tool | MCP server registered in | rule installed in |
65
66
  |---|---|---|
66
67
  | Cursor | `.cursor/mcp.json` | `.cursor/rules/content-md.mdc` |
67
- | Claude Code | `.mcp.json` | `.claude/skills/content-md/SKILL.md` |
68
+ | Claude Code | `.mcp.json` | `.claude/skills/content-md/SKILL.md`, and a pointer in `CLAUDE.md` |
68
69
  | Codex | `~/.codex/config.toml` (with `--global`) | `AGENTS.md` (marked block) |
69
70
  | VS Code (Copilot) | `.vscode/mcp.json` | `.github/copilot-instructions.md` (marked block) |
70
71
  | Windsurf | `~/.codeium/windsurf/mcp_config.json` (with `--global`) | `.windsurfrules` (marked block) |
71
72
 
73
+ ## Usage stats
74
+
75
+ content-md sends anonymous usage stats, the way Next.js and Astro do, so it's possible to see which tools people use and where the checks get in the way. It tells you the first time it runs.
76
+
77
+ What it sends: which tool ran, how long it took and whether it worked; the kind of screen and the stakes, from content-md's own lists; for `lint_copy`, how many pieces of copy, whether it flagged anything and which content-md rules fired; the content-md version, the agent (Claude Code, Cursor, Codex...), your OS and Node version; and a random install id made on your machine.
78
+
79
+ What it never sends: your copy, your code, file names or paths, repo or product names, or anything from your product brief. The collector at agarau.dev doesn't pass on or store your IP address. Details: https://agarau.dev/content-md#usage-stats
80
+
81
+ Turn it off with any of these. It's always off in CI.
82
+
83
+ ```sh
84
+ npx content-md telemetry off # stored in ~/.config/content-md/telemetry.json
85
+ export DO_NOT_TRACK=1
86
+ export CONTENT_MD_TELEMETRY=0
87
+ ```
88
+
89
+ `npx content-md telemetry` shows the current setting. `CONTENT_MD_TELEMETRY_DEBUG=1` prints each event to stderr instead of sending it, so you can see exactly what would go.
90
+
91
+ **Example sharing** is separate and off unless you say yes. `init` asks once. With it on, `lint_copy` also sends the copy it checked, before and after, with emails, links, long numbers, paths and keys removed. Turn it on or off with `npx content-md telemetry examples on` / `off`.
92
+
93
+ ## Feedback
94
+
95
+ ```sh
96
+ npx content-md feedback "lint flagged a button that was fine"
97
+ npx content-md feedback "..." --example "Save changes"
98
+ ```
99
+
100
+ It opens a GitHub issue with your content-md version, Node version and OS filled in. Run it with no message to be asked for one, and for an example you can paste if you want to. Nothing is sent until you submit the issue, and issues are public.
101
+
72
102
  ### Tuning it to your repo
73
103
 
74
104
  Put a `.content-md.json` at the repo root to tell the tools what your product has already decided:
package/bin/content-md.js CHANGED
@@ -1,9 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  const [cmd, ...rest] = process.argv.slice(2);
3
3
 
4
+ const cli = async (event, props) => { const t = await import("../src/telemetry.js"); t.noticeOnce(process.stderr); t.track(event, props); await t.flush(); };
5
+
4
6
  if (cmd === "init") {
5
- const { init } = await import("../src/init.js");
6
- init(rest);
7
+ const { initCli } = await import("../src/init.js");
8
+ await initCli(rest);
9
+ } else if (cmd === "telemetry") {
10
+ const { telemetryCommand } = await import("../src/telemetry.js");
11
+ telemetryCommand(rest);
12
+ } else if (cmd === "feedback") {
13
+ const { feedback } = await import("../src/feedback.js");
14
+ await feedback(rest);
15
+ await cli("cli", { command: "feedback" });
7
16
  } else if (cmd === "remove" || cmd === "uninstall") {
8
17
  const { remove } = await import("../src/init.js");
9
18
  remove(rest);
@@ -11,15 +20,18 @@ if (cmd === "init") {
11
20
  // npx content-md audit [path_filter] : the worst user-facing lines in this repo
12
21
  const { auditCopy } = await import("../src/product.js");
13
22
  console.log(JSON.stringify(auditCopy({ path_filter: rest[0] }), null, 1));
23
+ await cli("cli", { command: "audit" });
14
24
  } else if (cmd === "lint") {
15
25
  // npx content-md lint '{"pattern":"error","units":[{"element":"headline","text":"Error"}]}'
16
26
  const { lintCopy } = await import("../src/tools.js");
17
27
  console.log(JSON.stringify(lintCopy(JSON.parse(rest.join(" "))), null, 1));
28
+ await cli("cli", { command: "lint" });
18
29
  } else if (cmd === "--help" || cmd === "-h" || cmd === "help") {
19
30
  console.log(`content-md: UX writing tools for coding agents, a tone decider, pattern playbooks, style-guide rules and a copy linter.
20
31
 
21
32
  npx content-md init [--cursor --claude --codex --vscode --windsurf | --all] [--rules] [--global] [--dry-run]
22
- register the MCP server with your tools and add a short pointer (with no flag, it uses the tools this repo already has config for, and writes nothing if it finds none).
33
+ register the MCP server with your tools and add a short pointer. With no flag it uses the tools this repo
34
+ already has config for; if there are none, it asks (or sets up Claude Code, Cursor and Codex).
23
35
  Writes only inside this repo unless you pass --global. --rules puts the full method
24
36
  in AGENTS.md and the other shared files instead of the pointer.
25
37
  npx content-md remove [--global] [--dry-run]
@@ -29,7 +41,12 @@ if (cmd === "init") {
29
41
  npx content-md
30
42
  run the MCP server over stdio (this is what your editor calls)
31
43
  npx content-md lint '<json>'
32
- lint one screen: {"pattern":"error","units":[{"element":"headline","text":"..."}]}`);
44
+ lint one screen: {"pattern":"error","units":[{"element":"headline","text":"..."}]}
45
+ npx content-md feedback ["message"] [--example "the copy"]
46
+ open a GitHub issue with your version filled in; attach an example only if you want to
47
+ npx content-md telemetry [status | off | on | examples on | examples off]
48
+ anonymous usage stats are on by default and never include your copy or code.
49
+ Also off with DO_NOT_TRACK=1 or CONTENT_MD_TELEMETRY=0, and always off in CI.`);
33
50
  } else {
34
51
  const { serve } = await import("../src/server.js");
35
52
  await serve();
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "tone-decider-1.1",
2
+ "version": "tone-decider-1.2",
3
3
  "method": "tone = clip(neutral + per-axis push / sqrt(features pushing it) + flex(stakes) * (voice - neutral), bands). Bands intersect across features; the tightest wins. Tone words are the pair from the label set, eligible in this context, whose blended vector sits closest to the result; wrong tones are label words that break a band; tempting tones are the nearest misfires.",
4
4
  "axes": [
5
5
  "formality",
@@ -47,10 +47,10 @@
47
47
  "delta": {
48
48
  "warmth": 0.5,
49
49
  "seriousness": -0.5,
50
- "energy": 0.5
50
+ "energy": 0.25
51
51
  },
52
52
  "band": {},
53
- "why": "something worked; mark it, then move on"
53
+ "why": "something worked; confirm it calmly, then move on"
54
54
  },
55
55
  "error": {
56
56
  "delta": {
@@ -245,7 +245,6 @@
245
245
  },
246
246
  "user": {
247
247
  "delta": {
248
- "warmth": 0.5,
249
248
  "agency": 0.5
250
249
  },
251
250
  "band": {
@@ -324,7 +323,7 @@
324
323
  "exploring": {
325
324
  "delta": {
326
325
  "warmth": 0.5,
327
- "energy": 0.5,
326
+ "energy": 0.25,
328
327
  "agency": 0.5
329
328
  },
330
329
  "band": {}
@@ -353,7 +352,7 @@
353
352
  },
354
353
  "hesitant": {
355
354
  "delta": {
356
- "warmth": 0.5,
355
+ "warmth": 0.25,
357
356
  "agency": 1,
358
357
  "energy": -0.5
359
358
  },
@@ -367,7 +366,6 @@
367
366
  },
368
367
  "worried": {
369
368
  "delta": {
370
- "warmth": 0.5,
371
369
  "confidence": 0.5,
372
370
  "seriousness": 0.5,
373
371
  "energy": -1
@@ -382,7 +380,7 @@
382
380
  0
383
381
  ]
384
382
  },
385
- "why": "calm and specific lowers worry; jokes raise it"
383
+ "why": "calm and specific lowers worry; warmth words and jokes read as padding"
386
384
  },
387
385
  "frustrated": {
388
386
  "delta": {
@@ -408,8 +406,7 @@
408
406
  },
409
407
  "stuck": {
410
408
  "delta": {
411
- "directness": 1,
412
- "warmth": 0.5
409
+ "directness": 1
413
410
  },
414
411
  "band": {
415
412
  "seriousness": [
@@ -422,7 +419,7 @@
422
419
  "accomplished": {
423
420
  "delta": {
424
421
  "warmth": 0.5,
425
- "energy": 1,
422
+ "energy": 0.75,
426
423
  "seriousness": -0.5
427
424
  },
428
425
  "band": {}
@@ -481,7 +478,6 @@
481
478
  },
482
479
  "anxious": {
483
480
  "delta": {
484
- "warmth": 0.5,
485
481
  "confidence": 0.25,
486
482
  "energy": -0.5
487
483
  },
@@ -546,7 +542,7 @@
546
542
  "journey_stage": {
547
543
  "discover": {
548
544
  "delta": {
549
- "energy": 0.5,
545
+ "energy": 0.25,
550
546
  "formality": -0.5
551
547
  },
552
548
  "band": {}
@@ -690,7 +686,7 @@
690
686
  },
691
687
  "milestone": {
692
688
  "delta": {
693
- "energy": 1,
689
+ "energy": 0.75,
694
690
  "warmth": 0.5,
695
691
  "seriousness": -0.5
696
692
  },
package/guide/SKILL.md CHANGED
@@ -7,6 +7,8 @@ description: Write, review or rewrite product microcopy (buttons, errors, empty
7
7
 
8
8
  These rules come from a labeled set of shipped interface copy. Each piece was labeled for pattern, element, intent, tone and a 1 to 3 quality score. Every rule below is backed by examples that scored 3, and every "not this" by examples that scored 1. They were then checked against 16 public style guides (Apple HIG, Atlassian, Baymard, Carbon, GOV.UK Design System, GOV.UK Service Manual, Microsoft HAX, Intuit, Mailchimp, Material, Microsoft Writing Style Guide, Microsoft Windows guidelines, NN/g, Google PAIR, Polaris, Salesforce). Where a guide adds something screenshots can't show, it's cited in [brackets].
9
9
 
10
+ If the `content-md` MCP tools aren't loaded (Claude Code defers MCP tools behind tool search), load them first with tool search: `select:mcp__content-md__read_product,mcp__content-md__get_guide,mcp__content-md__decide_tone,mcp__content-md__lint_copy,mcp__content-md__audit_copy`. In a codebase, call `read_product` before anything else.
11
+
10
12
  **The repo's own copy rules, glossary and voice guide come first.** Look for them in AGENTS.md, CLAUDE.md and the docs before you write, and follow them wherever they differ from anything below. Reuse the product's own words for its own things, even where a rule here would pick another.
11
13
 
12
14
  ## How to work
@@ -16,7 +18,8 @@ These rules come from a labeled set of shipped interface copy. Each piece was la
16
18
  3. **Write the button first.** It is the decision. The headline and body exist to make the button obvious.
17
19
  4. **Check against the universal rules, then the pattern's playbook.**
18
20
  **Use only the facts you were given.** Never invent prices, plans, discounts, counts, features, timings or behavior. If a line would help but needs a fact you don't have, leave it out of the copy and suggest it after, as a note ("If the link is public, add..."). Placeholders like [X]% inside the copy count as inventing.
19
- **Keep what already works.** When rewriting, change only what breaks a rule. Don't rewrite a clear line for style.
21
+ **Keep what already works.** When rewriting, change only what breaks a rule. Don't rewrite a clear line for style. "No change" is a valid answer, and a rewrite never adds a claim the original didn't make. Keep string keys and element names as given; change only the text.
22
+ **The code beats the request.** If the request says something about the product that the code contradicts, write from the code and say what the request got wrong. Back every claim (sent, refunded, deleted, restorable, takes N days) with a file and line; pass them to `lint_copy` as `evidence`.
20
23
  5. **When reviewing,** quote the original, name the rule it breaks, and give the rewrite. When writing from scratch, give 2 or 3 options with a one-line reason each, and recommend one.
21
24
  6. If the project's shared folder has example copy, use it as evidence for the case at hand, and cite the product when you quote one.
22
25
 
@@ -101,7 +104,7 @@ Headline is the action as a question ("Delete event?"). Body says what is lost o
101
104
  Offer the alternative first if one exists, then list what's lost in concrete nouns, then add friction that matches the stakes.
102
105
  - Do: "Downgrade to free instead" (Dovetail). "Any Railcards you've bought" + "We can't get them back." (Trainline). Flag billing traps: "your subscription will stay active". For workspaces: typed confirmation ("Type DELETE WORKSPACE to confirm."), a first-person checkbox, and a button that names the workspace.
103
106
  - Pause instead of delete: name the alternative ("How about a pause instead?", Hinge), say what is hidden and what still works ("You can still chat with your current matches."), and head off surprises: time limits, billing ("Your subscription won't be paused automatically..."), and the timeline to permanent deletion.
104
- - Word choice: "Delete" destroys, "Remove" takes something out of a context, "Move to trash" when it's recoverable [Carbon]. Say "permanently" when it can't be undone [Microsoft, GOV.UK].
107
+ - Word choice: "Delete" destroys, "Remove" takes something out of a context, "Move to trash" when it's recoverable [Carbon]. Say "permanently" when it can't be undone [Microsoft, GOV.UK]. A soft delete the person has no way to restore is gone for them: say plainly that it can't be undone, not "you can't restore it yourself". Say it can be restored only if there is a restore the person can reach.
105
108
  - Give a restore deadline when one exists ("This project can be restored until 2024-09-24", GitLab). When leaving a team, say what happens to the user's work ("Everything you have created will remain accessible to the rest of the team.", Todoist).
106
109
  - Not this: a vague "All your data will be deleted" with no list. Jokes ("Danger, Will Robinson!").
107
110
 
package/guide/rules.md CHANGED
@@ -12,10 +12,10 @@ Write from the rules, the tone decision and the matching pattern rules. They car
12
12
  3. Write every piece the screen needs. Do not drop the headline or a button.
13
13
  4. Optional: when you want evidence for a decision, or when copy describes progress or an outcome, call `find_reference` with its `role` (or `element`), the situation in a short clause that says what the line does for the person, and the `brief` of the moment. Pass the old line as `draft` when rewriting, and pass `state` (what the product's tool or API reports about the item) whenever copy describes progress or an outcome: it returns a correction example when the copy could claim more than that state supports. It returns up to 3 pairs (the brief a screen was built for, and the line it got), one weak counter-example and the tones to avoid, ready to read in its `xml` field. It often returns nothing: when no pair clears its quality floor, write from the rules and `decide_tone`, and do not hunt for a weaker one.
14
14
  5. If you used references, write a short `<pattern_notes>` before the copy: what the pairs share (structure, word count, what each part carries) and what the counter-example gets wrong. Then write from the pattern and the rules. References come from other products, so don't lift their wording or a claim you can't back; the product's own words and glossary are a different matter, and you should reuse them. List what you BORROWED (structure, order, length) and what you CHANGED (facts, words, tone). Use `compare_to_reference` only if you chose to follow a reference's shape.
15
- 6. State-check before you write: name the screen state (empty, loading, error, success, blocked, partial, first time, returning) and the one thing the person must be able to do next. Copy for the wrong state is wrong however well it reads.
15
+ 6. State-check before you write: name the screen state (empty, loading, error, success, blocked, partial, first time, returning) and the one thing the person must be able to do next. Copy for the wrong state is wrong however well it reads. Take the state from the code, not from the request. The request is a brief, not the truth: when it says something about the product that the code contradicts (a trash that doesn't exist, a refund timeline, an email that isn't sent), the code wins. Write from the code and tell the person what the request got wrong. When the code doesn't settle it, leave the claim out and ask.
16
16
  7. Promise audit, only when the copy describes progress, money, time or an outcome AND a claim in the draft goes beyond what the tool state says (if every claim is already stated, skip this step and leave the copy untouched): list every claim and promise in the draft and tag each as STATED (the tool state says it), IMPLIED (follows directly from it) or INVENTED (a time, step, reassurance or consequence the state does not give). Remove or hedge what is invented; leave every line that passes exactly as it is. Keep a reassurance the state supports ("your money is safe" when the state shows funds held), don't drop a specific the person needs (amounts, times, counts), and prefer a hedge to a deletion when part of a line is supported. Don't make the copy vaguer than the state allows. Also cut these tics: a reason or cause the facts do not give, a line that describes the screen ('shown when...') instead of the situation, a hint at an outcome nobody knows yet, and a hedge that adds no information.
17
17
  7b. In a codebase, for explanatory, help, policy or onboarding copy, back every promise or factual claim about how the product works (a time, a rule, a feature, what happens to someone's data or report) with a file and line in the repo or its data. Drop or soften any claim you can't back, and list what you dropped. A page that describes a feature the data doesn't have is worse than a shorter page.
18
- 8. Run `lint_copy` on the draft; fix every `block` and `warn` or say why you kept it. Score each string 1 to 3 (see `get_guide`) and return nothing below 2.
18
+ 8. Run `lint_copy` on the draft, with `original` when rewriting; fix every `block` and `warn` or say why you kept it. It lists every claim the copy makes (sent, refunded, deleted, restorable, takes N days, saved, visible to). In a codebase, pass `evidence` with the file:line that backs each one: the tool reads those lines. Cut any claim you can't back. Score each string 1 to 3 (see `get_guide`) and return nothing below 2.
19
19
 
20
20
  Defaults, which also apply when the tools aren't available. They are defaults, not laws: break one when the moment calls for it and say why.
21
21
  - Buttons are verb + object and match the headline's noun ("Delete event", not "OK"). Both buttons in a pair name their outcome.
@@ -30,4 +30,4 @@ Defaults, which also apply when the tools aren't available. They are defaults, n
30
30
  - Sentence case. "You" for the person, "we" when the product takes responsibility.
31
31
  - Avoid confirmshaming, hidden prices and fake urgency. Money copy states the amount, when it's charged, whether it recurs, and how to cancel.
32
32
  - Never invent a source, person, outlet, date, case number or figure to use as an example. Use a real one from the repo's own data, or an obvious placeholder like "[Outlet] reported on [date]". A made-up citation with a real outlet's name reads as fact once it is screenshotted.
33
- - When rewriting, keep the labels, buttons and titles that already work, word for word. Change a line only for a reason you can state (it is wrong for the state, unclear, or misses a fact).
33
+ - When rewriting, keep the labels, buttons and titles that already work, word for word. Change a line only for a reason you can state (it is wrong for the state, unclear, or misses a fact). When asked to tighten or review copy that already works, "no change" is a valid answer. Never add a claim, promise or reassurance the original didn't make. Keep string keys, ids and element names exactly as given (primary_cta stays primary_cta); change only the text.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "content-md",
3
- "version": "1.0.3",
3
+ "version": "1.0.9",
4
4
  "description": "UX writing tools for coding agents (Codex, Cursor, Claude Code, VS Code, Windsurf): a tone decider, playbooks for 35 UI patterns, 194 pattern rules, 413 style-guide rules and a copy linter, as an MCP server.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,6 +31,6 @@
31
31
  "zod": "^3.25.0"
32
32
  },
33
33
  "scripts": {
34
- "test": "node --test test/*.test.mjs"
34
+ "test": "CONTENT_MD_TELEMETRY=0 node --test test/*.test.mjs"
35
35
  }
36
36
  }
package/src/claims.js ADDED
@@ -0,0 +1,122 @@
1
+ // Claim check, rebuilt for 1.0.4. The old check compared copy with a state the agent wrote itself, so a false
2
+ // brief passed straight through. This one pulls every claim out of the draft and asks for the file and line in the
3
+ // code that backs it. A cited line is read: it must exist and mention what the claim is about.
4
+ import { existsSync, readFileSync, statSync } from "node:fs";
5
+ import { join, isAbsolute, resolve, sep } from "node:path";
6
+
7
+ // What a line of interface copy can promise. Each kind names the words that make the promise and the words a
8
+ // backing line in the code is likely to contain.
9
+ const KINDS = [
10
+ ["sent", /\b(sent|emailed|texted|notified|messaged|forwarded|we('ve| have) (sent|emailed|let)|(we'll|we will|you'll|you will) (send|email|text|notify|let you know|get|receive|hear)|(check|look in) your (inbox|email))\b/gi, /send|mail|notif|sms|message|deliver|queue|job|webhook/i],
11
+ ["money", /\b(refund(ed|ing|s)?|charged?|charging|billed|billing|paid|payment (went through|failed|is processing)|deducted|credited|reimburs\w+|free trial|cancel(led)? (your|the) (plan|subscription))\b/gi, /refund|charge|bill|pay|invoice|stripe|amount|price|credit|subscription|trial/i],
12
+ ["deletion", /\b(deleted|removed|erased|wiped|purged|permanently|forever|can('t|not)( be)? (be )?undo(ne)?|cannot be undone|can't be reversed|for good|(goes|go|moved?) to (the )?(trash|bin|archive)|in (the )?(trash|bin))\b/gi, /delete|destroy|remove|purge|trash|bin|archive|soft|restore|undo|paranoid|deleted_at|discard/i],
13
+ ["restore", /\b(restore[ds]?|recover(ed|able)?|undo|bring (it|them) back|get (it|them) back|retriev\w+)\b/gi, /restore|recover|undo|trash|deleted_at|soft|revert|retriev/i],
14
+ ["timing", /\b(within|in|after|for|up to|takes?|about|around)\s+(\d+|a|an|one|two|three|five|seven|ten|thirty|24|48|72)([-–]\d+)?\s+(seconds?|minutes?|mins?|hours?|hrs?|days?|business days|working days|weeks?|months?)\b|\b(instantly|immediately|right away|by tomorrow|tonight|today|overnight|in real time|real-time)\b/gi, /\d|time|delay|ttl|expire|interval|cron|schedule|duration|days?|hours?|minutes?|seconds?|ms\b|timeout/i],
15
+ ["status", /\b(approved|accepted|rejected|declined|delivered|published|is live|went live|verified|confirmed|booked|reserved|synced|backed up|saved|uploaded|imported|exported|completed?|finished|ready|processing|pending|in progress|queued|scheduled|cancel(l)?ed|expired|joined|shared)\b/gi, /status|state|approve|accept|reject|deliver|publish|verif|confirm|book|reserv|sync|backup|save|upload|import|export|complete|ready|process|pend|queue|schedul|cancel|expir|join|share/i],
16
+ ["access", /\b(only you|anyone with the link|visible to|can see|can('t| not) see|private|public|encrypted|end-to-end|secure)\b/gi, /visib|private|public|permission|role|access|share|encrypt|auth|policy|scope/i],
17
+ ["absolute", /\b(always|never|guarantee[ds]?|every time|all of your|nothing is lost|no data is lost)\b/gi, /./],
18
+ ];
19
+ // Buttons and labels name actions; they do not promise outcomes.
20
+ const ACTION_ELEMENTS = new Set(["primary-cta", "secondary-cta", "tertiary-link", "label", "badge", "title-bar", "placeholder", "tab"]);
21
+ const STOP = new Set("this that with your from will have been they them their there what when were would could should about into after before only also just more most other some than then these those very which while where here".split(" "));
22
+
23
+ export function extractClaims(units = []) {
24
+ const out = [];
25
+ units.forEach((u, i) => {
26
+ if (ACTION_ELEMENTS.has(u.element)) return;
27
+ const t = u.text || "";
28
+ for (const [kind, re] of KINDS) {
29
+ const g = new RegExp(re.source, "gi"); let m;
30
+ while ((m = g.exec(t))) {
31
+ // the claim is the sentence around the matched words, so evidence can be matched on either
32
+ const start = Math.max(0, t.lastIndexOf(".", m.index) + 1), endDot = t.indexOf(".", m.index + m[0].length);
33
+ const sentence = t.slice(start, endDot < 0 ? t.length : endDot + 1).trim();
34
+ if (!out.some((c) => c.unit === i && c.kind === kind && c.words.toLowerCase() === m[0].toLowerCase())) out.push({ unit: i, kind, words: m[0], sentence });
35
+ }
36
+ }
37
+ });
38
+ return out;
39
+ }
40
+
41
+ const keywords = (s) => [...new Set((s.toLowerCase().match(/[a-z]{4,}|\d+/g) || []).filter((w) => !STOP.has(w)))];
42
+ const stem = (w) => (/^\d+$/.test(w) ? w : w.slice(0, Math.min(5, w.length)));
43
+
44
+ // "src/billing/refund.ts:42" or "src/billing/refund.ts:40-48"
45
+ function readCited(root, where) {
46
+ const m = String(where).trim().match(/^(.+?):(\d+)(?:-(\d+))?$/);
47
+ if (!m) return { error: "not a file:line reference" };
48
+ const abs = isAbsolute(m[1]) ? m[1] : resolve(root, m[1]);
49
+ if (!(abs === root || abs.startsWith(root + sep))) return { error: "outside this repo" };
50
+ if (!existsSync(abs)) return { error: "no such file" };
51
+ try { if (statSync(abs).size > 2_000_000) return { lines: null }; } catch { return { error: "unreadable" }; }
52
+ const lines = readFileSync(abs, "utf8").split("\n");
53
+ const a = +m[2], b = +(m[3] || m[2]);
54
+ if (a < 1 || a > lines.length) return { error: `line ${a} is past the end of the file (${lines.length} lines)` };
55
+ return { text: lines.slice(Math.max(0, a - 6), Math.min(lines.length, b + 5)).join("\n").toLowerCase(), file: lines.join("\n").toLowerCase(), exact: lines.slice(a - 1, b).join("\n").toLowerCase() };
56
+ }
57
+
58
+ // Every claim needs evidence: [{ claim, where }]. `where` is file:line in the repo; "request" marks a claim taken
59
+ // from the request alone, which is allowed but flagged, because a request can be wrong about the product.
60
+ export function checkClaims({ units, evidence, stakes, original, root = process.cwd() }) {
61
+ const claims = extractClaims(units);
62
+ const findings = [];
63
+ const add = (unit, severity, rule, detail) => findings.push({ unit, severity, rule, detail });
64
+ const ev = (evidence || []).map((e) => ({ claim: String(e.claim || "").toLowerCase().trim(), where: String(e.where || "").trim() }));
65
+ const matches = (c, e) => e.claim && (c.sentence.toLowerCase().includes(e.claim) || e.claim.includes(c.words.toLowerCase()) || e.claim.includes(c.sentence.toLowerCase().replace(/[.!?]$/, "")));
66
+ const serious = (k) => ["money", "deletion", "restore", "timing", "sent"].includes(k);
67
+ const status = claims.map((c) => {
68
+ const hits = ev.filter((e) => matches(c, e));
69
+ if (!hits.length) {
70
+ add(c.unit, stakes === "high" || serious(c.kind) ? "block" : "warn", "unbacked-claim",
71
+ `'${c.words}' (${c.kind}) has no evidence. Find the code that does this and pass it in evidence as {claim, where: "file:line"}; if the code doesn't do it, cut the claim. A request saying so is not evidence.`);
72
+ return { ...c, backed: false };
73
+ }
74
+ const results = hits.map((e) => {
75
+ if (/^(request|brief|ticket|user|person)$/i.test(e.where)) return { where: e.where, ok: "request" };
76
+ const r = readCited(root, e.where);
77
+ if (r.error) return { where: e.where, ok: false, why: r.error };
78
+ if (r.text === undefined || r.text === null) return { where: e.where, ok: true };
79
+ const pattern = KINDS.find(([k]) => k === c.kind)[2];
80
+ // match on the claim's own words ("go to Trash", "for 30 days"), not the whole sentence, so a hard-delete
81
+ // function can't back a promise of a trash, and a line without the number can't back a timeline
82
+ let kw = keywords(c.words).map(stem);
83
+ if (!kw.length) kw = keywords(c.sentence).map(stem);
84
+ const permanence = /undo|undone|permanent|forever|for good|revers/i.test(c.words);
85
+ const SOFT = /trash|soft[-_ ]?delete|deleted_?at|paranoid|restore|recycle|bin\b/;
86
+ const says = (t) => permanence
87
+ ? /delete|destroy|purge|drop|truncate|unlink|remove/.test(t) && !SOFT.test(t)
88
+ : pattern.test(t) && (c.kind === "absolute" || kw.some((w) => t.includes(w)));
89
+ if (!says(r.text)) return { where: e.where, ok: false, why: "the cited lines don't mention what the claim is about" };
90
+ // copy citing copy: if the claim's words only appear inside prose strings (a toast, a t`...` call, the old
91
+ // message), the lines show what the screen says, not what the product does
92
+ const prose = /(["'`])((?:\\.|(?!\1).)*\s(?:\\.|(?!\1).)*)\1/g;
93
+ const exact = r.exact || "";
94
+ if (exact.match(prose)?.some((q) => says(q)) && !says(exact.replace(prose, '""'))) return { where: e.where, ok: false, why: "the cited lines are interface copy (a message string), not the code that does it. The old copy is not evidence: cite the code that sets the state" };
95
+ // the code does it, but maybe not every time: a send behind an if, a refund that is only requested
96
+ let caveat;
97
+ if (permanence && SOFT.test(r.file || "")) caveat = `the same file also has '${(r.file.match(SOFT) || [])[0]}'. If the person can restore it, don't say it can't be undone. If they have no restore, keep the claim and say it plainly, without hedging`;
98
+ if (c.kind === "sent" && /\bif\s*\(|\bcatch\b|\bunless\b|&&|\?\s*[\w(]/.test(r.text)) caveat = "the cited send sits behind a condition or can fail. Say when it happens (\"if you gave an email\") or don't promise it";
99
+ if (c.kind === "money" && /(refunded|charged|paid|credited|processed|issued|completed|went through)/i.test(c.sentence) && /pending|request|requires_action|processing|async|queue|webhook|status/.test(r.text)) caveat = "the cited code may only start this, not finish it. Say it has started (\"refund requested\") unless the code shows it done";
100
+ return { where: e.where, ok: true, caveat };
101
+ });
102
+ const good = results.find((r) => r.ok === true && !r.caveat) || results.find((r) => r.ok === true);
103
+ if (good) {
104
+ if (good.caveat) add(c.unit, "warn", "conditional-claim", `'${c.words}': ${good.caveat} (${good.where}).`);
105
+ return { ...c, backed: true, where: good.where };
106
+ }
107
+ if (results.some((r) => r.ok === "request")) {
108
+ add(c.unit, serious(c.kind) ? "warn" : "note", "request-only-claim",
109
+ `'${c.words}' is backed only by the request. Check the code: if it disagrees, write from the code and tell the person what the request got wrong.`);
110
+ return { ...c, backed: "request" };
111
+ }
112
+ add(c.unit, "block", "bad-evidence", `evidence for '${c.words}' doesn't hold: ${results.map((r) => `${r.where} (${r.why})`).join("; ")}`);
113
+ return { ...c, backed: false };
114
+ });
115
+ // already-good copy: a rewrite must not promise more than the original did
116
+ if (Array.isArray(original) && original.length) {
117
+ const before = extractClaims(original);
118
+ const had = (c) => before.some((b) => b.kind === c.kind && (b.words.toLowerCase() === c.words.toLowerCase() || keywords(b.sentence).some((w) => keywords(c.sentence).includes(w) && w.length > 4)));
119
+ for (const c of claims) if (!had(c)) add(c.unit, "warn", "added-claim", `'${c.words}' is a new ${c.kind} claim the original didn't make. Drop it unless the code backs it; "no change" is a valid answer for copy that already works.`);
120
+ }
121
+ return { claims: status.map(({ unit, kind, words, backed, where }) => ({ unit, kind, words, backed, ...(where ? { where } : {}) })), findings };
122
+ }
@@ -0,0 +1,52 @@
1
+ // `npx content-md feedback`: opens a GitHub issue with the version and platform filled in. The person writes the
2
+ // message, and attaches one example of copy only if they choose to. Nothing is sent until they press Submit on GitHub.
3
+ import { readFileSync } from "node:fs";
4
+ import { dirname, join } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import { spawn } from "node:child_process";
7
+ import { createInterface } from "node:readline/promises";
8
+
9
+ const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
10
+ const PKG = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8"));
11
+ export const ISSUES = "https://github.com/adedayoagarau/content.md/issues/new";
12
+
13
+ const flag = (argv, name) => { const i = argv.indexOf(name); return i >= 0 && argv[i + 1] && !argv[i + 1].startsWith("--") ? argv[i + 1] : undefined; };
14
+
15
+ export function issueUrl({ message = "", example = "" }) {
16
+ const msg = message.trim();
17
+ const ex = example.trim().slice(0, 2000);
18
+ const title = msg ? `Feedback: ${msg.split("\n")[0].slice(0, 70)}` : "Feedback";
19
+ const body = [
20
+ "## What happened",
21
+ msg || "<!-- What did content-md do, and what did you expect? -->",
22
+ "",
23
+ "## Example",
24
+ ex ? "```\n" + ex + "\n```" : "<!-- Optional: paste the copy (before and after) if you're happy to share it. This issue is public. -->",
25
+ "",
26
+ "## Setup",
27
+ `- content-md ${PKG.version}`,
28
+ `- Node ${process.versions.node}, ${process.platform}`,
29
+ "- Agent: <!-- Claude Code, Cursor, Codex, VS Code, Windsurf... -->",
30
+ ].join("\n");
31
+ return `${ISSUES}?${new URLSearchParams({ title, body, labels: "feedback" })}`;
32
+ }
33
+
34
+ function openUrl(url) {
35
+ const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", "", url]] : ["xdg-open", [url]];
36
+ try { const p = spawn(cmd, args, { stdio: "ignore", detached: true }); p.on("error", () => {}); p.unref(); return true; } catch { return false; }
37
+ }
38
+
39
+ export async function feedback(argv) {
40
+ let message = flag(argv, "--message") ?? argv.filter((a, i) => !a.startsWith("--") && !["--message", "--example"].includes(argv[i - 1])).join(" ");
41
+ let example = flag(argv, "--example") || "";
42
+ if (!message && process.stdin.isTTY && process.stdout.isTTY) {
43
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
44
+ message = await rl.question("What should we know? ");
45
+ if (!example) example = await rl.question("Paste one example of the copy, if you want to share it (it will be public). Press Enter to skip: ");
46
+ rl.close();
47
+ }
48
+ const url = issueUrl({ message, example });
49
+ const opened = !argv.includes("--no-open") && openUrl(url);
50
+ console.log(`${opened ? "Opening a GitHub issue in your browser." : "Open this link to send feedback:"} Nothing is sent until you submit it there.\n\n${url}`);
51
+ return url;
52
+ }
package/src/init.js CHANGED
@@ -6,6 +6,8 @@ import { homedir } from "node:os";
6
6
  import { dirname, join, relative, sep } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import { findRepoRules } from "./repo.js";
9
+ import { createInterface } from "node:readline/promises";
10
+ import { enabled, noticeOnce, readConfig, writeConfig, track, flush, PRIVACY_URL } from "./telemetry.js";
9
11
 
10
12
  const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
11
13
  const PKG = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8"));
@@ -37,7 +39,9 @@ export function pointer(repoRules = []) {
37
39
  : "If this repo gains its own copy rules, glossary or voice guide, they come first. Where content-md disagrees with them, follow the repo.";
38
40
  return `## Interface copy (content-md)
39
41
 
40
- When you write or review user-facing copy (buttons, errors, empty states, dialogs, onboarding, notifications), use the \`content-md\` MCP tools: \`read_product\` once per session, \`get_guide\` for the pattern, \`decide_tone\` when the moment has stakes, and \`lint_copy\` on every draft. Reuse the product's own words.
42
+ When you write or review user-facing copy (buttons, errors, empty states, dialogs, onboarding, notifications), use the \`content-md\` MCP tools. Start with \`read_product\` (once per session, before anything else: it is what keeps facts in the copy, and its \`position\` gives this product's own habits for contractions, full stops, case and length; follow them), then \`get_guide\` for the pattern, \`decide_tone\` when the moment has stakes, and \`lint_copy\` on every draft. Reuse the product's own words.
43
+ When the request says something about the product that the code contradicts, write from the code and say so. Back every claim (sent, refunded, deleted, restorable, takes N days) with a file and line, and pass it to \`lint_copy\` as evidence. "No change" is a valid answer for copy that already works.
44
+ If the content-md tools aren't loaded (Claude Code defers MCP tools behind tool search), load them first: search for \`select:mcp__content-md__read_product,mcp__content-md__get_guide,mcp__content-md__decide_tone,mcp__content-md__lint_copy,mcp__content-md__audit_copy\`.
41
45
  ${theirs} Lint findings are prompts to look, not verdicts.`;
42
46
  }
43
47
 
@@ -102,6 +106,8 @@ export function init(argv, cwd = process.cwd()) {
102
106
  : "6. Use the `content-md` MCP tools: `get_guide` for the pattern's playbook, `find_rules` for style-guide rules, and `lint_copy` on every draft.");
103
107
  if (repoRules.length) skill = skill.replace(/^(---[\s\S]*?---\n)/, `$1\nThis repo's own copy rules come first (${repoRules.map((r) => "`" + r.file + "`").join(", ")}). Follow them wherever they differ from this skill.\n`);
104
108
  write(join(cwd, ".claude", "skills", "content-md", "SKILL.md"), skill);
109
+ // Claude Code defers MCP tools by default, so the agent needs a standing note that they exist and how to load them
110
+ upsertBlock(join(cwd, "CLAUDE.md"), shared);
105
111
  }
106
112
  if (t === "codex") {
107
113
  const cfg = join(process.env.CODEX_HOME || join(homedir(), ".codex"), "config.toml");
@@ -136,6 +142,60 @@ export function init(argv, cwd = process.cwd()) {
136
142
  if (!dry) console.log("Restart your editor or agent so it picks up the new MCP server.");
137
143
  }
138
144
 
145
+ // The agent running this command, from its environment, when there is no config in the repo to go on.
146
+ export function agentFromEnv(env = process.env) {
147
+ if (env.CLAUDECODE || env.CLAUDE_CODE_ENTRYPOINT) return "claude";
148
+ if (env.CURSOR_TRACE_ID || env.CURSOR_AGENT) return "cursor";
149
+ if (env.CODEX_SANDBOX || env.CODEX_SANDBOX_NETWORK_DISABLED || env.CODEX_THREAD_ID) return "codex";
150
+ if (/windsurf/i.test(env.TERM_PROGRAM || "")) return "windsurf";
151
+ return null;
152
+ }
153
+ export const DEFAULT_TARGETS = ["claude", "cursor", "codex"];
154
+ const LABELS = { claude: "Claude Code", cursor: "Cursor", codex: "Codex", vscode: "VS Code", windsurf: "Windsurf" };
155
+
156
+ // What bare `npx content-md init` sets up when the repo has no tool config yet. 1.0.8 wrote nothing here,
157
+ // which left people who followed the one-line install with no setup at all.
158
+ export function pickTargets(argv, cwd = process.cwd(), env = process.env) {
159
+ const asked = argv.includes("--all") ? TARGETS : TARGETS.filter((t) => argv.includes("--" + t));
160
+ if (asked.length) return { targets: asked, how: "flags" };
161
+ const found = detect(cwd);
162
+ if (found.length) return { targets: found, how: "detected" };
163
+ const agent = agentFromEnv(env);
164
+ if (agent) return { targets: [agent], how: "agent" };
165
+ return { targets: DEFAULT_TARGETS, how: "default" };
166
+ }
167
+
168
+ async function ask(question) {
169
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
170
+ try { return (await rl.question(question)).trim(); } finally { rl.close(); }
171
+ }
172
+
173
+ // The command-line entry: picks the tools (asking when a person is at the keyboard), runs init, and asks once
174
+ // whether to share examples of copy.
175
+ export async function initCli(argv, cwd = process.cwd()) {
176
+ const interactive = process.stdin.isTTY && process.stdout.isTTY && !argv.includes("--yes") && !argv.includes("-y");
177
+ let { targets, how } = pickTargets(argv, cwd);
178
+ if (how === "default" && interactive) {
179
+ const names = TARGETS.map((t, i) => ` ${i + 1}. ${LABELS[t]}`).join("\n");
180
+ const a = await ask(`No coding-tool setup found in this repo. Which tools do you use?\n${names}\nType the numbers (e.g. 1 3), or press Enter for Claude Code, Cursor and Codex: `);
181
+ const picked = [...new Set((a.match(/[1-5]/g) || []).map((n) => TARGETS[+n - 1]))];
182
+ if (picked.length) { targets = picked; how = "prompt"; }
183
+ } else if (how === "agent") console.log(`No coding-tool setup found in this repo. You're running this from ${LABELS[targets[0]]}, so it's set up for that. Add --cursor, --codex and so on for other tools.\n`);
184
+ else if (how === "default") console.log(`No coding-tool setup found in this repo, so it's set up for Claude Code, Cursor and Codex. Name the tools you use to change that: --claude --cursor --codex --vscode --windsurf.\n`);
185
+ const rest = argv.filter((a) => !TARGETS.includes(a.slice(2)) && a !== "--all");
186
+ init([...rest, ...targets.map((t) => "--" + t)], cwd);
187
+
188
+ if (!noticeOnce() && enabled()) console.log(`Anonymous usage stats are on (never your copy or code). Turn them off with \`npx content-md telemetry off\`. ${PRIVACY_URL}`);
189
+ if (enabled() && interactive && readConfig().examples === undefined) {
190
+ const a = await ask("\nShare examples of copy to help improve content-md? lint_copy would send the text it checks, before and after, with emails, links, numbers, paths and keys removed. [y/N] ");
191
+ const yes = /^y(es)?$/i.test(a);
192
+ writeConfig({ examples: yes });
193
+ console.log(yes ? "Thanks. Example sharing is on. Turn it off with `npx content-md telemetry examples off`." : "No copy will be shared. You can turn this on later with `npx content-md telemetry examples on`.");
194
+ }
195
+ track("init", { targets, how, dry: argv.includes("--dry-run"), global: argv.includes("--global"), rules: argv.includes("--rules") });
196
+ await flush();
197
+ }
198
+
139
199
  // Take out everything init added: marked blocks, our server entries, our rule and skill files.
140
200
  export function remove(argv, cwd = process.cwd()) {
141
201
  const dry = argv.includes("--dry-run");
@@ -0,0 +1,141 @@
1
+ // Product position: the product's own style habits, read from its shipped strings and returned as verdicts.
2
+ // Measured 2026-11-25 on six held-out repos: following these habits raised style agreement with the real strings,
3
+ // mostly by fixing contractions ("can't" in a product that writes "cannot"). The agent sees verdicts, never rates.
4
+ import { existsSync } from "node:fs";
5
+ import { collectStrings } from "./product.js";
6
+
7
+ const EMOJI = /[\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}]/u;
8
+ const ap = (t) => String(t || "").replace(/[‘’]/g, "'");
9
+ export const FEATURES = {
10
+ contraction: { label: "contractions (can't, you're)", test: (t) => /\b\w+(n't|'re|'ll|'ve|'m|'d)\b|\b(it|that|there|let|what|here)'s\b/i.test(ap(t)), lint: "warn" },
11
+ full_stop: { label: "a final full stop", test: (t) => /\.\s*$/.test(t.trim()) && !/\.\.\.\s*$/.test(t.trim()), lint: "warn" },
12
+ you: { label: "\"you\"/\"your\"", test: (t) => /\b(you|your|you're|you'll|you've|yours)\b/i.test(ap(t)), lint: "note" },
13
+ we: { label: "\"we\"/\"our\"", test: (t) => /\b(we|we're|we've|we'll|our|us)\b/i.test(ap(t)), lint: "note" },
14
+ exclaim: { label: "an exclamation mark", test: (t) => /[A-Za-z0-9)]!+(\s|$|["'”])/.test(t), lint: "note" },
15
+ please: { label: "\"please\"", test: (t) => /\bplease\b/i.test(t), lint: "note" },
16
+ emoji: { label: "an emoji", test: (t) => EMOJI.test(t), lint: "note" },
17
+ };
18
+ const SHORT = new Set(["headline", "primary-cta", "secondary-cta", "tertiary-link", "label", "badge", "title-bar"]);
19
+ const words = (t) => t.trim().split(/\s+/).filter(Boolean).length;
20
+ export const groupOf = (element, text) => (element && element !== "label" && element !== "body" ? (SHORT.has(element) ? "short" : "sentence")
21
+ : words(text) <= 6 && !/\.$/.test(text.trim()) ? "short" : "sentence");
22
+ const titleWords = (t) => t.replace(/[^A-Za-z' ]/g, " ").split(/\s+/).filter(Boolean).slice(1).filter((w) => w.length > 3 && !/'/.test(w));
23
+ export const isTitleCase = (t) => { const w = titleWords(t); return w.length ? w.every((x) => /^[A-Z]/.test(x)) : null; };
24
+ const pct = (a, q) => { const s = [...a].sort((x, y) => x - y); return s[Math.min(s.length - 1, Math.floor(q * s.length))]; };
25
+
26
+ function habit(pool, test, label, what) {
27
+ const hits = pool.filter((s) => test(s.text));
28
+ const n = pool.length, k = hits.length;
29
+ const ex = (h) => h.slice(0, 2).map((s) => (s.file ? `${s.file}:${s.line} ` : "") + `"${s.text.slice(0, 70)}"`);
30
+ if (k >= 3 && k / n >= 0.25) return { call: "use", why: `This product uses ${label} in ${k} of its ${n} ${what}. Follow it.`, examples: ex(hits) };
31
+ if (n >= 8 && k === 0) return { call: "avoid", why: `This product never uses ${label} in its ${n} ${what}. Follow it.` };
32
+ if (n >= 20 && k / n < 0.05) return { call: "avoid", why: `This product rarely uses ${label} (${k} of its ${n} ${what}). Follow it.`, examples: ex(hits) };
33
+ return null;
34
+ }
35
+
36
+ // strings: the product's own [{text, element, file, line}]. Returns only the habits it can see.
37
+ export function productPosition(strings) {
38
+ const all = (strings || []).filter((s) => s.text && s.text.length < 400);
39
+ const out = {};
40
+ for (const group of ["short", "sentence"]) {
41
+ const pool = all.filter((s) => groupOf(s.element, s.text) === group);
42
+ const what = group === "short" ? "short strings (buttons, headlines, labels)" : "sentences (bodies, errors, toasts, helper text)";
43
+ const v = {};
44
+ for (const [name, f] of Object.entries(FEATURES)) {
45
+ if (group === "short" && (name === "contraction" || name === "please")) continue; // too few words to show a habit
46
+ const sentencePool = group === "sentence" && name === "contraction" ? pool.filter((s) => words(s.text) >= 5) : pool;
47
+ const h = habit(sentencePool, f.test, f.label, what);
48
+ if (h) v[name] = h;
49
+ }
50
+ const cased = pool.map((s) => isTitleCase(s.text)).filter((x) => x !== null);
51
+ const tc = cased.filter(Boolean).length;
52
+ if (cased.length >= 10 && tc / cased.length >= 0.6) v.case = { call: "Title Case", why: `This product writes its ${what} in Title Case (${tc} of ${cased.length}).` };
53
+ else if (cased.length >= 10 && tc / cased.length <= 0.15) v.case = { call: "Sentence case", why: `This product writes its ${what} in sentence case (${cased.length - tc} of ${cased.length}).` };
54
+ if (pool.length >= 8) { const L = pool.map((s) => words(s.text)); v.length = { call: `${pct(L, 0.25)}-${pct(L, 0.75)} words`, why: `The middle half of this product's ${pool.length} ${what}.` }; }
55
+ if (Object.keys(v).length) out[group] = v;
56
+ }
57
+ return Object.keys(out).length ? out : null;
58
+ }
59
+
60
+ // --- moments: errors, empty states, confirmations and successes often keep their own habits ---------------
61
+ const PATTERN_CLASS = { success: "success", error: "error", offline: "error", "empty-state": "empty", "search-no-results": "empty",
62
+ "confirmation-dialog": "confirm", "settings-destructive": "confirm" };
63
+ const CLASS_RX = {
64
+ confirm: /\bare you sure\b|\breally (want|delete|remove)\b|\b(can't|cannot|can not) be undone\b|\bpermanently\b|^(delete|remove|discard|leave|reset|revoke|deactivate)\b[^.!]*\?\s*$/i,
65
+ error: /\b(error|fail(ed|ure|s)?|couldn't|could not|can't|cannot|unable|went wrong|invalid|problem|oops|denied|expired|not found|timed out|try again)\b/i,
66
+ empty: /\bno \w+( \w+)? (yet|found|available|here)\b|\bnothing (here|to|yet|found)\b|\bno results\b|\b(is|are) empty\b|^empty\b/i,
67
+ success: /\b(success(ful(ly)?)?|saved|done|complete(d)?|congrat\w*|all set|well done|great( job| work)?|nice( work| job)?|updated|created|added|sent|unlocked|achievement|you did it|you're in|welcome)\b/i,
68
+ };
69
+ const KEY_RX = { confirm: /confirm|areyousure|are_you_sure|really/i, error: /error|fail|invalid/i, empty: /empty|no_?results|nothing/i, success: /success|saved|complete|congrat/i };
70
+ export function classOf(text, key = "") {
71
+ const t = ap(text);
72
+ for (const c of ["confirm", "error", "empty", "success"]) if (CLASS_RX[c].test(t) || KEY_RX[c].test(key)) return c;
73
+ return "other";
74
+ }
75
+ export const momentOf = (pattern) => PATTERN_CLASS[pattern] || null;
76
+ // Verdicts for one moment where they differ from the product-wide ones (only where the moment has 8+ strings of that size).
77
+ export function momentPositions(strings, base) {
78
+ const out = {};
79
+ for (const cls of ["error", "empty", "confirm", "success"]) {
80
+ const p = productPosition((strings || []).filter((s) => s.text && classOf(s.text, s.key || "") === cls));
81
+ if (!p) continue;
82
+ const diff = {};
83
+ for (const g of Object.keys(p)) for (const [k, v] of Object.entries(p[g])) {
84
+ if (k === "length") continue;
85
+ if (base?.[g]?.[k]?.call !== v.call) (diff[g] ||= {})[k] = { call: v.call, why: v.why.replace("This product", `In ${cls === "empty" ? "empty states" : cls === "confirm" ? "confirmations" : cls === "error" ? "errors" : "success messages"}, this product`) };
86
+ }
87
+ if (Object.keys(diff).length) out[cls] = diff;
88
+ }
89
+ return Object.keys(out).length ? out : null;
90
+ }
91
+
92
+ export const POSITION_NOTE = "These are this product's own habits, read from its strings. Follow them in new copy: they decide contractions, the final full stop, case, 'you' and 'we', and length. `by_moment` lists where errors, empty states, confirmations or success messages keep a different habit; in those moments it wins. They cover style only; the facts, the state and the outcome the person needs still decide what the copy says. Where the repo's rules say otherwise, the rules win.";
93
+
94
+ const CACHE = new Map();
95
+ // The product's position, with a moment's own habits laid over it when the pattern names one.
96
+ export function positionFor(root, pattern) {
97
+ if (!root || !existsSync(root)) return null;
98
+ if (!CACHE.has(root)) {
99
+ try { const strings = collectStrings(root).strings; const base = productPosition(strings); CACHE.set(root, { base, moments: momentPositions(strings, base) }); }
100
+ catch { CACHE.set(root, { base: null, moments: null }); }
101
+ }
102
+ const { base, moments } = CACHE.get(root);
103
+ const m = momentOf(pattern) && moments?.[momentOf(pattern)];
104
+ if (!m) return base;
105
+ const merged = JSON.parse(JSON.stringify(base || {}));
106
+ for (const g of Object.keys(m)) merged[g] = { ...(merged[g] || {}), ...m[g] };
107
+ return merged;
108
+ }
109
+
110
+ // Departures from the product's habits, as lint findings.
111
+ export function checkPosition(units, position) {
112
+ const out = [];
113
+ if (!position) return out;
114
+ units.forEach((u, i) => {
115
+ const t = u.text || "";
116
+ if (!t.trim()) return;
117
+ const group = groupOf(u.element, t);
118
+ const v = position[group];
119
+ if (!v) return;
120
+ for (const [name, f] of Object.entries(FEATURES)) {
121
+ const h = v[name];
122
+ if (!h) continue;
123
+ if (name === "contraction" && words(t) < 5) continue;
124
+ if (name === "full_stop" && group === "sentence" && /[?!]\s*$/.test(t.trim())) continue;
125
+ const has = f.test(t);
126
+ // only the absence of a habit the copy could have used is checked for 'use'; 'avoid' is checked whenever the feature appears
127
+ if (h.call === "avoid" && has) out.push({ unit: i, severity: f.lint, rule: "product-position", detail: `${h.why.replace(/ Follow it\.$/, "")}; this line uses it` });
128
+ if (h.call === "use" && !has && (name === "full_stop" || name === "contraction" && /\b(can not|cannot|do not|does not|did not|is not|are not|was not|were not|will not|would not|could not|should not|have not|has not|had not|you are|we are|it is|that is|there is|let us|you will|we will)\b/i.test(t)))
129
+ out.push({ unit: i, severity: f.lint, rule: "product-position", detail: `${h.why.replace(/ Follow it\.$/, "")}; this line doesn't` });
130
+ }
131
+ if (v.case && (group === "short")) {
132
+ const tc = isTitleCase(t);
133
+ if (tc !== null && (tc ? "Title Case" : "Sentence case") !== v.case.call) out.push({ unit: i, severity: "warn", rule: "product-position", detail: `${v.case.why} Write this one in ${v.case.call}.` });
134
+ }
135
+ if (v.length && /^\d+-\d+ words$/.test(v.length.call)) {
136
+ const [lo, hi] = v.length.call.match(/\d+/g).map(Number), w = words(t);
137
+ if (w > hi * 2 && w > hi + 4) out.push({ unit: i, severity: "note", rule: "product-position", detail: `${w} words; ${v.length.why.replace(/\.$/, "")} run ${v.length.call}` });
138
+ }
139
+ });
140
+ return out;
141
+ }
package/src/product.js CHANGED
@@ -6,6 +6,7 @@ import { findRepoRules, readConfig } from "./repo.js";
6
6
  import { readdirSync, readFileSync, statSync, existsSync } from "node:fs";
7
7
  import { join, relative, extname, basename } from "node:path";
8
8
  import { lintCopy } from "./tools.js";
9
+ import { productPosition, momentPositions, POSITION_NOTE } from "./position.js";
9
10
  import { inferIndustry, industryProfile, readSavedBrief, contextSlots, ASK_POLICY } from "./context.js";
10
11
 
11
12
  const SKIP_DIRS = new Set(["docs", "dev-docs", "documentation", "examples", "example", "scripts", "node_modules", ".git", "dist", "build", ".next", "out", "coverage", "vendor", "Pods", ".turbo",
@@ -273,12 +274,13 @@ export function readProduct({ root = process.cwd(), sample = 18 } = {}) {
273
274
  readme: saved ? undefined : rd,
274
275
  landing_copy: landing,
275
276
  voice,
277
+ ...(() => { const p = productPosition(strings); if (!p) return {}; const m = momentPositions(strings, p); return { position: { ...p, ...(m ? { by_moment: m } : {}), how_to_use: POSITION_NOTE } }; })(),
276
278
  industry: { ...guess, profile: guess.industry ? industryProfile(guess.industry, voice) : null },
277
279
  sample_lines: [...byUse, ...sentences].map((s) => ({ text: s.text, element: s.element, where: `${s.file}:${s.line}` })),
278
280
  slots, questions, ask_policy: ASK_POLICY,
279
- next: first + (saved
281
+ next: first + (strings.length ? "Write new copy in the product's own style: follow every verdict in `position`. " : "") + "Before you write, list what the request claims about the product (deletion and restore, emails and notifications, money, timing, who can see what) and open the code for each. Where the request and the code disagree, the code wins: write from it and tell the person. " + (saved
280
282
  ? "A saved brief exists: use it, fill any slot still marked unknown, and don't re-ask what it answers. Call save_product_brief only if something changed."
281
- : "Fill every slot: read-and-fill slots from the README and strings, inferred slots by checking them against the sample lines. Then write a brief of at most six lines: (1) what the product is, in its own words; (2) who uses it and the niche; (3) the main job; (4) its current voice, quoting 2 or 3 sample lines, and how it differs from the industry baseline; (5) its own words for its things (reuse them); (6) what is at stake for its users. Mark what you inferred. Handle `questions` by the ask_policy (ask_person shows a form where the client supports it). Then call save_product_brief so the next session starts from it. Use the industry examples as evidence of what comparable products do, not as wording to copy. Keep the product's voice unless the person asks to change it; fix tics, not personality.") + (guess.industry ? ` Save industry "${guess.industry}" in the brief (or correct it), so find_reference and find_examples stay with comparable products.` : ""),
283
+ : "Fill every slot: read-and-fill slots from the README and strings, inferred slots by checking them against the sample lines. Then write a brief of at most six lines: (1) what the product is, in its own words; (2) who uses it and the niche; (3) the main job; (4) its current voice, quoting 2 or 3 sample lines and the habits in `position` (contractions, full stop, case), and how it differs from the industry baseline; (5) its own words for its things (reuse them); (6) what is at stake for its users. Mark what you inferred. Handle `questions` by the ask_policy (ask_person shows a form where the client supports it). Then call save_product_brief so the next session starts from it. Use the industry examples as evidence of what comparable products do, not as wording to copy. Keep the product's voice unless the person asks to change it; fix tics, not personality.") + (guess.industry ? ` Save industry "${guess.industry}" in the brief (or correct it), so find_reference and find_examples stay with comparable products.` : ""),
282
284
  };
283
285
  }
284
286
 
package/src/server.js CHANGED
@@ -8,7 +8,13 @@ import { findReferenceV2Async, decideTone, HAS_ENRICHED, INDUSTRIES } from "./re
8
8
  import { readProduct, auditCopy } from "./product.js";
9
9
  import { saveProductBrief, askPerson, readSavedBrief } from "./context.js";
10
10
  import { readConfig } from "./repo.js";
11
+ import { checkClaims } from "./claims.js";
12
+ import { positionFor, checkPosition } from "./position.js";
13
+ import { existsSync as exists } from "node:fs";
14
+ import { track, trackExample, setClient, noticeOnce, flush } from "./telemetry.js";
15
+ import { join as pjoin } from "node:path";
11
16
  import { normElement, META, PATTERNS, ELEMENTS, HAS_EXAMPLES, findExamples, findRules, getGuide, lintCopy, findReference, compareToReference } from "./tools.js";
17
+ let productRead = false; // get_guide reminds the agent to read the product first
12
18
 
13
19
  const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
14
20
 
@@ -18,17 +24,17 @@ Write from the rules, the tone decision and the pattern playbook. Shipped copy i
18
24
  0. In a codebase, call read_product once per session. Use the saved brief if there is one; otherwise fill its slots from the repo, write the short brief, ask the person at most two questions that would change the copy (ask_person; otherwise state your assumption), and save it with save_product_brief (it writes .content-md/product.md, not your instruction files) unless the person said not to touch files. Write for that product, its audience and its own words, and keep its voice. To improve existing copy, call audit_copy and fix the worst lines first; leave unflagged lines alone.
19
25
  1. Call get_guide with the pattern once per task and follow it.
20
26
  2. If the moment has stakes or feeling (an error, money, a deletion, a success), call decide_tone with the facts of the moment, and use its tone words and instruction.
21
- 3. State-check before you write: name the screen state and what the product actually knows. Do not claim more than that.
22
- 4. Write every piece the screen needs. When rewriting, keep labels, buttons and titles that already work.
27
+ 3. State-check before you write: name the screen state and what the product actually knows, from the code. The request is a brief, not the truth: when it says something about the product that the code contradicts (a trash that doesn't exist, a refund timeline, an email that isn't sent), the code wins. Write from the code and tell the person what the request got wrong. When the code doesn't settle it, leave the claim out and ask.
28
+ 4. Write every piece the screen needs. When rewriting, keep labels, buttons and titles that already work. When asked to tighten or review copy that already works, "no change" is a valid answer, and never add a claim, promise or reassurance the original didn't make. Keep string keys, ids and element names exactly as given (primary_cta stays primary_cta); change only the text.
23
29
  5. Optional: call find_reference when you want evidence for a decision, or pass the tool state when the copy describes progress or an outcome, to get a correction example. If it returns nothing, write from the rules.
24
- 6. Run lint_copy on every draft and fix each block and warn, or say why you kept it. Run a promise audit only when a claim goes beyond what the state says. In a codebase, back each claim in help, policy or onboarding copy with a file and line, and drop what you can't back. Never invent a source, name, date or figure as an example. Score each string 1-3 with the rubric in the guide and return nothing below 2.
30
+ 6. Run lint_copy on every draft, with the original when rewriting, and fix each block and warn, or say why you kept it. It lists every claim the copy makes; in a codebase pass evidence with the file:line that backs each one, and cut any claim you can't back. Never invent a source, name, date or figure as an example. Score each string 1-3 with the rubric in the guide and return nothing below 2.
25
31
  Lead with paste-ready copy. If you quote a shipped line, quote it exactly as a tool returned it.`;
26
32
  const INSTRUCTIONS = HAS_EXAMPLES ? INSTRUCTIONS_FULL : `Use these tools whenever you write or review interface copy, including strings in code.
27
33
  The repo's own copy rules, glossary and voice guide come first: where they differ from this guidance, follow them.
28
34
  0. In a codebase, call read_product once and write the product brief it asks for; to improve existing copy, call audit_copy and fix the worst lines first.
29
35
  1. Call get_guide with the pattern once per task and follow it.
30
36
  2. If the moment has stakes or feeling, call decide_tone first.
31
- 3. State-check, write every piece the screen needs, then run lint_copy on every draft and fix each block and warn, or say why you kept it. Score each string 1-3 with the rubric in the guide and return nothing below 2.
37
+ 3. State-check from the code: where the request and the code disagree, write from the code and say so. Write every piece the screen needs ("no change" is a valid answer for copy that works; keep keys and element names as given), then run lint_copy on every draft with evidence (file:line) for each claim, and fix each block and warn, or say why you kept it. Score each string 1-3 with the rubric in the guide and return nothing below 2.
32
38
  Lead with paste-ready copy, recommend one option, and cite the rule behind it.`;
33
39
 
34
40
  // the repo's industry, from .content-md.json or the saved product brief, so references stay on-domain by default
@@ -47,6 +53,7 @@ const element = z.string().transform((e, ctx) => {
47
53
 
48
54
  export async function serve() {
49
55
  const server = new McpServer({ name: "content-md", version: pkg.version }, { instructions: INSTRUCTIONS });
56
+ instrument(server);
50
57
 
51
58
  server.registerTool("get_guide", {
52
59
  title: "UX writing guide",
@@ -56,7 +63,14 @@ export async function serve() {
56
63
  full: z.boolean().optional().describe("Also return every topic in the pattern index (about 18,000 more characters). Rarely needed."),
57
64
  },
58
65
  annotations: { readOnlyHint: true },
59
- }, async ({ pattern, full }) => ({ content: [{ type: "text", text: getGuide({ pattern, full }) }] }));
66
+ }, async ({ pattern, full }) => {
67
+ const root = process.cwd();
68
+ const inRepo = [".git", "package.json", "pyproject.toml", "Gemfile", "go.mod", "Cargo.toml", "composer.json"].some((f) => exists(pjoin(root, f)));
69
+ const first = !productRead && inRepo
70
+ ? "Before you write: call read_product. It shows what this product says, who uses it and what its code does; agents who skip it leave out facts the copy needs. Then list what the request claims about the product and open the code for each.\n\n"
71
+ : "";
72
+ return { content: [{ type: "text", text: first + getGuide({ pattern, full }) }] };
73
+ });
60
74
 
61
75
  if (HAS_EXAMPLES) server.registerTool("find_examples", {
62
76
  title: "Find shipped examples",
@@ -144,7 +158,7 @@ export async function serve() {
144
158
 
145
159
  server.registerTool("lint_copy", {
146
160
  title: "Lint copy",
147
- description: "Deterministic pass/fail checks on one screen's copy (pass the tool state, stakes and expected pieces for the full set): state overclaim, tone fence at high stakes, plural handling, verb-only buttons, missing pieces, template leaks, raw error codes, filler, generic buttons, blame words, 'Are you sure', body repeating headline, casing, length, emoji at high stakes. Severity block > warn > note. Run on every draft before presenting it.",
161
+ description: "Deterministic pass/fail checks on one screen's copy. It pulls every claim out of the copy (sent, refunded, deleted, restorable, takes N days, saved, visible to) and, in a repo, needs a file:line in `evidence` for each, which it reads to check. Pass `original` when rewriting to catch claims the original didn't make. Also: tone fence at high stakes, plural handling, verb-only buttons, missing pieces, template leaks, raw error codes, filler, generic buttons, blame words, 'Are you sure', body repeating headline, casing, length, emoji at high stakes, colon or semicolon joining clauses, a trailing 'yet', and, in a repo, departures from the product's own habits (read_product's position). Severity block > warn > note. Run on every draft before presenting it.",
148
162
  inputSchema: {
149
163
  pattern: pattern.optional(),
150
164
  units: z.array(z.object({ element, text: z.string() })).min(1).describe("Every piece of copy on the screen, in order"),
@@ -153,23 +167,39 @@ export async function serve() {
153
167
  expected_pieces: z.array(element).optional().describe("The pieces the screen needs; any missing one is blocked."),
154
168
  original: z.array(z.object({ element: z.string(), text: z.string() })).optional().describe("When rewriting: the old pieces. Short originals that were changed are noted."),
155
169
  allow: z.array(z.string()).optional().describe("Words or whole lines the repo's own rules or glossary accept (e.g. 'Continue', 'Inbox'); they are never flagged. Entries in the repo's .content-md.json are added automatically."),
170
+ evidence: z.array(z.object({ claim: z.string().describe("The words of the claim, as they appear in the copy"), where: z.string().describe("file:line (or file:start-end) in this repo where the code does it; 'request' if only the request says so") })).optional()
171
+ .describe("One entry per claim the copy makes: that something was sent, refunded, deleted, can be restored, takes N days, is saved or visible to someone. In a repo every claim needs a file:line; the cited lines are read and must mention it."),
156
172
  },
157
173
  annotations: { readOnlyHint: true },
158
174
  }, async (args) => {
159
- const findings = lintCopy({ ...args, allow: [...(args.allow || []), ...readConfig(process.cwd()).allow] });
175
+ const root = process.cwd();
176
+ const findings = lintCopy({ ...args, allow: [...(args.allow || []), ...readConfig(root).allow] });
177
+ // claims need file:line evidence in a repo; outside one there is no code to cite, so they are listed as notes
178
+ const inRepo = [".git", "package.json", "pyproject.toml", "Gemfile", "go.mod", "Cargo.toml", "composer.json"].some((f) => exists(pjoin(root, f)));
179
+ const units = args.units.map((u) => ({ ...u, element: normElement(u.element) }));
180
+ const original = args.original?.map((o) => ({ ...o, element: normElement(o.element) }));
181
+ const cc = checkClaims({ units, evidence: args.evidence, stakes: args.stakes, original, root });
182
+ for (const f of cc.findings) findings.push(inRepo || f.rule === "added-claim" ? f : { ...f, severity: "note" });
183
+ // the product's own style habits (read_product's `position`): departures are flagged, and its casing wins over the generic sentence-case note
184
+ if (inRepo) {
185
+ const pos = positionFor(root, args.pattern);
186
+ if (pos?.short?.case?.call === "Title Case") for (let k = findings.length - 1; k >= 0; k--) if (findings[k].rule === "title-case") findings.splice(k, 1);
187
+ findings.push(...checkPosition(units, pos));
188
+ }
160
189
  const pass = !findings.some((f) => f.severity === "block" || f.severity === "warn");
161
- return json({ pass, findings: findings.length ? findings : "No findings.", ...(pass ? {} : { next: "Fix every block and warn, then run lint_copy again, or say why you kept one." }) });
190
+ return json({ pass, findings: findings.length ? findings : "No findings.", ...(cc.claims.length ? { claims: cc.claims } : {}),
191
+ ...(pass ? {} : { next: "Fix every block and warn, then run lint_copy again, or say why you kept one. For an unbacked claim: open the code that does it and pass {claim, where: \"file:line\"}; if the code doesn't do it, cut the claim or ask. If the request and the code disagree, write from the code and say so." }) });
162
192
  });
163
193
 
164
194
  server.registerTool("read_product", {
165
195
  title: "Read the product",
166
- description: "Read the codebase you are working in to learn what the product is, who uses it and how it already sounds: manifest, README, landing copy, a sample of its own UI strings with file:line, and voice numbers (casing, 'we', exclamation marks, contractions, the product's own words). Call it once per session before writing or reviewing copy in a repo, then write the short product brief it asks for.",
196
+ description: "Read the codebase you are working in to learn what the product is, who uses it and how it already sounds: manifest, README, landing copy, a sample of its own UI strings with file:line, voice numbers, and `position`: this product's own habits (contractions, final full stop, case, 'you'/'we', length) as verdicts to follow in new copy. Call it once per session before writing or reviewing copy in a repo, then write the short product brief it asks for.",
167
197
  inputSchema: {
168
198
  root: z.string().optional().describe("Project root; defaults to the folder the server was started in"),
169
199
  sample: z.number().int().min(5).max(80).optional(),
170
200
  },
171
201
  annotations: { readOnlyHint: true },
172
- }, async (args) => json(readProduct(args)));
202
+ }, async (args) => { productRead = true; return json(readProduct(args)); });
173
203
 
174
204
  server.registerTool("save_product_brief", {
175
205
  title: "Save the product brief",
@@ -226,4 +256,49 @@ export async function serve() {
226
256
  }, async (uri) => ({ contents: [{ uri: uri.href, mimeType: "text/markdown", text: getGuide({ full: true }) }] }));
227
257
 
228
258
  await server.connect(new StdioServerTransport());
259
+ noticeOnce(process.stderr);
260
+ // a stdio server ends when the client closes stdin: send what is queued first
261
+ process.stdin.on("end", () => { flush().finally(() => process.exit(0)); });
262
+ }
263
+
264
+ // Usage stats: wrap every tool so each call records its name, our own enum values from its arguments and the
265
+ // shape of its result. Nothing the agent wrote (copy, situations, paths, briefs) is read here.
266
+ const ENUM_ARGS = ["stakes", "screen_state", "reversibility", "journey_stage", "trigger", "audience", "cause", "user_mindset", "platform", "quality"];
267
+ function instrument(server) {
268
+ const register = server.registerTool.bind(server);
269
+ server.registerTool = (name, config, handler) => register(name, config, async (args, extra) => {
270
+ const t0 = Date.now();
271
+ let result, ok = true;
272
+ try { result = await handler(args, extra); return result; }
273
+ catch (e) { ok = false; throw e; }
274
+ finally { try { record(server, name, args || {}, result, ok, Date.now() - t0); } catch { /* stats never break a tool */ } }
275
+ });
276
+ }
277
+ function record(server, tool, args, result, ok, ms) {
278
+ setClient(server.server.getClientVersion?.()?.name);
279
+ const props = { tool, ok, duration_ms: ms };
280
+ if (PATTERNS.includes(args.pattern)) props.pattern = args.pattern;
281
+ for (const k of ENUM_ARGS) if (typeof args[k] === "string") props[k] = args[k];
282
+ if (Array.isArray(args.risk)) props.risk = args.risk;
283
+ if (ELEMENTS.includes(args.element)) props.element = args.element;
284
+ let out; try { out = JSON.parse(result?.content?.[0]?.text); } catch { out = undefined; }
285
+ if (tool === "lint_copy") {
286
+ const findings = Array.isArray(out?.findings) ? out.findings : [];
287
+ Object.assign(props, {
288
+ n_units: args.units?.length || 0, elements: [...new Set((args.units || []).map((u) => normElement(u.element)).filter((e) => ELEMENTS.includes(e)))],
289
+ rewrite: !!args.original?.length, n_evidence: args.evidence?.length || 0, has_state: !!args.state,
290
+ pass: !!out?.pass, flagged: findings.some((f) => f.severity === "block" || f.severity === "warn"),
291
+ blocks: findings.filter((f) => f.severity === "block").length, warns: findings.filter((f) => f.severity === "warn").length,
292
+ notes: findings.filter((f) => f.severity === "note").length, rules: [...new Set(findings.map((f) => f.rule))], n_claims: out?.claims?.length || 0,
293
+ });
294
+ if (out) trackExample({ pattern: props.pattern, stakes: args.stakes, units: args.units, original: args.original, rules: props.rules, pass: props.pass });
295
+ }
296
+ if (["find_reference", "find_examples", "find_rules", "audit_copy"].includes(tool)) {
297
+ const list = Array.isArray(out) ? out : out?.results || out?.references || out?.strings || out?.lines;
298
+ if (Array.isArray(list)) props.n_results = list.length;
299
+ if (tool === "audit_copy") { props.passed_strings = !!args.strings; props.filtered = !!args.path_filter; }
300
+ }
301
+ if (tool === "ask_person") props.n_questions = args.questions?.length || 0;
302
+ if (tool === "decide_tone" && Array.isArray(out?.tones)) props.n_tones = out.tones.length;
303
+ track("tool", props);
229
304
  }
@@ -0,0 +1,167 @@
1
+ // Anonymous usage stats, on by default, the way Next.js and Astro do it: announced on first run, off with one
2
+ // command, and never on in CI or when DO_NOT_TRACK is set. Only event names and our own enum values are sent:
3
+ // which tool ran, the UI pattern, the stakes, whether lint flagged anything and which of our rules fired.
4
+ // Never copy, code, file paths, repo names or product details. Sharing examples of copy is a separate opt-in.
5
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
6
+ import { homedir, platform } from "node:os";
7
+ import { dirname, join } from "node:path";
8
+ import { randomUUID } from "node:crypto";
9
+ import { fileURLToPath } from "node:url";
10
+
11
+ const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
12
+ const PKG = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8"));
13
+ export const ENDPOINT = process.env.CONTENT_MD_TELEMETRY_URL || "https://agarau.dev/api/content-md/events";
14
+ export const PRIVACY_URL = "https://agarau.dev/content-md#usage-stats";
15
+ const SESSION = randomUUID();
16
+
17
+ export const NOTICE = `content-md collects anonymous usage stats: which tools run, the kind of screen, and whether lint flagged anything.
18
+ It never sends your copy, code, file paths or repo names. Details: ${PRIVACY_URL}
19
+ Turn it off with \`npx content-md telemetry off\`, or set DO_NOT_TRACK=1.`;
20
+
21
+ export function configDir() {
22
+ if (process.env.CONTENT_MD_CONFIG_DIR) return process.env.CONTENT_MD_CONFIG_DIR;
23
+ if (process.platform === "win32" && process.env.APPDATA) return join(process.env.APPDATA, "content-md");
24
+ return join(process.env.XDG_CONFIG_HOME || join(homedir(), ".config"), "content-md");
25
+ }
26
+ const file = () => join(configDir(), "telemetry.json");
27
+
28
+ export function readConfig() {
29
+ try { return JSON.parse(readFileSync(file(), "utf8")); } catch { return {}; }
30
+ }
31
+ export function writeConfig(patch) {
32
+ const next = { ...readConfig(), ...patch };
33
+ try { mkdirSync(configDir(), { recursive: true }); writeFileSync(file(), JSON.stringify(next, null, 2) + "\n"); } catch { /* read-only home: stay quiet */ }
34
+ return next;
35
+ }
36
+
37
+ const CI_VARS = ["CI", "CONTINUOUS_INTEGRATION", "BUILD_NUMBER", "RUN_ID", "GITHUB_ACTIONS", "GITLAB_CI", "BUILDKITE", "CIRCLECI", "TRAVIS", "JENKINS_URL", "TEAMCITY_VERSION", "TF_BUILD", "CODEBUILD_BUILD_ID", "BITBUCKET_BUILD_NUMBER"];
38
+ const off = (v) => v != null && /^(0|false|off|no)$/i.test(String(v).trim());
39
+ const on = (v) => v != null && /^(1|true|on|yes)$/i.test(String(v).trim());
40
+
41
+ // Why stats are off, or null when they are on.
42
+ export function disabledReason(env = process.env, cfg = readConfig()) {
43
+ if (on(env.DO_NOT_TRACK)) return "DO_NOT_TRACK is set";
44
+ if (off(env.CONTENT_MD_TELEMETRY) || on(env.CONTENT_MD_TELEMETRY_DISABLED)) return "CONTENT_MD_TELEMETRY is off";
45
+ if (cfg.enabled === false) return "turned off with `content-md telemetry off`";
46
+ if (CI_VARS.some((k) => env[k] && !off(env[k]))) return "running in CI";
47
+ if (env.NODE_ENV === "test") return "NODE_ENV is test";
48
+ return null;
49
+ }
50
+ export const enabled = () => !disabledReason();
51
+ export const examplesEnabled = () => enabled() && readConfig().examples === true;
52
+ const debug = () => on(process.env.CONTENT_MD_TELEMETRY_DEBUG);
53
+
54
+ function installId() {
55
+ const cfg = readConfig();
56
+ if (/^[0-9a-f-]{36}$/.test(cfg.installId || "")) return cfg.installId;
57
+ return writeConfig({ installId: randomUUID() }).installId;
58
+ }
59
+
60
+ // Show the notice once per machine. `stream` is stderr for the MCP server, whose stdout is the protocol.
61
+ export function noticeOnce(stream = process.stdout) {
62
+ if (!enabled()) return false;
63
+ const cfg = readConfig();
64
+ if (cfg.notifiedAt) return false;
65
+ stream.write(`\n${NOTICE}\n\n`);
66
+ writeConfig({ notifiedAt: new Date().toISOString() });
67
+ return true;
68
+ }
69
+
70
+ // The calling agent's client, reduced to a short known name.
71
+ const CLIENTS = [[/claude/i, "claude-code"], [/cursor/i, "cursor"], [/codex/i, "codex"], [/windsurf|codeium|cascade/i, "windsurf"], [/copilot|vscode|visual studio code/i, "vscode"], [/zed/i, "zed"], [/gemini/i, "gemini"], [/cline/i, "cline"], [/goose/i, "goose"]];
72
+ export function clientName(raw) {
73
+ if (!raw) return "unknown";
74
+ const hit = CLIENTS.find(([re]) => re.test(raw));
75
+ return hit ? hit[1] : "other";
76
+ }
77
+
78
+ const SAFE = /^[a-z0-9][a-z0-9._-]{0,47}$/i;
79
+ const safe = (v) => (typeof v === "string" && SAFE.test(v) ? v : undefined);
80
+
81
+ let queue = [], timer = null, client = "cli";
82
+ export const setClient = (raw) => { client = clientName(raw); };
83
+
84
+ function base() {
85
+ return { install_id: installId(), session_id: SESSION, version: PKG.version, client, os: platform(), node: process.versions.node.split(".")[0] };
86
+ }
87
+
88
+ export function track(event, props = {}) {
89
+ if (!enabled()) return;
90
+ const clean = {};
91
+ for (const [k, v] of Object.entries(props)) {
92
+ if (typeof v === "number" && Number.isFinite(v)) clean[k] = Math.round(v);
93
+ else if (typeof v === "boolean") clean[k] = v;
94
+ else if (Array.isArray(v)) { const a = v.map(safe).filter(Boolean).slice(0, 40); if (a.length) clean[k] = a; }
95
+ else if (safe(v)) clean[k] = v;
96
+ }
97
+ push({ kind: "event", event: safe(event) || "unknown", props: clean });
98
+ }
99
+
100
+ // Opt-in only: the before/after text of one lint_copy check, scrubbed of anything that looks private.
101
+ export function trackExample(example) {
102
+ if (!examplesEnabled()) return;
103
+ const units = (list) => (list || []).slice(0, 12).map((u) => ({ element: safe(u.element) || "other", text: scrub(u.text) })).filter((u) => u.text);
104
+ push({ kind: "example", pattern: safe(example.pattern), stakes: safe(example.stakes), units: units(example.units), original: units(example.original), rules: (example.rules || []).map(safe).filter(Boolean).slice(0, 40), pass: !!example.pass });
105
+ }
106
+
107
+ export function scrub(text) {
108
+ if (typeof text !== "string") return "";
109
+ return text
110
+ .replace(/[\w.+-]+@[\w-]+(\.[\w-]+)+/g, "[email]")
111
+ .replace(/\bhttps?:\/\/\S+|\bwww\.\S+/gi, "[link]")
112
+ .replace(/\b(sk|pk|rk|ghp|gho|ghs|github_pat|xox[abpr]|AKIA|AIza)[-_A-Za-z0-9]{10,}/g, "[key]")
113
+ .replace(/\b[A-Za-z0-9_-]{32,}\b/g, "[key]")
114
+ .replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/g, "[key]")
115
+ .replace(/(?:~|\.{1,2})?\/(?:[\w.-]+\/)+[\w.-]+/g, "[path]")
116
+ .replace(/\b[A-Z]:\\[^\s]+/g, "[path]")
117
+ .replace(/\+?\d[\d ()-]{7,}\d/g, "[number]")
118
+ .slice(0, 300);
119
+ }
120
+
121
+ function push(item) {
122
+ const full = { ...base(), ...item, at: new Date().toISOString() };
123
+ if (debug()) { process.stderr.write(`[content-md telemetry] ${JSON.stringify(full)}\n`); return; }
124
+ queue.push(full);
125
+ if (queue.length >= 20) { flush(); return; }
126
+ if (!timer) { timer = setTimeout(() => { timer = null; flush(); }, 5000); timer.unref?.(); }
127
+ }
128
+
129
+ // Send what is queued. Never throws, never waits more than 1.5 seconds.
130
+ export async function flush() {
131
+ if (timer) { clearTimeout(timer); timer = null; }
132
+ if (!queue.length) return;
133
+ const batch = queue; queue = [];
134
+ try {
135
+ await fetch(ENDPOINT, {
136
+ method: "POST",
137
+ headers: { "content-type": "application/json", "user-agent": `content-md/${PKG.version}` },
138
+ body: JSON.stringify({ items: batch }),
139
+ signal: AbortSignal.timeout(1500),
140
+ });
141
+ } catch { /* offline or blocked: drop it */ }
142
+ }
143
+
144
+ // `npx content-md telemetry [status|on|off|examples on|examples off]`
145
+ export function telemetryCommand(argv) {
146
+ const [a, b] = argv;
147
+ if (a === "off" || a === "disable") { writeConfig({ enabled: false, examples: false }); console.log("Usage stats are off on this machine. Nothing more will be sent."); return; }
148
+ if (a === "on" || a === "enable") { writeConfig({ enabled: true }); console.log("Usage stats are on. Only anonymous events are sent, never your copy or code."); return; }
149
+ if (a === "examples" && (b === "on" || b === "off")) {
150
+ writeConfig({ examples: b === "on", ...(b === "on" ? { enabled: true } : {}) });
151
+ console.log(b === "on"
152
+ ? "Example sharing is on. lint_copy checks now send the copy they checked (before and after), with emails, links, numbers, paths and keys removed. Turn it off with `npx content-md telemetry examples off`."
153
+ : "Example sharing is off. Only anonymous usage stats are sent.");
154
+ return;
155
+ }
156
+ const reason = disabledReason();
157
+ const cfg = readConfig();
158
+ console.log(`Usage stats: ${reason ? `off (${reason})` : "on"}
159
+ Example sharing: ${!reason && cfg.examples === true ? "on" : "off"}
160
+ Config: ${file()}
161
+ ${NOTICE.split("\n").slice(0, 2).join("\n")}
162
+
163
+ npx content-md telemetry off stop sending usage stats
164
+ npx content-md telemetry on start again
165
+ npx content-md telemetry examples on also share the copy lint_copy checks (scrubbed)
166
+ npx content-md telemetry examples off stop sharing copy`);
167
+ }
package/src/tools.js CHANGED
@@ -261,6 +261,15 @@ export function lintCopy({ units, pattern, state, stakes, expected_pieces, origi
261
261
  for (let k = out.length - 1; k >= 0; k--) if (out[k].unit === i && out[k].rule === "absence-headline") out.splice(k, 1); // one finding per problem
262
262
  add(i, "warn", "no-x-yet", `'${x}' is the most common model empty-state headline (49% of model lines, 5.5% of shipped); lead with what the person gets or can do ("Add your first contact")`);
263
263
  }
264
+ // a colon or semicolon stitching two clauses together reads as written-by-a-model in short UI copy (picked against 2 of 2 times in blind review)
265
+ if (u.element !== "label" && u.element !== "legal-fineprint" && /[A-Za-z0-9)'"\]][;:]\s+[A-Za-z0-9'"{(]/.test(x) && !/^\S+:\s*$/.test(x) && !/^[^\s:;]+( [^\s:;]+)?:\s[^;]*$/.test(x))
266
+ add(i, "warn", "clause-join", `'${(x.match(/[^\s]*[;:]\s+\S+/) || [""])[0]}': a ${x.includes(";") ? "semicolon" : "colon"} joins two clauses; write two sentences, or join them with a word ("so", "and", "because")`);
267
+ // a permanent delete hedged as "you can't restore it yourself": the person reads that someone else can. Say it can't be undone, or name the restore they can reach
268
+ for (const m of x.match(/\b(?:can't|cannot|can not|won't be able to|will not be able to|unable to)\s+(?:restore|recover|undo|undelete|get back|bring back|retrieve)\b[^.!?]{0,30}?\b(?:yourself|on your own|by yourself)\b/gi) || [])
269
+ add(i, "warn", "restore-hedge", `'${m}' suggests someone else can restore it. If nobody the person can reach can restore it, say it can't be undone; if someone can, say who`);
270
+ // "yet" promises that something is coming; the model adds it (a note: shipped products use it too, so it is a prompt to check the facts) to empty and absence lines whether or not the facts say so
271
+ if (!out.some((f) => f.unit === i && f.rule === "no-x-yet") && /\byet\s*[.!?]?\s*$|\byet[.,;:]\s/i.test(x))
272
+ add(i, "note", "filler-yet", `'yet' suggests it will happen soon; cut it unless the facts say it will ("None of the 9 repositories has published a release.")`);
264
273
  if (/\b(will|'ll)\s+(show up|appear|be listed|be shown|be displayed)\s+here\b|\byou('ll| will) see (it|them|\w+) here\b/i.test(x)) add(i, "warn", "narrating-location", "says where content will appear instead of what the person gets; say what it is and what to do");
265
274
  if (u.element === "body") {
266
275
  const sents = x.split(/(?<=[.!?])\s+/).filter((t) => t.split(/\s+/).length > 1);