From fa0e4a761bfc56dd787abfb33f80b1be86c239a8 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 10 Mar 2026 00:20:30 -0400 Subject: [PATCH] chore(conductor): Add language support tracks (Lua and GDScript) --- conductor/tracks.md | 4 +++ .../index.md | 5 +++ .../metadata.json | 8 +++++ .../plan.md | 25 +++++++++++++++ .../spec.md | 32 +++++++++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 conductor/tracks/gdscript_godot_script_language_support_tools_20260310/index.md create mode 100644 conductor/tracks/gdscript_godot_script_language_support_tools_20260310/metadata.json create mode 100644 conductor/tracks/gdscript_godot_script_language_support_tools_20260310/plan.md create mode 100644 conductor/tracks/gdscript_godot_script_language_support_tools_20260310/spec.md diff --git a/conductor/tracks.md b/conductor/tracks.md index 952f284..046e4da 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -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 diff --git a/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/index.md b/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/index.md new file mode 100644 index 0000000..a9ab0db --- /dev/null +++ b/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/index.md @@ -0,0 +1,5 @@ +# Track gdscript_godot_script_language_support_tools_20260310 Context + +- [Specification](./spec.md) +- [Implementation Plan](./plan.md) +- [Metadata](./metadata.json) diff --git a/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/metadata.json b/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/metadata.json new file mode 100644 index 0000000..6f6484a --- /dev/null +++ b/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/metadata.json @@ -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" +} diff --git a/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/plan.md b/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/plan.md new file mode 100644 index 0000000..7d35e09 --- /dev/null +++ b/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/plan.md @@ -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) diff --git a/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/spec.md b/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/spec.md new file mode 100644 index 0000000..957d8fd --- /dev/null +++ b/conductor/tracks/gdscript_godot_script_language_support_tools_20260310/spec.md @@ -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).