hoveychen

Gd Agent — Development skill for Claude Code

Development community

Drive any Godot 4 game in the background from an agent, script or bot — screenshots, input injection, click-by-text, eval, snapshots, fast/headless backtests, hitch & crash reports.

How to install Gd Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open hoveychen/gd-agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Gd Agent does

Drive any Godot 4 game in the background from an agent, script or bot — screenshots, input injection, click-by-text, eval, snapshots, fast/headless backtests, hitch & crash reports. Ships as an Agent Skill (SKILL.md).

Alternatives in Development

  • Godogen — Claude Code skills that build complete Godot 4 projects from a game description 2.4k ★
  • Crash Analysis 2.3k ★
  • React Native Movie App — Get hands-on with React Native and Expo in this crash course 787 ★

README

gd-agent

一个 Godot 4 插件,同时也是一个 [Agent Skill](https://agentskills.io)(Claude Code、Codex、Cursor、Gemini CLI 等支持 SKILL.md 的 agent 都能用):让 agent、脚本或 bot 在后台驱动任意 Godot 4 游戏。它能截图录像,注入键鼠、触摸、手柄和文字输入,按文字点控件,在运行中的游戏里 eval GDScript,等信号,读快照跳档,用 `--fast` 加速或用 `--headless` 跑回测,出卡顿和崩溃报告,还能多开。

*A Godot 4 addon that doubles as an [Agent Skill](https://agentskills.io) (works in Claude Code, Codex, Cursor, Gemini CLI and other SKILL.md-compatible agents). It lets an agent, script or bot drive any Godot 4 game in the background: screenshots and recording, key/mouse/touch/gamepad/text injection, click-by-text, live GDScript eval, signal waits, snapshot jumps, faster-than-real-time and headless backtests (~40–50x), hitch and crash reports, multiple instances.*

为什么

  • 不抢焦点。 输入在进程内通过 Input.parse_input_event 注入,窗口藏在屏幕外照常渲染。agent 在跑的时候,你照样用自己的鼠标键盘。
  • 给 agent 用,不只是给人用。 命令行每次输出一个 JSON,用退出码区分成败;click 被挡住会报错,不会静默点空;主线程卡死时 report --kill-hung 直接给出卡在哪一行 GDScript。
  • 能跑快。 带渲染时 --fast 约 1.4–2.3 倍速;--headless 只跑数值,约 40–50 倍速,适合 bot 打几十局做数值回测。

安装

用跨 agent 的安装器(会问你装给哪些 agent、装到项目还是全局):

npx skills add hoveychen/gd-agent

或者手动克隆到你的 agent 读 skill 的目录:

git clone https://github.com/hoveychen/gd-agent ~/.claude/skills/gd-agent   # Claude Code
git clone https://github.com/hoveychen/gd-agent ~/.agents/skills/gd-agent   # Codex 等

装好的目录既是 skill,也是插件本体。接进一个游戏:

/sync.sh <游戏目录>      # 把 addons/gd_agent 拷进游戏

然后在游戏的 `project.godot` 里,把它加成**第一个** autoload:

[autoload]
GdAgent="*res://addons/gd_agent/gd_agent.gd"

再跑一次 `godot --headless --path <游戏目录> --import`。不带 `-- --agent-port=N` 启动时插件什么都不做,留在玩家包里也没事。存档隔离和快照这些跟游戏本身有关的功能,需要写一个可选的适配器,见 [addons/gd_agent/README.md](addons/gd_agent/README.md)。

不用 agent 的话,只拷 `addons/gd_agent/` 也能用,命令行和 Python API 都不依赖 skill。

用起来

A=addons/gd_agent/gd_agent.py
python3 $A launch --name s1 && python3 $A s1 wait-booted
python3 $A s1 click 开始
python3 $A s1 shot /tmp/a.png --width 900
python3