agentleFS
stablebaselinestablebaseline/claude-code/skills/sb-create-diagram/SKILL.md

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.

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
  1. Very specific:

    If documentId is missing: ask for it or locate via listDocuments / hierarchy resources.

    line 11
  2. Very specific:

    Call getDocument to get the current versionTimestamp and line numbering.

    line 12
  3. Distinctive:

    If user specified a type, use it.

    line 14
  4. Very specific:

    Call getDiagramTypeGuide for DSL instructions (it takes a type or a family's name).

    line 16
  5. Very specific:

    Before writing any DSL that uses icons, call listArchitectureIcons with a query for each technology/service you plan to include (e.g.

    line 18
  6. Very specific:

    Use the field the answer's usage names for your diagram type, exactly as returned: iconKey as the icon in a platform default diagram …

    line 19
  7. Distinctive:

    If you cannot find an icon for a node, leave its icon out rather than guessing.

    line 21
  8. Distinctive:

    Do not hand-edit diagram markers in CDMD.

    line 32
  9. Very specific:

    If insertion fails due to versionTimestamp mismatch, re-run getDocument and retry with the new timestamp.

    line 33

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Stable Baseline: Create Diagram

Insert a diagram into a Stable Baseline document using MCP.

Steps:

  1. If documentId is missing: ask for it or locate via listDocuments / hierarchy resources. Or read .sb/config.json for cached IDs.
  2. Call getDocument to get the current versionTimestamp and line numbering.
  3. Decide diagram type:
    • If user specified a type, use it.
    • Otherwise call listDiagramTypes with a query for 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. default is the platform default renderer, for architecture, process, org chart and other box-and-line diagrams.
  4. Call getDiagramTypeGuide for DSL instructions (it takes a type or a family's name).
  5. Icon lookup (for any diagram with icons):
    • Before writing any DSL that uses icons, call listArchitectureIcons with a query for each technology/service you plan to include (e.g. query="docker", query="aws ec2").
    • Use the field the answer's usage names for your diagram type, exactly as returned: iconKey as the icon in a platform default diagram (default), d2IconPath in D2. For another type, follow the icon example getDiagramTypeGuide gives. Do NOT guess or invent icons.
    • A result without an iconKey cannot 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.
  6. Generate diagramCode.
  7. Call insertDiagramInDocument with:
    • 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 getDocument and retry with the new timestamp.

Reference:

  • sb://diagram-types

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.