AgentSkillsCN

gdscript-doctor

针对 GDScript 逻辑错误及运行时崩溃的专家级诊断与故障排除。当验证任务失败,或编辑器提示解析/运行时警告时,可使用此流程。

SKILL.md
--- frontmatter
name: gdscript-doctor
description: Expert diagnosis and troubleshooting for GDScript logic errors and runtime crashes. Use when verification tasks fail or when the editor reports parsing/runtime warnings.

GDScript Doctor

Systematic diagnosis and resolution of common Godot/GDScript errors.

Workflow

  1. Reproduction: Run the specific test file in GUT or launch the scene via F5.
  2. Trace Analysis: Verify the line number and base object type in the Godot Output console.
  3. Lookup: Match the symptom in bug-library.md.
  4. Fix & Verify:
    • Apply the correction (e.g., null check, deferred call).
    • Re-run benchmarks or unit tests 3x to ensure stability.

Guidelines

  • Log Verbosity: Use push_error() for fatal issues and print() for state tracking.
  • Node Discovery: Use mcp_godot-mcp_list_nodes to find invalid paths.

Artefacts to Update (bug fixes)

  • When a fix requires changing APIs, data formats, or public contracts, add an entry to ./docs/todo/master_todo.md describing the change and which files will be modified.
  • Update references/bug-library.md with the discovered symptom and the fix pattern for future reference.
  • Commit tests that reproduce the failure along with the fix and include the GUT summary in the PR description.