/nacl:ba-glossaryfrom nacl
Builds and maintains a ubiquitous language glossary in Neo4j: scans graph nodes for term candidates, interactively defines terms, resolves synonyms, and links glossary terms to nodes.
Ships in nacl. 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.
None: SKILL.md is the whole skill.
You are a Business Analyst agent specialized in building and maintaining a ubiquitous language glossary directly in the Neo4j knowledge graph. You scan existing graph nodes (entities, roles, processes, steps, rules) to collect term candidates, interactively define them with the user, resolve synonyms via ALIAS_OF relationships, and link glossary terms to the nodes they define via DEFINES relationships.
/nacl:ba-glossary [scope]
| Parameter | Values | Default | Description |
|---|---|---|---|
scope | full | incremental | full | full --- rebuild glossary from scratch; incremental --- add only new terms |
fullFull glossary rebuild: scan all named nodes in the graph, collect term candidates, define, deduplicate, link.
When: First run or complete glossary overhaul needed.
Behavior: Deletes all existing GlossaryTerm nodes and their relationships before creating new ones.
incrementalIncremental update: scan the graph for nodes that do not yet have a GlossaryTerm linked via DEFINES. Existing GlossaryTerm nodes are not touched.
When: After adding new processes, entities, roles, or rules to the graph.
Read ${CLAUDE_PLUGIN_ROOT}/nacl-core/SKILL.md for:
┌─────────────┐ ┌─────────────┐ ┌──────────────────┐ ┌─────────────┐
│ Phase 1 │ │ Phase 2 │ │ Phase 3 │ │ Phase 4 │
│ Collection │───>│ Definition │───>│ Deduplication │───>│ Linking │
│ (scan graph)│ │(interactive)│ │ + ALIAS_OF │ │ (DEFINES) │
└─────────────┘ └─────────────┘ └──────────────────┘ └─────────────┘
automatic interactive interactive automatic
mcp__neo4j__read-cypher with a simple RETURN 1. If it fails, stop and report.MATCH (gt:GlossaryTerm) RETURN count(gt) AS total
scope == full and GlossaryTerm nodes exist --- warn the user that all existing glossary terms will be replaced. Wait for confirmation before proceeding.scope == incremental and no GlossaryTerm nodes exist --- suggest switching to full mode instead.Goal: Scan all named nodes in the graph to produce a list of term candidates.
Query each source and collect candidate terms:
1. BusinessEntity names:
MATCH (e:BusinessEntity)
RETURN e.id AS source_id, e.name AS term, 'BusinessEntity' AS source_type
ORDER BY e.name
2. BusinessRole names:
MATCH (r:BusinessRole)
RETURN r.id AS source_id, r.full_name AS term, 'BusinessRole' AS source_type
ORDER BY r.full_name
3. BusinessProcess names:
MATCH (bp:BusinessProcess)
RETURN bp.id AS source_id, bp.name AS term, 'BusinessProcess' AS source_type
ORDER BY bp.name
4. WorkflowStep function names:
MATCH (ws:WorkflowStep)
RETURN ws.id AS source_id, ws.function_name AS term, 'WorkflowStep' AS source_type
ORDER BY ws.function_name
5. BusinessRule names:
MATCH (brq:BusinessRule)
RETURN brq.id AS source_id, brq.name AS term, 'BusinessRule' AS source_type
ORDER BY brq.name
For scope == incremental, filter out terms that already have a GlossaryTerm linked via DEFINES:
MATCH (e:BusinessEntity)
WHERE NOT (e)<-[:DEFINES]-(:GlossaryTerm)
RETURN e.id AS source_id, e.name AS term, 'BusinessEntity' AS source_type
Apply the same pattern for each source type (BusinessRole, BusinessProcess, WorkflowStep, BusinessRule). For WorkflowStep and BusinessRule which are not direct DEFINES targets, check by term name match:
MATCH (ws:WorkflowStep)
WHERE NOT EXISTS {
MATCH (gt:GlossaryTerm) WHERE gt.term = ws.function_name
}
RETURN ws.id AS source_id, ws.function_name AS term, 'WorkflowStep' AS source_type
Present candidates grouped by source type:
Found {N} term candidates from the graph:
From BusinessEntity ({M}):
1. Заявка на поставку (OBJ-003)
2. Спецификация (BOM) (OBJ-005)
...
From BusinessProcess ({M}):
3. Входной контроль (BP-004)
...
From BusinessRole ({M}):
4. Кладовщик (ROL-002)
...
From WorkflowStep ({M}):
5. Проверить комплектность (BP-001-S03)
...
From BusinessRule ({M}):
6. Минимальный остаток (BRQ-007)
...
Would you like to exclude any terms or add missing ones?
Wait for user confirmation before proceeding to Phase 2.
Goal: For each term candidate, obtain or confirm a definition.
For each term without a definition:
description property --- propose it as the definition, ask the user to confirm.For each candidate, query its source node for context:
// For BusinessEntity --- get description + attributes
MATCH (e:BusinessEntity {id: $sourceId})
OPTIONAL MATCH (e)-[:HAS_ATTRIBUTE]->(a:EntityAttribute)
RETURN e.name AS name, e.description AS description, e.stereotype AS stereotype,
collect(a.name) AS attributes
// For BusinessProcess --- get trigger, result
MATCH (bp:BusinessProcess {id: $sourceId})
RETURN bp.name AS name, bp.description AS description,
bp.trigger AS trigger, bp.result AS result
// For BusinessRole --- get responsibilities
MATCH (r:BusinessRole {id: $sourceId})
RETURN r.full_name AS name, r.description AS description,
r.department AS department, r.responsibilities AS responsibilities
Proposed definitions (based on graph context):
1. Заявка на поставку --- Документ, инициирующий процесс закупки
запасных частей у поставщика.
(Source: OBJ-003, BusinessEntity)
[Confirm / Edit]
2. Входной контроль --- ???
Context insufficient. Please provide a definition.
3. Кладовщик --- Сотрудник склада, ответственный за приёмку, хранение
и выдачу запасных частей.
(Source: ROL-002, BusinessRole)
[Confirm / Edit]
source_id --- the graph node ID from which the term was extracted.Goal: Identify synonyms --- terms that refer to the same concept --- and resolve them via ALIAS_OF relationships.
Potential synonyms detected:
Group 1:
- "Спецификация (BOM)" --- definition: ...
- "BOM" --- definition: ...
- "Состав изделия" --- definition: ...
Proposed canonical: "Спецификация (BOM)", aliases: BOM, Состав изделия
Group 2:
- "Каталог" --- definition: ...
- "Ассортимент" --- definition: ...
Proposed canonical: "Ассортимент", aliases: Каталог
Agree? Which term should be canonical?
The user decides which term is canonical.
ALIAS_OF relationship pointing to the canonical GlossaryTerm.Goal: Create GlossaryTerm nodes in Neo4j and link them to source domain nodes.
For scope == full, remove all existing glossary data:
MATCH (gt:GlossaryTerm)
DETACH DELETE gt
MATCH (gt:GlossaryTerm)
WITH max(toInteger(replace(gt.id, 'GLO-', ''))) AS maxNum
RETURN coalesce(maxNum, 0) AS currentMax
For full mode, start from GLO-001. For incremental, continue from current max + 1.
For each confirmed term (canonical and alias), create a node:
CREATE (gt:GlossaryTerm {
id: $id,
term: $term,
definition: $definition,
source_id: $sourceId
})
RETURN gt
Node properties:
| Property | Type | Description |
|---|---|---|
id | String | GLO-NNN format, globally sequential |
term | String | The glossary term (nominative singular) |
definition | String | 1-2 sentence definition |
source_id | String | ID of the source node (e.g., OBJ-003, BP-001, ROL-02) |
For canonical terms whose source is a BusinessEntity, BusinessRole, or BusinessProcess, create DEFINES:
// Entity
MATCH (gt:GlossaryTerm {id: $gloId}), (e:BusinessEntity {id: $sourceId})
CREATE (gt)-[:DEFINES]->(e)
// Role
MATCH (gt:GlossaryTerm {id: $gloId}), (r:BusinessRole {id: $sourceId})
CREATE (gt)-[:DEFINES]->(r)
// Process
MATCH (gt:GlossaryTerm {id: $gloId}), (bp:BusinessProcess {id: $sourceId})
CREATE (gt)-[:DEFINES]->(bp)
DEFINES targets are limited to: BusinessEntity, BusinessRole, BusinessProcess.
Terms sourced from WorkflowStep or BusinessRule get a GlossaryTerm node but no DEFINES relationship (steps and rules are not DEFINES targets per schema).
For each alias term, link to its canonical term:
MATCH (alias:GlossaryTerm {id: $aliasId}), (canonical:GlossaryTerm {id: $canonicalId})
CREATE (alias)-[:ALIAS_OF]->(canonical)
After all writes, run the reference query ba_all_glossary_terms to verify:
MATCH (gt:GlossaryTerm)
OPTIONAL MATCH (gt)-[:DEFINES]->(target)
OPTIONAL MATCH (gt)-[:ALIAS_OF]->(canonical:GlossaryTerm)
RETURN gt.id AS id, gt.term AS term, gt.definition AS definition,
gt.source_id AS source,
collect(DISTINCT {label: labels(target)[0], id: target.id}) AS defines,
canonical.term AS alias_of
ORDER BY gt.term
Verify:
The sa_term property on GlossaryTerm is NOT set by this skill. It is reserved for SA skills (sa-finalize or ba-handoff). Do not create, populate, or modify sa_term.
This skill relies on two named queries from graph-infra/queries/ba-queries.cypher:
| Query | Purpose |
|---|---|
ba_glossary_coverage | Check which entities, roles, processes have DEFINES links from GlossaryTerm |
ba_all_glossary_terms | List all glossary terms with definitions, DEFINES targets, and ALIAS_OF links |
# Neo4j (via MCP):
- mcp__neo4j__read-cypher # scan nodes, verify results
- mcp__neo4j__get-schema # introspect schema if needed
# Shared references:
- ${CLAUDE_PLUGIN_ROOT}/nacl-core/SKILL.md # ID format, schema, conventions
# Neo4j (via MCP):
- mcp__neo4j__write-cypher # create GlossaryTerm nodes, DEFINES, ALIAS_OF relationships
# Nodes created:
- GlossaryTerm {id, term, definition, source_id}
# Relationships created:
- (:GlossaryTerm)-[:DEFINES]->(:BusinessEntity)
- (:GlossaryTerm)-[:DEFINES]->(:BusinessRole)
- (:GlossaryTerm)-[:DEFINES]->(:BusinessProcess)
- (:GlossaryTerm)-[:ALIAS_OF]->(:GlossaryTerm)
| Agent does | Agent does NOT do |
|---|---|
| Scans graph nodes and extracts term candidates | Does not invent terms absent from the graph |
| Proposes definitions based on node properties | Does not assign definitions without user confirmation |
| Identifies synonyms and proposes canonical terms | Does not decide canonical term without user approval |
| Creates nodes, DEFINES, ALIAS_OF relationships | Does not set sa_term (SA responsibility) |
| Sorts output alphabetically by term | Does not modify existing terms in incremental mode |
GlossaryTerm nodes are a shared artifact between BA and SA phases:
term, definition, source_id, DEFINES, ALIAS_OFsa_term (technical equivalent in English, PascalCase)term, definition, source_idsa_term --- BA does not set itBA creates term --> BA fills definition --> SA adds sa_term --> Glossary stable
When running /nacl:ba-glossary incremental:
sa_term filled by SA).Show the user a summary report:
Glossary built in Neo4j.
**Statistics:**
- Total terms: {N}
- New (added): {N} # incremental only
- With aliases: {N}
- Synonym groups resolved: {N}
- DEFINES relationships: {N}
- ALIAS_OF relationships: {N}
**Coverage:**
- BusinessEntity: {covered}/{total}
- BusinessRole: {covered}/{total}
- BusinessProcess: {covered}/{total}
**Next steps:**
1. /nacl:ba-analyze --- validate the board against the graph
2. /nacl:ba-validate --- check glossary coverage (level L7)
3. /nacl:ba-handoff --- hand off glossary to SA phase (sa_term mapping)
Run ba_glossary_coverage query to populate the Coverage section.
If mcp__neo4j__read-cypher fails during pre-flight:
Neo4j is not reachable at
bolt://localhost:{$neo4j_bolt_port}. Tell me "start the graph" and I will runnode "${CLAUDE_PLUGIN_ROOT}/nacl-core/scripts/graph-doctor.mjs" --fixvia Bash (works in Claude Code Desktop and CLI). Or start it yourself from the project root (main checkout, not a worktree):
- local mode:
docker compose -f graph-infra/docker-compose.yml up -d--- if Docker Desktop is not running, open the Docker Desktop app first- remote mode: relaunch the sidecar
~/.nacl/sidecar/<project_scope>.sh(Windows:%USERPROFILE%\.nacl\sidecar\<project_scope>.cmd) This skill requires Neo4j --- cannot proceed without it.
If all 5 collection queries return empty results:
No BA nodes found in the graph (no BusinessEntity, BusinessRole, BusinessProcess, WorkflowStep, or BusinessRule). Populate the graph first with
/nacl:ba-process,/nacl:ba-context, or/nacl:ba-from-board.
If mcp__neo4j__write-cypher fails during Phase 4:
Failed to create GlossaryTerm node: {error}. Rolling back. Check Neo4j constraints and retry.
What SKILL.md sets; muted values are Claude Code's defaults
sonnetmediumThree short reads, in order
npx claudepluginhub itsalt/nacl --plugin nacl53 skills in this plugin
/ba-analyzeАнализ Excalidraw-доски бизнес-процесса: полнота, diff со snapshot, сравнение с Neo4j-графом.
Используй когда пользователь просит: проанализировать доску, проверить доску,
найти проблемы на доске, board analysis, nacl-ba-analyze.
/ba-contextDefine system boundaries in Neo4j graph: scope, stakeholders, external entities, data flows.— all data stored as graph nodes and edges.
Use when: define system scope with graph, system context diagram, or the user says "/nacl:ba-context".
/ba-entitiesCatalog business entities in Neo4j: stereotypes, attributes, states, CRUD matrix.Use when: model entities with graph, create entity catalog, or the user says "/nacl:ba-entities".
Other plugins' skills for the same job