@el4cteo/godot-skills 0.0.0-stage → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/AGENTS.md +46 -0
  2. package/CHANGELOG.md +26 -0
  3. package/LICENSE +21 -0
  4. package/README.md +97 -2
  5. package/assets/banner.png +0 -0
  6. package/cli/godot-skills.js +46 -0
  7. package/install/install.ps1 +56 -0
  8. package/install/install.sh +50 -0
  9. package/package.json +13 -4
  10. package/shared/_godotx.py +178 -0
  11. package/skills/godot-2d/SKILL.md +60 -0
  12. package/skills/godot-2d/references/patterns.md +141 -0
  13. package/skills/godot-3d-gameplay/SKILL.md +71 -0
  14. package/skills/godot-3d-gameplay/references/patterns.md +328 -0
  15. package/skills/godot-3d-rendering/SKILL.md +73 -0
  16. package/skills/godot-3d-rendering/references/recipes.md +163 -0
  17. package/skills/godot-addons/SKILL.md +61 -0
  18. package/skills/godot-addons/references/patterns.md +86 -0
  19. package/skills/godot-addons/scripts/_godotx.py +178 -0
  20. package/skills/godot-addons/scripts/addon_inspect.py +165 -0
  21. package/skills/godot-animation/SKILL.md +51 -0
  22. package/skills/godot-animation/references/patterns.md +158 -0
  23. package/skills/godot-architecture/SKILL.md +62 -0
  24. package/skills/godot-architecture/references/patterns.md +230 -0
  25. package/skills/godot-audio/SKILL.md +45 -0
  26. package/skills/godot-audio/references/patterns.md +166 -0
  27. package/skills/godot-core/SKILL.md +90 -0
  28. package/skills/godot-core/references/cli.md +29 -0
  29. package/skills/godot-core/references/godot3-traps.md +73 -0
  30. package/skills/godot-core/references/whats-new.md +69 -0
  31. package/skills/godot-core/scripts/_godotx.py +178 -0
  32. package/skills/godot-core/scripts/api_lookup.py +532 -0
  33. package/skills/godot-core/scripts/project_inspect.py +229 -0
  34. package/skills/godot-core/scripts/run_godot.py +84 -0
  35. package/skills/godot-core/scripts/scene_edit.gd +262 -0
  36. package/skills/godot-core/scripts/scene_edit.py +71 -0
  37. package/skills/godot-csharp/SKILL.md +67 -0
  38. package/skills/godot-csharp/references/patterns.md +198 -0
  39. package/skills/godot-csharp/scripts/_godotx.py +178 -0
  40. package/skills/godot-csharp/scripts/cs_build.py +160 -0
  41. package/skills/godot-editor-tooling/SKILL.md +49 -0
  42. package/skills/godot-editor-tooling/references/patterns.md +190 -0
  43. package/skills/godot-export-ci/SKILL.md +48 -0
  44. package/skills/godot-export-ci/references/ci.md +78 -0
  45. package/skills/godot-export-ci/scripts/_godotx.py +178 -0
  46. package/skills/godot-export-ci/scripts/export.py +96 -0
  47. package/skills/godot-game-feel/SKILL.md +52 -0
  48. package/skills/godot-game-feel/references/patterns.md +257 -0
  49. package/skills/godot-gdscript/SKILL.md +61 -0
  50. package/skills/godot-gdscript/references/patterns.md +186 -0
  51. package/skills/godot-gdscript/scripts/_godotx.py +178 -0
  52. package/skills/godot-gdscript/scripts/gd_check.gd +17 -0
  53. package/skills/godot-gdscript/scripts/gd_check.py +89 -0
  54. package/skills/godot-input/SKILL.md +49 -0
  55. package/skills/godot-input/references/patterns.md +186 -0
  56. package/skills/godot-migration/SKILL.md +73 -0
  57. package/skills/godot-migration/references/porting.md +207 -0
  58. package/skills/godot-migration/scripts/_godotx.py +178 -0
  59. package/skills/godot-migration/scripts/migrate_scan.py +179 -0
  60. package/skills/godot-mobile-web/SKILL.md +70 -0
  61. package/skills/godot-mobile-web/references/patterns.md +255 -0
  62. package/skills/godot-mobile-web/scripts/_godotx.py +178 -0
  63. package/skills/godot-mobile-web/scripts/serve_web.py +122 -0
  64. package/skills/godot-modding-dlc/SKILL.md +66 -0
  65. package/skills/godot-modding-dlc/references/patterns.md +269 -0
  66. package/skills/godot-narrative/SKILL.md +65 -0
  67. package/skills/godot-narrative/references/patterns.md +373 -0
  68. package/skills/godot-navigation-ai/SKILL.md +69 -0
  69. package/skills/godot-navigation-ai/references/patterns.md +531 -0
  70. package/skills/godot-networking/SKILL.md +47 -0
  71. package/skills/godot-networking/references/patterns.md +213 -0
  72. package/skills/godot-performance/SKILL.md +59 -0
  73. package/skills/godot-performance/references/patterns.md +162 -0
  74. package/skills/godot-physics/SKILL.md +61 -0
  75. package/skills/godot-physics/references/patterns.md +169 -0
  76. package/skills/godot-procedural/SKILL.md +62 -0
  77. package/skills/godot-procedural/references/patterns.md +381 -0
  78. package/skills/godot-shaders-vfx/SKILL.md +46 -0
  79. package/skills/godot-shaders-vfx/references/shaders.md +199 -0
  80. package/skills/godot-shaders-vfx/references/vfx.md +126 -0
  81. package/skills/godot-shaders-vfx/scripts/_godotx.py +178 -0
  82. package/skills/godot-shaders-vfx/scripts/shader_check.gd +21 -0
  83. package/skills/godot-shaders-vfx/scripts/shader_check.py +77 -0
  84. package/skills/godot-testing-debug/SKILL.md +46 -0
  85. package/skills/godot-testing-debug/references/patterns.md +165 -0
  86. package/skills/godot-testing-debug/scripts/_godotx.py +178 -0
  87. package/skills/godot-testing-debug/scripts/test_run.py +147 -0
  88. package/skills/godot-ui/SKILL.md +56 -0
  89. package/skills/godot-ui/references/patterns.md +147 -0
  90. package/skills/godot-xr/SKILL.md +40 -0
  91. package/skills/godot-xr/references/patterns.md +125 -0
package/AGENTS.md ADDED
@@ -0,0 +1,46 @@
1
+ # Godot Agent Skills: agent instructions
2
+
3
+ This repo contains Agent Skills (`skills/<name>/SKILL.md`, agentskills.io format) for **Godot 4.7** (standard and .NET builds, GDScript and C#). Codex, OpenCode, Gemini CLI, Copilot and Cursor read them from `.agents/skills`, and Claude Code reads `.claude/skills` (see `install/`).
4
+
5
+ ## Using the skills
6
+ - Start any Godot task with `skills/godot-core/SKILL.md`. It routes to the right skill and defines the verification loop.
7
+ - **Never guess an API:** `python skills/godot-core/scripts/api_lookup.py Class.member` reads the installed engine and returns GDScript and C# signatures, defaults and deprecations.
8
+ - Run scripts; don't read them. Every `skills/*/scripts/*.py` documents its flags in its docstring and prints one compact JSON result. Set `GODOT_EXE` if the engine isn't found.
9
+ - Load a skill's `references/*.md` only when the SKILL.md points you there.
10
+ - Verify edits: `gd_check.py` (GDScript), `cs_build.py` (C#), `shader_check.py` (shaders), `run_godot.py smoke`, `test_run.py`. Project checks: `migrate_scan.py` (stale APIs), `addon_inspect.py` (addons), `serve_web.py --check` (Web exports).
11
+
12
+ | Skill | Use for |
13
+ |---|---|
14
+ | godot-core | API lookup, headless runs, scene editing, project facts, 4.5–4.7 changes (start here) |
15
+ | godot-gdscript | typed GDScript, signals and await, patterns, compile check |
16
+ | godot-csharp | .NET setup, partial classes, signals, marshaling, interop, build errors |
17
+ | godot-architecture | folders, composition, autoloads, Resources, state machines, saves |
18
+ | godot-2d | TileMapLayer, Parallax2D, Camera2D, pixel art, 2D lights |
19
+ | godot-3d-rendering | renderers, Environment, lights (AreaLight3D), GI, materials, import, HDR |
20
+ | godot-physics | Jolt, CharacterBody, RigidBody, Areas, queries, ragdolls |
21
+ | godot-ui | Controls, containers, themes, focus navigation, localization, accessibility |
22
+ | godot-input | actions, rebinding, gamepads, gyro, touch, VirtualJoystick |
23
+ | godot-animation | AnimationPlayer/Tree, Tween, root motion, IK framework |
24
+ | godot-shaders-vfx | shading language, stencil, particles, compositor, shader check |
25
+ | godot-audio | buses, 3D audio, adaptive music |
26
+ | godot-networking | multiplayer, RPC, replication, HTTP |
27
+ | godot-performance | profiling, MultiMesh, servers, threads |
28
+ | godot-export-ci | presets, templates, signing, platforms, GitHub Actions |
29
+ | godot-editor-tooling | @tool, EditorPlugin/EditorDock, importers, GDExtension |
30
+ | godot-testing-debug | GdUnit4, gdUnit4Net, debugging, Logger |
31
+ | godot-xr | OpenXR, controllers, passthrough, comfort |
32
+ | godot-navigation-ai | navmesh, agents, avoidance, AStarGrid2D, enemy AI, behavior trees |
33
+ | godot-3d-gameplay | third-person/orbit/RTS cameras, GridMap, CSG, interactables |
34
+ | godot-procedural | seeded RNG, noise, caves/dungeons, heightmap meshes, chunks |
35
+ | godot-migration | Godot 3 → 4.7, 4.x → 4.7, Unity concepts, stale-API scanner |
36
+ | godot-mobile-web | safe area, lifecycle, touch, IAP, Web threads/hosting, web server |
37
+ | godot-narrative | dialogue addons vs custom, typewriter boxes, quests, cutscenes |
38
+ | godot-modding-dlc | PCK mods, manifests, load order, runtime assets, DLC, patches |
39
+ | godot-game-feel | screen shake, hit-stop, flashes, tweens, Movie Maker |
40
+ | godot-addons | Asset Store, vetting, GDExtension checks, curated 4.7 list |
41
+
42
+ ## Working on this repo
43
+ - Shared helper: edit `shared/_godotx.py` only, then run `python tools/sync_shared.py`.
44
+ - Validate: `python tools/validate_skills.py --strict` (spec, token budgets, links, script contract). `python tools/trigger_check.py` checks routing.
45
+ - Test: `python tools/run_tests.py [filter]` needs Godot 4.7 (.NET build plus the .NET 8+ SDK for C# tests; set `GODOT_EXE`). Every ```gdscript, ```csharp and ```gdshader block in the skills is compiled on the real engine. Keep blocks complete and compilable.
46
+ - Keep each SKILL.md under ~2.5k tokens and each description under 400 characters. Verify every API claim with `api_lookup.py` against 4.7 before writing it.
package/CHANGELOG.md ADDED
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ ## 1.1.1
4
+ - Codex: installable via marketplace (#1, thanks @GamerDubz).
5
+
6
+ ## 1.1.0
7
+ - 9 new skills: godot-navigation-ai, godot-3d-gameplay, godot-procedural, godot-migration, godot-mobile-web, godot-narrative, godot-modding-dlc, godot-game-feel, godot-addons.
8
+ - New scripts: `migrate_scan.py` (stale Godot 3 / 4.x APIs, converter wrapper), `serve_web.py` (Web export check + COOP/COEP server), `addon_inspect.py` (addon compatibility, enable/disable).
9
+ - godot-core routes to the new skills.
10
+
11
+ ## 1.0.3
12
+ - README recommends the Godot .NET build with C# for AI agents.
13
+
14
+ ## 1.0.2
15
+ - README states the skills are based on Godot 4.7.2.
16
+
17
+ ## 1.0.1
18
+ - README banner, badges and logo credit.
19
+
20
+ ## 1.0.0
21
+ - 18 Godot 4.7 skills for GDScript and C#/.NET.
22
+ - API lookup from the installed engine, with C# names, defaults and deprecation flags.
23
+ - Scene editing through Godot itself (atomic, autoload-safe).
24
+ - Compile checks for GDScript, C# and shaders. Headless smoke runs, tests and exports as JSON.
25
+ - Installers for Claude Code, Codex, OpenCode, Gemini CLI, Copilot and Cursor.
26
+ - Test suite compiles every code example on Godot 4.7.2.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 EL4CTEO
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,98 @@
1
- # Temporary Holding Version
1
+ <p align="center"><img src="assets/banner.png" alt="Godot Skills" width="640"></p>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/@el4cteo/godot-skills"><img alt="npm" src="https://img.shields.io/npm/v/@el4cteo/godot-skills?logo=npm"></a>
5
+ <a href="https://github.com/EL4CTEO/godot-skills/releases"><img alt="Release" src="https://img.shields.io/github/v/release/EL4CTEO/godot-skills"></a>
6
+ <a href="https://github.com/EL4CTEO/godot-skills/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/EL4CTEO/godot-skills/actions/workflows/ci.yml/badge.svg"></a>
7
+ <img alt="Godot 4.7.2" src="https://img.shields.io/badge/Godot-4.7.2-478cbf?logo=godotengine&logoColor=white">
8
+ <img alt="GDScript and C#" src="https://img.shields.io/badge/GDScript%20%7C%20C%23-supported-478cbf">
9
+ <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green"></a>
10
+ </p>
11
+
12
+ # Godot Agent Skills
13
+
14
+ 27 Godot **4.7** skills for AI coding agents (Claude Code, Codex, OpenCode, Gemini CLI, Copilot, Cursor), GDScript and C#/.NET.
15
+
16
+ Agents look up exact APIs from **your installed engine**, edit scenes safely through Godot itself, and verify with real compile, test and export runs. Every code example is compiled on Godot 4.7.2 by the test suite.
17
+
18
+ **Tip:** use Godot .NET with C# if you can: models know C# better and the compiler catches mistakes early. Pick GDScript if you need web export (not supported for C# in 4.x).
19
+
20
+ ## Install
21
+
22
+ **Claude Code** (plugin):
23
+ ```
24
+ /plugin marketplace add EL4CTEO/godot-skills
25
+ /plugin install godot-agent-skills@godot-agent-skills
26
+ ```
27
+
28
+ **Codex**
29
+
30
+ ```bash
31
+ codex plugin marketplace add EL4CTEO/godot-skills
32
+ codex plugin add godot-agent-skills@godot-agent-skills
33
+ ```
34
+
35
+ **npm** (any agent):
36
+ ```bash
37
+ npx @el4cteo/godot-skills
38
+ ```
39
+
40
+ **Any agent** (clone, then run the installer):
41
+ ```bash
42
+ git clone https://github.com/EL4CTEO/godot-skills
43
+ ./godot-skills/install/install.sh # macOS / Linux
44
+ .\godot-skills\install\install.ps1 # Windows
45
+ ```
46
+ Installs to `~/.claude/skills` and `~/.agents/skills` (read by Codex, OpenCode, Gemini CLI, Copilot, Cursor). Options: `--agent claude|codex|opencode|gemini|copilot|cursor|all`, `--project DIR`, `--skills a,b`, `--uninstall` (PowerShell: `-Agent`, `-Project`, `-Skills`, `-Uninstall`).
47
+
48
+ **Requirements:** Godot 4.7+ (standard or .NET) and Python 3.9+. For C#, the .NET 8+ SDK. If Godot isn't found automatically, set `GODOT_EXE`.
49
+
50
+ ## Skills
51
+
52
+ | Skill | What it does |
53
+ |---|---|
54
+ | `godot-core` | Start here: API lookup, headless runs, scene editing, what's new |
55
+ | `godot-gdscript` | Typed GDScript, signals, await, compile check |
56
+ | `godot-csharp` | .NET setup, signals, interop, build errors |
57
+ | `godot-architecture` | Project structure, autoloads, Resources, saves |
58
+ | `godot-2d` | TileMapLayer, Parallax2D, cameras, pixel art |
59
+ | `godot-3d-rendering` | Renderers, lighting, GI, materials, import |
60
+ | `godot-physics` | Jolt, character controllers, raycasts, ragdolls |
61
+ | `godot-ui` | Menus, themes, gamepad focus, localization |
62
+ | `godot-input` | Rebinding, gamepads, gyro, touch |
63
+ | `godot-animation` | AnimationTree, Tweens, root motion, IK |
64
+ | `godot-shaders-vfx` | Shaders, particles, post effects, shader check |
65
+ | `godot-audio` | Buses, 3D sound, adaptive music |
66
+ | `godot-networking` | Multiplayer, RPCs, replication, HTTP |
67
+ | `godot-performance` | Profiling, MultiMesh, threads |
68
+ | `godot-export-ci` | Exports, signing, GitHub Actions |
69
+ | `godot-editor-tooling` | Tool scripts, editor plugins, importers |
70
+ | `godot-testing-debug` | GdUnit4, gdUnit4Net, debugging |
71
+ | `godot-xr` | OpenXR VR/AR |
72
+ | `godot-navigation-ai` | Pathfinding, avoidance, enemy AI, behavior trees |
73
+ | `godot-3d-gameplay` | Third-person cameras, GridMap and CSG levels |
74
+ | `godot-procedural` | Noise, dungeons, caves, terrain meshes, chunks |
75
+ | `godot-migration` | Godot 3 or older 4.x to 4.7, Unity porting, API scanner |
76
+ | `godot-mobile-web` | Safe areas, app lifecycle, purchases, Web hosting |
77
+ | `godot-narrative` | Dialogue, choices, quests, cutscenes |
78
+ | `godot-modding-dlc` | Mod loading, PCK packs, DLC, patches |
79
+ | `godot-game-feel` | Screen shake, hit-stop, juice, trailer capture |
80
+ | `godot-addons` | Vetting and installing plugins, curated 4.7 list |
81
+
82
+ ## Try it
83
+
84
+ > "Add a player with coyote-time jumping and a camera that shakes on landing."
85
+ > "My C# build fails after upgrading to 4.7, fix it."
86
+ > "Add enemies that patrol, spot the player and chase them around obstacles."
87
+
88
+ ## Development
89
+
90
+ ```bash
91
+ python tools/validate_skills.py --strict # spec, token budgets, links
92
+ python tools/trigger_check.py # skill routing
93
+ python tools/run_tests.py # real-engine tests (set GODOT_EXE if needed)
94
+ ```
95
+
96
+ ## Credits
97
+
98
+ Godot logo by Andrea Calabró, licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
Binary file
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ // npx @el4cteo/godot-skills [--agent claude|agents|codex|opencode|gemini|copilot|cursor|all]
4
+ // [--project DIR] [--skills a,b] [--uninstall]
5
+ // Copies the skills (no symlinks) so they survive the npx cache being cleaned.
6
+ const { spawnSync } = require("child_process");
7
+ const path = require("path");
8
+
9
+ const root = path.join(__dirname, "..");
10
+ const args = process.argv.slice(2);
11
+ if (args.includes("-h") || args.includes("--help")) {
12
+ console.log(
13
+ "Usage: godot-skills [--agent <name>[,<name>]]... [--project DIR] [--skills a,b] [--uninstall]\n" +
14
+ "Agents: claude, agents, codex, opencode, gemini, copilot, cursor, all (default: claude + agents)"
15
+ );
16
+ process.exit(0);
17
+ }
18
+
19
+ const agents = [];
20
+ let project = "", skills = "", uninstall = false;
21
+ for (let i = 0; i < args.length; i++) {
22
+ const a = args[i];
23
+ if (a === "--agent") agents.push(...String(args[++i] || "").split(",").filter(Boolean));
24
+ else if (a === "--project") project = args[++i] || "";
25
+ else if (a === "--skills") skills = args[++i] || "";
26
+ else if (a === "--uninstall") uninstall = true;
27
+ else { console.error("unknown arg " + a); process.exit(1); }
28
+ }
29
+
30
+ let res;
31
+ if (process.platform === "win32") {
32
+ const ps = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", path.join(root, "install", "install.ps1")];
33
+ if (agents.length) ps.push("-Agent", agents.join(","));
34
+ if (project) ps.push("-Project", project);
35
+ if (skills) ps.push("-Skills", skills);
36
+ if (uninstall) ps.push("-Uninstall");
37
+ res = spawnSync("powershell.exe", ps, { stdio: "inherit" });
38
+ } else {
39
+ const sh = [path.join(root, "install", "install.sh"), "--copy"];
40
+ for (const a of agents) sh.push("--agent", a);
41
+ if (project) sh.push("--project", project);
42
+ if (skills) sh.push("--skills", skills);
43
+ if (uninstall) sh.push("--uninstall");
44
+ res = spawnSync("bash", sh, { stdio: "inherit" });
45
+ }
46
+ process.exit(res.status === null ? 1 : res.status);
@@ -0,0 +1,56 @@
1
+ <#
2
+ Install godot-agent-skills for your AI agent(s) on Windows.
3
+ .\install\install.ps1 [-Agent claude,agents,codex,opencode,gemini,copilot,cursor,all]
4
+ [-Scope user|project] [-Project DIR] [-Link] [-Uninstall] [-Skills a,b]
5
+ Defaults: -Agent claude,agents -Scope user (copies; -Link makes junctions, no admin needed)
6
+ "agents" = ~/.agents/skills, read by Codex, OpenCode, Gemini CLI, GitHub Copilot and Cursor.
7
+ #>
8
+ param(
9
+ [string[]]$Agent = @("claude", "agents"),
10
+ [ValidateSet("user", "project")][string]$Scope = "user",
11
+ [string]$Project = (Get-Location).Path,
12
+ [switch]$Link,
13
+ [switch]$Uninstall,
14
+ [string[]]$Skills = @()
15
+ )
16
+ $ErrorActionPreference = "Stop"
17
+ $Root = Split-Path -Parent $PSScriptRoot
18
+ if ($PSBoundParameters.ContainsKey("Project")) { $Scope = "project" }
19
+ if ($Agent -contains "all") { $Agent = @("claude", "agents", "opencode", "gemini", "copilot", "cursor") }
20
+
21
+ function Get-Target([string]$a) {
22
+ $u = $HOME; $p = $Project
23
+ $map = @{
24
+ "claude:user" = "$u\.claude\skills"; "claude:project" = "$p\.claude\skills"
25
+ "agents:user" = "$u\.agents\skills"; "agents:project" = "$p\.agents\skills"
26
+ "codex:user" = "$u\.agents\skills"; "codex:project" = "$p\.agents\skills"
27
+ "opencode:user" = "$u\.config\opencode\skills"; "opencode:project" = "$p\.opencode\skills"
28
+ "gemini:user" = "$u\.gemini\skills"; "gemini:project" = "$p\.gemini\skills"
29
+ "copilot:user" = "$u\.copilot\skills"; "copilot:project" = "$p\.github\skills"
30
+ "cursor:user" = "$u\.cursor\skills"; "cursor:project" = "$p\.cursor\skills"
31
+ }
32
+ $k = "${a}:$Scope"
33
+ if (-not $map.ContainsKey($k)) { throw "unknown agent $a" }
34
+ return $map[$k]
35
+ }
36
+
37
+ foreach ($a in $Agent) {
38
+ $dst = Get-Target $a
39
+ New-Item -ItemType Directory -Force $dst | Out-Null
40
+ $n = 0
41
+ foreach ($s in Get-ChildItem -Directory (Join-Path $Root "skills")) {
42
+ if ($Skills.Count -and -not ($Skills -contains $s.Name)) { continue }
43
+ $target = Join-Path $dst $s.Name
44
+ if (Test-Path $target) {
45
+ $item = Get-Item $target -Force
46
+ if ($item.LinkType) { $item.Delete() } else { Remove-Item -Recurse -Force $target }
47
+ }
48
+ if (-not $Uninstall) {
49
+ if ($Link) { New-Item -ItemType Junction -Path $target -Target $s.FullName | Out-Null }
50
+ else { Copy-Item -Recurse $s.FullName $target -Exclude "__pycache__" }
51
+ }
52
+ $n++
53
+ }
54
+ $verb = if ($Uninstall) { "removed" } else { "installed" }
55
+ Write-Output "$verb $n skills -> $dst ($a)"
56
+ }
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env bash
2
+ # Install godot-agent-skills for your AI agent(s).
3
+ # ./install/install.sh [--agent claude|agents|codex|opencode|gemini|copilot|cursor|all]...
4
+ # [--scope user|project] [--project DIR] [--copy] [--uninstall] [--skills a,b]
5
+ # Defaults: --agent claude --agent agents --scope user (symlinks; --copy to copy)
6
+ # "agents" = ~/.agents/skills, read by Codex, OpenCode, Gemini CLI, GitHub Copilot and Cursor.
7
+ set -euo pipefail
8
+ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
9
+ AGENTS=() SCOPE=user PROJECT="$PWD" MODE=link UNINSTALL=0 ONLY=""
10
+ while [ $# -gt 0 ]; do
11
+ case "$1" in
12
+ --agent) AGENTS+=("$2"); shift 2 ;;
13
+ --scope) SCOPE="$2"; shift 2 ;;
14
+ --project) mkdir -p "$2"; PROJECT="$(cd "$2" && pwd)"; SCOPE=project; shift 2 ;;
15
+ --copy) MODE=copy; shift ;;
16
+ --uninstall) UNINSTALL=1; shift ;;
17
+ --skills) ONLY="$2"; shift 2 ;;
18
+ -h|--help) sed -n '2,6p' "$0"; exit 0 ;;
19
+ *) echo "unknown arg $1"; exit 1 ;;
20
+ esac
21
+ done
22
+ [ ${#AGENTS[@]} -eq 0 ] && AGENTS=(claude agents)
23
+ [[ " ${AGENTS[*]} " == *" all "* ]] && AGENTS=(claude agents opencode gemini copilot cursor)
24
+
25
+ target() { # $1 agent -> skills dir
26
+ local u="$HOME" p="$PROJECT"
27
+ case "$1:$SCOPE" in
28
+ claude:user) echo "$u/.claude/skills" ;; claude:project) echo "$p/.claude/skills" ;;
29
+ agents:user|codex:user) echo "$u/.agents/skills" ;; agents:project|codex:project) echo "$p/.agents/skills" ;;
30
+ opencode:user) echo "$u/.config/opencode/skills" ;; opencode:project) echo "$p/.opencode/skills" ;;
31
+ gemini:user) echo "$u/.gemini/skills" ;; gemini:project) echo "$p/.gemini/skills" ;;
32
+ copilot:user) echo "$u/.copilot/skills" ;; copilot:project) echo "$p/.github/skills" ;;
33
+ cursor:user) echo "$u/.cursor/skills" ;; cursor:project) echo "$p/.cursor/skills" ;;
34
+ *) echo "unknown agent $1" >&2; exit 1 ;;
35
+ esac
36
+ }
37
+
38
+ for a in "${AGENTS[@]}"; do
39
+ dst="$(target "$a")"; mkdir -p "$dst"; n=0
40
+ for s in "$ROOT"/skills/*/; do
41
+ name="$(basename "$s")"
42
+ [ -n "$ONLY" ] && [[ ",$ONLY," != *",$name,"* ]] && continue
43
+ rm -rf "${dst:?}/$name"
44
+ if [ $UNINSTALL -eq 0 ]; then
45
+ if [ $MODE = link ]; then ln -s "${s%/}" "$dst/$name"; else cp -R "${s%/}" "$dst/$name"; fi
46
+ fi
47
+ n=$((n+1))
48
+ done
49
+ echo "$([ $UNINSTALL -eq 1 ] && echo removed || echo installed) $n skills -> $dst ($a)"
50
+ done
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "@el4cteo/godot-skills",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.1",
4
+ "description": "Godot 4.7 Agent Skills for AI coding agents (Claude Code, Codex, OpenCode, Gemini CLI, Copilot, Cursor): GDScript and C#/.NET, exact API lookup, safe scene editing, compile checks.",
5
+ "bin": { "godot-skills": "cli/godot-skills.js" },
6
+ "files": ["cli", "skills", "shared", "install", "assets/banner.png", "README.md", "CHANGELOG.md", "LICENSE", "AGENTS.md"],
7
+ "author": "EL4CTEO",
8
+ "license": "MIT",
9
+ "homepage": "https://github.com/EL4CTEO/godot-skills",
10
+ "repository": { "type": "git", "url": "git+https://github.com/EL4CTEO/godot-skills.git" },
11
+ "bugs": { "url": "https://github.com/EL4CTEO/godot-skills/issues" },
12
+ "keywords": ["godot", "godot4", "gdscript", "csharp", "dotnet", "gamedev", "agent-skills", "claude-code", "codex", "ai-agents"],
13
+ "engines": { "node": ">=16" },
14
+ "publishConfig": { "access": "public" }
15
+ }
@@ -0,0 +1,178 @@
1
+ """Shared helpers for godot-agent-skills scripts (stdlib only, Python 3.9+).
2
+
3
+ Edit shared/_godotx.py only; tools/sync_shared.py copies it into skills/*/scripts/.
4
+ Finds the Godot executable, runs it headless, parses its error output, prints compact JSON.
5
+ """
6
+ import glob
7
+ import json
8
+ import os
9
+ import pathlib
10
+ import re
11
+ import shutil
12
+ import subprocess
13
+ import sys
14
+
15
+ TARGET = (4, 7) # skills are written for Godot 4.7.x
16
+ ERR_RE = re.compile(r"^(SCRIPT ERROR|ERROR|WARNING|USER ERROR|USER WARNING|SCRIPT WARNING):\s*(.*)$")
17
+ AT_RE = re.compile(r"^\s+at:\s*(.*?)\s*\((.*?):(\d+)\)\s*$")
18
+
19
+
20
+ def emit(obj, code=None):
21
+ """Print one compact JSON object and optionally exit."""
22
+ print(json.dumps(obj, separators=(",", ":"), ensure_ascii=False, default=str))
23
+ if code is not None:
24
+ sys.exit(code)
25
+
26
+
27
+ def _candidates():
28
+ for k in ("GODOT_EXE", "GODOT", "GODOT_BIN"):
29
+ if os.environ.get(k):
30
+ yield os.environ[k]
31
+ for n in ("godot-mono", "godot4-mono", "godot", "godot4"):
32
+ p = shutil.which(n)
33
+ if p:
34
+ yield p
35
+ home = pathlib.Path.home()
36
+ pats = []
37
+ if os.name == "nt":
38
+ la = os.environ.get("LOCALAPPDATA", str(home / "AppData/Local"))
39
+ for base in (f"{la}/Programs/Godot", f"{la}/Godot", "C:/Program Files/Godot", "C:/Godot",
40
+ str(home / "Godot"), str(home / "Downloads"), str(home / "Desktop"),
41
+ "C:/Program Files (x86)/Steam/steamapps/common/Godot Engine"):
42
+ # shallow patterns only: recursive globs over Desktop/Downloads can take minutes
43
+ pats += [f"{base}/Godot_v4*.exe", f"{base}/*/Godot_v4*.exe", f"{base}/*/*/Godot_v4*.exe"]
44
+ elif sys.platform == "darwin":
45
+ pats += ["/Applications/Godot*.app/Contents/MacOS/Godot",
46
+ str(home / "Applications/Godot*.app/Contents/MacOS/Godot")]
47
+ else:
48
+ pats += [str(home / ".local/bin/Godot_v4*"), str(home / "bin/Godot_v4*"), "/opt/godot*/Godot_v4*",
49
+ str(home / ".local/share/godot/*/Godot_v4*")]
50
+ found = []
51
+ for pat in pats:
52
+ found += glob.glob(pat)
53
+ # newest version first, mono and console builds preferred
54
+ def key(p):
55
+ v = re.findall(r"v(\d+)\.(\d+)(?:\.(\d+))?", p)
56
+ ver = tuple(int(x or 0) for x in v[-1]) if v else (0, 0, 0)
57
+ return (ver, "mono" in p.lower(), "console" in p.lower())
58
+ for p in sorted(found, key=key, reverse=True):
59
+ if "template" not in p.lower():
60
+ yield p
61
+
62
+
63
+ def find_godot():
64
+ """Return the path of a Godot 4 executable, or None. GODOT_EXE overrides discovery."""
65
+ for p in _candidates():
66
+ if p and os.path.isfile(p):
67
+ p = os.path.normpath(p)
68
+ if os.name == "nt" and not p.lower().endswith("_console.exe"):
69
+ con = p[:-4] + "_console.exe"
70
+ if os.path.isfile(con):
71
+ return con # console build: stdout is captured reliably
72
+ return p
73
+ return None
74
+
75
+
76
+ def godot_or_exit():
77
+ exe = find_godot()
78
+ if not exe:
79
+ emit({"ok": False, "error": "Godot not found; set GODOT_EXE to the Godot 4.7 (.NET) executable"}, 2)
80
+ return exe
81
+
82
+
83
+ def version(exe):
84
+ out = subprocess.run([exe, "--version"], capture_output=True, text=True, timeout=60,
85
+ encoding="utf-8", errors="replace").stdout.strip().splitlines()
86
+ return out[-1] if out else ""
87
+
88
+
89
+ def is_mono(exe):
90
+ return "mono" in version(exe) or "mono" in os.path.basename(exe).lower()
91
+
92
+
93
+ def find_project(start="."):
94
+ """Walk up from start to the folder holding project.godot."""
95
+ p = pathlib.Path(start).resolve()
96
+ if p.is_file():
97
+ p = p.parent
98
+ for d in (p, *p.parents):
99
+ if (d / "project.godot").is_file():
100
+ return d
101
+ return None
102
+
103
+
104
+ def project_or_exit(start="."):
105
+ d = find_project(start)
106
+ if not d:
107
+ emit({"ok": False, "error": f"no project.godot at or above {start}"}, 2)
108
+ return d
109
+
110
+
111
+ def run(args, project=None, timeout=600, headless=True, exe=None):
112
+ """Run Godot. Returns dict(rc, out, err). Adds --headless and --path <project>."""
113
+ exe = exe or godot_or_exit()
114
+ cmd = [exe] + (["--headless"] if headless else []) + (["--path", str(project)] if project else []) + list(args)
115
+ try:
116
+ # stdin=DEVNULL: a "-d" debugger prompt or any read can never block an agent's run
117
+ p = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, encoding="utf-8", errors="replace",
118
+ stdin=subprocess.DEVNULL)
119
+ return {"rc": p.returncode, "out": p.stdout, "err": p.stderr, "cmd": cmd}
120
+ except subprocess.TimeoutExpired as e:
121
+ return {"rc": -1, "out": (e.stdout or b"").decode("utf-8", "replace") if isinstance(e.stdout, bytes) else (e.stdout or ""),
122
+ "err": f"timeout after {timeout}s", "cmd": cmd}
123
+
124
+
125
+ def parse_messages(text, keep_engine=False):
126
+ """Parse Godot's 'ERROR: msg' + ' at: func (file:line)' pairs into dicts.
127
+
128
+ keep_engine=False drops errors located in engine C++ sources (only res:// and user files kept)
129
+ unless no file is known at all.
130
+ """
131
+ msgs, cur = [], None
132
+ for line in text.splitlines():
133
+ m = ERR_RE.match(line)
134
+ if m:
135
+ cur = {"type": m.group(1).lower().replace(" ", "_"), "msg": m.group(2).strip()}
136
+ msgs.append(cur)
137
+ continue
138
+ a = AT_RE.match(line)
139
+ if a and cur is not None and "file" not in cur:
140
+ cur["file"], cur["line"] = a.group(2), int(a.group(3))
141
+ cur = None
142
+ elif cur is not None and line.strip() and not line.startswith(("[", " ")) and len(cur["msg"]) < 600:
143
+ cur["msg"] += " | " + line.strip() # multi-line message (e.g. export configuration errors)
144
+ if not keep_engine:
145
+ msgs = [m for m in msgs if "file" not in m or m["file"].startswith(("res://", "user://"))
146
+ or m["file"].endswith((".gd", ".cs", ".tscn", ".tres"))]
147
+ seen, out = set(), []
148
+ for m in msgs: # Godot often repeats a parse error twice with different wording
149
+ k = (m.get("file"), m.get("line"), m["type"])
150
+ if k in seen and m["type"] == "script_error":
151
+ continue
152
+ seen.add(k)
153
+ out.append(m)
154
+ return out
155
+
156
+
157
+ def cache_dir():
158
+ base = os.environ.get("GODOT_SKILLS_CACHE")
159
+ if not base:
160
+ if os.name == "nt":
161
+ base = os.path.join(os.environ.get("LOCALAPPDATA", str(pathlib.Path.home())), "godot-agent-skills")
162
+ else:
163
+ base = os.path.join(os.environ.get("XDG_CACHE_HOME", str(pathlib.Path.home() / ".cache")), "godot-agent-skills")
164
+ os.makedirs(base, exist_ok=True)
165
+ return pathlib.Path(base)
166
+
167
+
168
+ def res_path(project, path):
169
+ """Absolute/relative file path -> res:// path (unchanged if already res://)."""
170
+ if str(path).startswith("res://"):
171
+ return str(path)
172
+ rel = pathlib.Path(path).resolve().relative_to(pathlib.Path(project).resolve())
173
+ return "res://" + rel.as_posix()
174
+
175
+
176
+ def runner(script_file, name):
177
+ """Absolute path of a GDScript helper shipped next to script_file (pass __file__)."""
178
+ return str(pathlib.Path(script_file).resolve().parent / name)
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: godot-2d
3
+ description: 2D games in Godot 4.7 - pixel-art and HD setup, TileMapLayer (cells, terrains, custom data, runtime tiles, physics chunking), Parallax2D, Camera2D (limits, smoothing, shake), y-sort and z-index, 2D lights and normal maps, AnimatedSprite2D, one-way platforms, custom drawing, many-sprite performance. Use for platformers, top-down, tile-based or any 2D scene.
4
+ license: MIT
5
+ compatibility: Godot 4.7+ (GDScript and C#).
6
+ metadata:
7
+ author: godot-agent-skills
8
+ version: "1.1.1"
9
+ ---
10
+
11
+ # 2D in Godot 4.7
12
+
13
+ Movement physics lives in `godot-physics`, UI in `godot-ui`, shaders in `godot-shaders-vfx`. Look up any API with `../godot-core/scripts/api_lookup.py`.
14
+
15
+ ## Project setup
16
+ | Style | Settings |
17
+ |---|---|
18
+ | Pixel art | `rendering/textures/canvas_textures/default_texture_filter = 0` (Nearest); `display/window/stretch/mode = "viewport"`, `scale_mode = "integer"`, aspect `keep`/`expand`; base size small (for example 320×180 or 640×360); optionally `rendering/2d/snap/snap_2d_transforms_to_pixel = true` |
19
+ | HD 2D / UI-heavy | stretch mode `canvas_items` (the 4.7 default for new projects), aspect `expand`, base size 1920×1080 or 1280×720, Linear filter |
20
+ Never mix texel sizes in pixel-art games. Scale sprites by whole numbers only.
21
+
22
+ ## TileMapLayer (TileMap is deprecated)
23
+ - Use **one `TileMapLayer` node per layer** (ground, walls, decoration), all sharing one `TileSet` resource. Old `TileMap` nodes convert through the TileMap panel's toolbox: "Extract TileMap layers".
24
+ - Code: `set_cell(coords, source_id, atlas_coords, alternative)`, `erase_cell`, `get_cell_source_id` (−1 means empty), `get_cell_atlas_coords`, `get_used_cells()`, `get_used_cells_by_id()`, `local_to_map(to_local(global_pos))`, `map_to_local(cell)`.
25
+ - Per-tile metadata: add custom data layers to the TileSet (`is_hazard: bool`, `cost: float`), then read them with `get_cell_tile_data(cell).get_custom_data("is_hazard")`.
26
+ - Autotiling: set up terrain sets in the TileSet, then call `set_cells_terrain_connect(cells, terrain_set, terrain)` or `set_cells_terrain_path`.
27
+ - Collision, navigation and occlusion come from the TileSet's physics, navigation and occlusion layers. Physics shapes are merged into chunks (`physics_quadrant_size`, default 16). Set it to 1 only if you need `get_coords_for_body_rid` per cell.
28
+ - For changes at runtime, set the cells, then `update_internals()` if you need them immediately. Per-cell runtime variations use `_use_tile_data_runtime_update` and `_tile_data_runtime_update` with `notify_runtime_tile_data_update()`.
29
+ - Large worlds: use chunked layers per region and free distant chunks. Thousands of `set_cell` calls in one frame stall, so spread them over several frames.
30
+
31
+ ## Camera2D
32
+ - `position_smoothing_enabled` and `position_smoothing_speed` smooth the follow. Limits are `limit_left/top/right/bottom` (toggle them all with `limit_enabled`). `drag_*_enabled` adds a dead zone.
33
+ - Screen shake: animate `offset` (not `position`) with decaying noise. See the reference.
34
+ - Use one active camera per viewport (`make_current()`). Zoom uses `zoom` (Vector2: >1 zooms in).
35
+
36
+ ## Parallax2D (replaces ParallaxBackground/Layer)
37
+ Add `Parallax2D` nodes anywhere, with a Sprite2D or TextureRect as child. Set `scroll_scale` (0 = static, 1 = moves with the world), `repeat_size` = texture size for infinite tiling, `repeat_times` for zoomed-out cameras and `autoscroll` for clouds. It follows the active Camera2D automatically.
38
+
39
+ ## Drawing order
40
+ - `y_sort_enabled` on the parent sorts its children by Y (top-down games). Each child's sort origin is its own origin, so put sprite feet at y=0.
41
+ - `z_index` (relative to the parent unless `z_as_relative = false`) works across siblings. `CanvasLayer` handles HUD and backgrounds independently of the camera.
42
+ - `CanvasGroup` renders a subtree as one unit, which lets outline shaders and transparency apply to a whole character.
43
+
44
+ ## Lights and atmosphere
45
+ `PointLight2D` (textured) and `DirectionalLight2D`, plus `LightOccluder2D` for shadows (TileSets can carry occluders). `CanvasModulate` darkens the scene. Normal and specular maps go through a `CanvasTexture` used as the sprite texture. Light2D is per-pixel, so keep lights overlapping any given sprite in the single digits on mobile.
46
+
47
+ ## Sprites and animation
48
+ - `AnimatedSprite2D` + `SpriteFrames` handles frame animation (`play(&"run")`, `animation_finished`). Since 4.7, per-animation loop mode uses `SpriteFrames.set_animation_loop_mode`.
49
+ - Use `AnimationPlayer` when frames must sync with hitboxes, sounds or method calls. Keyframe the `frame` property of a `Sprite2D` with `hframes`/`vframes`.
50
+ - Sprite sheets: `Sprite2D.region_enabled` + `region_rect`, or `AtlasTexture`.
51
+
52
+ ## Platformer specifics
53
+ - One-way platforms: `CollisionShape2D.one_way_collision = true`. 4.7 adds `one_way_collision_direction` (default `Vector2(0, 1)`). Drop through by briefly disabling the player's mask bit or raising the position.
54
+ - `CharacterBody2D` defaults to `MOTION_MODE_GROUNDED` for platformers. Use `MOTION_MODE_FLOATING` for top-down.
55
+ - Coyote time, jump buffering and variable jump height are in the reference.
56
+
57
+ ## Many objects
58
+ Thousands of bullets or particles: `MultiMeshInstance2D` or GPU particles, or skip nodes entirely with `RenderingServer` canvas items and `PhysicsServer2D`. `VisibleOnScreenEnabler2D` pauses off-screen enemies. See `godot-performance`.
59
+
60
+ Patterns (platformer feel, top-down movement, camera shake, tile queries, custom draw), compiled by the tests: [references/patterns.md](references/patterns.md)