mcpbeat

Create Diagram Agent Skill

Create architecture diagrams from a local codebase or system description. Use when the user asks to diagram a repo, map system architecture, show component relationships, create drill-down views, or explain a system visually with tld.

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
275
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/Mertcikla/tld --skill create-diagram

The instruction itself

9 sections, as written by the author

Create Diagram

Build a tld workspace that helps someone understand a system by moving from broad architecture to useful detail.

When to Use

  • The user asks for a diagram, architecture map, component map, dependency map, or data-flow view.
  • The target is a local codebase, service, package, multi-service app, or described system.
  • The useful output is a navigable tld model rather than prose alone.

When NOT to Use

  • The user only wants code explanation and did not ask for a visual model.
  • The task is to change application behavior.
  • The diagram is unrelated to software/system structure and does not benefit from tld's hierarchy.

tld Mental Model

tld models architecture as a hierarchy of elements and connectors.

  • An element is the node in the knowledge graph. It can represent a system, subsystem, service, module, class, database, external system, user, or any other entity relevant to the architecture.
  • A view is the canvas inside an element. Add children with --parent <ref> to create drill-downs. There is no separate "create view" command. View is used to group related elements, or to explain a subsystem in more detail.
  • A connector is the edges of the graph, describes a relationship between elements. The view is inferred from the elements' shared parent.
  • A kind is a broad role such as system, container, component, database, external system, or person omit if it doesn't fit any clear category.
  • A technology is metadata. Prefer catalog names suggested by tld tech suggest.

The goal is not to mirror folders. Build a navigable map of how control, data, ownership, and dependencies move through the system.

CLI Basics

Use the flat CLI shape:

tld add "<name>" --ref <ref> --kind <kind> --parent <parent-ref>
tld connect --from <source-ref> --to <target-ref> --label "<specific interaction>"
tld validate

For root-level elements, omit --parent.

If a technology label is uncertain, check it first:

tld tech suggest "<technology name>"

If the same real element appears in another view, reuse the same --ref with a different --parent. This creates another placement, not a duplicate element, and highly desired to truly show interaction. Add connectors with different labels in each view to show different relationships using --view <optional-view-ref>.

Working File

Record all diagram commands in ./.tld/diagram.sh:

#!/bin/bash
set -e

Group commands by view or subsystem with short comments. Run each new block after adding it so mistakes stay small and the script remains an execution log.

Do not manually edit elements.yaml or connectors.yaml. Use tld remove element <ref> or tld remove connector ... for corrections, then append the correction to diagram.sh.

Workflow

Before exploring, check for .tld folder. If it exists we are working in an active workspace and should inspect the existing model and ask the user how they want to update it. If not, run tld init in the codebase root then ask the user the following to set expectations and guide the level of detail:

> 1. How detailed should the diagram be? (overview, medium, detailed)

Use their answers to calibrate the rest of the work. If they don't know, suggest options based on the codebase size once you've done a quick directory scan.

Overview ~5–10 views, 1–2 levels deep Services and their direct dependencies. Entry points, major layers, external systems. Nothing low level.

Medium ~10–30 views, 2–3 levels deep Modules and packages decomposed. Key classes identified and placed. Major data and logic flows wired. Inheritance shown where architecturally significant.

Detailed ~50–200+ views, 4–6 levels deep. Every significant class and function has its own linked view. A reader should be able to navigate from the root view down to understanding a specific method's behavior without opening a file. Connected end-to-end from producers to consumers.

  • Inspect the codebase enough to identify entry points, major subsystems, storage, external systems, and runtime boundaries.
  • Write a compact inventory before adding elements:
Subsystem inventory:
- API: handles HTTP requests | calls: services, auth, database | called by: frontend
- Worker: processes queued jobs | calls: redis, external API | called by: queue
  • Create a root view with a few high-level elements that match the system, not a fixed template.
  • For each view, add children first, then immediately add labeled connectors for that same view.
  • Drill down on sub-systems if asked for: service internals, module responsibilities, key classes, important data paths, or complex methods. Children reuses the parent element ref when connecting, unless children exists as indiviual elements
API
Subsystem inventory:
-  Parent Element: Users 
    - endpoints: GET /users, POST /users
    - services: UserService
    - handlers: UserHandler
    - calls: UserService, GetUserData
  • Reuse shared elements in every relevant view and reconnect them, optionally with labels specific to that context.
  • Run tld validate, read the output carefully, fix the model, and repeat until validation passes or only intentional exceptions remain.
  • Run tld plan to see a summary of the workspace, if the resource counts do not match the initial goals set with the user, iterate. Use validation errors as a guide, look for overly-simplified views, or missing relationships.

Modeling Guidance

Keep each view readable. Aim for about 8-12 elements; split or cluster before a view becomes crowded. If a parent would contain many items, introduce a new element with a role-based name such as "Data Layer", "Event Pipeline", or "Authentication".

An isolated element is usually a modeling bug. Either connect it, move it to a better view, or remove it.

Depth should match the user's goal, before handoff, validate that the diagram meets their needs. If they want an overview, don't add too much detail. If they want a detailed map, make sure to drill down enough.

Handoff

Ask the user to run to apply pending changes:

tld apply 

Then to view the diagram:

tld serve --open

Use their feedback to if they want to add/remove some detail on sub-systems. Make adjustments to diagram.sh, run it, and validate again.

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take mertcikla/create-diagram from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.