emviz is an interactive visualizer for Event Modeling YAML projects. It renders stories, slices, screens, processors, commands, events, queries, and GWT cases as a directed graph so you can inspect model structure and trace behavior across slices.
It is not a YAML editor. The canonical model stays in your Event Modeling files; emviz helps you understand the graph, find validation issues, and copy precise context for LLM-assisted edits.
-
Visualize Event Modeling YAML
- Story lanes and slice groups show the narrative flow.
- Screens, processors, commands, events, queries, and GWT cases are rendered as graph nodes.
-
Trace connections
- Click a node to inspect incoming and outgoing connections.
- Search by node name, type, or source path.
- Select a field name to see where data flows through events and queries.
-
Review validation findings
- Open the validation drawer to inspect errors and warnings.
- Focus findings directly on the related graph node.
- Detect stale
.event-modeling/graph.jsonselectors and other model drift.
-
Copy context for LLM workflows
- Copy stable
em://...node references. - Copy YAML excerpts, connected context, or an edit-prompt scaffold.
- Copy stable
-
Compare model versions
- Run
emviz diffagainst a git ref or another project directory. - Review added, removed, and changed nodes on the same canvas.
- Filter the canvas to focus on one kind of change.
- Run
Run emviz from the root of an Event Modeling project:
npx emviz .The CLI prints a local URL:
-> Local: http://localhost:5173/
Project: /path/to/your/project
If .event-modeling/graph.json is missing, emviz creates it on first project-mode startup.
Install the companion skills before using the modeling, extraction, or linting workflows:
gh skill install craftell/emThe installed skills provide:
em-modelfor creating canonical Event Modeling YAML.em-extractfor extracting candidate models from code or an Understand Anything knowledge graph.em-lintfor validating Event Modeling YAML.
-
Open a project
npx emviz .Loads the current directory as an Event Modeling project. This is the normal daily-use mode.
-
Update the visualizer sidecar
npx emviz sync .Creates or updates
.event-modeling/graph.json. Existing node IDs are preserved when possible. -
Use manual import mode
npx emviz
Opens the browser app without a project server. Import a folder or select YAML / JSON files in the browser. This is useful for demos and one-off inspection.
-
Export a standalone HTML file
Use the
...menu in the top-right toolbar and chooseExport. The exported HTML embeds the current model and can be opened without the project server. -
Compare two versions
npx emviz diff HEAD~1
Compares the current project with a git commit, branch, or tag. The current working tree is used as the target.
npx emviz diff --from HEAD~1 --to . npx emviz diff --from ../old-event-model --to .
--fromis the base model and--tois the target model. Each side can be a git ref or an Event Modeling project directory.
emviz diff opens the normal canvas with diff metadata layered onto the graph. Added nodes and edges are green, removed nodes and edges are red and dashed, and changed nodes are amber.
The left panel summarizes changed nodes and provides filters for added, removed, and changed graph elements.
emviz expects the Event Modeling YAML layout produced by the em-model and em-extract workflows:
.event-modeling/
config.yaml
graph.json
event-model/
events.yaml
stories/
*.yaml
features/
**/*.slice.yaml
.event-modeling/config.yaml is owned by the modeling workflow. .event-modeling/graph.json is owned by emviz and stores stable visualizer node IDs. Keeping that sidecar separate avoids adding visualizer-only IDs to canonical slice YAML.
-
Toolbar
- Shows story, slice, and event counts.
- Provides back / forward selection history.
- Searches nodes by name, type, or source path.
-
Canvas
- Shows stories and slices as background groups.
- Draws behavior flow from screen / processor to command, command to event, and event to query.
- Uses React Flow controls for zoom and fit view.
-
Selection panel
- Shows the selected node type, stable reference, source path, and source excerpt.
- Lists incoming and outgoing connections.
- Provides
Copy for LLMactions for reference, YAML, context, and edit prompt.
-
Validation drawer
- Open it from the
!button in the lower-left corner. - Use
Focuson a finding to jump to the related node.
- Open it from the
emviz does not directly render .understand-anything/knowledge-graph.json. The integration path goes through em-extract and Understand Anything:
-
Analyze the codebase with Understand Anything
.understand-anything/knowledge-graph.jsonUnderstand Anything produces a knowledge graph of implementation entities and relationships.
-
Extract candidate Event Modeling artifacts with
em-extractWhen
.understand-anything/knowledge-graph.jsonis present,em-extractprefers it over broad code search. It uses implementation evidence such as routes, use cases, jobs, database writes, queries, and integrations to propose stories, slices, commands, events, and queries. -
Confirm and write Event Modeling YAML
Treat extraction output as a proposal. After domain review, write canonical YAML under
event-model/using theem-modelformat. -
Visualize the result
npx emviz sync . npx emviz .
-
Iterate with LLM assistance
Select a node in
emviz, openCopy for LLM, and copy the reference, context, or edit prompt. Stable references use theem://<model-id>/<node-id>format, which makes follow-up edits easier to target.
This repository is a pnpm workspace.
pnpm install
pnpm build
pnpm testRun the app during development:
pnpm devRun the local CLI build:
pnpm build
node packages/cli/dist/index.js .packages/
app/ # Vite + React visualizer
cli/ # npx emviz entrypoint
parser/ # Event Modeling YAML -> normalized graph
validator/ # schema / graph / modeling checks
graph/ # .event-modeling/graph.json sidecar
skills/
em-model/ # Creates Event Modeling YAML
em-extract/ # Extracts candidates from code or an Understand Anything graph
em-lint/ # Validates Event Modeling YAML



