ngDiagram skill

31 skills teach a coding agent to build diagram editors and workflow builders on ngDiagram for Angular and dodge the usual bugs

  • 588 ★ on the repository
  • Last commit
  • Apache-2.0
SkillOfficial

Minimal access

Why this level

  • The skills are instructions; the agent writes code in the project under its usual permission rules
All reasons and checks

synergycodes/ng-diagram

Install

Manual install

npx skills add https://github.com/synergycodes/ng-diagram/tree/release/skills

Run it in the project folder; Node.js 22.20 or newer is required. The tool asks which agents to install for.

Access and checks

How we review

Minimal accessThe tool runs nothing and makes no network calls.

  • The skills are instructions; the agent writes code in the project under its usual permission rules

This is third-party code. Review the repository files before installing.

What it does

The 31 skills live in the skills/ folder of the ngDiagram repository, an Angular library for interactive diagrams and node-based editors. Each skill covers one topic: model initialization, ports and links, custom nodes and edges, groups, edge routing, the minimap, the palette, export, persistence, touch gestures and performance. The agent loads a skill when your request matches its description, or by name, for example "use the ng-diagram-visibility skill". The starting point is ng-diagram-fundamentals: it explains how the library works and lists the rules that prevent most bugs. When something breaks, ng-diagram-troubleshooting takes over and works from a symptom or a console message. The skills are written for ngDiagram 1.4.0 and work in Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and other agents that read SKILL.md. Before writing code the agent checks the installed version and confirms API names in node_modules/ng-diagram/ng-diagram.d.ts. The author calls the set a preview. A separate MCP server, @ng-diagram/mcp, searches the documentation and API reference and is optional.

Who it is for. Angular developers who build a schema editor, a workflow builder or an org chart on ngDiagram and work with Claude Code, Codex or Cursor.

Good fit when

  • You are adding ngDiagram to a project for the first time and the agent has to set up global styles, the provider and the container size
  • Nodes and edges have to be your own Angular components with ports and labels
  • The console shows "Library engine not initialized yet" and the cause is unclear
  • The diagram model must be saved and loaded, and the diagram itself exported to a file
  • A large diagram is slow and the agent is hunting for the bottleneck

Not a fit when

  • The project uses React or Vue: the library targets Angular 18 and newer
  • You are changing the ngDiagram sources themselves: the skills are written for people who build apps on the library
  • The project runs ngDiagram older than 1.4.0 and nobody can check the API by hand: advice on newer features carries a "since vX.Y" mark

Example request

Add an ngDiagram diagram with custom nodes and ports to this project and load the relevant ng-diagram skills

Limitations

  • The set is marked as a preview and written for ngDiagram 1.4.0; the author asks users to report wrong advice.
  • The 31 descriptions take about 7,200 characters in the agent's skill list. With many other skills installed some may not fit, and you then call the skill by name.
  • Installing through the skills CLI needs Node.js 22.20 or newer. The tool sends anonymous usage data; set DISABLE_TELEMETRY=1 to turn it off.
  • The MCP server is not part of the set and is connected separately.

How to disable. Delete the ng-diagram-* folders from the directory where the skills CLI put them: .claude/skills/ for Claude Code, .agents/skills/ for Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. Remove the ng-diagram-docs block from the MCP config if you added the server.

FAQ

How do I install the ngDiagram skills in Claude Code?

Run npx skills add https://github.com/synergycodes/ng-diagram/tree/release/skills in the project folder and pick Claude Code in the agent list. A single skill installs with --skill, for example --skill ng-diagram-linking. To do it by hand, copy the folders into .claude/skills/.

Do I need the MCP server alongside the skills?

No, but the author recommends it: the server searches the documentation and API reference. Add an entry to the agent config with the command npx and the arguments -y @ng-diagram/mcp.

How do the ngDiagram skills differ from angular-skills?

The ngDiagram skills cover one diagram library, while angular-skills from the Angular team covers the framework itself: signals, forms, SSR. The topics do not overlap.

Which Angular versions do the ngDiagram skills work with?

The library needs Angular 18.0.0 or newer and TypeScript 5.6.0 or newer. The skills are written for ngDiagram 1.4.0, and the agent checks the installed version before coding.

How do I update the ngDiagram skills?

Run npx skills update. If you copied the folders by hand, replace them with fresh ones from the release branch of the repository.

Discussion

No questions or reviews yet.

Skills

Official Angular team skills: code generation with current practices, signals, forms, SSR and new app setup

SkillExtended access101.5KRepository stars

A skill and MCP server for the spartan/ui Angular library: the agent installs components and blocks from current docs.

SkillExtended access3KRepository stars

A skill and CLI that make dependency-free single-file HTML: shadcn tokens, seven layouts, SVG charts and an agent self-check

SkillMinimal access66Repository stars

Hand-built skills for Angular, React, Next.js, TypeScript and Django plus six community ones for Java, Elixir and Electron

SkillMinimal access668Repository stars

An MCP server and panel for Angular developers: the agent sees routes, forms, signals and dependencies of a running app.

MCP serverExtended access88Repository stars
Official

Microsoft's official skill lays out graphs and networks in JavaScript and TypeScript and exports figures to SVG, PDF, PNG and EPS.

SkillMinimal access175Repository stars

README in short

The README opens with the feature list: nodes, edges with three kinds of routing, groups, a minimap, a palette and touch gestures. Next come examples, starter templates, a video course and documentation links. The Build with AI section holds a prompt for the agent, the skills install command and the MCP server config block. Requirements: Angular 18 or newer, TypeScript 5.6 or newer, Node.js 18.19.1 or newer.

README badge

Original SKILL.md

---
name: ng-diagram-fundamentals
description: Use when starting any ng-diagram task or unsure how the library works - data flow, golden rules, system-owned node/edge fields, where NgDiagram services can be injected, and which ng-diagram skill to load next.
license: Apache-2.0
---

# ng-diagram fundamentals

How ng-diagram works, the rules that prevent most bugs, and where to look next. The skill map at the end names the skill that owns each topic.

## Rules

- **Import the styles globally.** `@import 'ng-diagram/styles.css';` goes in the global stylesheet (`src/styles.css` or `.scss`), never in a component's `styles`. The library is styled through CSS variables on `:root`, and component styles are scoped. See `ng-diagram-setup`.
- **One `provideNgDiagram()` per diagram.** Put it in `providers` of the component that renders `<ng-diagram>`, or of an ancestor that also renders your toolbar or sidebar. Services resolve to the nearest registration, so two diagrams under one registration fight over one engine.
- **Change the model only through the services** (`NgDiagramModelService`, `NgDiagramSelectionService`, `NgDiagramNodeService`, ...). Do not mutate node or edge objects or write to the adapter from `getModel()`: only the services run middlewares, routing, z-index and events.
- **`await` when the next line depends on the change**, otherwise `void` the promise. Never `await` a service call inside a middleware: the update pipeline is not re-entrant and the await deadlocks (see `ng-diagram-middleware`).
- **Never write system-owned fields:** `measuredPorts`, `measuredBounds`, `measuredLabels`, `computedZIndex`, `computedHidden`, `sourcePosition`/`targetPosition` of connected edge ends, `points` of auto-routed edges, `size` of auto-sized nodes. The library recomputes them and your value is lost. Read `references/model-reference.md` when you need to know who owns a property.
- **Wait for initialization** before working with a new model: use `(diagramInit)` or `isInitialized()`. Calls made right after you assign a new model still reach the old model and are lost.
- **Hide elements with the `hidden` flag (since 1.4.0), not CSS `display: none`.** CSS-hidden elements cannot be measured, so loading waits for the measurement timeout and logs warnings. See `ng-diagram-visibility`.
- **Create every model with `initializeModel()`** (pass a custom adapter through `initializeModelAdapter()`), and give each diagram instance its own model. The adapter is destroyed together with its diagram.

## How it works

```
your code ──► NgDiagram*Service method ──┐
user gesture (drag, draw, keys) ─────────┤
                                         ▼
            command (one operation: addNodes, moveNodesBy, paste, ...)
                                         ▼
   middleware chain: your middlewares + built-ins (internal ids, z-index, edge routing)
                                         ▼
   model (the ModelAdapter from initializeModel) ──► events: (selectionChanged), addEventListener, ...
                                         ▼
               Angular renders nodes, edges, ports and labels
                                         ▼
   ResizeObserver measures nodes, ports and edge labels; the results go back through
   the same pipeline as size / measuredPorts / measuredLabels, and edges re-route
```

- Each `<ng-diagram>` has one engine. It is created when `<ng-diagram>` first renders and created again when you bind a new model. Before that, service methods throw `[ngDiagram] Library engine not initialized yet.`

Report a problem