New commands: get_scene_insights, get_node_insights#52
Open
ethandaviessmith wants to merge 1 commit intoCoding-Solo:mainfrom
Open
New commands: get_scene_insights, get_node_insights#52ethandaviessmith wants to merge 1 commit intoCoding-Solo:mainfrom
ethandaviessmith wants to merge 1 commit intoCoding-Solo:mainfrom
Conversation
- Implement get_scene_insights for scene file analysis - Implement get_node_insights for script structure analysis - Add consolidated behavioral engine (godot_insights.gd) - Enhance MCP server with new tool handlers - Update build system for new scripts - Add comprehensive behavioral analysis capabilities
Author
|
I wasn't happy with the get_scene_structure PR #48 I put up last month... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete scene and script behavioral analysis system for Godot projects. Provides deep insights into scene architecture, script patterns, signal flows, and component relationships with minimal overhead.
Enables AI assistants to understand project architecture through comprehensive behavioral analysis - tracking signal emissions, method chains, state management patterns, and inter-component communication. Supports both scene-level analysis (hierarchy + attached scripts) and standalone script analysis.
Use cases: Architecture mapping, refactoring safety checks, signal flow tracing, dependency analysis, pattern detection, debugging scene interactions, and codebase exploration.
Technical Implementation
Scene Analysis (get_scene_insights)
Text-based TSCN parser (headless-compatible, no ResourceLoader dependencies)
Property extraction with script reference resolution via ExtResource mapping
Recursive script collection and behavioral analysis for all attached scripts
Signal connection parsing from scene definitions
Behavioral data aggregation across all scene scripts
Script Analysis (get_node_insights)
GDScript parser extracting class structure, exports, variables, methods, signals
Method body analysis for call patterns, signal emissions, and behavioral flows
Dependency tracking: preload(), load(), ClassDB, type hints, and class references
Scene interaction detection: node queries ($, %, get_node), tree manipulation, scene loading
Local variable type inference for accurate method call classification
Behavioral Intelligence
Pattern detection: initialization, continuous processing, input handling, event-driven, state management (simple)
Method summaries with call profiles (internal/external/builtin methods, signal usage)
Signal flow analysis: definitions, emissions, connections with line numbers
Scene interaction categorization: node queries, tree changes, communication patterns (upward/downward)
Core Functions Added (godot_insights.gd overview)
Entry Points
Scene Parsing
Script Parsing
Dependency Analysis
Behavioral Analysis
Signal Intelligence
Type Analysis
Variable type registry with class-level, parameter, and local variable tracking
Method call classification: internal (same script), external (other objects), builtin (engine)