content-md 0.0.0-stage → 1.0.0
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/LICENSE +21 -0
- package/README.md +84 -2
- package/bin/content-md.js +23 -0
- package/data/aivoice-rates.json +79 -0
- package/data/catalogue.json +1 -0
- package/data/corrections.json +209 -0
- package/data/enriched.json +1 -0
- package/data/failures.json +1 -0
- package/data/industries.json +1437 -0
- package/data/meta.json +60 -0
- package/data/patterns.json +1 -0
- package/data/rules.json +1 -0
- package/data/screens.json +1 -0
- package/data/tone/decider.json +1668 -0
- package/data/tone/model.json +5867 -0
- package/guide/SKILL.md +272 -0
- package/guide/patterns.md +235 -0
- package/guide/rubric.md +22 -0
- package/guide/rules.md +31 -0
- package/guide/voice.md +66 -0
- package/package.json +33 -4
- package/src/aivoice.js +50 -0
- package/src/context.js +139 -0
- package/src/decider.js +109 -0
- package/src/embed.js +65 -0
- package/src/init.js +94 -0
- package/src/product.js +283 -0
- package/src/reference2.js +338 -0
- package/src/server.js +202 -0
- package/src/tools.js +416 -0
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,85 @@
|
|
|
1
|
-
#
|
|
1
|
+
# content-md
|
|
2
2
|
|
|
3
|
-
|
|
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 194 interface patterns (error, empty state, paywall, confirmation dialog, push notification and so on), 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
|
+
| `decide_tone` | call first when the moment has stakes or feeling; returns tone words, an instruction and what to avoid |
|
|
26
|
+
| `get_guide` | voice, workflow, universal rules and the playbook for one of 194 patterns, plus a rubric |
|
|
27
|
+
| `find_rules` | style-guide rules with do and don't examples |
|
|
28
|
+
| `lint_copy` | deterministic checks on one screen's copy; pass the pattern, the tool state, the stakes and the original lines if rewriting |
|
|
29
|
+
| `find_reference` | optional: the closest shipped lines for one element in one situation |
|
|
30
|
+
| `compare_to_reference` | optional: checks that a candidate keeps a reference's shape |
|
|
31
|
+
| `find_examples` | optional: whole shipped screens, with headline, body and buttons together |
|
|
32
|
+
|
|
33
|
+
There are also two prompts, `write-copy` and `review-copy`, and a `content-md://guide` resource.
|
|
34
|
+
|
|
35
|
+
You can run the linter on its own:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
content-md lint '{"pattern":"error","units":[{"element":"headline","text":"Error"}]}'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
cd your-app
|
|
45
|
+
npx content-md init # detects your tools; or add --cursor --claude --codex --vscode --windsurf, or --all
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Restart the editor or agent afterwards. `init` only adds its own entries and is safe to run again. Use `--dry-run` to see what it would write.
|
|
49
|
+
|
|
50
|
+
| tool | MCP server registered in | rule installed in |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| Cursor | `.cursor/mcp.json` | `.cursor/rules/content-md.mdc` |
|
|
53
|
+
| Claude Code | `.mcp.json` | `.claude/skills/content-md/SKILL.md` |
|
|
54
|
+
| Codex | `~/.codex/config.toml` | `AGENTS.md` (marked block) |
|
|
55
|
+
| VS Code (Copilot) | `.vscode/mcp.json` | `.github/copilot-instructions.md` (marked block) |
|
|
56
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` | `.windsurfrules` (marked block) |
|
|
57
|
+
|
|
58
|
+
Run through `npx`, `init` registers `npx -y content-md`. A global or local install points the configs at that copy on disk instead.
|
|
59
|
+
|
|
60
|
+
## What we tested, and what we found
|
|
61
|
+
|
|
62
|
+
These are results from our own tests. They are small samples and we say so.
|
|
63
|
+
|
|
64
|
+
**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.
|
|
65
|
+
|
|
66
|
+
**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.
|
|
67
|
+
|
|
68
|
+
| question | result |
|
|
69
|
+
|---|---|
|
|
70
|
+
| 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. |
|
|
71
|
+
| 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). |
|
|
72
|
+
| 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. |
|
|
73
|
+
| 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. |
|
|
74
|
+
| 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. |
|
|
75
|
+
| 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. |
|
|
76
|
+
|
|
77
|
+
**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.
|
|
78
|
+
|
|
79
|
+
**Limits.**
|
|
80
|
+
|
|
81
|
+
- Samples are small: 10 to 12 blind pairs per question, one person choosing.
|
|
82
|
+
- The same model families wrote and judged some tests, so part of any judge gain is a model agreeing with itself.
|
|
83
|
+
- The data is mostly English, mostly consumer mobile and web apps.
|
|
84
|
+
- The tone decider's output is a recommendation. Nothing yet proves it improves copy beyond the checks above.
|
|
85
|
+
- Lint results are rules of thumb. A warning is a prompt to look again, not a verdict.
|
|
@@ -0,0 +1,23 @@
|
|
|
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 === "lint") {
|
|
8
|
+
// npx content-md lint '{"pattern":"error","units":[{"element":"headline","text":"Error"}]}'
|
|
9
|
+
const { lintCopy } = await import("../src/tools.js");
|
|
10
|
+
console.log(JSON.stringify(lintCopy(JSON.parse(rest.join(" "))), null, 1));
|
|
11
|
+
} else if (cmd === "--help" || cmd === "-h" || cmd === "help") {
|
|
12
|
+
console.log(`content-md: UX writing tools for coding agents, a tone decider, pattern playbooks, style-guide rules and a copy linter.
|
|
13
|
+
|
|
14
|
+
npx content-md init [--cursor --claude --codex --vscode --windsurf | --all] [--dry-run]
|
|
15
|
+
register the MCP server with your tools and add a short rule (auto-detects if no flag)
|
|
16
|
+
npx content-md
|
|
17
|
+
run the MCP server over stdio (this is what your editor calls)
|
|
18
|
+
npx content-md lint '<json>'
|
|
19
|
+
lint one screen: {"pattern":"error","units":[{"element":"headline","text":"..."}]}`);
|
|
20
|
+
} else {
|
|
21
|
+
const { serve } = await import("../src/server.js");
|
|
22
|
+
await serve();
|
|
23
|
+
}
|
|
@@ -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
|
+
}
|