chore(conductor): Add language support tracks (Lua and GDScript)

This commit is contained in:
2026-03-10 00:20:30 -04:00
parent fe93cd347e
commit fa0e4a761b
5 changed files with 74 additions and 0 deletions

View File

@@ -77,6 +77,10 @@ This file tracks all major tracks for the project. Each track has its own detail
*Link: [./tracks/tree_sitter_lua_mcp_tools_20260310/](./tracks/tree_sitter_lua_mcp_tools_20260310/)*
*Goal: Add Tree-Sitter Lua MCP tools for structural parsing, documentation extraction, and surgical editing.*
4. [ ] **Track: GDScript Language Support Tools**
*Link: [./tracks/gdscript_godot_script_language_support_tools_20260310/](./tracks/gdscript_godot_script_language_support_tools_20260310/)*
*Goal: Add Tree-Sitter GDScript MCP tools for structural parsing, documentation extraction, and surgical editing.*
---
### Path Configuration

View File

@@ -0,0 +1,5 @@
# Track gdscript_godot_script_language_support_tools_20260310 Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)

View File

@@ -0,0 +1,8 @@
{
"track_id": "gdscript_godot_script_language_support_tools_20260310",
"type": "feature",
"status": "new",
"created_at": "2026-03-10T01:00:00Z",
"updated_at": "2026-03-10T01:00:00Z",
"description": "GDScript (godot script) language support tools"
}

View File

@@ -0,0 +1,25 @@
# Implementation Plan: GDScript (Godot) MCP Tools
## Phase 1: Grammar Integration & Base Parser
- [ ] Task: Update project dependencies (e.g., `requirements.txt` or `pyproject.toml`) to include the GDScript tree-sitter binding.
- [ ] Task: Write Tests: Verify the tree-sitter parser can successfully initialize the GDScript language and parse a simple `func _ready(): pass` string.
- [ ] Task: Implement: Create `src/gdscript_parser.py` (or extend existing AST parsers) to handle the base GDScript tree-sitter initialization and generic node walking.
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Grammar Integration & Base Parser' (Protocol in workflow.md)
## Phase 2: Structural & Context Tools
- [ ] Task: Write Tests: Verify `gd_get_skeleton` and `gd_get_code_outline` against a complex GDScript file containing classes, `@export` vars, signals, and docstrings.
- [ ] Task: Implement: Add `gd_get_skeleton` logic to extract signatures, Godot-specific keywords, and replace bodies with `pass`.
- [ ] Task: Implement: Add `gd_get_code_outline` and `gd_get_docstring` logic to traverse the AST and map line numbers and comments.
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Structural & Context Tools' (Protocol in workflow.md)
## Phase 3: Surgical Editing Tools
- [ ] Task: Write Tests: Verify `gd_get_definition` returns the exact source text of a targeted function, and `gd_update_definition` replaces it accurately within a larger file.
- [ ] Task: Implement: Add `gd_get_definition` logic using AST line/byte ranges.
- [ ] Task: Implement: Add `gd_update_definition` and `gd_set_signature` logic to perform string replacement based on strict AST node boundaries.
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Surgical Editing Tools' (Protocol in workflow.md)
## Phase 4: MCP Client Integration & Polish
- [ ] Task: Write Tests: Verify the new tools are successfully registered and invokable via the `mcp_client.py` unified interface.
- [ ] Task: Implement: Register the new `gd_*` functions as official tools in `src/mcp_client.py`.
- [ ] Task: Implement: Ensure the caching layer (mtime invalidation) is correctly applied to the new GDScript parsing operations.
- [ ] Task: Conductor - User Manual Verification 'Phase 4: MCP Client Integration & Polish' (Protocol in workflow.md)

View File

@@ -0,0 +1,32 @@
# Specification: GDScript (Godot) MCP Tools
## Overview
Expand the Conductor's AI context-gathering and surgical editing capabilities by introducing full Tree-Sitter parsing support for GDScript (Godot's native scripting language). This will bring GDScript to feature-parity with the existing Python MCP tools, enabling deep AST-driven structural mapping, documentation extraction, and precise code modification.
## Functional Requirements
- **Grammar Integration:**
- Introduce a stable GDScript Tree-Sitter grammar (`tree-sitter-gdscript`) to the project's parsing environment via Python bindings (or the most robust available method) to generate deterministic Abstract Syntax Trees for `.gd` files.
- **Structural Parsing Tools:**
- **`gd_get_skeleton`:** Extract a high-level view of a GDScript file, containing all class declarations, signals, exported variables, and function signatures with their associated docstrings, replacing function bodies with `pass` or `...`.
- **`gd_get_code_outline`:** Generate a hierarchical text outline showing line ranges for major structural elements (classes, functions, macros).
- **Documentation & Context Tools:**
- **`gd_get_docstring`:** Extract the block comment/docstring immediately preceding a function or class definition.
- **`gd_find_usages`:** Locate usages of specific GDScript symbols/functions across a file or directory using AST or strict regex boundaries.
- **Surgical Editing Tools:**
- **`gd_get_definition`:** Extract the full source code of a specific GDScript function or class definition.
- **`gd_update_definition`:** Surgically replace the implementation of a specific GDScript function without relying on generic search-and-replace strings.
- **`gd_set_signature`:** Update only the signature (parameters/return type) of a GDScript function.
## Non-Functional Requirements
- **Performance:** Parsing and skeleton generation should be heavily cached (using `mtime` invalidation) to ensure near-instantaneous responses, matching the current Python tool performance.
- **Robustness:** The parser must gracefully handle malformed GDScript code, returning as much structural information as possible rather than failing entirely.
## Acceptance Criteria
- [ ] A new suite of GDScript-specific tools (`gd_get_skeleton`, `gd_get_code_outline`, `gd_get_definition`, `gd_update_definition`) is available via the MCP Client.
- [ ] Automated tests verify that `gd_get_skeleton` correctly identifies classes, inner classes, functions, and Godot-specific keywords (like `@export`, `signal`, `onready`).
- [ ] `gd_update_definition` can successfully replace a multi-line function body while maintaining the surrounding file structure and indentation.
- [ ] The `tree-sitter-gdscript` grammar is successfully integrated into the build/setup pipeline.
## Out of Scope
- Full language server protocol (LSP) features like deep type inference or cross-file variable renaming.
- Automated code formatting or linting for GDScript (formatting relies on external ecosystem tools if needed).