Grasshopper Unified Analyzer
Automatically analyze Grasshopper XML definitions (.ghx) to understand workflow structure, extract custom C#/Python scripts, and generate comprehensive documentation suitable for porting to C#.
When to use this skill
Use this skill when the user:
- Asks to analyze a Grasshopper file or definition
- Wants to understand the structure of a .ghx file
- Needs to extract C# or Python scripts from Grasshopper components
- Requests documentation for a parametric workflow
- Mentions converting or porting Grasshopper logic to C#
- Needs algorithmic breakdown of a computational design script
What this skill does
- Parses Grasshopper XML (.ghx/.xml format) without requiring Rhino/Grasshopper runtime
- Builds workflow graph from components and connections
- Identifies topology: start/end nodes, branching points, merge points, primary workflow paths
- Extracts custom scripts: Full C# and Python code with input/output parameters
- Detects dependencies: Libraries, Rhino.Geometry, RhinoCommon SDK references
- Generates comprehensive report with:
- Executive Summary (purpose and scope)
- Workflow Summary (topology and primary flow)
- Libraries & Dependencies
- Custom Script Analysis (full code with I/O metadata)
- Algorithmic Analysis (A-E format for C# developers)
- Definition Summary (component counts, statistics)
How to use
Execute the unified analyzer script:
python ~/.claude/skills/grasshopper-analyzer/gh-unified-analyzer.py "path/to/file.ghx"
Arguments:
- Path to .ghx or .xml file (binary .gh files are NOT supported)
Example:
python ~/.claude/skills/grasshopper-analyzer/gh-unified-analyzer.py ~/Desktop/parametric-design.ghx
Output
The analyzer generates a comprehensive Markdown report:
- Location:
<input-filename>-grasshopper-report.md (same directory as input)
- Format: Single structured Markdown document
Report Structure
- Executive Summary - Purpose, scope, and component counts
- Workflow Summary - Start/end nodes, branching, primary flow
- Libraries and Dependencies - External assemblies and references
- Key Grasshopper Components - Standard components used (grid, remap, etc.)
- Custom Script Analysis - Full code listings with I/O parameters
- Algorithmic Analysis (A-E format):
- A. High-Level Algorithmic Summary
- B. Core Algorithm Breakdown (input → processing → output)
- C. Key Computational Components (purpose, algorithm, dependencies)
- D. Data Flow Architecture (parameters and processing order)
- E. Implementation Notes for C# Developer (dependencies, performance, edge cases)
- Definition Summary - Statistics (component count, scripts, libraries, paths)
Requirements
- Python: 3.6+
- Dependencies: Standard library only (xml.etree.ElementTree, os, sys, re)
- Platform: Windows/macOS/Linux
- File Format: .ghx (XML) or .xml only - binary .gh must be saved as .ghx first
Important notes
- The analyzer processes files in-memory without modifying the original
- Report is deterministic and suitable for version control
- Custom components beyond standard scripts are treated generically
- Flow diagrams are analyzed but not embedded (topology shown as text)
- Perfect for understanding existing definitions or preparing for C# migration
- The algorithmic analysis (A-E format) is specifically structured for C# developers
1---2name: grasshopper-analyzer3description: Analyze Grasshopper (.ghx/.xml) files to extract workflow, custom scripts, algorithmic patterns, and generate comprehensive reports for C# developers4---5
6# Grasshopper Unified Analyzer
7
8Automatically analyze Grasshopper XML definitions (.ghx) to understand workflow structure, extract custom C#/Python scripts, and generate comprehensive documentation suitable for porting to C#.
9
10## When to use this skill
11
12Use this skill when the user:
13- Asks to analyze a Grasshopper file or definition
14- Wants to understand the structure of a .ghx file
15- Needs to extract C# or Python scripts from Grasshopper components
16- Requests documentation for a parametric workflow
17- Mentions converting or porting Grasshopper logic to C#
18- Needs algorithmic breakdown of a computational design script
19
20## What this skill does
21
221. **Parses Grasshopper XML** (.ghx/.xml format) without requiring Rhino/Grasshopper runtime
232. **Builds workflow graph** from components and connections
243. **Identifies topology**: start/end nodes, branching points, merge points, primary workflow paths
254. **Extracts custom scripts**: Full C# and Python code with input/output parameters
265. **Detects dependencies**: Libraries, Rhino.Geometry, RhinoCommon SDK references
276. **Generates comprehensive report** with:
28 - Executive Summary (purpose and scope)
29 - Workflow Summary (topology and primary flow)
30 - Libraries & Dependencies
31 - Custom Script Analysis (full code with I/O metadata)
32 - Algorithmic Analysis (A-E format for C# developers)
33 - Definition Summary (component counts, statistics)
34
35## How to use
36
37Execute the unified analyzer script:
38
39```bash
40python ~/.claude/skills/grasshopper-analyzer/gh-unified-analyzer.py "path/to/file.ghx"
41```
42
43**Arguments:**
44- Path to .ghx or .xml file (binary .gh files are NOT supported)
45
46**Example:**
47```bash
48python ~/.claude/skills/grasshopper-analyzer/gh-unified-analyzer.py ~/Desktop/parametric-design.ghx
49```
50
51## Output
52
53The analyzer generates a comprehensive Markdown report:
54- **Location**: `<input-filename>-grasshopper-report.md` (same directory as input)
55- **Format**: Single structured Markdown document
56
57### Report Structure
58
591. **Executive Summary** - Purpose, scope, and component counts
602. **Workflow Summary** - Start/end nodes, branching, primary flow
613. **Libraries and Dependencies** - External assemblies and references
624. **Key Grasshopper Components** - Standard components used (grid, remap, etc.)
635. **Custom Script Analysis** - Full code listings with I/O parameters
646. **Algorithmic Analysis (A-E format)**:
65 - A. High-Level Algorithmic Summary
66 - B. Core Algorithm Breakdown (input → processing → output)
67 - C. Key Computational Components (purpose, algorithm, dependencies)
68 - D. Data Flow Architecture (parameters and processing order)
69 - E. Implementation Notes for C# Developer (dependencies, performance, edge cases)
707. **Definition Summary** - Statistics (component count, scripts, libraries, paths)
71
72## Requirements
73
74- **Python**: 3.6+
75- **Dependencies**: Standard library only (xml.etree.ElementTree, os, sys, re)
76- **Platform**: Windows/macOS/Linux
77- **File Format**: .ghx (XML) or .xml only - binary .gh must be saved as .ghx first
78
79## Important notes
80
81- The analyzer processes files in-memory without modifying the original
82- Report is deterministic and suitable for version control
83- Custom components beyond standard scripts are treated generically
84- Flow diagrams are analyzed but not embedded (topology shown as text)
85- Perfect for understanding existing definitions or preparing for C# migration
86- The algorithmic analysis (A-E format) is specifically structured for C# developers