XBOX-Godot-Sample
Copilot instructions238 starsChanged 59 days agoMITView on GitHub
XBOX Godot Sample is a repository of Godot 4.x GDExtension addons for Windows gaming integrations around the Microsoft public GDK. Current addon targets: Each addon owns its own CMakeLists.txt. The root CMakeLists.txt is a thin superproject that wires the addon-local targets together. Debug and Release use separate configure presets and binary directories because godot-cpp's GODOTCPP_TARGET is a configure-time cache variable. Every configure preset has a -release sibling (default-release, gdk-only-release, playfab-only-release, gameinput-only-release, addon-package-release, installed-gdk-release). cmake --build build --config Release is guarded…
In this repository4 other files it gives its agents.
- adversarial-reviewSkill
- gdextension-hygieneSkill
- issue-triageSkill
- pr-feedback-loopSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
17 rules. About 0 are common, 6 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Keep addon-specific architecture, API, and workflow guidance in path-scoped instruction files under .github\instructions\.
- Very specific: line 45
Do not assume godot_gdk conventions automatically apply to godot_gameinput, or vice versa.
- Very specific: line 46
Treat godot_gdk and godot_playfab as service/runtime addons: prefer one root singleton with typed service and wrapper surfaces beneath it.
- Very specific: line 47
Treat godot_gameinput as an input integration addon: optimize for compatibility with Godot's Input / InputMap flow and additive device …
- Very specific: line 48
Treat godot_gdk_editortools as editor tooling, not as a runtime service addon.
- Distinctive: line 49
When behavior changes, update the related addon-local docs, sample content, and tooling that define or demonstrate that behavior.
- Distinctive: line 50
Prefer narrow, addon-local changes over repo-wide edits unless the task truly spans multiple addons.
- Distinctive: line 57
If future addon-specific guidance is needed, add another scoped instruction file instead of expanding this top-level file with rules that …
- Distinctive: line 61
Use repo-local skills when they match the task:
- Very specific: line 65
When the task touches .gd files anywhere in the repo, run the repo-managed headless validator:
- Distinctive: line 71
Do not assume GitHub checks exercised the relevant local build, sample, or validation paths.
- Very specific: line 73
Use the specific Godot project root when invoking Godot commands (a host under tests\godot\, or whichever project you are running against — …
- Distinctive: line 82
When public addon behavior changes, keep the corresponding docs, samples, tests, and path-scoped instructions aligned in the same change.
- Very specific: line 88
Parse gate ran: If any .gd file was touched (anywhere in the repo, including synced sample copies under sample\<host>\addons\), run …
- Very specific: line 91
Public-API drift was reconciled in the same change: When public addon behavior changed, the matching doc_classes\*.xml, spec\gdext-*.md, …
- Very specific: line 107
Instead, extend the existing spec\gdext-<feature>.md with two checked-in sections:
- Very specific: line 114
Do not introduce a parallel docs\plans\ tree.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions - XBOX Godot Sample Repo
Repository Overview
XBOX Godot Sample is a repository of Godot 4.x GDExtension addons for Windows gaming integrations around the Microsoft public GDK.
Current addon targets:
addons\godot_gdk— GDK runtime and Xbox services integrationaddons\godot_playfab— PlayFab runtime, users, Game Saves, and leaderboardsaddons\godot_gameinput— GameInput integrationaddons\godot_gdk_editortools— GDScript editor tooling for PC packaging
Each addon owns its own CMakeLists.txt. The root CMakeLists.txt is a thin superproject that wires the addon-local targets together.
Build Commands
# Configure and build debug
cmake --preset default
cmake --build --preset debug
# Configure and build release (separate build tree - see below)
cmake --preset default-release
cmake --build --preset release
# Optional: build only the GameInput addon
cmake --preset gameinput-only
cmake --build --preset debug-gameinputDebug and Release use separate configure presets and binary directories
because godot-cpp's GODOTCPP_TARGET is a configure-time cache variable. Every
configure preset has a -release sibling (default-release,
gdk-only-release, playfab-only-release, gameinput-only-release,
addon-package-release, installed-gdk-release). cmake --build build --config
Release is guarded and fails on purpose; see
docs\troubleshooting.md ("Release build linked the debug godot-cpp").
Output binaries land in each addon's bin\ folder. Addon-local build logic may also sync files into sample\addons\...\.
Repo-Wide Conventions
- Keep addon-specific architecture, API, and workflow guidance in path-scoped instruction files under
.github\instructions\. - Do not assume
godot_gdkconventions automatically apply togodot_gameinput, or vice versa. - Treat
godot_gdkandgodot_playfabas service/runtime addons: prefer one root singleton with typed service and wrapper surfaces beneath it. - Treat
godot_gameinputas an input integration addon: optimize for compatibility with Godot'sInput/InputMapflow and additive device functionality rather than forcing it into the same public API shape as the service/runtime addons. - Treat
godot_gdk_editortoolsas editor tooling, not as a runtime service addon. - When behavior changes, update the related addon-local docs, sample content, and tooling that define or demonstrate that behavior.
- Prefer narrow, addon-local changes over repo-wide edits unless the task truly spans multiple addons.
Path-Scoped Instructions
addons\godot_gdk\, the GDK-owned sample files,docs\gdk\,spec\gdext-gdk.md, andtools\setup_sample.ps1are covered by.github\instructions\godot-gdk.instructions.md.addons\godot_playfab\,tests\godot\playfab\, the PlayFab-facing sample tracks (sample\tutorial_playfab\andsample\tutorial_integrated\),docs\playfab\,docs\tutorials\playfab\, andspec\gdext-playfab.mdare covered by.github\instructions\godot-playfab.instructions.md.addons\godot_gameinput\,tests\godot\gameinput\, the GameInput-touching sample files (the pong logic scripts that pulse rumble or wire hot-plug),docs\gameinput\, andspec\gdext-gameinput.mdare covered by.github\instructions\godot-gameinput.instructions.md.- If future addon-specific guidance is needed, add another scoped instruction file instead of expanding this top-level file with rules that only apply to one addon.
Workflow Quality Gates
- Use repo-local skills when they match the task:
adversarial-reviewfor risky or cross-cutting diffs that need pressure testingpr-feedback-loopwhen the user mentions PR feedback, review comments, or check resultsgdextension-hygienefor a finish pass that checks validation, documentation, sample/test sync, and build wiring
- When the task touches
.gdfiles anywhere in the repo, run the repo-managed headless validator:
pwsh -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\tools\check_gd_scripts_headless.ps1- Do not assume GitHub checks exercised the relevant local build, sample, or validation paths; run the matching local validation yourself.
- PR Gates are scoped by changed paths:
tools\ci\pr_gate_scope.cjsdecides which addons build and test, so a PlayFab-only PR never runs GDK gates, and a docs-only or workflow-only PR runs only lightweight checks. The single required check is the aggregatePR gates. When you add a new top-level path or addon area, add a routing rule (and a test intools\ci\tests\pr_gate_scope.test.cjs). Unknown paths fall back to the full gate set. Seedocs\ci\pr-gates.md("Scoped gate selection"). - Use the specific Godot project root when invoking Godot commands (a host under
tests\godot\, or whichever project you are running against — the legacysample\gdk_demo,sample\gdk_launch_point,sample\multiplayer_pong, andsample\playfab_demoprojects have been removed and will be replaced by the tutorial-driven samples in PR 3). - For end-to-end test coverage, run the repo-root orchestrator. It is the canonical way to validate "tests pass" across all addons:
pwsh -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\tools\run_all_tests.ps1The orchestrator runs (in order): the parse gate, cmake --build --preset debug, the C++ doctest exe (gdk_unit_tests.exe), GUT for each coverage host (tests\godot\gdk, tests\godot\playfab, tests\godot\gameinput), and the bootstrap mini-runners under each host's tests\bootstrap\ directory. Per-stage results land in build\test-results\run-summary.{json,md}. Use -Live to opt in to live-service tests (LIVE_TESTS=1). Use -Live -AllowLiveWrites to also set LIVE_WRITE_TESTS=1; only do this against a verified sandbox PlayFab title. See tests\godot\README.md for the test-tier contract.
- New GUT suites live under each host's
tests\directory astest_*.gdfiles (auto-discovered via-gdir res://tests -ginclude_subdirs) and shouldextendsthe appropriate shared base fromaddons\godot_gdk_tests\(gdk_test_base.gd,playfab_test_base.gd, orgameinput_test_base.gd). The bases live inaddons\godot_gdk\tests_support\bases\and CMake mirrors them into each host. GUT is carried as two git submodules because GUT 9.6.0 hard-requires Godot 4.6+ (required_godot_version = '4.6') but the repo also supports Godot 4.5.x:third_party\Gut\is pinned to upstream tagv9.6.0(the default, for Godot 4.6+), andthird_party\Gut-4.5\is pinned to upstream commitb366b70(v9.5.0+ the #778is_push_warningfix, stillrequired_godot_version = '4.5', for Godot 4.5.x). CMake mirrors both into each host asaddons\gut\(9.6.0) andaddons\gut-4.5\; the 4.5.x test legs swapgut-4.5overgut(CI viarun-offline-tier, local viarun_all_tests.ps1'sSelect-GutForGodotVersion). Both submodules' contents and the mirrored copies are intentionally untouched — never edit them. To refresh either GUT, bump that submodule's pin (cd third_party\Gutorthird_party\Gut-4.5,git fetch && git checkout <ref>from the repo root, then commit the updated submodule pointer); do not vendor copies into the superproject. - When public addon behavior changes, keep the corresponding docs, samples, tests, and path-scoped instructions aligned in the same change.
Before Reporting Completion
A task is not done until the following are satisfied. Walk through this checklist explicitly before claiming completion or opening a PR:
- Parse gate ran. If any
.gdfile was touched (anywhere in the repo, including synced sample copies undersample\<host>\addons\), runtools\check_gd_scripts_headless.ps1and confirm it exits clean. If no.gdwas touched, say so out loud — do not skip silently. - Test orchestrator ran or was intentionally narrowed. The canonical green bar is
tools\run_all_tests.ps1. Running a narrower subset (single GUT host, single bootstrap script,cmake --buildonly) is allowed, but state which subset and why. Never report "tests pass" based on GitHub Actions output alone. - Live coverage decision is explicit. State whether live tests were skipped (default) or run (
-Live, with a sandbox title id named). For tests that write online state, state whether-AllowLiveWriteswas used; only run it against a verified sandbox PlayFab title and call that out in the PR description. Seetests\godot\README.mdfor the test-tier contract. - Public-API drift was reconciled in the same change. When public addon behavior changed, the matching
doc_classes\*.xml,spec\gdext-*.md,docs\<addon>\*.md, sample content, and tests were updated in this change — not deferred to follow-up. - PR description carries usage examples. When public API was added or renamed, the PR description (or the change commit body if no PR yet) shows a short GDScript usage snippet for each new or renamed surface. Reviewers should not have to reverse-engineer the new API from the diff.
Worktree Lifecycle
This repo regularly uses multiple worktrees for parallel feature branches (.copilot-worktrees/<branch> and R:\repos\XBOX-Godot-Sample-<feature> are both seen in practice). Treat each worktree as expendable:
- Name the worktree after its feature branch.
R:\repos\XBOX-Godot-Sample-<feature>is preferred for human-driven work;.copilot-worktrees/<branch>is acceptable for agent-driven slices. - Rebase or merge
origin/mainbefore "make the PR". A worktree that has drifted from main is not ready to be reviewed. Rungit fetch origin && git merge --ff-only origin/main(orgit rebase origin/main) before opening or refreshing a PR — do not ask the user to retry merges. - Delete the worktree after its PR merges. Once the corresponding PR is merged into
origin/main(or explicitly abandoned), remove the worktree withgit worktree remove --force <path>andgit worktree prune. Stale worktrees serve as a foothold for outdated.github/copilot-instructions.mdcontent and confuse later sessions. - A standalone helper to list stale worktrees (
tools\list_stale_worktrees.ps1) is forthcoming in the companion tooling PR. Until it lands, rungit worktree listmanually and check whether each worktree's branch is fully merged intoorigin/mainbefore pruning.
Long-Lived Feature Plans
For multi-session work (multi-week features such as PlayFab Multiplayer, PlayFab Party, GDK packaging tooling), do not rely on ~\.copilot\session-state\<id>\plan.md as the persistent plan — those files are scoped to a single session and the next session cannot find them.
Instead, extend the existing spec\gdext-<feature>.md with two checked-in sections:
## Plan— the phased execution plan that survives across sessions. Each phase calls out the public API surface it lands, the test tier it targets, and any sample/doc updates it must carry.## Progress— the running ledger of what has shipped (Phase 1: ✅ shipped in #109), what is in-flight, and what is intentionally deferred. New sessions read this section first to know where to pick up.
Session-state plan.md remains the right place for one-off tasks (single PR scope, a few hours of work). It is not the right place for anything you expect to outlive the session.
Do not introduce a parallel docs\plans\ tree. The spec is the single source of truth for both design and progress.
Anti-Patterns
Recurring detours observed in past sessions. Recognize them early and steer back to the established conventions instead:
- No code-generation or manifest pipelines for binding surfaces. Hand-written C++ bindings and the GDScript test matrix (
tests\godot\<addon>\tests\test_api_services.gdand siblings) are the source of truth. Do not introduce JSON manifests, generators, or "generated/" directories — past attempts have all been removed. - No new global engine singletons. Each addon registers exactly one root singleton (
GDK,PlayFab,GameInput). New feature areas attach as service namespaces under the existing singleton (GDK.users,PlayFab.party, …), not as new top-level names. - No
Ref<>parameters across addon DLL boundaries.godot_playfabcannot accept aRef<XboxUser>directly becausegodot_gdkandgodot_playfabare separate GDExtension DLLs. UseObject *and duck-type viahas_method/call. Same rule for any future cross-addon API. - No silent "tests pass" claims after GitHub Actions runs. Local validation must be run explicitly per the Before Reporting Completion checklist.
- No raw local Xbox user ids in PlayFab sign-in.
PlayFab.users.sign_in_with_xuser_asyncaccepts anXboxUserobject only. Plumbing local handles through the higher-level API is a step backwards — keep Xbox-facing identity inside the GDK side.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

