msagljs
Copilot instructions174 starsChanged 4 months agoMITView on GitHub
msagl-js is a JavaScript/TypeScript implementation of Microsoft's Automatic Graph Layout (MSAGL) algorithms. It computes node positions and edge routes for graph visualization. Run a single test file: Run examples locally: This is a Yarn workspaces + Lerna monorepo with six @msagl/* packages under modules/: Dependency flow (each arrow means "depends on"): core has zero internal dependencies. All other modules depend on core.
In this repositoryOne other file it gives its agents.
- msagljsSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Run a single test file:
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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.
Files
Copilot Instructions for msagl-js
Project Overview
msagl-js is a JavaScript/TypeScript implementation of Microsoft's Automatic Graph Layout (MSAGL) algorithms. It computes node positions and edge routes for graph visualization.
Build, Test, and Lint
yarn build # Build all modules (lerna + tsc + esbuild bundles)
yarn test # Run all tests (Jest with ts-jest)
yarn typecheck # Type-check without emitting (tsc --noEmit)
yarn eslint # Lint modules/core/src
yarn prettier # Format modules/core/srcRun a single test file:
npx jest --testPathPattern="graph.spec"Run examples locally:
cd examples/svg-renderer && npm run start
cd examples/webgl-renderer && npm run startArchitecture
This is a Yarn workspaces + Lerna monorepo with six @msagl/* packages under modules/:
@msagl/core → Graph data model, layout algorithms, math, routing
@msagl/drawing → Visual attributes (colors, shapes, styles) for nodes/edges
@msagl/parser → DOT and JSON graph format parsers
@msagl/renderer-common → Shared renderer utilities (text measurement, etc.)
@msagl/renderer-svg → SVG renderer (uses panzoom)
@msagl/renderer-webgl → WebGL renderer (uses deck.gl)Dependency flow (each arrow means "depends on"):
core ← drawing ← parser ← renderer-common ← renderer-svg
← renderer-webglcore has zero internal dependencies. All other modules depend on core.
Core Data Model (@msagl/core)
GraphextendsNode— a graph is also a node, enabling nested/clustered subgraphsNodeextendsEntity— has anidstring andinEdges/outEdges/selfEdgessetsEdgeextendsEntity— connectssourceandtargetnodes; self-registers in node edge sets on constructionGeomGraph/GeomNode/GeomEdge— geometry layer counterparts that store computed positions, curves, and bounding boxes- Layout and geometry are separate from the structural graph —
Graph/Node/Edgehold structure,Geom*objects hold layout results
Layout Algorithms
- Sugiyama (layered) —
SugiyamaLayoutSettings,LayeredLayoutfor hierarchical DAG layouts - MDS (multidimensional scaling) —
MdsLayoutSettings,PivotMDSfor force-directed-like layouts - Incremental —
IPsepColaSettingfor interactive/incremental layouts - Entry point:
layoutGeomGraph()fromlayout/driver.ts
Edge Routing
- Spline routing, rectilinear routing, bundle routing, sleeve routing, and straight-line edges
- Configured via
EdgeRoutingSettingsandEdgeRoutingMode
Key Conventions
- ES modules — all packages use
"type": "module"in package.json - TypeScript target — ES2018 with
moduleResolution: node - Formatting — Prettier with: single quotes, no semicolons, no bracket spacing, trailing commas, 140 char print width
- Tests — Jest with ts-jest preset; test files use
*.spec.tsnaming and live inmodules/core/test/mirroring thesrc/structure - Test utilities —
parseDotGraph()and other helpers inmodules/core/test/utils/testUtils.tsload.gvgraph files for testing - Module path aliases —
@msagl/core,@msagl/drawing, etc. are mapped in bothtsconfig.jsonandjest.config.js - Bundle builds — each module builds with
tscthen bundles via a sharedesbuild.jsscript at the repo root - Graph construction —
new Edge(source, target)automatically registers itself in both nodes' edge sets (no separateaddEdgecall)
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
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.

