| name | new-sop |
| description | Scaffold a new Standard Operating Procedure (SOP) in the current project from one of the built-in templates — first-aid, emergency, household-procedure, troubleshooting-flow, or recipe-method. Creates a Typst source file with structured frontmatter (title, revision, date, audience) and section stubs ready to fill in. Use when the user wants to start writing a new procedure document. |
new-sop
Scaffold a new SOP from a template into the current project. The plugin does not own a global SOPs directory — files are written into the project the user is working in.
Inputs to gather
- Template — one of:
first-aid — clinical procedures (e.g. choking, burns, CPR adjuncts)
emergency — incident response (e.g. fire, siren, power outage)
household-procedure — routine domestic ops (e.g. monthly inspection, water shutoff)
troubleshooting-flow — diagnose-then-act technical procedures
recipe-method — strict ordered steps with prep / equipment / timing
- Title — short human-readable title.
- Slug — kebab-case filename stem. Default: derived from title.
- Output directory — default
sops/ relative to the project root. Create if missing.
- Audience (optional) — who's expected to follow this (e.g. "household members", "on-call engineer").
What to do
- Resolve the templates directory: prefer a project-local
templates/sop/<template>.typ if present, otherwise fall back to the plugin's bundled template at ${CLAUDE_PLUGIN_ROOT}/templates/sop/<template>.typ.
- Read the template, substitute frontmatter:
title — from input
revision — 1.0
date — today's date in ISO format
audience — from input or omit
slug — from input
- Write the result to
<output-dir>/<slug>.typ in the current project.
- Do NOT compile. The user runs
compile separately when ready.
- Print the path to the new file and a one-line summary of the next sections to fill in.
Templates location
Bundled templates live in ${CLAUDE_PLUGIN_ROOT}/templates/sop/. The user can override per-project by creating templates/sop/<template>.typ in their project — that takes precedence.
Notes
- The user may not have Typst installed yet. This skill only writes source — it doesn't compile.
- If the project has no
sops/ directory, create it.
- If a file with the same slug already exists, ask before overwriting.