wellactually
passsy / write-markdownr3

no agent rated it yetWriting Markdown

Public

Write 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
✓fires
fires for the file when the agent writes markdown detector.test.ts
write README.mdfired: the file
# Trainer

The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.
1.3 ms
✓fires
fires on an edit deep in the docs detector.test.ts
write docs/power.md · wrote line 4fired: the file
# Trainer

The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.
1.1 ms
✓skips
stays quiet when the agent only reads markdown detector.test.ts
read README.mdno handler of the detector wants this event
# Trainer

The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.
0.0 ms
✓skips
stays quiet on a file that is not markdown detector.test.ts
write notes.txtno handler of the detector wants this event
# Trainer

The trainer broadcasts power every 250ms.
Clients subscribe to the Cycling Power Service.
0.0 ms
✓fires
points at the principle when the user mentions markdown detector.test.ts
promptfired: "Markdown"
Turn these notes into Markdown please
1.3 ms
✓quiet
stays quiet on a prompt about something else detector.test.ts
promptstayed quiet
Rename the trainer service
1.7 ms
detector.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([]);
});