passsy / write-markdownr3
Writing Markdown
PublicWrite markdown with one sentence per line, no wrapping, dash bullets, ATX headings and tagged code fences, and run markdownlint-cli2 after every edit.
tests, run by the registry6 passed · slowest 1.7 ms
- The advice links to wellactually.dev
✓fires1.3 ms
fires for the file when the agent writes markdown
write README.mdfired: the file
Trainer
The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.✓fires1.1 ms
fires on an edit deep in the docs
write docs/power.md · wrote line 4fired: the file
Trainer
The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.✓skips0.0 ms
stays quiet when the agent only reads markdown
read README.mdno handler of the detector wants this event
Trainer
The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.✓skips0.0 ms
stays quiet on a file that is not markdown
write notes.txtno handler of the detector wants this event
# Trainer
The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.✓fires1.3 ms
points at the principle when the user mentions markdown
promptfired: "Markdown"
Turn these notes into Markdown please✓quiet1.7 ms
stays quiet on a prompt about something else
promptstayed quiet
Rename the trainer servicedetector.test.tseach detect() call runs the real detectorEdit
import { expect, test } from "vitest";
import { detect, edit, prompt, read, source, write } from "@wellactually/sdk/v3/test";
const readme = source`
# Trainer
The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.
`;
test("fires for the file when the agent writes markdown", () => {
expect(detect(write("README.md", readme))).toEqual([{}]);
});
test("fires on an edit deep in the docs", () => {
expect(detect(edit("docs/power.md", readme, { written: "Clients subscribe to the Cycling Power Service." }))).toEqual([{}]);
});
test("stays quiet when the agent only reads markdown", () => {
expect(detect(read("README.md", readme))).toEqual([]);
});
test("stays quiet on a file that is not markdown", () => {
expect(detect(write("notes.txt", readme))).toEqual([]);
});
test("points at the principle when the user mentions markdown", () => {
expect(detect(prompt("Turn these notes into Markdown please"))).toEqual([{ match: "Markdown", depth: "pointer" }]);
});
test("stays quiet on a prompt about something else", () => {
expect(detect(prompt("Rename the trainer service"))).toEqual([]);
});