content-md 0.0.0-stage → 1.0.2

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 ADDED
@@ -0,0 +1,79 @@
1
+ # Changelog
2
+
3
+ ## 1.0.2
4
+
5
+ From a trial in a real product repo and a full audit of 1.0.0. (1.0.1 was built but never published; its changes are listed under it below and ship in this release.)
6
+
7
+ **Serious bugs fixed**
8
+ - `audit_copy` and `read_product` no longer skip most of a big repo. The walk is breadth-first, counts only files it can read copy from, stops at 40,000 (set `CONTENT_MD_MAX_FILES` to change it) and says so: the result carries `truncated` and a warning naming the folders it didn't read.
9
+ - `path_filter` that names a folder walks that folder directly, and a filter that finds nothing says so instead of returning `scanned: 0`.
10
+ - Curly apostrophes and quotes ("won’t") are read the same as straight ones by every check, and by `read_product`'s contraction count.
11
+ - Future tense ("will read", "we’ll publish", "going to") is no longer read as a claim that something already happened.
12
+ - `outcome-hint` was inverted. It now fires when the state shows no decision.
13
+ - The plural check no longer matches `{name}`; it still catches `{count} messages`.
14
+ - New `are-you-sure` check: a warning, or a note when the line goes on to name the cost.
15
+
16
+ **Lint**
17
+ - New: `absence-headline` ("Nothing to see here", "There are no X at the moment", "You don't have any X"), `typo` (about 70 common misspellings, "occured" among them), `empty-text` (a piece with no text is blocked). "Uh oh" and "yikes" are flagged as filler at any stakes.
18
+ - Common one-word buttons pass (Save, Send, Delete, Undo, Add, Open, Create, View and more). A lone vague verb ("Manage") is a note, and not even that when the headline names the object.
19
+ - `audit_copy` labels links, nav items and footer items as links, not buttons.
20
+ - `no-way-forward` counts contact, sign in, reload, wait, update and visit, and skips empty and non-English text.
21
+ - `lint_copy` and the other tools accept the element names agents guess: button, title, heading, link, error, description and similar.
22
+ - On the package's own 778 strong and gold lines, 1.5% now get a warn or block (3.9% before); on their 550 screens, 4.0% (7.5% before).
23
+
24
+ **References**
25
+ - `find_reference` always takes one path and returns one shape, with the quality floor, whether you pass `role` or `element`.
26
+ - `find_examples` ranks by the query when you give one, and returns nothing when no screen shares a word with it.
27
+ - `compare_to_reference`'s length range is now really within 30%.
28
+ - `decide_tone` with no facts returns an error asking for at least the screen state and stakes. With facts it always returns an instruction.
29
+ - The rubric's "Stay close to the reference" section is gone. It told agents to write every line from a reference, against the rules and the test results.
30
+
31
+ **Cost and install**
32
+ - `get_guide` with a pattern returns about 14,000 characters (33,700 before): the playbook, the universal rules, the rubric and only the parts of the pattern index that fit. `full: true` returns everything. Without a pattern it returns the rules and the list of patterns, not every playbook (58,000 before).
33
+ - `read_product` returns about 10,000 characters (16,000 before).
34
+ - The optional semantic-search dependency is gone. It added about 55 MB and couldn't work, because its vectors were never shipped. Search is keyword-based, as it was in practice.
35
+ - `ask_person` no longer requires `slot` or `default`.
36
+ - The numbers in the guide, skill, README and data now agree: 8,876 lines from 703 products, 16 style guides, 413 rules, 35 patterns, 194 pattern rules.
37
+
38
+ **init and files**
39
+ - `save_product_brief` writes `.content-md/product.md`, its own file, and never edits AGENTS.md or CLAUDE.md unless asked to. Briefs saved in those files by 1.0.0 are still read.
40
+ - With no flags, init uses only what the repo shows (`.cursor`, `.claude`, `CLAUDE.md`, `AGENTS.md`, `.vscode`, `.windsurfrules`), not folders in your home directory. If it finds nothing, it writes nothing and tells you which flag to pass.
41
+
42
+ On five open-source app repos, lines flagged by the kinds of check 1.0.0 had fell from 769 to 542 (−30%). The new checks (a failure with no fix, "Are you sure", absence headlines, typos) flag 151 more lines, which I sampled and found to be real.
43
+
44
+ ## 1.0.1 (not published)
45
+
46
+ **init**
47
+ - Writes only inside the repo. For Codex and Windsurf, whose MCP settings live in your home folder, it prints the lines to add; `--global` lets it write them.
48
+ - Pins the server to the installed version (`npx -y content-md@<version>`), so an editor never pulls a new release on its own.
49
+ - Shared instruction files (`AGENTS.md`, `.github/copilot-instructions.md`, `.windsurfrules`) get a short pointer instead of the full method. `--rules` restores the full method.
50
+ - Finds the repo's own copy rules and glossary and tells the agent they come first.
51
+ - New: `npx content-md remove` takes out everything init added. `npx content-md audit` runs the audit from the command line.
52
+
53
+ **Precedence**
54
+ - The rules, the skill and the server instructions now say the repo's own copy rules, glossary and voice guide win. The line about not reusing a reference's wording now applies to other products' lines only; the product's own words should be reused.
55
+ - `read_product` and `audit_copy` return `repo_rules`, the files where the repo states its rules.
56
+
57
+ **Lint**
58
+ - Standard labels pass: Continue, Submit, Next, Confirm, Inbox, Terms, Privacy, Settings, Help and similar. A lone word is flagged only when it is a verb that needs an object, so product and brand names pass.
59
+ - "null" and "undefined" in field docs ("Can be null", "Returns null when...") are no longer template leaks.
60
+ - "exception" in prose is no longer a raw error code.
61
+ - Success toasts can take an exclamation mark; only failure toasts are flagged.
62
+ - "Contact us", "email", "reach out" and similar count as a way forward.
63
+ - The word "page" alone is no longer screen narration; "This page lists..." still is.
64
+ - "Failed to", "went wrong" and "an error occurred" are flagged only when the line gives no fix, under the new rule `verdict-no-fix`. `blame-or-verdict` now covers blame only ("invalid", "you forgot"); "you must" is no longer flagged.
65
+ - "You can" is kept when it grants permission or names an option ("You can change this later", "If you lose it, you can reset it").
66
+ - "100%" is flagged only as a promise ("100% secure"), not as a value. Format tokens (YYYY MM DD) aren't flagged as all caps. A verdict and its fix ("Couldn't save. Try again.") aren't flagged as even sentences.
67
+ - New `allow` input, and `.content-md.json` (`allow`, `ignore`, `industry`), for words the repo has decided to use.
68
+
69
+ **audit_copy**
70
+ - Skips vendored, third-party, demo, playground, sandbox, generated and component-library folders (for example `shadcn-*` and `*-studio` blocks) and files marked `@generated` or `DO NOT EDIT`.
71
+
72
+ **References**
73
+ - `find_reference` and `find_examples` take an `industry` (defaulting to `.content-md.json`, then the saved brief). Lines from the same or a near industry rank higher; a line from an unrelated industry that carries that industry's own words (a booking, a workout) is dropped, and other unrelated lines need a close match on the moment.
74
+ - Higher floors (fit 0.40, situation 0.22): it returns nothing more often, rather than a weak match. Numbers, codes and stray tokens are no longer returned as copy.
75
+ - `how_to_use` no longer tells the agent to copy a reference's template; it treats references as evidence and points to the repo's rules.
76
+
77
+ ## 1.0.0
78
+
79
+ First release.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adedayo Agarau
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,115 @@
1
- # Temporary Holding Version
1
+ # content-md
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An MCP server that gives coding agents (Claude Code, Cursor, Codex, VS Code, Windsurf) a content designer's working method for interface copy. Your agent's own model writes the words, so no extra API key is needed. The server supplies the method, the checks and a body of shipped copy to look at.
4
+
5
+ Install with `npx content-md init`.
6
+
7
+ ## What it does
8
+
9
+ When your agent writes a button, an error, an empty state, a dialog or a notification, it can:
10
+
11
+ 1. **Decide the tone for the moment.** `decide_tone` takes the facts (what happened, how much is at stake, who has to act next) and returns two tone words, one concrete instruction, the tones to avoid and the mistakes writers are tempted to make. The voice stays your product's. Only the tone moves with the moment.
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
+ 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
+ 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.
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
+ 7. **Look up style-guide rules.** `find_rules` searches 413 rules from 16 public style guides, with do and don't examples.
18
+
19
+ The writing rules are defaults with stated exceptions, not laws. They are in `guide/rules.md` and are short enough to read in a minute.
20
+
21
+ ## Tools
22
+
23
+ | tool | use |
24
+ |---|---|
25
+ | `read_product` | reads the repo once (README, manifest, its own strings, its copy rules) and returns the slots for a short product brief and the likely industry |
26
+ | `save_product_brief` | saves that brief in a marked block in AGENTS.md or CLAUDE.md, so the next session doesn't ask again |
27
+ | `ask_person` | asks the person at most two questions, as a form where the client supports it |
28
+ | `audit_copy` | finds the user-facing strings in the code and ranks them worst first, so the agent fixes those and leaves the rest |
29
+ | `decide_tone` | call first when the moment has stakes or feeling; returns tone words, an instruction and what to avoid |
30
+ | `get_guide` | voice, universal rules, the playbook for one of 35 patterns, the matching part of the pattern index and a rubric (about 14,000 characters) |
31
+ | `find_rules` | style-guide rules with do and don't examples |
32
+ | `lint_copy` | deterministic checks on one screen's copy; pass the pattern, the tool state, the stakes and the original lines if rewriting |
33
+ | `find_reference` | optional: the closest shipped lines for one element in one situation, kept to your industry; often returns none |
34
+ | `compare_to_reference` | optional: checks that a candidate keeps a reference's shape |
35
+ | `find_examples` | optional: whole shipped screens, with headline, body and buttons together |
36
+
37
+ There are also two prompts, `write-copy` and `review-copy`, and a `content-md://guide` resource.
38
+
39
+ You can run the linter on its own:
40
+
41
+ ```sh
42
+ content-md lint '{"pattern":"error","units":[{"element":"headline","text":"Error"}]}'
43
+ ```
44
+
45
+ ## Install
46
+
47
+ ```sh
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
50
+ ```
51
+
52
+ Restart the editor or agent afterwards. `init` is safe to run again, and `--dry-run` shows what it would write.
53
+
54
+ What it does, and what it leaves alone:
55
+
56
+ - **It writes only inside your repo.** Codex and Windsurf keep their MCP settings in your home folder, so for those `init` prints the lines to add instead. Pass `--global` to let it write them.
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
+ - **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
+ - **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.
61
+ - **The product brief gets its own file.** `save_product_brief` writes `.content-md/product.md`, not your agent instructions.
62
+ - **`npx content-md remove`** takes out everything `init` added. Add `--global` to clean the home-folder entries too.
63
+
64
+ | tool | MCP server registered in | rule installed in |
65
+ |---|---|---|
66
+ | Cursor | `.cursor/mcp.json` | `.cursor/rules/content-md.mdc` |
67
+ | Claude Code | `.mcp.json` | `.claude/skills/content-md/SKILL.md` |
68
+ | Codex | `~/.codex/config.toml` (with `--global`) | `AGENTS.md` (marked block) |
69
+ | VS Code (Copilot) | `.vscode/mcp.json` | `.github/copilot-instructions.md` (marked block) |
70
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` (with `--global`) | `.windsurfrules` (marked block) |
71
+
72
+ ### Tuning it to your repo
73
+
74
+ Put a `.content-md.json` at the repo root to tell the tools what your product has already decided:
75
+
76
+ ```json
77
+ {
78
+ "allow": ["Continue", "Inbox", "Submit"],
79
+ "ignore": ["src/legacy/", "packages/email-templates/"],
80
+ "industry": "media-entertainment"
81
+ }
82
+ ```
83
+
84
+ - `allow`: words and whole lines your glossary or style guide asks for. `lint_copy` and `audit_copy` never flag them. (A state overclaim is still flagged.)
85
+ - `ignore`: folders that aren't product UI. `audit_copy` already skips tests, vendored and third-party folders, demos, playgrounds, generated files and component-library blocks.
86
+ - `industry`: keeps `find_reference` and `find_examples` to comparable products. One of finance, commerce, productivity, social, ai-tools, health-fitness, media-entertainment, food-delivery, travel, education, developer-tools, mobility. Without it, the tools use the industry saved in your product brief.
87
+
88
+ To see the lines in a repo that most need a look, run `npx content-md audit` (or `npx content-md audit src/settings` for one area).
89
+
90
+ ## What we tested, and what we found
91
+
92
+ These are results from our own tests. They are small samples and we say so.
93
+
94
+ **With models.** We wrote copy for 24 held-out tasks (12 rewrites, 12 written from a brief) with several models, three runs each, and had other models judge the results blind. Judge scores moved by about 0.3 between identical runs, so differences smaller than that mean nothing.
95
+
96
+ **With a person.** A content designer picked between blind pairs. We treat these picks as the real verdict, because the model judges rewarded habits the designer rejected: padding, hedging, "No X yet" headlines and copy that describes the screen.
97
+
98
+ | question | result |
99
+ |---|---|
100
+ | Does adding 3 shipped references beat rules alone? | No. The designer picked rules alone in 8 of 12 pairs (rewrites 4 of 6, new copy 4 of 6). Model judges agreed on 11 of 17 clear votes. |
101
+ | Does adapting the nearest shipped line beat writing from the rules? | No. Rules alone won 7 of 10 pairs. Model judges also scored the adapted lines lower (win rate 34 to 40 percent). |
102
+ | Does an always-on promise audit help? | Only when the draft overclaims. The audited line was picked 5 times in 10, but the pattern was clear. Where the original truly overclaimed, the audit won. Where the original was already safe, the audit added hedging and the original won every time. So the audit now runs only when the state check finds an unsupported claim. |
103
+ | Does the tone brief reduce overclaiming? | Not on its own. Overclaim rates were 18 percent without it and 25 percent with it, within noise (60 tasks per cell). The state check, the pattern guide and the conditional audit do that work. The tone brief is there for voice, not safety. |
104
+ | Does it help an agent write copy for new states in a real repo? | Yes, after two rounds of fixes. On 10 new states across five open-source apps, the designer picked Claude with the tool in 6 of 10 and Codex with the tool in 7 of 10, against the same agent without it. An earlier version lost 1 to 4: it put every fact on screen and added reassurance. Codex's remaining losses cut too much: a benefit, a cause or an instruction. |
105
+ | Did the default rules change model habits? | Yes, on the habits we can count. Rewriting the rules from "never" statements into defaults with exceptions cut "No X yet" empty-state headlines from 67 percent to 0 (only 6 cases), raised short original lines kept word for word in rewrites from 44 to 65 percent, and lowered bodies that repeat their headline from 25 to 20 percent. Model judges scored the new defaults the same or lower, which we read as judges rewarding those habits. We have not yet run a blind human test of old against new defaults. |
106
+
107
+ **What this means in practice.** The package does not make an agent imitate any particular product. It makes the agent state what is true, pick a tone that fits the moment, avoid a short list of known habits and check its own work. References are there when you want evidence for a decision.
108
+
109
+ **Limits.**
110
+
111
+ - Samples are small: 10 to 12 blind pairs per question, one person choosing.
112
+ - The same model families wrote and judged some tests, so part of any judge gain is a model agreeing with itself.
113
+ - The data is mostly English, mostly consumer mobile and web apps.
114
+ - The tone decider's output is a recommendation. Nothing yet proves it improves copy beyond the checks above.
115
+ - Lint results are rules of thumb. A warning is a prompt to look again, not a verdict.
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ const [cmd, ...rest] = process.argv.slice(2);
3
+
4
+ if (cmd === "init") {
5
+ const { init } = await import("../src/init.js");
6
+ init(rest);
7
+ } else if (cmd === "remove" || cmd === "uninstall") {
8
+ const { remove } = await import("../src/init.js");
9
+ remove(rest);
10
+ } else if (cmd === "audit") {
11
+ // npx content-md audit [path_filter] : the worst user-facing lines in this repo
12
+ const { auditCopy } = await import("../src/product.js");
13
+ console.log(JSON.stringify(auditCopy({ path_filter: rest[0] }), null, 1));
14
+ } else if (cmd === "lint") {
15
+ // npx content-md lint '{"pattern":"error","units":[{"element":"headline","text":"Error"}]}'
16
+ const { lintCopy } = await import("../src/tools.js");
17
+ console.log(JSON.stringify(lintCopy(JSON.parse(rest.join(" "))), null, 1));
18
+ } else if (cmd === "--help" || cmd === "-h" || cmd === "help") {
19
+ console.log(`content-md: UX writing tools for coding agents, a tone decider, pattern playbooks, style-guide rules and a copy linter.
20
+
21
+ 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).
23
+ Writes only inside this repo unless you pass --global. --rules puts the full method
24
+ in AGENTS.md and the other shared files instead of the pointer.
25
+ npx content-md remove [--global] [--dry-run]
26
+ take out everything init added
27
+ npx content-md audit [path]
28
+ list the user-facing lines in this repo that most need a look
29
+ npx content-md
30
+ run the MCP server over stdio (this is what your editor calls)
31
+ npx content-md lint '<json>'
32
+ lint one screen: {"pattern":"error","units":[{"element":"headline","text":"..."}]}`);
33
+ } else {
34
+ const { serve } = await import("../src/server.js");
35
+ await serve();
36
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "hedge": {
3
+ "model_pct": 0.62,
4
+ "shipped_pct": 1.04,
5
+ "keep": false,
6
+ "severity": "note",
7
+ "show_rates": true
8
+ },
9
+ "throat-clearing": {
10
+ "model_pct": 0.18,
11
+ "shipped_pct": 0.4,
12
+ "keep": false,
13
+ "severity": "note",
14
+ "show_rates": true
15
+ },
16
+ "explains-the-obvious": {
17
+ "model_pct": 0.14,
18
+ "shipped_pct": 0.29,
19
+ "keep": false,
20
+ "severity": "note",
21
+ "show_rates": true
22
+ },
23
+ "padded-reassurance": {
24
+ "model_pct": 1,
25
+ "shipped_pct": 0.61,
26
+ "keep": true,
27
+ "severity": "note",
28
+ "show_rates": true
29
+ },
30
+ "you-can": {
31
+ "model_pct": 2.45,
32
+ "shipped_pct": 1.49,
33
+ "keep": true,
34
+ "severity": "note",
35
+ "show_rates": true
36
+ },
37
+ "triad": {
38
+ "model_pct": 6.51,
39
+ "shipped_pct": 4.77,
40
+ "keep": false,
41
+ "severity": "note",
42
+ "show_rates": true
43
+ },
44
+ "not-x-but-y": {
45
+ "model_pct": 0.04,
46
+ "shipped_pct": 0,
47
+ "keep": false,
48
+ "severity": "note",
49
+ "show_rates": true
50
+ },
51
+ "dash-aside": {
52
+ "model_pct": 0,
53
+ "shipped_pct": 0.58,
54
+ "keep": false,
55
+ "severity": "note",
56
+ "show_rates": true
57
+ },
58
+ "marketing-filler": {
59
+ "model_pct": 0.31,
60
+ "shipped_pct": 0.72,
61
+ "keep": true,
62
+ "severity": "note",
63
+ "show_rates": false
64
+ },
65
+ "help-you": {
66
+ "model_pct": 0.38,
67
+ "shipped_pct": 0.23,
68
+ "keep": true,
69
+ "severity": "note",
70
+ "show_rates": true
71
+ },
72
+ "instant-promise": {
73
+ "model_pct": 0,
74
+ "shipped_pct": 0.21,
75
+ "keep": false,
76
+ "severity": "note",
77
+ "show_rates": true
78
+ }
79
+ }