DeepSeek Harness × Godot: Letting DSH Truly "Understand" Your Godot 4 Project

Introduction

The philosophy behind DeepSeek Harness (DSH) is “everything is a plugin.” For game developers, Godot 4 projects typically contain a large number of GDScript files, scenes, and resources. When AI works with such projects, it frequently encounters a recurring problem: the fixes it proposes are often unverified, leaving scripts still throwing errors after modification. Meanwhile, Godot’s error messages are scattered across the editor panel, runtime logs, and developer memory, with no unified entry point for diagnosis.

y1mingsama184/dsh-plugin-godot is a pure ESM DSH plugin that bridges to the Godot editor via a GDScript addon, providing engine-level parse checking, runtime error capture, static optimization scanning, precise fixes with re-verification, and real-time editor bridging capabilities.

Core Features

The plugin provides seven tools that cover the complete loop from diagnosis to repair:

godot_probe

Locates the Godot engine executable, project root directory, main scene, autoload singletons, and plugins, and detects the bridge port. This is the first step for any operation.

godot_check

Runs --check-only on each script and returns diagnostics in file:line format. Results are based on Godot’s own parser, not heuristic guesses. Check results are cached by mtime (modification time) and file size, significantly reducing redundant check time.

godot_run

Runs the Godot project in headless mode for a specified number of frames, capturing runtime errors (such as null references, missing methods, signal parameter mismatches, etc.).

godot_optimize

Performs static scans for performance and structural issues, including per-frame node lookups, per-frame resource loading, oversized scenes and textures, and more.

godot_fix

Executes precise find-and-replace on a specified file, creates a timestamped backup, and automatically invokes --check-only for re-verification, feeding the results back to DSH.

godot_addon

Installs the editor bridge addon into the project with one click and registers the relevant entries in project.godot.

godot_bridge

Connects to the editor, providing access to the scene tree, selected node, node properties, opening running scenes, view screenshots, and more — ideal for scenarios requiring visual confirmation.

Installation & Activation

Add the dependency to the package.json of your DSH profile:

{
  "dependencies": {
    "dsh-plugin-godot": "github:Y1MingSaMa184/dsh-plugin-godot#v0.1.0"
  },
  "dsh": {
    "profile": { "bundles": ["dsh-plugin-godot"] }
  }
}

For local development, you can use "link:/absolute/path/to/dsh-plugin-godot". After installation, reload DSH to see the seven godot_* tools.

Typical Usage

Here is a workflow for a typical Godot 4 project:

  1. Probe project configuration
godot_probe()
# Example output:
# Engine 4.7.2.stable.official · D:\Godot\Godot_v4.7.2-stable_win64_console.exe
# Project MyGame · Main scene res://main.tscn · 1 autoload · 42 .gd assets
  1. Parse check
godot_check()
# Example output:
# Parse check 42 scripts · 2 failed · 890ms
# ERR  res://player.gd:24  Parse Error: Preload file "res://scenes/coin.tscn" does not exist
  1. Runtime error capture
godot_run({ frames: 120 })
# Example output:
# 120-frame headless run complete · 1 runtime error
# ERR  res://enemy.gd:45  Attempt to call function 'take_damage' on a null instance
  1. Performance scan
godot_optimize({ focus: 'perf' })
# Example output:
# Found 3 potential performance issues:
# - res://player.gd:78 Per-frame node lookup (caching recommended)
# - res://main.tscn:12 Oversized scene (splitting recommended)
  1. Precise fix with automatic re-verification
godot_fix({
  file: 'player.gd',
  find: '@onready var label: Label = $HUD/Score',
  replace: '@onready var label: Label = get_node("HUD/Score")'
})
# The plugin performs the replacement, creates a backup, auto re-verifies, and returns check results
  1. Editor bridging (optional)
godot_addon({ op: 'install' })   # Install editor bridge addon
godot_bridge({ op: 'scene_tree' })  # Get scene tree

Two Channels

The plugin interacts with Godot through two channels:

  • CLI channel: The DSH plugin directly spawns the Godot executable using command-line arguments such as --check-only and --headless --quit-after. This approach requires no additional configuration and is suitable for offline validation.
  • Bridge channel: Communicates with Godot’s editor interface via the editor addon, supporting scene tree, selection, properties, screenshots, and more. This approach requires the editor to be open with the addon enabled.

They complement each other: prefer the CLI for scenarios that can be validated offline, and use the bridge for scenarios requiring visual confirmation.

Reliability & Limitations

Why It’s Trustworthy

Single-script --check-only has a real pitfall: autoload singletons (e.g., Game, Boot) and cross-file class_name references are invisible during single-script compilation, producing false positives like Identifier not found: Game. A tool that doesn’t account for this will flag a healthy project with numerous errors.

godot_check avoids false positives through a two-layer mechanism:
1. During per-script parsing, it identifies and counts “single-file mode false positives” and does not report them as errors.
2. A project-level runtime pass is then performed with --headless --quit-after 2, at which point autoloads and the main scene context are fully available — any genuine errors will reproduce here.

In practice (on a real project with 12 scripts): 20 false positives were filtered out, the project-level run was clean, and the final result was 0 failures.

Known Limitations

  • Screenshots require GUI rendering: A headless editor has no framebuffer, so godot_bridge op=screenshot will explicitly error out rather than return a black image.
  • Godot 4.7 lacks EditorInterface.stop(): op=stop will return an explicit error; please use the editor UI to stop execution.
  • One script per process: Initial check time grows linearly with script count, and caching only applies to unchanged files. For projects with thousands of scripts, it’s recommended to narrow the scope first using the files parameter.
  • Static rules are text heuristics: False positives may occur, so each suggestion includes a file:line location for human (or model) judgment.
  • Port 8790 is the fixed default: Can be changed via the port parameter or the DSH_GODOT_BRIDGE_PORT environment variable.

Use Cases

Suitable for the following scenarios:

  • DSH users who need a unified workflow for Godot project diagnosis and repair
  • Scenarios where runtime error capture is part of an automated pipeline
  • Static scanning and optimization of performance-sensitive scripts
  • Developers who want to invoke Godot editor capabilities directly from DSH

Notes

The plugin runs with the permissions of the current DSH process. Review the source code and license (MIT) before installation.

Summary

y1mingsama184/dsh-plugin-godot integrates parse checking, runtime error capture, static optimization, precise fixes, and editor bridging into the DSH workflow through deep integration with Godot, forming a “diagnose → fix → re-verify” closed loop. It addresses the common problem of AI “fixing without verifying” in Godot projects, enabling DSH to truly “understand” the project.

  • Directory page: https://www.skillhub.cn/plugins/Y1MingSaMa184/dsh-plugin-godot
  • GitHub: https://github.com/Y1MingSaMa184/dsh-plugin-godot
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye