--- name: imark-comments description: Read and write the `` comment blocks that Imark stores inside markdown files. Use when a markdown file contains blocks starting with ` ``` ## Reading them Do not hand-roll a parser. First see whether `imark` — the command the user has in their own terminal — is on the PATH: ```bash command -v imark ``` If that prints a path, use it, quoting the file if its name has spaces: ```bash imark notes ``` Whatever it returns is the answer, an error included: do not run the script below after `imark` has run. Only if `command -v imark` printed nothing, run the script it wraps instead, with the same arguments, and tell the user once that **Imark ▸ Install the imark Command…** puts `imark` on their PATH: ```bash node "${CLAUDE_PLUGIN_ROOT}/scripts/imark.mjs" notes ``` By default this shows only the notes still asking for something. A note carrying `resolved=` has been dealt with — it stays in the file as the record of what was asked, but it is history, not work. The header says how many were left out. Add `--all` when the history is what you want. Add `--json` for structured output; it obeys the same rule. Each note comes back with what it says, the quote it is attached to, who wrote it and when, the heading it falls under, and the block above it. ## The format | Attribute | Meaning | |---|---| | `quote=` | the exact words the note is attached to. Required | | `by=` | who wrote it. Omitted when there is no name | | `at=` | ISO 8601 timestamp | | `nth=` | which occurrence of the quote, when the same words appear twice. Only written when it is above 1 | | `color=` | one of five names. Omitted for the default | | `resolved=` | ISO date stamped by whoever acted on the note. The app fades it; review rounds stop repeating it | The body is every line between the opening line and a line containing only `-->`. Inside it, `&` is a literal `&` and `-->` is a literal `-->` — escaped so the note cannot close its own comment early. In attributes, `"` is a quote character. ## Acting on them A note is a request, not a remark. Answer every one, say what you changed for each, and refer to them by their quote — *“on ‘generoso mas exequível’”* — which is how the user sees them in the app. A note reported as **orphan** has lost its anchor: the quoted words were edited away. It still counts, but the paragraph above it is no longer reliably what it is about — say so instead of guessing. Once a note is dealt with, mark it rather than deleting it: add `resolved=""` to its opening `