Gdscript Syntax Guide
GDScript 语法权威指南,提供最新 Godot 4.5 语法规范、最佳实践、缩进规则和代码风格
Install
npx skills add hhhh124hhhh/godot-mcp --skill gdscript-syntax-guidegit clone --depth 1 https://github.com/hhhh124hhhh/godot-mcp.git /tmp/godot-mcp
mkdir -p ~/.claude/skills
cp -r /tmp/godot-mcp/.claude/skills/godot-skills/sub-skills/gdscript-syntax-guide ~/.claude/skills/gdscript-syntax-guidePersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# GDScript 语法权威指南
## 技能概述
`gdscript-syntax-guide` 是专门用于提供 Godot 4.5 环境下 GDScript 语法规范、最佳实践和代码风格的权威指南。该技能确保所有生成的代码符合最新标准和最佳实践。
## 🎯 核心目标
- **语法准确性**: 确保代码符合 Godot 4.5 语法标准
- **缩进规范**: 严格遵守 GDScript 官方缩进规范(制表符缩进)
- **最佳实践**: 提供业界认可的最佳实践示例
- **代码风格**: 统一代码风格和命名规范
- **类型安全**: 推荐强类型和类型提示使用
## 📋 缩进规范(核心重点)
### ✅ 官方推荐标准
#### 基本缩进规则
- **缩进字符**: **必须使用制表符 (Tab)**,而非空格
- **缩进宽度**: 显示为4个字符宽度(编辑器配置)
- **缩进层级**: 每个嵌套层级使用一个Tab
- **对齐**: 严格使用Tab缩进,避免Tab和空格混用
#### 为什么使用制表符
- Godot官方编辑器默认支持和推荐Tab缩进
- 文件大小更小,解析性能更好
- 避免空格/制表符混用导致的显示问题
- 团队协作时缩进一致性更容易保证
#### ✅ 正确示例
```gdscript
# 函数定义无前导缩进
func my_function(param: int) -> void:
# 函数体内使用一个Tab缩进
if condition:
# 嵌套代码块使用两个Tab缩进
nested_call()
another_call()
# 同级别的代码保持一个Tab缩进
other_call()
# 静态函数同样遵循缩进规则
static func static_function() -> void:
# 静态函数体内的代码使用一个Tab缩进
pass
```
#### ❌ 错误示例
```gdscript
# 错误:函数定义前有缩进
func bad_function() -> void:
pass
# 错误:混用空格和制表符
func bad_example() -> void:
var variable = 0 # 这里可能使用了空格
another_var = 1 # 这里可能使用了不同的缩进
# 错误:缩进层级混乱
func bad_function() -> void:
if condition:
do_something()
nested_call()
```
## 🔤 类型系统最佳实践
### 强类型推荐Details
- Skill name
gdscript-syntax-guide- Repository
- hhhh124hhhh/godot-mcp
- Path
.claude/skills/godot-skills/sub-skills/gdscript-syntax-guide/SKILL.md- License
- MIT
- Repo updated
- 15 November 2025
FAQ
What does the Gdscript Syntax Guide skill do?
GDScript 语法权威指南,提供最新 Godot 4.5 语法规范、最佳实践、缩进规则和代码风格
How do I install the Gdscript Syntax Guide skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add hhhh124hhhh/godot-mcp --skill gdscript-syntax-guide. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Gdscript Syntax Guide popular?
It lives in hhhh124hhhh/godot-mcp, which has 44 GitHub stars and 4 forks.
Related skills
Context7 Auto Research
44hhhh124hhhh/godot-mcp
自动使用Context7进行文档研究,当用户需要代码生成、配置步骤或库/API文档时无需明确请求即可自动获取最新信息
Godot Animation Studio
44hhhh124hhhh/godot-mcp
Godot 资源与动画创建专家,支持自然语言描述自动完成精灵导入、动画配置、特效制作、音效集成等资源工作
Godot Material Manager
44hhhh124hhhh/godot-mcp
专业的Godot材质管理系统,支持StandardMaterial3D和ShaderMaterial的创建、配置、批量操作和性能优化,与Context7集成获取最新材质技术
Activity Recap
43rohitg00/agentbrain
Use when the user needs a standup-ready summary of recent project activity from local evidence.
Godot Performance Optimizer
44hhhh124hhhh/godot-mcp
Godot 性能优化与适配专家,支持自然语言描述自动完成分辨率适配、性能分析、内存优化、帧率提升等优化工作
Preview
33sanghun0724/cmux-claude-skills
마크다운 파일을 cmux 사이드 패널에서 실시간 미리보기로 엽니다. 파일 변경 시 자동 새로고침됩니다.
Browse the most popular Claude skills, all other skills, or write your own with the skills generator.