← 返回 Skills 市场
isonaei

Godot Dev Guide

作者 IsonaEi · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1105
总下载
1
收藏
6
当前安装
1
版本数
在 OpenClaw 中安装
/install godot-dev-guide
功能描述
Godot 4.x 完整開發指南。涵蓋 GDScript 模式、文件格式(.gd/.tscn/.tres)、場景架構、物理/UI/音效、性能優化、多平台導出、測試。自動觸發於 Godot 相關開發。
使用说明 (SKILL.md)

Godot Dev Guide Skill

Godot 4.x 遊戲開發完整指南,專為 AI 輔助開發設計。

核心原則

1. 文件格式差異(最重要!)

.gd  → GDScript 程式碼(完整語言)
.tscn → 場景序列化(嚴格格式,非 GDScript)
.tres → 資源序列化(嚴格格式,非 GDScript)

⚠️ AI PITFALL:混淆 GDScript 與資源格式

# ❌ WRONG in .tres/.tscn
script = preload("res://script.gd")
var items = [1, 2, 3]

# ✅ CORRECT in .tres/.tscn
[ext_resource type="Script" path="res://script.gd" id="1"]
script = ExtResource("1")
items = Array[int]([1, 2, 3])

2. 類型系統(永遠使用)

# 變數類型
var health: int = 100
var speed: float = 200.0
var items: Array[Item] = []
var stats: Dictionary = {}

# 函數簽名
func calculate_damage(base: int, multiplier: float) -> int:
    return int(base * multiplier)

3. 架構模式

組合優先於繼承
信號用於解耦通信
資源用於數據配置
自動載入用於全局系統

快速參考

項目結構

res://
├── project.godot
├── scenes/           # .tscn 場景
│   ├── player/
│   ├── enemies/
│   └── ui/
├── scripts/          # .gd 腳本
├── assets/           # 資源文件
├── autoload/         # 單例腳本
├── resources/        # .tres 資源
└── test/             # 測試

常用節點

2D 3D 用途
CharacterBody2D CharacterBody3D 玩家/NPC 移動
RigidBody2D RigidBody3D 物理模擬
Area2D Area3D 碰撞檢測(無物理)
Sprite2D MeshInstance3D 視覺渲染

Export 變數

@export var speed: float = 5.0
@export_range(0, 100, 1) var health: int = 100
@export_file("*.tscn") var next_level: String
@export_group("Combat")
@export var damage: int = 10

信號模式

signal health_changed(current: int, maximum: int)
signal died

func take_damage(amount: int) -> void:
    health -= amount
    health_changed.emit(health, max_health)
    if health \x3C= 0:
        died.emit()

節點引用

@onready var sprite: Sprite2D = $Sprite2D
@onready var anim: AnimationPlayer = $AnimationPlayer

關鍵陷阱清單

陷阱 錯誤寫法 正確寫法
.tres 使用 preload preload("res://x.gd") ExtResource("id")
.tres 使用 var var x = 5 x = 5
未類型化陣列 [1, 2, 3] in .tres Array[int]([1, 2, 3])
缺少 ext_resource 直接使用 id 先宣告 ext_resource
@onready 初始化 在宣告時存取其他節點 等到 _ready()
直接修改資源 resource.value = x resource.duplicate()
輸入處理 UI 和遊戲混用 _input UI 用 _gui_input

參考文件

主題 路徑
項目結構 references/01-project-structure.md
GDScript 模式 references/02-gdscript-patterns.md
文件格式 references/03-file-formats.md
場景與節點 references/04-scenes-nodes.md
UI 與輸入 references/05-ui-input.md
物理系統 references/06-physics.md
音效與動畫 references/07-audio-animation.md
性能優化 references/08-performance.md
導出平台 references/09-export.md
測試指南 references/10-testing.md

CLI 快速命令

# 運行遊戲
godot --path .

# 驗證腳本
godot --path . --check-only --script path/to/script.gd

# 無頭測試
godot --path . --headless --quit

# 導出
godot --path . --export-release "Preset Name" builds/game.exe

Version: 1.0.0 | Last Updated: 2026-02-17

安全使用建议
This skill is an instruction-only Godot 4.x reference and appears coherent and low-risk: it requests no credentials and performs no installs. Things to consider before installing: (1) autoInvoke/high priority means it will auto-trigger on Godot-related prompts—disable autonomous invocation or lower priority if you prefer manual use; (2) CLI examples call the local 'godot' binary and will read your project files if the agent executes them—ensure you are comfortable with the agent accessing the working directory; (3) BUILD_REPORT mentions combined sources (local material, GitHub, a third-party skill) — if licensing or provenance matters, review the reference files for copied content. If any of these are concerns, either run the skill manually or request the publisher add a note about provenance and licensing.
功能分析
Type: OpenClaw Skill Name: godot-dev-guide Version: 1.0.0 The OpenClaw AgentSkills skill bundle is a comprehensive Godot 4.x development guide, explicitly designed for AI assistance. All code snippets, CLI commands, and documentation (including SKILL.md, BUILD_REPORT.md, REVIEW_REPORT.md, and reference files) are benign. The 'AI PITFALL' sections are instructional, clearly distinguishing between '❌ WRONG' and '✅ CORRECT' practices, aiming to guide the AI agent towards best practices rather than tricking it into harmful actions. There is no evidence of data exfiltration, malicious execution, persistence mechanisms, or prompt injection with harmful intent. All operations described are standard Godot development workflows.
能力评估
Purpose & Capability
Name/description, files, and runtime instructions are all focused on Godot 4.x development; nothing requested (no env vars, no binaries, no installs) is disproportionate to a documentation/assistant skill.
Instruction Scope
SKILL.md contains code examples, file-format guidance, and CLI commands (godot --path ..., headless checks, export). These may cause the agent to read or validate local project files when invoked (expected for a dev guide). It does not instruct collection or exfiltration of unrelated system data.
Install Mechanism
No install spec and no code files to execute at install time; risk is low because the skill is instruction-only and nothing is downloaded or written by an installer.
Credentials
The skill declares no environment variables, credentials, or config paths. All referenced resources are project files and Godot artifacts relevant to the stated purpose.
Persistence & Privilege
Registry flags show always=false but SKILL.md frontmatter sets autoInvoke: true and a high priority with multiple triggers, and model invocation is allowed—this means the agent may autonomously activate the skill on Godot-related prompts. That behavior is coherent with an auto-triggering dev helper but may cause frequent automatic activations.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install godot-dev-guide
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /godot-dev-guide 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Complete Godot 4.x development guide with 28 AI pitfall annotations
元数据
Slug godot-dev-guide
版本 1.0.0
许可证
累计安装 7
当前安装数 6
历史版本数 1
常见问题

Godot Dev Guide 是什么?

Godot 4.x 完整開發指南。涵蓋 GDScript 模式、文件格式(.gd/.tscn/.tres)、場景架構、物理/UI/音效、性能優化、多平台導出、測試。自動觸發於 Godot 相關開發。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1105 次。

如何安装 Godot Dev Guide?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install godot-dev-guide」即可一键安装,无需额外配置。

Godot Dev Guide 是免费的吗?

是的,Godot Dev Guide 完全免费(开源免费),可自由下载、安装和使用。

Godot Dev Guide 支持哪些平台?

Godot Dev Guide 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Godot Dev Guide?

由 IsonaEi(@isonaei)开发并维护,当前版本 v1.0.0。

💬 留言讨论