/memgraph:memgraph-lab-write-gssfrom memgraph
Writes and edits Graph Style Script (GSS) for Memgraph Lab graph visualization. Styles nodes, edges, labels, and layouts using CSS-like directives.
Ships in memgraph. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
GSS is Memgraph's language for customizing graph visualization in Memgraph Lab. A GSS file is a sequence of expressions and directives.
Boolean, Color, Number, String, Array, Map, Function, Null
Three forms:
"Hello", numbers 42 / 3.14, colors #ff0000,
booleans True / False, NullDefine; all CSS/X11 color
names are built-in (e.g. dodgerblue, gold, red)FunctionName(arg1, arg2, ...)Name rules: starts with a letter, may contain digits, -, _.
Strings support \ escaping for " and newlines.
Six falsy values: False, 0, "", Null, [] (empty array), {} (empty map).
Everything else is truthy.
If, And, Or skip branches that are not needed.
Function() does not evaluate argument names or body until call time.
Directives are CSS-like blocks that set visual properties.
@<DirectiveName> <optional predicate> {
<property-name>: <expression>
...
}
name: expression pairs separated by newlines.| Directive | Styles | Binds variable |
|---|---|---|
@NodeStyle | Graph nodes | node |
@EdgeStyle | Graph relationships | edge |
@ViewStyle | Canvas / layout | graph |
@ViewStyle.Map is deprecated since Lab 3.4 -- use @ViewStyle with
map-tile-layer instead.
| Variable | Available in | Type |
|---|---|---|
node | @NodeStyle only | Map (properties, labels, id) |
edge | @EdgeStyle only | Map (properties, type, start, end, id) |
graph | Everywhere (global + all directives) | Graph |
Using node outside @NodeStyle or edge outside @EdgeStyle causes a
compile error.
Define calls and cached computations. graph is available here.@NodeStyle: evaluated per node.@EdgeStyle: evaluated per relationship.Global names are visible inside directives. Define inside a directive creates
a local variable (useful for per-element caching).
Define(EDGE_COUNT, EdgeCount(graph))
@NodeStyle {
size: Sqrt(NodeCount(graph))
}
@EdgeStyle {
width: If(Greater(EDGE_COUNT, 1000), 1, 2)
}
@NodeStyle properties| Property | Type | Notes |
|---|---|---|
border-color | Color | |
border-color-hover | Color | |
border-color-selected | Color | |
border-width | Number | px |
border-width-selected | Number | px |
color | Color | Background fill |
color-hover | Color | |
color-selected | Color | |
font-background-color | Color | Label background |
font-color | Color | Label text |
font-family | String | e.g. "sans-serif" |
font-size | Number | px |
image-url | String | PNG/JPEG/GIF(static)/WEBP/base64; overrides color |
image-url-selected | String | |
label | String | Text below node |
shadow-color | Color | |
shadow-size | Number | Blur radius (0 = solid) |
shadow-offset-x | Number | |
shadow-offset-y | Number | |
shape | String | "dot" (default), "square", "diamond", "triangle", "triangleDown", "star" |
size | Number | Node radius in px |
z-index | Number | Stack order |
@EdgeStyle properties| Property | Type | Notes |
|---|---|---|
arrow-size | Number | 0 = no arrow |
color | Color | Line color |
color-hover | Color | |
color-selected | Color | |
font-background-color | Color | |
font-color | Color | |
font-family | String | |
font-size | Number | |
label | String | |
shadow-color | Color | |
shadow-size | Number | |
shadow-offset-x | Number | |
shadow-offset-y | Number | |
width | Number | Line width in px |
width-hover | Number | |
width-selected | Number | |
z-index | Number |
@ViewStyle properties| Property | Type | Default |
|---|---|---|
background-color | Color | |
view | String | "default" -- also "map", "force", "tree" |
force-collision-radius | Number | 15 |
force-repel-force | Number | -100 |
force-link-distance | Number | 30 |
force-physics-enabled | Boolean | |
tree-orientation | String | "vertical" or "horizontal" |
tree-node-gap | Number | |
tree-level-gap | Number | |
map-tile-layer | String | "detailed", "light", "dark", "basic", "satellite" |
Map view requires nodes with latitude and longitude properties.
Use Define + Function to create reusable logic:
Define(square, Function(x, Mul(x, x)))
square(5) // -> 25
Define(pow, Function(x, n,
If(Equals(n, 1), x, Mul(x, pow(x, Sub(n, 1))))
))
pow(2, 10) // -> 1024
Lambdas for higher-order functions:
Filter(AsArray(1, 2, 3, 4), Function(item, Greater(item, 2)))
// -> [3, 4]
Use Execute to run side-effect expressions and return the last value:
Execute(
Set(map, "key1", "value1"),
Set(map, "key2", "value2"),
MapKeys(map)
)
Three ways to specify a color:
red, dodgerblue, gold, etc.#FF0000, #1E90FFRGB(r, g, b), RGBA(r, g, b, a), HSL(h, s, l),
HSLA(h, s, l, a), Darker(color), Lighter(color), Mix(c1, c2)@NodeStyle {
label: Property(node, "name")
}
@NodeStyle HasLabel(node, "Person") {
color: dodgerblue
size: 40
}
@NodeStyle And(HasLabel(node, "Person"), Greater(Property(node, "age"), 30)) {
color: coral
}
@NodeStyle HasLabel(node, "Country") {
image-url: Format("https://flagcdn.com/w320/{}.png",
LowerCase(Property(node, "code")))
}
@NodeStyle {
color: lightgray
size: 20
}
@NodeStyle Equals(Property(node, "name"), "Special") {
color: gold
size: 50
}
Define(MIN_SIZE, 5)
Define(MAX_SIZE, 20)
Define(PROP, "age")
Define(SIZE_RANGE, Sub(MAX_SIZE, MIN_SIZE))
Define(GetProps, Function(nodes, prop,
Map(nodes, Function(n, Property(n, prop)))
))
Define(KeepNumbers, Function(vals,
Filter(vals, Function(v, IsNumber(v)))
))
Define(MAX_VAL, If(Greater(NodeCount(graph), 0),
Max(KeepNumbers(GetProps(Nodes(graph), PROP))), 0))
Define(MIN_VAL, If(Greater(NodeCount(graph), 0),
Min(KeepNumbers(GetProps(Nodes(graph), PROP))), 0))
Define(Normalize, Function(n,
Add(MIN_SIZE, Mul(SIZE_RANGE,
Div(Sub(Property(n, PROP), MIN_VAL), Sub(MAX_VAL, MIN_VAL))
))
))
@NodeStyle And(HasLabel(node, "Person"), IsNumber(Property(node, PROP))) {
Define(NORM, Normalize(node))
size: NORM
label: Format("Age: {}", AsText(Property(node, PROP)))
}
@ViewStyle IsTreeStructure(graph) {
view: "tree"
}
@EdgeStyle Equals(Type(edge), "FRIENDS_WITH") {
color: dodgerblue
width: 2
label: Type(edge)
}
If the validate-gss tool is available, always run it after writing or
modifying GSS to catch syntax errors before applying the style in Memgraph Lab.
If the evaluate-gss tool is available, run it after validation to see how
styles resolve against actual graph data. Pass custom nodes and relationships
to the tool and inspect the computed style properties (color, size, label, etc.)
for each node and edge. This catches logic errors that syntax validation
cannot - such as a Property call on a missing key, overlapping predicates
where the wrong rule wins, or a Format expression producing unexpected text.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
gss, graph-style-script, memgraph-lab, graph-visualization, styling
memgraph@memgraph is listed by memgraph/marketplace — review the source before installing
npx claudepluginhub memgraph/marketplace --plugin memgraph14 skills in this plugin
/memgraph-brand-uiGenerate apps, demos, dashboards, diagrams, landing pages, and any visual output that looks like it belongs in the Memgraph product family. Use whenever producing UI, visual artifacts (Mermaid, SVGs, charts), Lab-style admin tools, internal dashboards, feature splash pages, or embeddable widgets for Memgraph engineers./memgraph-cpp-query-modulesDevelop custom query modules in C++ for Memgraph graph database. Use when creating high-performance graph algorithms, procedures (ProcedureType::Read/Write), or functions using the mgp.hpp C++ API. Covers compilation, memory management, graph traversal, and module deployment./memgraph-cypher-syntaxWrite Cypher queries for Memgraph, including Memgraph-specific extensions like deep path traversals (BFS, DFS, WSP, ASP, KSP with filter/weight lambdas), text and vector search, parallel execution, and CALL subqueries. Use when the user asks to write, fix, or optimize a Cypher query for Memgraph, or asks about Cypher syntax differences between Memgraph and Neo4j./memgraph-database-configurationConfigure Memgraph triggers, transactions, storage modes, data durability, and memory settings. Use when the user asks about triggers, transaction isolation levels, storage modes (transactional vs analytical), snapshots, WAL, memory limits, data types, or database runtime configuration./memgraph-graph-ragLanguage-agnostic blueprint for building GraphRAG systems with Memgraph and agent tooling. Covers end-to-end architecture, schema design, ingestion, hybrid retrieval, tool contracts, and evaluation. Use when designing GraphRAG platforms that must work across multiple programming languages./memgraph-import-dataImport or migrate data into Memgraph from CSV, Parquet, JSON/JSONL, CYPHERL dumps, relational databases (PostgreSQL, MySQL, SQL Server, Oracle, DuckDB) or Neo4j: choosing between LOAD CSV, cross_database procedures and client-driven batches, preparing indexes and storage mode, ordering nodes before relationships, and verifying counts. Use when the user wants to load, bulk-insert, ingest or migrate data into Memgraph, or an import is slow or failing.Other plugins' skills for the same job