[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CS2NGKD3DSWW63Q8AXQHA8":3,"skill-same:01M7CS2NGKD3DSWW63Q8AXQHA8":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7CS2NGKD3DSWW63Q8AXQHA8","godot-gdscript-patterns",null,"Use when writing Godot 4 GDScript - static typing everywhere, scene composition with component nodes, call down\u002Fsignal up, @onready caching, Resources as data duplicated per instance, autoloads only for services, state machines, pooling, physics in _physics_process, and threaded loading.","makifbaysal\u002Ftasktrooper","makifbaysal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F25031940?v=4","01M7CRG3ZCSYZSSEVDMW3DEYC8","Mehmet Akif Baysal","01M7CRG401FJ8YAXH5ER730XYV",122,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fgame-developer\u002Fskills\u002Fgodot-gdscript-patterns\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: godot-gdscript-patterns\ncategory: architecture\ndescription: Use when writing Godot 4 GDScript - static typing everywhere, scene composition with component nodes, call down\u002Fsignal up, @onready caching, Resources as data duplicated per instance, autoloads only for services, state machines, pooling, physics in _physics_process, and threaded loading.\ntech_stack: Godot\nsource: wshobson\u002Fagents godot-gdscript-patterns (MIT), adapted; Godot 4 documentation cited\n---\n# Godot GDScript Patterns\n\n## Overview\n\nGodot's building blocks are nodes composed into scenes, signals between them, and Resources for data. GDScript is dynamic by default, which hides typos until runtime and costs speed; typed GDScript catches them at parse time and runs faster. The common failure modes are untyped code, `get_node` chains reaching up the tree, logic in Resources, and autoloads holding everything.\n\n**Core principle:** Type everything, compose scenes from small nodes, call down and signal up, keep data in Resources and rules in plain classes.\n\n## Type everything\n\n```gdscript\n# ❌ untyped: typos and wrong types surface only when this line runs\nvar speed = 200\nfunc take_damage(amount):\n    health -= amount\n\n# ✅ typed: checked when the script parses, faster at runtime\nclass_name Player extends CharacterBody2D\n\nsignal health_changed(current: int, maximum: int)\nsignal died\n\n@export var definition: PlayerDefinition\n@onready var _sprite: AnimatedSprite2D = $AnimatedSprite2D\n@onready var _hurtbox: Area2D = %Hurtbox\n\nvar health: int\n\nfunc _ready() -> void:\n    health = definition.max_health\n\nfunc take_damage(amount: int) -> void:\n    health = maxi(0, health - amount)\n    health_changed.emit(health, definition.max_health)\n    if health == 0:\n        died.emit()\n```\n\nTurn on Project Settings → Debug → GDScript → `untyped_declaration` (and `unsafe_*` warnings) as warnings or errors if the repository has not yet. Typed arrays and dictionaries (`Array[Enemy]`, `Dictionary[StringName, int]` in 4.4+) everywhere a collection has one element type.\n\n## Composition with component nodes\n\nBuild behaviour from small reusable child scenes rather than deep inheritance:\n\n```\nEnemy (CharacterBody2D)          enemy.gd: wires components, no rules of its own\n├── HealthComponent (Node)       health_component.gd: health, damage(), signal died\n├── HitboxComponent (Area2D)     deals damage on overlap\n├── HurtboxComponent (Area2D)    forwards hits to HealthComponent\n└── StateMachine (Node)          child state nodes: Idle, Chase, Attack\n```\n\nEach component exports its dependencies (`@export var health: HealthComponent`) so the scene wires them in the inspector, and each is testable alone.\n\n## Call down, signal up\n\n```gdscript\n# ❌ reaching up and across the tree: breaks when the scene is reused or rearranged\nfunc _on_hit() -> void:\n    get_parent().get_parent().get_node(\"UI\u002FHUD\").update_health(health)\n\n# ✅ the child emits; whoever owns both connects them\n# in level.gd:\nfunc _ready() -> void:\n    player.health_changed.connect(hud.show_health)\n```\n\n- Parents call methods on children they own; children announce events with signals.\n- Connect in code with Callables (`button.pressed.connect(_on_start_pressed)`) or in the editor — follow the repository.\n- `@onready` (or `%UniqueName` for unique-in-owner nodes) caches node references once; never `get_node()` or `$Path` inside `_process`.\n\n## Resources: data, duplicated per instance\n\n```gdscript\nclass_name PlayerDefinition extends Resource\n@export var max_health: int = 100\n@export var move_speed: float = 180.0\n@export var dash_curve: Curve\n```\n\n- Resources hold data, not behaviour (no gameplay logic, no node references).\n- A loaded `.tres` is shared by everyone who loads it. Runtime state goes on the node, or `definition.duplicate()` per instance, or `resource_local_to_scene` for sub-resources edited per scene.\n- Never load user-provided `.tres`\u002F`.res` files: they can carry scripts (game-save-and-persistence).\n\n## Autoloads sparingly\n\nAutoloads are global singletons. Acceptable for **services**: scene loading, save, audio, settings, an event bus for genuinely global events. Not for the current level's state, the player's health or anything a test needs to reset. A level's data belongs to the level scene.\n\n## State machines\n\nSmall: an `enum` and a `match`. Larger: a `StateMachine` node with one child node per state (`enter()`, `exit()`, `physics_update(delta)`, `handle_input(event)`), transitions requested by name, and the legal transitions tested (game-state-machines-and-ai).\n\n```gdscript\nenum State { IDLE, CHASE, ATTACK }\nvar _state := State.IDLE\n\nfunc _physics_process(delta: float) -> void:\n    match _state:\n        State.IDLE:\n            if _target_in_range(definition.aggro_range): _change(State.CHASE)\n        State.CHASE:\n            _chase(delta)\n            if _target_in_range(definition.attack_range): _change(State.ATTACK)\n        State.ATTACK:\n            pass\n```\n\n## Physics, processing and pooling\n\n- `CharacterBody2D\u002F3D`: set `velocity`, call `move_and_slide()` in `_physics_process(delta)`. `RigidBody`: forces\u002Fimpulses, or `_integrate_forces(state)` for direct control — never set `position` on it every frame.\n- Turn off what is idle: `set_process(false)` \u002F `set_physics_process(false)`, `process_mode = PROCESS_MODE_DISABLED`, `VisibleOnScreenEnabler2D\u002F3D` for off-screen enemies.\n- Pool frequent spawns (bullets, hit effects): pre-instantiate, hide and disable processing on return, reset state on reuse — never `queue_free()` + `instantiate()` every shot.\n- Groups (`add_to_group(\"enemies\")`, `get_tree().get_nodes_in_group(...)`) for broadcast queries, not for per-frame lookups in hot loops.\n\n## Loading and awaiting\n\n- Big scenes: `ResourceLoader.load_threaded_request(path)` at a loading screen, poll `load_threaded_get_status`, then `load_threaded_get` (game-asset-pipeline).\n- `await` on a signal of a node that may be freed hangs or errors; check `is_instance_valid(node)` after awaits that span frames.\n\n## Project hygiene\n\n- Commit `.import` files and, from 4.4, the `.uid` files beside scripts and shaders; ignore `.godot\u002F`.\n- Keep the editor version pinned in `config\u002Ffeatures`; opening the project in a newer minor rewrites files.\n\n## Common Mistakes\n\n- Untyped variables and functions in new code.\n- `get_node(\"..\u002F..\u002FUI\u002FHUD\")` or `get_parent()` chains for communication.\n- Mutating a shared `.tres` at runtime.\n- An autoload per feature, holding level state.\n- Moving a `RigidBody` by setting its position.\n\n## Red Flags\n\n- `$Path` or `get_node` inside `_process` \u002F `_physics_process`.\n- A Resource script with methods that change game state.\n- `queue_free()` and `instantiate()` for projectiles fired many times a second.\n","# Godot GDScript Patterns\n\n## Overview\n\nGodot's building blocks are nodes composed into scenes, signals between them, and Resources for data. GDScript is dynamic by default, which hides typos until runtime and costs speed; typed GDScript catches them at parse time and runs faster. The common failure modes are untyped code, `get_node` chains reaching up the tree, logic in Resources, and autoloads holding everything.\n\n**Core principle:** Type everything, compose scenes from small nodes, call down and signal up, keep data in Resources and rules in plain classes.\n\n## Type everything\n\n```gdscript\n# ❌ untyped: typos and wrong types surface only when this line runs\nvar speed = 200\nfunc take_damage(amount):\n    health -= amount\n\n# ✅ typed: checked when the script parses, faster at runtime\nclass_name Player extends CharacterBody2D\n\nsignal health_changed(current: int, maximum: int)\nsignal died\n\n@export var definition: PlayerDefinition\n@onready var _sprite: AnimatedSprite2D = $AnimatedSprite2D\n@onready var _hurtbox: Area2D = %Hurtbox\n\nvar health: int\n\nfunc _ready() -> void:\n    health = definition.max_health\n\nfunc take_damage(amount: int) -> void:\n    health = maxi(0, health - amount)\n    health_changed.emit(health, definition.max_health)\n    if health == 0:\n        died.emit()\n```\n\nTurn on Project Settings → Debug → GDScript → `untyped_declaration` (and `unsafe_*` warnings) as warnings or errors if the repository has not yet. Typed arrays and dictionaries (`Array[Enemy]`, `Dictionary[StringName, int]` in 4.4+) everywhere a collection has one element type.\n\n## Composition with component nodes\n\nBuild behaviour from small reusable child scenes rather than deep inheritance:\n\n```\nEnemy (CharacterBody2D)          enemy.gd: wires components, no rules of its own\n├── HealthComponent (Node)       health_component.gd: health, damage(), signal died\n├── HitboxComponent (Area2D)     deals damage on overlap\n├── HurtboxComponent (Area2D)    forwards hits to HealthComponent\n└── StateMachine (Node)          child state nodes: Idle, Chase, Attack\n```\n\nEach component exports its dependencies (`@export var health: HealthComponent`) so the scene wires them in the inspector, and each is testable alone.\n\n## Call down, signal up\n\n```gdscript\n# ❌ reaching up and across the tree: breaks when the scene is reused or rearranged\nfunc _on_hit() -> void:\n    get_parent().get_parent().get_node(\"UI\u002FHUD\").update_health(health)\n\n# ✅ the child emits; whoever owns both connects them\n# in level.gd:\nfunc _ready() -> void:\n    player.health_changed.connect(hud.show_health)\n```\n\n- Parents call methods on children they own; children announce events with signals.\n- Connect in code with Callables (`button.pressed.connect(_on_start_pressed)`) or in the editor — follow the repository.\n- `@onready` (or `%UniqueName` for unique-in-owner nodes) caches node references once; never `get_node()` or `$Path` inside `_process`.\n\n## Resources: data, duplicated per instance\n\n```gdscript\nclass_name PlayerDefinition extends Resource\n@export var max_health: int = 100\n@export var move_speed: float = 180.0\n@export var dash_curve: Curve\n```\n\n- Resources hold data, not behaviour (no gameplay logic, no node references).\n- A loaded `.tres` is shared by everyone who loads it. Runtime state goes on the node, or `definition.duplicate()` per instance, or `resource_local_to_scene` for sub-resources edited per scene.\n- Never load user-provided `.tres`\u002F`.res` files: they can carry scripts (game-save-and-persistence).\n\n## Autoloads sparingly\n\nAutoloads are global singletons. Acceptable for **services**: scene loading, save, audio, settings, an event bus for genuinely global events. Not for the current level's state, the player's health or anything a test needs to reset. A level's data belongs to the level scene.\n\n## State machines\n\nSmall: an `enum` and a `match`. Larger: a `StateMachine` node with one child node per state (`enter()`, `exit()`, `physics_update(delta)`, `handle_input(event)`), transitions requested by name, and the legal transitions tested (game-state-machines-and-ai).\n\n```gdscript\nenum State { IDLE, CHASE, ATTACK }\nvar _state := State.IDLE\n\nfunc _physics_process(delta: float) -> void:\n    match _state:\n        State.IDLE:\n            if _target_in_range(definition.aggro_range): _change(State.CHASE)\n        State.CHASE:\n            _chase(delta)\n            if _target_in_range(definition.attack_range): _change(State.ATTACK)\n        State.ATTACK:\n            pass\n```\n\n## Physics, processing and pooling\n\n- `CharacterBody2D\u002F3D`: set `velocity`, call `move_and_slide()` in `_physics_process(delta)`. `RigidBody`: forces\u002Fimpulses, or `_integrate_forces(state)` for direct control — never set `position` on it every frame.\n- Turn off what is idle: `set_process(false)` \u002F `set_physics_process(false)`, `process_mode = PROCESS_MODE_DISABLED`, `VisibleOnScreenEnabler2D\u002F3D` for off-screen enemies.\n- Pool frequent spawns (bullets, hit effects): pre-instantiate, hide and disable processing on return, reset state on reuse — never `queue_free()` + `instantiate()` every shot.\n- Groups (`add_to_group(\"enemies\")`, `get_tree().get_nodes_in_group(...)`) for broadcast queries, not for per-frame lookups in hot loops.\n\n## Loading and awaiting\n\n- Big scenes: `ResourceLoader.load_threaded_request(path)` at a loading screen, poll `load_threaded_get_status`, then `load_threaded_get` (game-asset-pipeline).\n- `await` on a signal of a node that may be freed hangs or errors; check `is_instance_valid(node)` after awaits that span frames.\n\n## Project hygiene\n\n- Commit `.import` files and, from 4.4, the `.uid` files beside scripts and shaders; ignore `.godot\u002F`.\n- Keep the editor version pinned in `config\u002Ffeatures`; opening the project in a newer minor rewrites files.\n\n## Common Mistakes\n\n- Untyped variables and functions in new code.\n- `get_node(\"..\u002F..\u002FUI\u002FHUD\")` or `get_parent()` chains for communication.\n- Mutating a shared `.tres` at runtime.\n- An autoload per feature, holding level state.\n- Moving a `RigidBody` by setting its position.\n\n## Red Flags\n\n- `$Path` or `get_node` inside `_process` \u002F `_physics_process`.\n- A Resource script with methods that change game state.\n- `queue_free()` and `instantiate()` for projectiles fired many times a second.\n",{"name":5,"source":24,"category":25,"tech_stack":26,"description":7},"wshobson\u002Fagents godot-gdscript-patterns (MIT), adapted; Godot 4 documentation cited","architecture","Godot","main","910394a0b6db9fc8c9a8f36328ec421d3ebd8b38","catalog\u002Fagents\u002Fgame-developer\u002Fskills\u002Fgodot-gdscript-patterns",18,"https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper","https:\u002F\u002Ftasktrooper.ai","https:\u002F\u002Fgithub.com\u002Fmakifbaysal","Senior Software Developer","2026-11-15 04:50:29",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add makifbaysal\u002Ftasktrooper --skill godot-gdscript-patterns",{"tool":42,"command":43},"bunx","bunx skills add makifbaysal\u002Ftasktrooper --skill godot-gdscript-patterns",{"tool":45,"command":46},"pnpm","pnpm dlx skills add makifbaysal\u002Ftasktrooper --skill godot-gdscript-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fgame-developer\u002Fskills\u002Fgodot-gdscript-patterns\u002FSKILL.md",true,[],[51,57,64,71,78,85],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7CSVEPQW6J6TD6CS2T5FPNZ","visual-craft","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fvisual-craft\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7CSVAQG91ETHQ0HBNZDG5FR","ux-copy","Use when you write any words a user reads in a mockup or a hand-off - content language and voice, buttons, labels, errors, empty states, confirmations, numbers and dates, and the longest-string check","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fux-copy\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7CSV6H0J38659NDXHJQ8396","screen-mockup-html","Use when you draw screens as the design task's HTML mockup - ONE canvas document holding every screen and every variant side by side, the sanitizer-safe recipe, phone and wide frames, the states grid, static control states, and the loopback self-check with screenshots at 375, 768 and 1440 attached to the task","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fscreen-mockup-html\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7CSV3JFRF3BM3XK52M7YEYR","performance-awareness","How the performance score moves for your role. Use when the score context shows a declining trend, or before handing off work you have not self-checked against every criterion.","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fperformance-awareness\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7CSTZDH00YRF5SCT7BRT9QD","design-variants","Use when a screen design needs variants - how many, variants as side-by-side rows on the one canvas, what makes two variants genuinely different, recommending one, how the human's choice is read, and narrowing to the chosen one in revision","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-variants\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7CSTV6P3SM3PAE28DB0RF77","design-system-authoring","Use when you derive, change or extend a design system - where tokens live per stack, the DTCG token tree, role-based names for both themes, base vs layer vs drift, the DESIGN.md section order, the inventory format, the contrast check and the lint every proposal returns","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-system-authoring\u002FSKILL.md",[],[]]