sop-builder
Turn a process.json (title, owner, purpose, steps, checkpoints) into a formatted SOP markdown document with purpose, prerequisites, numbered steps, quality checkpoints, owner, and a review date. Use when writing down how a recurring task should be done so anyone — including future you — can follow it the same way every time.
$ skillbank install sop-builder@1.0.0 # pins exactly 1.0.0 · README + changelog included
SOP Builder
Overview
The process lives in your head until you write it down, and then it lives in one person's head anyway when they quit. sop.py turns a process.json into a clean SOP document: purpose, prerequisites, numbered steps, quality checkpoints with checkboxes, the owner's name, and a review date six months out (configurable). Steps can be plain strings or title/detail objects for steps that need explanation.
An SOP nobody reviews rots. The review date at the top and bottom is there so the document tells you when it's stale.
All data stays local — nothing is uploaded anywhere.
Installation
1. Copy the sop-builder/ directory anywhere convenient. 2. Make the script executable (Unix):
chmod +x scripts/sop.py
No pip install needed — standard library only.
Configuration
One input file, process.json. Required: title, owner, purpose, steps (array of strings or {"title": ..., "detail": ...} objects). Optional: prerequisites (array), checkpoints (array), related (array), review_months (default 6).
{
"title": "Morning Bakery Opening",
"owner": "Shift Lead",
"purpose": "Open the bakery safely and have the first bake in the oven by 5:30am.",
"prerequisites": ["Alarm code", "Oven preheat checklist"],
"steps": [
{"title": "Disarm the alarm and unlock",
"detail": "Enter through the rear door; disarm within 60 seconds."},
"Turn on ovens and start preheat to 450F"
],
"checkpoints": ["Oven reads 450F by 5:15am", "First batch in oven by 5:30am"],
"related": ["Evening closing checklist"]
}
Inputs
| Flag | Required | Description | |---|---|---| | --process | yes | Path to process.json | | --out | no | Output directory (default sops) |
Writes <title-slug>-sop.md into the output directory. Missing required fields or malformed steps stop the run with a named error. Exit codes: 0 = ok, 2 = bad/missing input.
Worked example
$ ./scripts/sop.py --process process.json --out sops
wrote sops/morning-bakery-opening-sop.md
done: SOP for 'Morning Bakery Opening' (owner: Shift Lead) in sops/
sops/morning-bakery-opening-sop.md:
# SOP: Morning Bakery Opening
**Owner:** Shift Lead
**Review date:** 2027-03-26
## Purpose
Open the bakery safely and have the first bake in the oven by 5:30am.
## Prerequisites
- Alarm code
- Oven preheat checklist
## Steps
1. **Disarm the alarm and unlock**
Enter through the rear door; disarm within 60 seconds.
2. Turn on ovens and start preheat to 450F
3. **Mix first dough batch**
Follow the sourdough formula card on the wall.
## Quality checkpoints
- [ ] Oven reads 450F by 5:15am
- [ ] First batch in oven by 5:30am
- [ ] Front door unlocked by 6:00am
## Related
- Evening closing checklist
---
_Review this SOP on or before 2027-03-26. If the process changed, update the steps first, then move the review date._
See references/sop-writing-guide.md for how to write steps worth following.
Version history
Changelog
1.0.0 — 2026-09-27
- Initial release:
scripts/sop.pybuilds a formatted SOP markdown document from process.json — purpose, prerequisites, numbered steps (plain strings or title/detail objects), quality checkpoints, owner, related docs, and a review date (today + review_months, default 6). Includesreferences/sop-writing-guide.md.