src/render/SKILL.md
GNN code generation for simulation frameworks. Use when generating PyMDP, RxInfer.jl, ActiveInference.jl, JAX, or DisCoPy simulation code from GNN model specifications.
npx skillsauth add activeinferenceinstitute/generalizednotationnotation gnn-code-generationInstall 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.
Generates executable simulation code from parsed GNN models targeting multiple Active Inference frameworks. Performs pre-render validation of POMDP structures and matrix normalization.
# Render code for all frameworks
python src/11_render.py --target-dir input/gnn_files --output-dir output --verbose
# As part of pipeline
python src/main.py --only-steps 11 --verbose
| Framework | Language | Subdirectory | Output |
| ----------- | ---------- | ------------- | -------- |
| PyMDP | Python | render/pymdp/ | .py scripts |
| RxInfer.jl | Julia | render/rxinfer/ | .jl scripts |
| ActiveInference.jl | Julia | render/activeinference_jl/ | .jl scripts |
| JAX | Python | render/jax/ | .py scripts |
| DisCoPy | Python | render/discopy/ | .py scripts |
from render import (
process_render, render_gnn_spec, get_supported_frameworks,
generate_pymdp_code, generate_rxinfer_code,
generate_activeinference_jl_code, generate_discopy_code,
validate_render, PyMDPRenderer, JAXRenderer
)
# Render for all frameworks (used by pipeline)
process_render(target_dir, output_dir, verbose=True)
# Render a single GNN spec
result = render_gnn_spec(parsed_spec, framework="pymdp")
# Framework-specific code generation
pymdp_code = generate_pymdp_code(parsed_model)
rxinfer_code = generate_rxinfer_code(parsed_model)
# Query supported frameworks
frameworks = get_supported_frameworks() # ['pymdp', 'rxinfer', 'activeinference_jl', 'jax', 'discopy']
# Validate render output
validate_render(result, framework="pymdp")
process_render / render_gnn_spec — core rendering functionsgenerate_pymdp_code, generate_rxinfer_code, generate_discopy_code, generate_activeinference_jl_codePyMDPRenderer / JAXRenderer — renderer classesget_supported_frameworks / validate_render — utilitiesThe render processor follows a structured pipeline for each GNN file:
# Core rendering (no extra deps needed)
uv sync
# For Julia frameworks (RxInfer.jl, ActiveInference.jl)
# Requires Julia installed and Julia packages: RxInfer, ActiveInference
julia -e 'using Pkg; Pkg.add(["RxInfer", "ActiveInference"])'
# For DisCoPy
uv sync --extra graphs
output/11_render_output/pymdp/, rxinfer/, jax/, discopy/, activeinference_jl/| Issue | Solution |
| ----- | ------- |
| Empty render output | Check GNN file has valid StateSpaceBlock section |
| Matrix normalization warnings | Verify matrix dimensions match connections |
| Julia framework errors | Ensure Julia is installed and packages available |
This module registers tools with the GNN MCP server (see mcp.py):
process_renderlist_render_frameworksrender_gnn_to_formatdevelopment
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.