This skill should be used when the user asks to "convert this PDF to markdown", "convert this image to quarto", "turn my diagram into mermaid", "transcribe my notes", "sketch to text", "scribble to quarto", "turn this sketch into a document", "process my Boox export", or provides a JPEG/PNG/PDF file path and wants it converted to structured text. Converts handwritten notes and diagrams (from Onyx Boox or any source) into Quarto (.qmd) or Markdown with Mermaid diagrams.
Convert a handwritten or scanned artifact (JPEG, PNG, PDF) into a structured Quarto document (.qmd) or Markdown file with Mermaid diagrams.
Accept a file path as the primary argument. Optionally accept --format md to output plain Markdown with ```mermaid blocks instead of the default Quarto .qmd with {mermaid} blocks.
Use the Read tool on the provided file path. For PDFs with multiple pages, read all pages in a single call (up to 20 pages). Note the total page count.
For each page, identify:
For each page:
-- label --> not bare -->For each page produce:
## Page N or titled section header (use the handwritten title if present)Wrap the full output in the appropriate template (see references/output-templates.md).
Before writing, review the generated Mermaid syntax:
: is wrapped in "quotes"@{ shape: ... } usage is flagged in the uncertainty callout-- label --> — if you wrote a bare --> for a labelled arrow, fix itFix issues before writing. If the fix is uncertain, output best attempt and note it in the callout block. For renderer-specific issues, direct the user to references/troubleshooting.md.
Derive the output filename from the input: same base name, replace extension with .qmd (or .md). Write the file to the same directory as the input unless the user specifies otherwise.
After writing, summarize:
| Page content | Mermaid type |
|---|---|
| Flowchart with decisions (yes/no branches) | flowchart TD or flowchart LR |
| Steps in sequence between actors | sequenceDiagram |
| Nodes with bidirectional sync arrows | flowchart LR |
| Concept/entity boxes with relationships | flowchart TD |
| Rough mindmap or hierarchy | mindmap |
| Handwritten shape | Mermaid syntax | Notes |
|---|---|---|
| Oval / stadium | node("text") | Rounded pill |
| Rectangle / box | node["text"] | Sharp corners |
| Circle | node(("text")) | Circle |
| Double circle / cloud | node((("text"))) | Terminal, stop, and cloud shapes (outputs, exposures) |
| Diamond / decision | node{"text"} | Rhombus |
| Parallelogram | node[/"text"/] | Slanted sides |
| Handwritten | Mermaid |
|---|---|
| Single arrow → | --> |
| Double-headed ↔ | <--> |
| Dashed arrow | -.-> |
| Labeled arrow | -- label --> |
To put multiple lines inside a node, wrap the label in backticks:
goals["`Reduce effort
Increase ROI
Fail fast`"]
Use this for nodes that contain a list of items in the sketch. Bullet characters are not supported — just newlines.
For --format qmd:
```{mermaid}
flowchart TD
...
```
For --format md:
```mermaid
flowchart TD
...
```
When a reading is uncertain, never silently guess. Instead:
<!-- uncertain: "word" may be "other word" -->--- (undirected) with a noteFor .qmd output:
::: {.callout-caution title="Skill uncertainty notes" collapse="true"}
- "Anon Blocks" — may be a name abbreviation; exact label unclear
- Arrow between node B and C — direction unclear from sketch
:::
For .md output:
> **[skill]** Uncertainty notes
> - "Anon Blocks" — may be a name abbreviation; exact label unclear
> - Arrow between node B and C — direction unclear from sketch
Only include the block if there are actual uncertainties. Omit it on clean pages.
For PDFs with multiple pages:
## Diagram N section per pageDiagram Nreferences/output-templates.md — QMD frontmatter template, MD template, section structurereferences/conversion-guide.md — Detailed guidance on reading messy handwriting, inferring intent, handling common Boox OCR failure modesreferences/troubleshooting.md — Common Mermaid syntax errors, shape compatibility, self-check checklist, and links to Mermaid and Quarto docsevals/ — Individual page PDFs used as test inputsImportant: Never read files under
evals/ground-truth/when processing an input file. Those files are human-reviewed reference outputs used for offline comparison only. Reading them during conversion would contaminate the eval.