gdscript-syntax-guide

Provides a style guide for writing consistent, standards-compliant GScript code.

40|4|Updated Nov 9, 2025
One-click install
npx skills add https://github.com/hhhh124hhhh/godot-mcp --skill gdscript-syntax-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gdscript-syntax-guide
Source: https://github.com/hhhh124hhhh/godot-mcp/tree/main/.claude/skills/godot-skills/sub-skills/gdscript-syntax-guide
Command: npx skills add https://github.com/hhhh124hhhh/godot-mcp --skill gdscript-syntax-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GDScript 的语法规范与风格在大量 Godot 项目中分散,导致代码可读性差和维护成本上升。本技能提供一个权威、可直接应用的参考,帮助团队统一语法、缩进和命名约定。

Core Features & Use Cases

  • 语法与类型系统: 指导强类型提示、变量和函数签名的统一用法,避免常见错误。
  • 缩进与代码风格: 规定制表符缩进、snake_case 命名、统一的导入与注释风格,使团队协作更顺畅。
  • 实用示例与场景: 提供在节点、信号、资源加载等常见场景中的正确实现示例,适用于重构和新项目。

Quick Start

  • Open a Godot 4.5 project to compare your scripts against the guide's recommendations for syntax, naming, and indentation.
  • Apply the indentation and type-hinting examples to a sample script to see immediate improvements.
  • Use the checklist to audit existing code and start refactoring with the guide's guidelines.

Frequently Asked Questions about gdscript-syntax-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to enforce consistent GDScript syntax and type safety in Godot 4.5?

The best way to enforce consistent GDScript syntax is by applying an authoritative style guide that mandates clear type annotations, tab-based indentation, and snake_case naming conventions across all project scripts.

How do I apply strong type hints to variables and function signatures in GDScript?

To apply strong type hints in GDScript, use explicit type annotations for variables and function signatures following a standardized syntax reference, which prevents common type errors and improves code readability.

Does GDScript require tab-based indentation or spaces for Godot projects?

GDScript requires tab-based indentation for Godot projects, and a unified coding standard enforces this alongside snake_case naming to ensure team collaboration remains smooth and consistent.

How do I write standardized GDScript for nodes, signals, and resource loading?

You write standardized GDScript for nodes and signals by following practical examples from a syntax guide that provides correct implementation patterns for these common Godot scenarios.

Can I use this GDScript syntax guide to refactor existing Godot code?

You can use this GDScript syntax guide to refactor existing Godot code by applying its checklist to audit current scripts and update indentation, type hints, and naming conventions to match best practices.