human-review
The user reviews your HTML, Markdown, or localhost page in a real browser: they fix small things
by typing, select anything to comment on it, and send you the whole batch at once.
Markdown files open rendered. Their quotes and edits reference the rendered text,
and the file itself is never touched — apply every change to the Markdown source,
keeping its formatting syntax.
The loop
Write or update the HTML or Markdown file, or start the local page being reviewed.
Open it for the user:
npx -y human-review path/to/file.html
For a page served by a local development server, open the real route instead
of recreating it as a separate HTML file:
npx -y human-review http://localhost:3000/wiki
Wait for feedback. This blocks until they hit Send, or the timeout passes:
npx -y human-review poll path/to/file.html --timeout 600
Keep this command in the foreground. Do not end your turn while it is waiting.
If your shell returns a process or session handle, keep waiting on that handle
until the command exits. If it prints {"status":"timeout"}, no feedback has
arrived yet — run the same poll command again to keep waiting. Feedback is
saved even if a poll dies, so nothing is ever lost.
If it prints {"status":"closed"}, the user ended the review from the
browser — stop polling and do not run the poll command again. Unsent
feedback is kept and ships the next time this target is reviewed.
Apply what comes back, then wait again. --ack clears the batch you just handled:
npx -y human-review poll path/to/file.html --ack --timeout 600
Repeat 3–4 until the user says they are done.
Not sure whether feedback is already waiting — say, at the start of a new turn?
This answers instantly without blocking:
npx -y human-review status path/to/file.html
It prints {"status": "feedback-waiting"} when a batch is ready for a poll,
plus counts of unsent comments and edits still in the browser.
What you get
One batch covers every page the user visited, grouped by file or localhost URL.
{
"status": "feedback",
"pages": [
{
"file": "/abs/path/to/page.html",
"comments": [
{ "id": "c_1", "kind": "selection", "quote": "the exact text they selected",
"anchor": { "prefix": "...", "quote": "...", "suffix": "..." },
"feedback": "what they want changed" }
],
"edits": [
{ "label": "Problem body", "kind": "edited",
"before": "the original wording",
"after": "their exact new wording",
"after_html": "their exact new wording with <strong>formatting</strong>" }
]
}
],
"overall_note": "feedback not tied to any one page"
}
Rules
edits are changes the user already made. after is their exact wording —
carry it across verbatim and never revert it. If the HTML was generated from
something else (MDX, Markdown, a template), apply after to the source too,
or their fix disappears on the next build.
- When
before_html/after_html are present, the user changed formatting, not
just words — bold, italic, underline, links. Use the HTML version to carry the
formatting into the source, translated to its syntax (e.g. <strong> → **
in Markdown/MDX).
- A page with
kind: "url" was edited directly in the review UI. Its file
and url fields name the localhost route, not a writable file. Find the
matching project source (such as MDX, TSX, or a template), apply every edit
and deletion there, then acknowledge so the route reloads. Never write the
rendered HTTP response back into the app.
- Find each comment by its
quote; that exact string is in the file.
kind: "element" points at a whole block, so quote is its label, not body text.
- Fix every page in
pages, not just the first.
- Do not write a reply. There is no chat. The user sees your work when the page
reloads, which happens on its own the moment you save the file.
Better edit labels (optional)
Name the sections you author and the user's edit list uses your names instead of
guessing from the DOM:
<p data-block="Problem body">…</p>
<div data-container="Metrics callout">…</div>
data-block names a region for the edit list. data-container also makes the block
clickable as a comment target.
1---2name: human-review3description: Open an HTML file, Markdown file, or localhost page in the browser so the user can edit text directly and leave comments on specific parts, then send all edits and comments back to you. Use after writing or updating something the user will read — specs, plans, reports, newsletter drafts, landing pages, slide decks, and locally running web pages.4---5
6# human-review
7
8The user reviews your HTML, Markdown, or localhost page in a real browser: they fix small things
9by typing, select anything to comment on it, and send you the whole batch at once.
10
11Markdown files open rendered. Their quotes and edits reference the rendered text,
12and the file itself is never touched — apply every change to the Markdown source,
13keeping its formatting syntax.
14
15## The loop
16
171. Write or update the HTML or Markdown file, or start the local page being reviewed.
182. Open it for the user:
19
20 ```sh
21 npx -y human-review path/to/file.html
22 ```
23
24 For a page served by a local development server, open the real route instead
25 of recreating it as a separate HTML file:
26
27 ```sh
28 npx -y human-review http://localhost:3000/wiki
29 ```
30
313. Wait for feedback. This blocks until they hit Send, or the timeout passes:
32
33 ```sh
34 npx -y human-review poll path/to/file.html --timeout 600
35 ```
36
37 Keep this command in the foreground. Do not end your turn while it is waiting.
38 If your shell returns a process or session handle, keep waiting on that handle
39 until the command exits. If it prints `{"status":"timeout"}`, no feedback has
40 arrived yet — run the same poll command again to keep waiting. Feedback is
41 saved even if a poll dies, so nothing is ever lost.
42
43 If it prints `{"status":"closed"}`, the user ended the review from the
44 browser — stop polling and do not run the poll command again. Unsent
45 feedback is kept and ships the next time this target is reviewed.
46
474. Apply what comes back, then wait again. `--ack` clears the batch you just handled:
48
49 ```sh
50 npx -y human-review poll path/to/file.html --ack --timeout 600
51 ```
52
53Repeat 3–4 until the user says they are done.
54
55Not sure whether feedback is already waiting — say, at the start of a new turn?
56This answers instantly without blocking:
57
58```sh
59npx -y human-review status path/to/file.html
60```
61
62It prints `{"status": "feedback-waiting"}` when a batch is ready for a poll,
63plus counts of unsent comments and edits still in the browser.
64
65## What you get
66
67One batch covers every page the user visited, grouped by file or localhost URL.
68
69```json
70{
71 "status": "feedback",
72 "pages": [
73 {
74 "file": "/abs/path/to/page.html",
75 "comments": [
76 { "id": "c_1", "kind": "selection", "quote": "the exact text they selected",
77 "anchor": { "prefix": "...", "quote": "...", "suffix": "..." },
78 "feedback": "what they want changed" }
79 ],
80 "edits": [
81 { "label": "Problem body", "kind": "edited",
82 "before": "the original wording",
83 "after": "their exact new wording",
84 "after_html": "their exact new wording with <strong>formatting</strong>" }
85 ]
86 }
87 ],
88 "overall_note": "feedback not tied to any one page"
89}
90```
91
92## Rules
93
94- **`edits` are changes the user already made.** `after` is their exact wording —
95 carry it across verbatim and never revert it. If the HTML was generated from
96 something else (MDX, Markdown, a template), apply `after` to the **source** too,
97 or their fix disappears on the next build.
98- When `before_html`/`after_html` are present, the user changed formatting, not
99 just words — bold, italic, underline, links. Use the HTML version to carry the
100 formatting into the source, translated to its syntax (e.g. `<strong>` → `**`
101 in Markdown/MDX).
102- A page with `kind: "url"` was edited directly in the review UI. Its `file`
103 and `url` fields name the localhost route, not a writable file. Find the
104 matching project source (such as MDX, TSX, or a template), apply every edit
105 and deletion there, then acknowledge so the route reloads. Never write the
106 rendered HTTP response back into the app.
107- Find each comment by its `quote`; that exact string is in the file.
108- `kind: "element"` points at a whole block, so `quote` is its label, not body text.
109- Fix every page in `pages`, not just the first.
110- **Do not write a reply.** There is no chat. The user sees your work when the page
111 reloads, which happens on its own the moment you save the file.
112
113## Better edit labels (optional)
114
115Name the sections you author and the user's edit list uses your names instead of
116guessing from the DOM:
117
118```html
119<p data-block="Problem body">…</p>
120<div data-container="Metrics callout">…</div>
121```
122
123`data-block` names a region for the edit list. `data-container` also makes the block
124clickable as a comment target.