agentleFS
tkollehtkolleh/skills/diagram/SKILL.md

diagram

Skill1 starsChanged 4 months agoMITView on GitHub

Generates technical diagrams using the D2 language, with automatic color-contrast verification and diagram-type detection.

31 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use benchmark-models, setup-gbrain and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • mahiunfilteredSkill

    benchmark-models

    Cross-model benchmark for gstack skills. Runs the same prompt through Claude, GPT (via Codex CLI), and Gemini side-by-side — compares latency, tokens, cost, and optionally quality via LLM judge. Answers "which model is actually best for this skill?" with data instead of vibes. Separate from /benchmark, which measures web page performance. Use when: "benchmark models", "compare models", "which model is best for X", "cross-model comparison", "model shootout". (gstack) Voice triggers (speech-to-text aliases): "compare models", "model shootout", "which model is best".

    Also in 3 projects that use this

  • chloropineSkill

    setup-gbrain

    Set up gbrain for this coding agent: install the CLI, initialize a local PGLite or Supabase brain, register MCP, capture per-remote trust policy. One command from zero to "gbrain is running, and this agent can call it." Use when: "setup gbrain", "connect gbrain", "start gbrain", "install gbrain", "configure gbrain for this machine". (cgstack)

    Also in 3 projects that use this

  • seek888Skill

    open-gstack-browser

    Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in. Opens a visible browser window where you can watch every action in real time. The sidebar shows a live activity feed and chat. Anti-bot stealth built in. Use when asked to "open gstack browser", "launch browser", "connect chrome", "open chrome", "real browser", "launch chrome", "side panel", or "control my browser". Voice triggers (speech-to-text aliases): "show me the browser".

    Also in 3 projects that use this

  • Kit4SomeSkill

    unfreeze

    Also in 3 projects that use this

  • chloropineSkill

    scrape

    Pull data from a web page. First call on a new intent prototypes the flow via $B primitives and returns JSON. Subsequent calls on a matching intent route to a codified browser-skill and return in ~200ms. Read-only — for mutating flows (form fills, clicks, submissions), use /automate. Use when asked to "scrape", "get data from", "pull", "extract from", or "what's on" a page. (cgstack)

    Also in 3 projects that use this

  • MicrosoftSkill

    worktree

    Create, reuse or clean up a dedicated git worktree for working on a pull request or a private branch. Use from any PR-scoped workflow that needs an isolated checkout to keep current code and build output untouched.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill whenever a system architecture, data flow, sequence diagram, or service interaction needs to be visualized.

    line 19
  2. Distinctive:

    Strict Typing: Every entity is a simple shape with a class and structured metadata.

    line 25
  3. Very specific:

    Context: Use D2 "Groups" (empty containers) for Domains (e.g., Analytics_Domain).

    line 39
  4. Very specific:

    Actors: Use shape: person for human users or external systems.

    line 42
  5. Distinctive:

    DO NOT: use semicolons in style blocks.

    line 57
  6. Distinctive:

    DO NOT: use local file paths for icons.

    line 58
  7. Very specific:

    Use undefined classes (tags) such as systembe for grouping components.

    line 64

“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “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

Diagram Creator

Generate professional architecture and sequence diagrams using the D2 declarative language. Output is a rigorous engineering artifact modeling complex distributed systems with precision, enforcing strict separation between inventory (what exists) and topology (how it connects) - with automatic color-contrast verification and diagram-type detection

When to use me

Use this skill whenever a system architecture, data flow, sequence diagram, or service interaction needs to be visualized. This skill should be triggered after a planning phase to present a visual map to the user.

Core Instructions

Core Philosophy: "Measure Once, Cut Twice"

  1. Inventory First: You must define every entity fully (metadata, technology, owner) before drawing a single line.
  2. Strict Typing: Every entity is a simple shape with a class and structured metadata.
  3. Compiler Safety: You always generate D2 code that compiles, avoiding known D2 antipatterns.

Instructions

1. Visualization Standard

You define the model and view in separate files. The model file (models.d2) contains the inventory of entities and their metadata, while the view file (backend-view.d2) contains the topology (connections) and styling. This separation ensures clarity and maintainability.

  • You Always reference the files models.d2 and backend-view.d2 for examples of how to structure your code.
  • You view files must import model files to reference entities.
  • You Always validate your D2 files using the d2 CLI tool against the view files

2. C4 Model Integration

  • Context: Use D2 "Groups" (empty containers) for Domains (e.g., Analytics_Domain).
  • Container: Runtime units (Services, DBs).
  • Component: Code units (Libraries, DAGs).
  • Actors: Use shape: person for human users or external systems.

3. D2 Code Structure (Strict Hierarchy)

You must generate code in this exact order to ensure compilation:

  1. Metamodel (Classes):
    • Critical Constraint: Classes must be defined at the root.
    • Critical Constraint: No nesting. You cannot define a class inside classes.
    • Critical Constraint: No inheritance. One class cannot reference another via class:.
  2. Domain Contexts: Empty groups with fill: transparent.
  3. Entity Inventory: Define objects using dot notation (Domain.Entity). No connections here.
  4. Topology: Define connections (->) in separate files after suspending unwanted classes.

Negative Constraints (Guardrails)

  • DO NOT mix entity definitions with relationships.
  • DO NOT use semicolons in style blocks.
  • DO NOT use local file paths for icons.
  • DO NOT nest classes inside the classes block.

Canonical Example

  • Reference the models.d2 and backend-view.d2 files as examples
  • Use undefined classes (tags) such as systembe for grouping components. The domain_actor class is defined with specific styles, and then both systembe and domain_actor are applied to the api_service component.

Execution Steps

  1. Analyze the user's request to identify Domains, Containers, and Components.
  2. Draft the Inventory list mentally, and assigning tech stacks.
  3. Generate the D2 code following the instructions strictly.
  4. Recommend diagram type — once the model/view files exist, run python3 main.py recommend-diagram-type --model_path <view-file>.d2. This parses actual entity/relationship counts, cycles, actor shapes, and edge ordering from the file and returns sequence, state, or c4 — a deterministic decision, not a free-form read of the user's request. If the recommendation doesn't match what was drafted in step 1, prefer the tool's output and adjust the structure.
  5. Check contrast — run python3 main.py check-contrast --model_path models.d2. This validates every class's fill/font-color pair against pastel textcolor and reports mismatches. Fix any "ok": false result before rendering.
    • Known limitation: this check assumes plain black/white text and will report _md/_grp markdown classes as failing even when they intentionally use a tinted font-color (see the styling comment at the top of models.d2). Treat _md/_grp class failures as informational, not blocking — the stroke vs fill distinction on those classes is the real readability signal, not font-color.
  6. Preview — render just the class/legend definitions from models.d2 to a small SVG first (d2 models.d2 preview.svg) and confirm it compiles cleanly before rendering the full diagram.
  7. Render the full view file to SVG (d2 backend-view.d2 output.svg) and present the result.

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.