Command Palette

Search for a command to run...

Назад к скиллам
скилл № 95303

gnn-parsing

GNN file discovery, parsing, and multi-format serialization. Use when reading GNN model files, parsing StateSpaceBlock definitions, extracting connections…

БесплатноЗапускает вложенные скрипты
ActiveInferenceInstituteот 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 .md GNN files in a directory tree
  • parse_gnn_file — parse a single GNN file into structured data
  • process_gnn_directory — process all files in a directory
  • process_gnn_multi_format — full multi-format serialization (needs logging.Logger)
  • check_gnn_file_structure — structural validation of a GNN file
  • validate_gnn_syntax — validation via the formal schema_validator pipeline (file path or content)
  • GNNParsingSystem, GNNFormat — registry-backed multi-format I/O
  • GNNFormalParser, 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_documentation
  • get_gnn_module_info
  • get_gnn_schema_info
  • parse_gnn_content
  • process_gnn_directory
  • run_round_trip_tests
  • validate_cross_format_consistency_content
  • validate_directory_cross_format_consistency
  • validate_gnn_content
  • validate_schema_definitions_consistency

References


Documentation

  • README: Module Overview
  • AGENTS: Agentic Workflows
  • SPEC: Architectural Specification
  • SKILL: Capability API
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • 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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить gnn-parsing с