godot-editor-controllisted
Install: claude install-skill chenhangcuisg-code/gat
# godot-editor-control — 用 AI 操控 Godot 编辑器
通过 **Hastur Operation Plugin**(rayxuln 作,Godot 4.x 远程代码执行插件)驱动**正在运行的 Godot 编辑器**:
发 GDScript 到 broker → broker 经 TCP 转给编辑器插件执行 → 回传 compile/run 结果与 outputs。
请求:$ARGUMENTS
> GAT v0.2 边界:本技能是可选的编辑器操控层。所有运行时代码/场景/资源写入仍必须经过
> `gat-godot-gate` 的修改前 MCP 前检与最终 `run → debug output → stop`;Hastur 成功不等于
> 功能、点击路径或玩家存档安全已经验证。
> 架构:**本 skill(Agent)──HTTP:5302──▶ Broker(Node/Express)──TCP:5301──▶ Godot 编辑器插件**
> 插件 GitHub:https://github.com/rayxuln/hastur-operation-plugin
> ⚠️ **安全**:插件在编辑器里执行**任意 GDScript**。broker **只绑 localhost**,token 当密码,别提交/外泄。
## 环境
- Python 3.10+(客户端**仅标准库**);用 `python`、`py -3` 或自己环境里的解释器。
- Node 18+(运行 broker);Godot 4.x 工程。
- 客户端/模板/测试都在本 skill 下:`scripts/` `gdscript/ops/` `references/`。
## 先决条件(一次性,见 `references/install.md`)
1. 把插件 `addons/hasturoperationgd/` 拷进 Godot 工程 → Project Settings → Plugins 启用 → dock 变绿。
2. 起 broker:`cd broker-server && npm install && npm run dev`(默认 HTTP `:5302` / TCP `:5301`),
**记下它打印的 64 位 hex token**。
3. 配置客户端连接:工程根/家目录放 `.hastur.json`:
```json
{ "broker": "http://localhost:5302", "token": "<broker打印的token>", "project_name": "修仙" }
```
(或用 `--broker/--token` 或环境变量 `HASTUR_BASE_URL/HASTUR_AUTH_TOKEN`。)
## 执行流程(收到一个"操控编辑器"的需求时)
1. **连通自检**:`gop.py health` → 200;`gop.py executors` → 看有没有 `type:editor` 实例、记下 `id`。
2. **选/拼操作**:
- 命中常用操作 → 用模板:`gop.py op <name> --set k=v ...`(`op --list` 看全部)。
- 不在模板里 → 写 GDScript:`gop.py exec --file x.gd`(或 `--code "..."`);照 `operati