Godot Gdscriptのロゴ

Godot Gdscript

コミュニティ
EL4CTEO
godot-gdscript

Write correct, statically typed GDScript for Godot 4.7 - script layout, typing (typed arrays and dictionaries), signals and await, setters, @export annotations, @abstract and variadic functions, lambdas, match, static members, error fixes, plus a real-engine compile check of all .gd files. Use when writing, reviewing or fixing any .gd file.

概要

公開者EL4CTEO
リポジトリgodot-skills
スキル名godot-gdscript
スター
60
フォーク
6
同梱ファイル
4
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 4個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    EL4CTEOがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Godot Gdscript」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/EL4CTEO/godot-skills/tree/main/skills/godot-gdscript
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/EL4CTEO/godot-skills.git /tmp/godot-skills
mkdir -p .claude/skills
cp -r /tmp/godot-skills/skills/godot-gdscript .claude/skills/godot-gdscript
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでGodot Gdscriptを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にGodot Gdscriptを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Godot Gdscriptは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

GDScript (4.7)

Check after every edit: python scripts/gd_check.py [paths] compiles every .gd file with the real engine and returns {file, line, msg} errors. Autoloads and class_names resolve like they do at runtime. Look up any engine API with ../godot-core/scripts/api_lookup.py before you use it.

Script layout (official style guide order)

@tool / @icon / @abstract  →  class_name  →  extends  →  ## doc comment
signals → enums → constants → static vars → @export vars → vars → @onready vars
_static_init → _init → _enter_tree → _ready → _process/_physics_process → other virtuals
public methods → _private methods → inner classes

Use snake_case for files, functions and variables, PascalCase for classes and nodes, CONSTANT_CASE for constants and enum values. Indent with tabs. Prefix private members with _.

Typing rules (always typed: safer, and up to ~2x faster)

  • var speed := 5.0 infers the type. Use var target: Node3D when there's no initializer. Use : Variant only on purpose.
  • Typed containers: Array[Enemy], Dictionary[StringName, int] (4.4+). Typed arrays reject wrong element types at runtime.
  • Give every function a return type, including -> void. In 4.7, an override of a typed-return method must return on every path.
  • node as Enemy returns null when the cast fails, for objects. is tests the type. Use is_instance_valid(x) after any await that might outlive x.
  • Enforce typing project-wide with debug/gdscript/warnings/untyped_declaration = 2 (Error). Keep inference_on_variant at its default of Error.
  • int / int is integer division. Write float(a) / b when you mean a fraction.

Signals and await

  • Declare typed signals: signal health_changed(current: int, maximum: int). Emit with health_changed.emit(hp, max_hp).
  • Connect a Callable: button.pressed.connect(_on_pressed). Add arguments with .bind(id) and one-shot behavior with connect(f, CONNECT_ONE_SHOT). Avoid string forms like connect("x", self, "y").
  • Connections made in code don't need manual cleanup when either object is freed. Disconnect explicitly only when you'll reconnect, or when the source is a long-lived autoload and the target is a lambda capturing a freed node.
  • await sig suspends the function. The caller gets control back immediately unless it also awaits. Any function containing await is a coroutine, so the caller must await it to get its return value.
  • Prefer await get_tree().create_timer(0.5).timeout and await get_tree().process_frame/physics_frame to busy waits.
  • "Call down, signal up": parents call methods on children, children emit signals. Cross-scene events go through an autoload event bus (see godot-architecture).

Language features you should use

  • Properties: var hp: int = 10: followed by an indented set(value): hp = clampi(value, 0, max_hp), or set = _set_hp.
  • @export variants (check them with api_lookup.py @export_range): @export_range(0, 100, 1, "or_greater"), @export_enum, @export_flags_3d_physics, @export_file("*.json"), @export_group("Movement"), @export_subgroup, @export_category, @export_storage, @export_custom, @export_tool_button("Bake", "Bake") (4.4+).
  • @onready var label: Label = %ScoreLabel uses a scene-unique name (%). That's safer than long $A/B/C paths.
  • @abstract class_name Weapon with @abstract func fire() -> void (4.5+). Variadic arguments: func log_all(...parts: Array) -> void (4.5+).
  • Lambdas: var double := func(x: int) -> int: return x * 2. They capture locals by value. Mutate shared state through an Array or Dictionary, or through a member variable.
  • match handles literals, [a, b, ..], {"k": v}, var x bindings and when guards (4.3+).
  • static var/static func, const PRELOADED := preload("res://x.tscn"), &"string_name", ^"Node/Path".
  • Doc comments: ## above members (shown in the editor's help and by --gdscript-docs).

Pitfalls (with fixes)

SymptomCause, then fix
Invalid access ... on a base object of type 'null instance'Wrong node path, or used before _ready. Use @onready/%Unique, and get_node_or_null when a node is optional.
previously freedAn await or deferred call outlived the node. Check is_instance_valid() or is_inside_tree().
Physics or tree changes during a callback error outUse call_deferred("add_child", n), set_deferred("disabled", true) or queue_free().
Cyclic reference / Could not resolve classclass_name cycles between preloads. Use type hints with load() at runtime, or split the shared type into its own script.
A signal callback never firesConnected in _ready of a node that isn't in the tree yet, signature mismatch, or a typo in the signal name. Typed sig.connect() catches typos at parse time.
Exported var resetsValue set in _init gets overwritten by the scene file. Initialize in the declaration or in _ready.
Mixed tabs and spacesTabs only. Godot rejects mixed indentation.

Deeper patterns, all compiled by the test suite: references/patterns.md.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Godot Gdscript」では何ができますか?

Write correct, statically typed GDScript for Godot 4.7 - script layout, typing (typed arrays and dictionaries), signals and await, setters, @export annotations, @abstract and variadic functions, lambdas, match, static members, error fixes, plus a real-engine compile check of all .gd files. Use when writing, reviewing or fixing any .gd file.

TypingMindでGodot Gdscriptを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Godot Gdscriptはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにGodot Gdscriptをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/EL4CTEO/godot-skills/tree/main/skills/godot-gdscriptを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Godot Gdscriptを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Godot Gdscriptで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもGodot Gdscriptを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Godot Gdscript」は無料ですか?

はい。EL4CTEOがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇