Generates conceptual process flow diagrams (PFDs) as editable SVGs with Python scripts. Useful for process engineers to diagram flows, control loops, and instrumentation.
Ships in Claude PFD Generator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Produce a conceptual PFD as a hand-authored SVG that a process engineer would accept: correct process flow, correct ISA instrumentation, closed control loops, and a layout with zero collisions and zero crossed process lines.
The output is judged by an engineer who will spot a backwards arrowhead, a steam coil above the liquid level, or a label sitting under a balloon. Accuracy and legibility rank above speed.
<text>, never glyph paths or outlines. The user must be able to edit labels in a text editor. Never emit a matplotlib/Illustrator-style SVG where letters are <use> or <path> references.A process description almost always underspecifies the drawing. Before drawing, resolve:
Ask at most 2–3 questions, and only for things that change the drawing. For anything minor, make a defensible engineering assumption and state it in the response afterward. Do not stall the drawing over detail that can be noted as an assumption.
Write out the coordinate plan first. This step is what prevents rework.
1400 × 940, landscape, with a hairline border inset 20.x 560–800, y 300–640.0.55 × font_size × character_count for regular and 0.6 × for bold. This is approximate — the render check in step 4 is the real verification.Rule of elevation. Lay out by physics first, then aesthetics:
Write a Python script that emits the SVG. Never hand-type raw SVG for a full drawing.
Every drawing goes through at least three revisions. A script with named coordinates makes "shift the steam header down 40" a one-line change; hand-typed SVG makes it a rewrite.
Emit in this order: vessel bodies and fills, external pipes, vessel internals (coils, dip pipes), equipment details, then balloons and valves last with white fill. Internals drawn before the vessel fill get painted over; balloons drawn before pipes get a line through the tag.
scripts/pid_lib.py provides the primitives: bubble, cvalve, pipe, sig, vessel, agitator, steam_trap, line_jump, legend, txt. Read that file before writing the script and use it rather than reinventing symbols. Read references/isa-conventions.md for symbol and tag rules, and references/layout-rules.md for the collision geometry.
This step is mandatory and is the difference between a passable drawing and a professional one. Do not deliver a P&ID you have not looked at.
This step needs cairosvg and pillow (see scripts/requirements.txt). Install them once before the first render rather than discovering the gap mid-loop.
pip install -r scripts/requirements.txt -q # add --break-system-packages on a managed Python
python3 build_pid.py
python3 -c "import cairosvg; cairosvg.svg2png(url='out.svg', write_to='preview.png', output_width=1680)"
If cairosvg will not install, do not skip this step and do not pretend the drawing was checked. cairosvg needs native Cairo/GTK libraries that pip does not supply on Windows, so this fails routinely there. Fall back to a pure-Python renderer, which needs no native libraries:
pip install -q svglib pymupdf
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF
import pymupdf
renderPDF.drawToFile(svg2rlg('out.svg'), '_tmp.pdf')
pymupdf.open('_tmp.pdf')[0].get_pixmap(dpi=120).save('preview.png')
The fallback does not draw arrowheads. Arrowheads are SVG <marker> elements, and neither svglib nor pymupdf supports markers — they render dashes, fonts, colors, and geometry faithfully, but every arrowhead silently disappears. So when you are on the fallback:
sig() call and every pipe(..., arrow=True) should emit a marker-end. Count them and check each control loop leg has one.If neither renderer is available, deliver the SVG and state plainly that you could not view it and it has not been visually checked. An unchecked drawing presented as a checked one is the worst outcome this skill can produce.
Then open preview.png as an image (the Read tool in Claude Code, the view tool on claude.ai) and inspect it as an engineer would. Also crop and zoom the dense areas (control clusters, the vessel interior, instrument stacks) at 3200 px wide — collisions of a few pixels are invisible at full-sheet scale:
from PIL import Image
im = Image.open('z.png'); sx = 3200/1400
im.crop((int(x0*sx), int(y0*sx), int(x1*sx), int(y1*sx))).save('zoom.png')
Run the checklist in references/layout-rules.md against what you see. Fix and re-render until it passes. Expect 2–4 rounds. Common defects caught only by looking:
Save the SVG where the user can reach it and present it: use the path they asked for, otherwise the current working directory — or /mnt/user-data/outputs/ when that directory exists (claude.ai). Keep the generator script alongside it, and mention it exists — the user will want revisions.
In the response, state briefly:
Full detail in references/isa-conventions.md. The rules that matter most:
TIC-101, TI-101, TV-101.Include unless the user says otherwise:
NOT FOR CONSTRUCTION stamp in red outline, top right — mandatory on any conceptual drawingAlso state, in the drawing or the response, what a conceptual P&ID deliberately omits: relief devices, isolation and drain valves, vents, line numbers, insulation and tracing, and equipment sizing. Without that note a reader may assume the scope is complete.
Restrained engineering palette, not a marketing graphic. Working defaults:
| Element | Color | Weight |
|---|---|---|
| Process liquid | #1d4e89 | 2.4 |
| Steam / condensate | #a34a28 | 2.4 |
| Instrument signal | #50565f | 1.35, dash 7,5.5 |
| Equipment outline | #343a46 | 1.6–2.2 |
| Body text | #111418 | — |
| Secondary text | #5a6472 | — |
| Vessel shell / liquid | #f7f8fa / #dce8f5 | — |
| NOT FOR CONSTRUCTION | #b02418 | 1.4 |
Add one color per additional service (cooling water, nitrogen, product) and put each in the legend. Balloons and valves get white fill so process lines do not show through them.
It draws conceptual P&IDs. It is not a substitute for an issued-for-design P&ID, does not size equipment or relief devices, and does not perform hazard analysis. Say so if the user's framing suggests they expect otherwise.
examples/README.md (opens in a new tab)examples/c-201-distillation-column.png (opens in a new tab)examples/c-201-distillation-column.svg (opens in a new tab)references/isa-conventions.md (opens in a new tab)references/layout-rules.md (opens in a new tab)scripts/pid_lib.py (opens in a new tab)scripts/requirements.txt (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/pfd-generator:pfd-generatorfrom Claude PFD Generator
npx claudepluginhub scottduncanai/claude-manufacturing-skills --plugin pfd-generatorOther plugins' skills for the same job