Create PDF From Plan¶
Export a Cursor plan file to a PDF in ~/Downloads on macOS. The bundled renderer strips plan frontmatter, turns the markdown into printable HTML, renders Mermaid diagrams when present, then prints the result with headless Google Chrome.
Workflow¶
- Resolve the source plan path in this order:
- Use the explicit path from the user when provided.
- Otherwise inspect the active tab and use it only if it is clearly a plan file, for example a path ending in
.plan.mdor living under.cursor/plans. - Otherwise ask the user which plan to export with
AskQuestioninstead of guessing. - Validate that the selected source is a markdown plan file. Accept
*.plan.mdand files under.cursor/plansor~/.cursor/plans. - Confirm Google Chrome exists at
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome. If it does not, stop and report the missing dependency. - Run the bundled script:
bash ".cursor/skills/create-pdf-from-plan/scripts/render_plan_pdf.sh" "<plan-path>" "<optional-output-name>"
- Report the final PDF path returned by the script.
Behavior Rules¶
- Keep the implementation macOS-specific where needed because the output target is
~/Downloads. - Do not leave intermediate HTML files behind. The script handles temp cleanup automatically.
- Prefer the script output filename when the user gives one. Otherwise let the script derive the PDF name from the plan filename.
- Mermaid diagrams inside
```mermaidfences are supported. If a Mermaid block cannot be rendered, the export should still succeed and keep the raw block visible instead of failing the whole PDF.
Path Selection Guidance¶
- Treat the active tab as authoritative only when its path clearly identifies a plan file.
- If the active tab is not a plan and the user did not provide a path, ask a focused question with candidate plan files rather than choosing one silently.
- If multiple plan files are plausible, prefer showing short labels and absolute paths in the question so the user can pick the right one quickly.
Expected Output¶
- The script writes the PDF to
~/Downloads/<sanitized-name>.pdf. - The script prints the final PDF path on stdout.
- The final response should mention the generated file path and whether Mermaid blocks were handled normally or fell back to raw code because of a rendering issue.