style(gui): Apply strict vertical compaction and add type hints
This commit is contained in:
@@ -1,32 +1,28 @@
|
||||
# Specification: GUI 2.py Cleanup & Structural Awareness
|
||||
|
||||
## Overview
|
||||
This track focuses on a comprehensive cleanup of `src/gui_2.py`, deriving best practices for maintaining the Python codebase, and updating the relevant guidelines. It also includes enhancing the MCP tools to better understand Python structural conventions such as annotations.
|
||||
This track focuses on studying recent manual cleanups performed on `src/gui_2.py` to derive best practices for maintaining the Python codebase. It aims to document these extracted conventions, apply them to remaining nitpicks, and significantly enhance the MCP tools' structural awareness of annotations and Python/ImGui conventions.
|
||||
|
||||
## Functional Requirements
|
||||
1. **`gui_2.py` Cleanup**:
|
||||
- Reorganize the `__init__` method and object state.
|
||||
- Improve type hints and annotations throughout the file.
|
||||
- Refactor layout and rendering logic for better readability.
|
||||
- Improve general code structure and maintainability.
|
||||
2. **Guidelines Update**:
|
||||
- Analyze the cleanup process to derive best practices.
|
||||
- Update `conductor/product-guidelines.md` with high-level maintenance strategies.
|
||||
- Update `conductor/code_styleguides/python.md` with specific coding conventions discovered during the cleanup.
|
||||
1. **Study & Documentation**:
|
||||
- Study the recent changes made to `gui_2.py` to identify conventions regarding type hints, state organization, and ImGui rendering patterns.
|
||||
- Update `conductor/product-guidelines.md` with high-level maintenance strategies derived from the study.
|
||||
- Update `conductor/code_styleguides/python.md` with explicit coding conventions discovered (e.g., annotation formatting, class layout).
|
||||
2. **`gui_2.py` Cleanup (Nitpicks)**:
|
||||
- Apply the formalized conventions to any remaining unorganized sections of `gui_2.py` (e.g., finishing `__init__` refactoring or scattered state).
|
||||
3. **MCP Tools Enhancements**:
|
||||
- Improve parsing of Python type annotations.
|
||||
- Enhance the extraction of class and method outlines.
|
||||
- Add support for recognizing specific ImGui/Dear PyGui patterns to improve structural awareness.
|
||||
- Enhance AST parsing logic (e.g., in Python outline/skeleton extraction) to properly parse and expose type annotations.
|
||||
- Modify structural tools to recognize common ImGui/Dear PyGui patterns for better structural awareness and token efficiency.
|
||||
|
||||
## Non-Functional Requirements
|
||||
- Ensure changes do not break existing functionality or introduce regressions.
|
||||
- Maintain the "1-space indentation" rule as strictly defined in the Python code styleguide.
|
||||
- All refactoring should aim to reduce token consumption when analyzing the file with AI.
|
||||
- All refactoring should aim to reduce token consumption when analyzing files with AI.
|
||||
|
||||
## Acceptance Criteria
|
||||
- `gui_2.py` is successfully refactored, specifically focusing on `__init__` declarations and type hints.
|
||||
- Both `conductor/product-guidelines.md` and `conductor/code_styleguides/python.md` are updated with the newly derived insights.
|
||||
- MCP tools (e.g., `py_get_skeleton`, `py_get_code_outline`) exhibit improved awareness of annotations and GUI patterns.
|
||||
- `gui_2.py` is successfully refactored according to the formalized conventions.
|
||||
- MCP tools exhibit improved awareness of annotations and GUI patterns.
|
||||
- Automated tests pass and manual GUI verification confirms no regressions.
|
||||
|
||||
## Out of Scope
|
||||
|
||||
Reference in New Issue
Block a user