gnn-parsing
GNN file discovery, parsing, and multi-format serialization. Use when reading GNN model files, parsing StateSpaceBlock definitions, extracting connections…
от ActiveInferenceInstitute★ 36 звёзд на GitHub
Установить gnn-parsing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
GNN Parsing (Step 3)
Purpose
Discovers, parses, and validates GNN model files. Extracts structured data from Markdown-based GNN specifications including state spaces, connections, parameterizations, and ontology annotations.
Key Commands
# Parse all GNN files in a directory
python src/gnn/3_gnn.py --target-dir input/gnn_files --output-dir output --verbose
# As part of pipeline
python src/gnn/main.py --only-steps 3 --verbose
GNN File Sections
| 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 |
API
import logging
from pathlib import Path
from gnn import (
discover_gnn_files,
parse_gnn_file,
process_gnn_directory,
process_gnn_multi_format,
validate_gnn_syntax,
)
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_syntax(content_string)
Key Exports
discover_gnn_files— find.mdGNN 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 (needslogging.Logger)check_gnn_file_structure— structural validation of a GNN filevalidate_gnn_syntax— validation via the formalschema_validatorpipeline (file path or content)GNNParsingSystem,GNNFormat— registry-backed multi-format I/OGNNFormalParser,ParsedGNN,ParsedGNNFormal— formal parser types
Output
Parsed models are consumed by downstream steps:
- Step 5 (Type Check): validates matrix dimensions
- Steps 7–8 (Export/Viz): generates outputs
- Step 11 (Render): generates simulation code
MCP Tools
This module registers tools with the GNN MCP server (see mcp.py):
get_gnn_documentationget_gnn_module_infoget_gnn_schema_infoparse_gnn_contentprocess_gnn_directoryrun_round_trip_testsvalidate_cross_format_consistency_contentvalidate_directory_cross_format_consistencyvalidate_gnn_contentvalidate_schema_definitions_consistency
References
- AGENTS.md — Module documentation
- README.md — Usage guide
- SPEC.md — Module specification
- ../../docs/gnn/reference/gnn_syntax.md — Complete syntax reference
- ../../docs/gnn/tutorials/gnn_examples_doc.md — Example models
Documentation
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- 0_template.py
- 10_ontology.py
- 11_render.py
- 12_execute.py
- 13_llm.py
- 14_ml_integration.py
- 15_audio.py
- 16_analysis.py
- 17_integration.py
- 18_security.py
- 19_research.py
- 1_setup.py
- 20_website.py
- 21_mcp.py
- 22_gui.py
- 23_report.py
- 24_intelligent_analysis.py
- 2_tests.py
- 3_gnn.py
- 4_model_registry.py
- 5_type_checker.py
- 6_validation.py
- 7_export.py
- 8_visualization.py
- 9_advanced_viz.py
- AGENTS.md
- README.md
- SPEC.md
- STEP_INDEX.md
- __init__.py
- advanced_visualization/AGENTS.md
- advanced_visualization/D2_README.md
- advanced_visualization/README.md
- advanced_visualization/SKILL.md
- advanced_visualization/SPEC.md
- advanced_visualization/__init__.py
- advanced_visualization/_shared.py
- advanced_visualization/_theme.py
- advanced_visualization/d2_visualizer.py
- advanced_visualization/dashboard.py
FAQ
Что делает скилл gnn-parsing?
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.
Как установить скилл gnn-parsing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gnn-parsing запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…