| name | import-to-sop |
| description | Restructure raw source material — a URL, pasted text, a PDF, or a markdown file — into a properly formatted SOP using one of the built-in templates. Reads the source, extracts the procedural content, maps it into the chosen template's section structure, and writes a new Typst SOP file in the project. Use when the user has reference material (e.g. a Red Cross first-aid page, a manufacturer manual, a wiki article) and wants to turn it into a printable household SOP. |
import-to-sop
Take raw source material and produce a structured SOP in the current project. This is where Claude does the actual restructuring work — extracting steps, warnings, materials, and contraindications from prose source material and slotting them into the template.
Inputs to gather
- Source — one of:
- URL (use WebFetch / fetch-and-convert MCP)
- Path to a local PDF (extract with
pdftotext or read directly)
- Path to a local text/markdown file
- Pasted text in the conversation
- Template — same options as
new-sop (first-aid, emergency, household-procedure, troubleshooting-flow, recipe-method). If unclear, suggest based on source content.
- Title — derive from source if not given; confirm with user.
- Output directory — default
sops/.
What to do
- Fetch / read the source material.
- Identify the structural elements relevant to the chosen template:
- Steps — ordered actions
- Warnings / contraindications — what NOT to do, when to stop, when to escalate
- Materials / equipment — what's needed
- Prerequisites — conditions that must hold before starting
- Decision points — branches in the procedure ("if X, then Y; otherwise Z")
- Escalation / when to call for help
- Map those into the template's section structure.
- Preserve attribution: include a
source field in the SOP frontmatter pointing back to the original (URL or document title), so the user can verify the procedure later.
- Flag anything ambiguous or missing in the source as
// TODO: comments inline in the Typst file — don't fabricate steps.
- Write the file to
<output-dir>/<slug>.typ.
Important
- Never invent procedural steps that aren't supported by the source. If the source is incomplete, leave gaps and flag them.
- For first-aid and medical content especially, preserve the source's exact warnings verbatim where possible. Don't paraphrase a "call emergency services if X" instruction into something looser.
- Include a revision note at the top of the file indicating this was imported, the date, and the source.