Skip to main content
Drop-in system prompt for an LLM that emits iso-topology DSL. Tested with Claude, GPT-4-class, and small local models. Customize the <TASK> section for your use case.

Minimal template

The block below is GENERATED from CapabilityReport() — run go run ./tools/gen-docs after any DSL change and it stays current. Don’t edit between the sentinels.

How to use this

Option A — full system prompt

Paste the template into your system prompt slot. Replace <TASK> with the user’s actual diagram request. Pipe the model output through isotopo validate; if it fails, send the JSON back to the model with “Apply the suggestions and emit a corrected YAML.”

Option B — minimal context injection

If the model has tool access, just give it:

Option C — fully autonomous loop

For agentic frameworks (Claude Code, Cursor, custom):

Worked example

User prompt:
Draw the data ingestion pipeline: user uploads to S3, a Lambda trigger pushes the metadata to a Postgres database. Show the user as a person icon, the upload bucket as a cloud, Lambda as a normal compute box, and Postgres as a cylinder.
Agent output (validated; note: zero hand-computed coordinates — the user anchors the scene, everything else chains off it with place):
Render with isotopo render scene.yaml ./out.

Things to tell the model NOT to do

  • Don’t hand-compute coordinates. offset: in generated DSL is a smell — if the model emits more than the occasional fine-tune delta, repeat the POSITIONING RULES section.
  • Don’t invent shape names. Stick to the enum in CAPABILITIES.md.
  • Don’t emit prose around the YAML — exactly one fenced code block.
  • Don’t reach for group for two-element groups — place them as siblings instead. Groups are for 3+ elements that share a semantic boundary (and then give the group a layout, not offsets).
  • Don’t set geom.h higher than 80 for a single element unless it’s the scene’s hero — visually reads as a billboard, not a service.
  • Don’t use stack for fewer than 3 replicas — at N=1 it’s a no-op and at N=2 it reads as a layered cake.

Token budget

The full template above is ~700 tokens. CAPABILITIES.md adds another ~1.5k tokens if you want to include it verbatim instead of just referencing it; one matching fixture from SAMPLES.md is usually the better spend (~300–900 tokens, and it demonstrates composition, not just grammar). For models with strict context budgets, drop the WHEN UNSURE and worked-example sections — they’re nice-to-have, not required for correct output. Keep POSITIONING RULES; it has the highest correctness-per-token of the whole prompt.