src/gnn/SKILL.md
GNN file discovery, parsing, and multi-format serialization. Use when reading GNN model files, parsing StateSpaceBlock definitions, extracting connections, validating GNN syntax, or converting between GNN formats.
npx skillsauth add activeinferenceinstitute/generalizednotationnotation gnn-parsingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Discovers, parses, and validates GNN model files. Extracts structured data from Markdown-based GNN specifications including state spaces, connections, parameterizations, and ontology annotations.
# Parse all GNN files in a directory
python src/3_gnn.py --target-dir input/gnn_files --output-dir output --verbose
# As part of pipeline
python src/main.py --only-steps 3 --verbose
| Section | Purpose | Example |
| --------- | --------- | --------- |
| GNNSection | Model type declaration | ActInfPOMDP |
| ModelName | Model identifier | T-Maze Agent |
| StateSpaceBlock | Matrix/vector definitions | A[3,3,type=float] |
| Connections | Directed (>) and undirected (-) edges | D>s, s-A |
| InitialParameterization | Default values | A={(0.9,0.05,0.05)} |
| ActInfOntologyAnnotation | Semantic labels | A=LikelihoodMatrix |
import logging
from pathlib import Path
from gnn import (
discover_gnn_files,
parse_gnn_file,
process_gnn_directory,
process_gnn_multi_format,
validate_gnn,
)
from gnn import GNNFormalParser
logger = logging.getLogger(__name__)
# Discover GNN files in a directory
files = discover_gnn_files("input/gnn_files/")
# Parse a single file (lightweight dict-style summary)
model = parse_gnn_file("input/gnn_files/my_model.md")
# Process entire directory (used by pipeline)
results = process_gnn_directory("input/gnn_files/", "output/")
# Multi-format processing (requires a Logger — same contract as 3_gnn.py)
process_gnn_multi_format(
Path("input/gnn_files"),
Path("output"),
logger,
verbose=True,
)
# Formal parsing and validation
is_valid, errors = validate_gnn(content_string)
discover_gnn_files — find .md GNN files in a directory treeparse_gnn_file — parse a single GNN file into structured dataprocess_gnn_directory — process all files in a directoryprocess_gnn_multi_format — full multi-format serialization (needs logging.Logger)validate_gnn_structure — structural validation of a parsed modelvalidate_gnn — content-level syntax validationGNNParsingSystem, GNNFormat — registry-backed multi-format I/OGNNFormalParser, ParsedGNN, ParsedGNNFormal — formal parser typesParsed models are consumed by downstream steps:
This module registers tools with the GNN MCP server (see mcp.py):
get_gnn_documentationvalidate_gnn_contentparse_gnn_contentprocess_gnn_directorydevelopment
GNN static HTML website generation from pipeline artifacts. Use when generating browsable documentation websites, creating HTML galleries of model visualizations, or publishing pipeline results as a static site.
data-ai
GNN graph and matrix visualization generation. Use when creating network graph plots, matrix heatmaps, state space diagrams, or other visual representations of GNN models.
testing
GNN advanced validation and consistency checking. Use when performing deep validation of GNN models, checking cross-model consistency, verifying structural integrity, or running validation reports.
tools
GNN shared utility functions and helper modules. Use when working with common pipeline utilities, logging helpers, file I/O wrappers, path management, or pipeline template infrastructure.