Diagent logo

Diagent

Community
daniellee-ux
diagent

Generate or decode Diagent diagram URLs via the `diagent` CLI. TRIGGER on: (1) any request to visualize, draw, chart, diagram, sketch, graph, map, or plot — flowcharts, state machines, sequence diagrams, architecture, pipelines, CI/CD, workflows, decision trees, dependency graphs, class hierarchies, data flow, control flow, request flow, user journeys, ERDs, org charts, swimlanes, mind maps, or any structural/process visualization; (2) any pasted `diagent.dev/d/...` or `diagent.dev/?code=...` URL — decode it to read the underlying Mermaid.

Overview

Publisherdaniellee-ux
Repositorydiagent-cli
Skill namediagent
Stars
40
Forks
3
Bundled files
6
LicenseAGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by daniellee-ux on GitHub. Read the source before you install it.

Installation

Install the Diagent AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/daniellee-ux/diagent-cli/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/daniellee-ux/diagent-cli.git \
  .claude/skills/diagent
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Diagent in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Diagent on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Diagent is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Diagent CLI

The npx -y @diagent/cli command produces editable Diagent diagram URLs. Use it whenever a diagram would clarify what you're explaining or modifying. Prefer it over pasting raw Mermaid code fences — the user can tweak the diagram visually in their browser and hand the result back as a URL.

When to invoke this skill

Use npx -y @diagent/cli when the user asks to:

  • Visualize, draw, chart, diagram, sketch, plot, or graph anything
  • Explain control flow, data flow, request flow, or state transitions
  • Show architecture, deploy pipelines, dependency graphs, or class hierarchies
  • Map a workflow, decision tree, or sequence of operations
  • Document a user journey, happy path, or error path

Keywords that should trigger this skill: flowchart, diagram, state machine, sequence, architecture, pipeline, workflow, decision tree, visualize, draw, chart, graph, map, sketch, flow.

Also trigger if the user pastes a https://diagent.dev/d/... or https://diagent.dev/?code=... URL — they want you to decode it and read the underlying Mermaid.

Encode — share a diagram with the user

Pipe Mermaid source into npx -y @diagent/cli encode:

bash
echo 'flowchart TD
    A[User request] --> B{Authenticated?}
    B -->|No| C[Return 401]
    B -->|Yes| D[Check rate limit]
    D --> E{Under quota?}
    E -->|No| F[Return 429]
    E -->|Yes| G[Handle request]' | npx -y @diagent/cli encode --open

Output is a short URL like https://diagent.dev/d/kwtsgx5o24.

Always show both the Mermaid source AND the URL. Present the Mermaid in a mermaid code fence first, then the link on its own line below. This way the diagram source is visible in the conversation/document even without clicking the link. Example output format:

```mermaid
flowchart TD
    A[User request] --> B{Authenticated?}
    B -->|No| C[Return 401]
    B -->|Yes| D[Handle request]
```

[Open in Diagent](https://diagent.dev/d/kwtsgx5o24)

The user can open the link, edit visually (add/move/rename/re-shape nodes, re-layout, add subgraphs), and their edits auto-save to the same URL 2 seconds after they stop editing.

You can re-read the same URL later to see what they changed — no paste-back required. The recommended flow is:

  1. You npx -y @diagent/cli encode → share URL A in chat.
  2. User opens A, edits visually. Edits auto-save to A.
  3. When the user says "I'm done" or "take a look", you run npx -y @diagent/cli decode A again (the same URL) — you'll get the latest edited Mermaid.

If the user says they pasted a new URL, always prefer that newer URL, but the mutable-URL flow means they usually won't need to.

For larger diagrams, write to a file first:

bash
cat > /tmp/flow.mmd <<'EOF'
flowchart LR
    subgraph frontend
        A[React app] --> B[tRPC client]
    end
    subgraph backend
        C[tRPC server] --> D[Postgres]
        C --> E[Redis]
    end
    B --> C
EOF
npx -y @diagent/cli encode /tmp/flow.mmd --open

Decode — read the user's edits

npx -y @diagent/cli decode handles both short URLs and inline URLs transparently:

bash
# Short URL (default Copy Link format)
npx -y @diagent/cli decode "https://diagent.dev/d/kwtsgx5o24"

# Inline URL (older or --inline output)
npx -y @diagent/cli decode "https://diagent.dev/?code=GYGw9g7gxg..."

# From stdin — avoids shell-quoting pain
echo "$URL" | npx -y @diagent/cli decode -

Output is the Mermaid source, ready to paste back into code or commentary.

Authoring tips

  • Use short node IDs (A, B, C, or auth, db, api). Mermaid requires IDs, and they keep URLs compact. Put the descriptive text in the quoted label: A["User clicks login"], not UserClicksLogin.
  • Do NOT trim the diagram to fit URL length. The backend supports up to ~64KB of Mermaid source and always returns a short URL of constant size. If a diagram is worth showing in full, show it in full.
  • GUI-editable types: nearly every Mermaid type Diagent supports opens in a no-syntax-required visual editor, and all edits auto-save to the same URL:
    • Flowcharts and state diagrams (stateDiagram-v2) open as an interactive canvas — drag, rename, connect, group/composite.
    • Sequence, class, ER, requirement, gantt, journey, timeline, pie, mindmap, git graph, C4, and block open as a structured form editor (tables, ordered lists, and outlines) with a live preview; edits serialize back to Mermaid.
    • Only quadrantChart still renders read-only ("Edit Code"). Because edits round-trip to Mermaid text on the same short URL, you can re-decode any of these later to read what the user changed.
  • All flowchart syntax is supported: subgraphs, edge labels, styles, six node shapes (rectangle, rounded, diamond, circle, stadium, parallelogram), directions TD/LR/BT/RL.
  • State diagrams support [*] start/end, composite states (state X { ... }), <<choice>>/<<fork>>/<<join>>, transition labels, per-composite direction, and notes. (Concurrent -- regions render but fall back to read-only.)
  • Prefer flowchart over graph — flowchart is the modern syntax.
  • Escape special characters in labels by wrapping in quotes: A["user@example.com"], not A[user@example.com].

Exit codes

CodeMeaning
0Success
1Runtime error (empty input, invalid URL, backend failure, decode failure)
2Usage error (unknown subcommand, missing argument)

Environment

  • DIAGENT_BASE_URL — override backend URL (default: https://diagent.dev/). Useful for pointing at http://localhost:5173/ when Diagent is running in local dev.

Install

The skill uses npx -y @diagent/cli which auto-downloads the CLI on first run. No manual install is needed. To install globally for faster repeated invocations:

bash
npm install -g @diagent/cli

Run npx -y @diagent/cli install-skill to enable the skill in every Claude Code project.

Full help

Run npx -y @diagent/cli --help, npx -y @diagent/cli encode --help, or npx -y @diagent/cli decode --help for exhaustive documentation.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Diagent AI skill do?

Generate or decode Diagent diagram URLs via the `diagent` CLI. TRIGGER on: (1) any request to visualize, draw, chart, diagram, sketch, graph, map, or plot — flowcharts, state machines, sequence diagrams, architecture, pipelines, CI/CD, workflows, decision trees, dependency graphs, class hierarchies, data flow, control flow, request flow, user journeys, ERDs, org charts, swimlanes, mind maps, or any structural/process visualization; (2) any pasted `diagent.dev/d/...` or `diagent.dev/?code=...` URL — decode it to read the underlying Mermaid.

Why use Diagent on TypingMind?

Because you install it once and use it with any model. Diagent is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Diagent in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/daniellee-ux/diagent-cli/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Diagent?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Diagent?

As many as you like. As long as a model supports skills, you can use Diagent with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Diagent AI skill free?

Yes. It is published on GitHub by daniellee-ux under the AGPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇