agentleFS
nick-vasnick-vas/hyperdot/.agents/skills/steam/SKILL.md

steam

Skill1 starsChanged 2 days agoApache-2.0View on GitHub

Use when a Godot game ships on Steam or uses Steamworks: achievements, stats, leaderboards, Steam Cloud, rich presence, DLC, demos, authentication, depots or branches, or when Steam does not start or an exported build quits at once.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep Steam behind one interface the game owns, so CI, tests and non-Steam builds run without it.

    line 8
  2. Very specific:

    Keep copies of what you upload in steam/ (with a .gdignore): the rich presence .vdf, achievements.json ({ "achievements": [...], "stats": …

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Steam for Godot 4 (C#)

Keep Steam behind one interface the game owns, so CI, tests and non-Steam builds run without it; then wire a binding in. Everything here was tested on Godot 4.7.2 mono without a Steam client (October 2026); sources: ${CLAUDE_PLUGIN_ROOT}/docs/steam.md.

1. Choose a binding

BindingWorks in 4.7.2 monoNatives in the exportNotes
GodotSteam add-on (GDExtension, MIT)yes, from C# with Engine.GetSingleton("Steam").Call(...) or the community C# wrappernext to the executableGDScript-first; string calls; 4.23.2's .gdextension names macOS files the zip lacks (doctor fails on it)
Steamworks.NET.AnyCPU (NuGet, MIT)2026.164.4 yes; 2026.165.0 and .2 fail on Linux (DllNotFoundException)data_<name>_<platform>/typed, one-to-one Steamworks API; doctor flags the broken versions
Facepunch.Steamworks (MIT)exported builds yes; a project run needs a native resolverper-OS assembly wiringNuGet 2.3.3 is Windows only
  • Not Steamworks.NET from NuGet (a third party's, SDK 1.60, no native libraries), not GodotSteam's pre-compiled editor (no C# builds), never a Steam emulator (the SDK agreement forbids replacing its functionality).
  • In C#, set Steam's variables with Godot's OS.SetEnvironment("SteamAppId", "480"). .NET's Environment.SetEnvironmentVariable never reached the native library on Linux (.NET keeps its own copy of the environment on Unix, so macOS behaves the same) (steam-env-dotnet rule).

2. Start-up

// An autoload: Steam calls only after a successful init; callbacks run in _Process, on the main thread.
public override void _Ready()
{
    if (SteamAPI.RestartAppIfNecessary(new AppId_t(AppId))) { GetTree().Quit(); return; }   // relaunch through Steam
    var result = SteamAPI.InitEx(out string message);
    Ready = result == ESteamAPIInitResult.k_ESteamAPIInitResult_OK;
    if (!Ready) GD.Print($"Steam unavailable ({result}): {message}");   // keep running without it
}
public override void _Process(double delta) { if (Ready) SteamAPI.RunCallbacks(); }
  • Without a Steam client InitEx returns FailedGeneric (1), not NoSteamClient (2): handle every failure as "no Steam", show a message, keep the game playable.
  • RestartAppIfNecessary returns true when neither steam_appid.txt (in the working directory) nor SteamAppId is present, and the game quits: in CI a smoke test then "passes" without running. The kit sets SteamAppId=480 for every run of a game that uses Steam. Use 480 (Valve's Spacewar) or your App ID while developing; never ship steam_appid.txt (a dedicated server is the exception, below).
  • A GodotSteam call after a failed init logs a Godot ERROR, which fails the kit's runs: gate every call on Ready.
  • SDK 1.65 added IsRunningUnderProton() (a Windows build played on Linux) next to IsRunningOnSteamHardware(): both are for support and analytics, so choose behaviour by feature, not by device. Neither is in the pinned Steamworks.NET.AnyCPU 2026.164.4 (SDK 1.64).

3. Achievements, stats, leaderboards, rich presence

  • SetAchievement and SetStat change Steam's memory; StoreStats uploads and shows the popup. Store at checkpoints (a level cleared, the run ended), "on the order of minutes", never per frame. RequestCurrentStats is gone: Steam loads stats before launch (steam-removed-api rule); Valve's stats guide still teaches it, and that page is stale.
  • IndicateAchievementProgress only shows a popup; it never unlocks.
  • A game with quality presets can tell Steam the chosen preset and render resolution with SetGamePerformanceSetting and SetGameRenderResolution (SDK 1.65, not in the pinned package); Steam adds them to anonymous frame-rate data only for players who opted in. Steam Timeline (SDK 1.60) is optional: events for a boss kill or a death, phases for a run.
  • Leaderboards: KeepBest or ForceUpdate; at most 10 uploads per 10 minutes and one in flight; upload at the end of a run. Scores that matter come from your server on a "Trusted" board (anti-cheat).
  • Rich presence: Valve's docs say at most 20 keys and SDK 1.65's header says 30, so design for 20; keys up to 64 characters, values up to 256. steam_display names a token from the localization file uploaded to Steamworks (#Status_Floor = "Floor %floor%"); a missing token or unset %key% shows nothing, with no error. Test on steamcommunity.com/dev/testrichpresence.
  • Keep copies of what you upload in steam/ (with a .gdignore): the rich presence .vdf, achievements.json ({ "achievements": [...], "stats": [...] }) and steamcmd's app_build_*.vdf. doctor fails on a token, achievement or stat name the code uses that they lack, and on a build script with no numeric AppID, a depot with no FileMapping or a secret in it.

4. Test without Steam

The C# example's Platform/ is the pattern: IPlatformServices (achievements, stats, leaderboard, rich presence) with LocalPlatform, a backend that keeps state in one JSON file written only by StoreStats, as Steam does. Unknown ids throw, so a misspelt achievement fails a test instead of never unlocking. Tests: an unlock survives a restart; nothing is kept without StoreStats; KeepBest; rich presence limits. The Steam backend implements the same interface: SteamPlatform over an ISteamApi seam (a fake in unit tests: an unlock goes through once, many SetStat calls are one StoreStats), and SteamworksApi over Steamworks.NET.AnyCPU in a project the game references only with -p:Steam=true. PlatformFactory falls back to LocalPlatform and logs once when Steam is not running or its library is missing, so an itch.io build, tests and CI never need Steam. Only manual runs (Spacewar or your App ID) touch the real client: overlay, popups, cloud dialogs, glyphs, keyboards, DLC.

5. Steam Cloud

  • Auto-Cloud needs no code: in App Admin give a root per OS where Godot's user:// lives (WinAppDataRoaming, LinuxXdgDataHome, MacAppSupport, plus the project's config/custom_user_dir_name) and a pattern matching the save files only, not temporary or backup files. Leave each root's OS Restriction on Cross-Platform and use Root Overrides where the folder differs per OS. Set a per-user byte quota and a file-count quota. Check the paths with testappcloudpaths <AppId> in the Steam console before release (the mapping was not tested end to end).
  • Steam's own conflict dialog shows dates, and no documented API tells the game which side the player chose. Keep the lineage inside the save and a local record of the last save this device wrote; after Steam's sync, decide with CloudSync.Decide(local, cloud) (saves), and after the player resolves a conflict, save with SaveStore.SaveResolved, so the next sync goes one way on both devices without asking again.
  • Offline play and an "unable to sync" launch make conflicts likely (Valve): test two devices editing the same save.

6. DLC, demos, servers, branches

  • DLC has its own App ID; its depot ID is that App ID. BIsDlcInstalled is a client-side convenience, never a reason to grant items; check ownership on your server. A DLC depot can carry a .pck mounted with ProjectSettings.LoadResourcePack (modding).
  • A soundtrack is a second product to sell beside the game; first check that the music's commission or licence allows a separate release (legal).
  • A demo is a separate app (type Demo) with its own depots; "Shared cloud APP ID" lets it share saves with the full game.
  • A dedicated server is a separate Tool app; its depot ships steam_appid.txt with the base game's App ID; tick "Include this tool in Dedicated Server package" for anonymous steamcmd downloads.
  • Branches: default plus your own (qa, experimental; optional passwords). SetLive in a build script works for a beta branch only; the default branch goes live by hand in App Admin. Upload commands, VDF keys and signing: godot-export-release. game-ci/steam-deploy leaves *.vdf out of depots: a Steam Input manifest the game reads must be added back.
  • Authentication: GetAuthTicketForWebApi on the client, ISteamUserAuth/AuthenticateUserTicket on your server; never trust a Steam ID the client states.
  • Networking: relay game traffic through Steam rather than connecting peers directly, so no player's IP is revealed and peers are known by Steam ID. GodotSteam's SteamMultiplayerPeer (create_host, create_client(steam_id, ...)) does this after Steam.initRelayNetworkAccess(); Steamworks.NET has SteamNetworkingSockets.ConnectP2P/ CreateListenSocketP2P with a SteamNetworkingIdentity (SetSteamID64), and ICE set to k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Disable so no IP reaches the peer. Why it matters for denial of service and IP privacy: anti-cheat.

7. Done means

  • the game runs, and says why, without Steam; no Godot errors from Steam calls
  • every achievement and stat name the code uses exists in Steamworks (LocalPlatform catches typos in tests)
  • unlock, restart, still unlocked: on the local backend in CI and on Spacewar or your App ID by hand
  • two devices, offline edits on both: the conflict is detected and resolved once
  • no steam_appid.txt in a game depot; builds uploaded to a beta branch first

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.