sb-create-diagram
Skill1 starsChanged 40 days agoApache-2.0View on GitHub
Generate and insert a diagram into an existing Stable Baseline document. Use when user wants to create a diagram, add a diagram, insert a chart, or run sb-create-diagram.
In this repository14 other files it gives its agents.
- sb-agentSkill
- sb-connectSkill
- sb-create-docSkill
- sb-create-whiteboardSkill
- sb-dashboardSkill
- sb-databaseSkill
- sb-edit-docSkill
- sb-edit-whiteboardSkill
- sb-manage-dataSkill
- sb-manage-imagesSkill
- sb-searchSkill
- sb-setupSkill
- sb-syncSkill
- sb-updateSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
If documentId is missing: ask for it or locate via listDocuments / hierarchy resources.
- Very specific: line 12
Call getDocument to get the current versionTimestamp and line numbering.
- Distinctive: line 14
If user specified a type, use it.
- Very specific: line 16
Call getDiagramTypeGuide for DSL instructions (it takes a type or a family's name).
- Very specific: line 18
Before writing any DSL that uses icons, call listArchitectureIcons with a query for each technology/service you plan to include (e.g.
- Very specific: line 19
Use the field the answer's usage names for your diagram type, exactly as returned: iconKey as the icon in a platform default diagram …
- Distinctive: line 21
If you cannot find an icon for a node, leave its icon out rather than guessing.
- Distinctive: line 32
Do not hand-edit diagram markers in CDMD.
- Very specific: line 33
If insertion fails due to versionTimestamp mismatch, re-run getDocument and retry with the new timestamp.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stable Baseline: Create Diagram
Insert a diagram into a Stable Baseline document using MCP.
Steps:
- If documentId is missing: ask for it or locate via
listDocuments/ hierarchy resources. Or read.sb/config.jsonfor cached IDs. - Call
getDocumentto get the current versionTimestamp and line numbering. - Decide diagram type:
- If user specified a type, use it.
- Otherwise call
listDiagramTypeswith aqueryfor the intent. Each type lists the diagram families it draws, each with its default renderer: use a family's default renderer as the type unless the user named a language.defaultis the platform default renderer, for architecture, process, org chart and other box-and-line diagrams.
- Call
getDiagramTypeGuidefor DSL instructions (it takes a type or a family's name). - Icon lookup (for any diagram with icons):
- Before writing any DSL that uses icons, call
listArchitectureIconswith aqueryfor each technology/service you plan to include (e.g. query="docker", query="aws ec2"). - Use the field the answer's
usagenames for your diagram type, exactly as returned:iconKeyas the icon in a platform default diagram (default),d2IconPathin D2. For another type, follow the icon examplegetDiagramTypeGuidegives. Do NOT guess or invent icons. - A result without an
iconKeycannot go in a platform default diagram. - If you cannot find an icon for a node, leave its icon out rather than guessing; an unknown icon is refused or drawn without its picture.
- Before writing any DSL that uses icons, call
- Generate
diagramCode. - Call
insertDiagramInDocumentwith:- documentId
- documentVersionTimestamp (from getDocument)
- type
- diagramCode
- prompt + nlDescription
- afterLine (choose sensible placement if not provided)
Hard rules:
- Do not hand-edit diagram markers in CDMD.
- If insertion fails due to versionTimestamp mismatch, re-run
getDocumentand retry with the new timestamp.
Reference:
sb://diagram-types
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

