steamworks-js
This skill owns the shared setup for every steamworks-* skill. It does not carry the operation steps itself: once setup passes, load the sub-skill for the job.
1. Environment check (read-only)
Section titled “1. Environment check (read-only)”- Confirm the Node version the project uses (
node -v) and that asteamworks.jspackage is in its dependencies. Read the installed typings (client.d.ts) before using any call; the surface differs between builds, so do not assume a function exists because another build has it. - Install the binding globally:
npm i -g @hagicode/steamworks.js@0.1.4(0.1.4 or later for Workshop screenshots; 0.1.5 or later to remove them). Item fields (metadata, key-value tags, content descriptors, videos),createItemwith a file type, app dependencies and the user actions (votes, favorites, playtime) are newer than the 0.1.5 release: install thedevdist-tag or the release that follows 0.1.5, and confirm each function exists in the installedclient.d.tsbefore use. The shared scripts useSTEAMWORKS_JSwhen it is set (a package folder containingindex.js), otherwise the global install, and print the version they loaded. If the npm mirror in use lags the registry, add--registry=https://registry.npmjs.org/. - Confirm the Steam desktop client is running and logged in to the account that will act. Steam calls fail without it.
- Confirm the AppID the code will use. Write operations must use the real AppID of the game or tool that owns the Workshop items. Never use a placeholder or a guessed value.
2. Initialization and callbacks
Section titled “2. Initialization and callbacks”- Initialize once per process with
init(appId?). If the app was launched outside Steam,restartAppIfNecessary(appId)tells you to relaunch through Steam. init()starts the callback pump itself (a 30 Hz timer in the checked build), so async results and progress events arrive without a manual loop. Do not addrunCallbacks()calls; check the installed build’sindex.jsif in doubt.- Call
shutdown()when the process exits; it stops that timer.
3. Errors
Section titled “3. Errors”- Promises reject with the Steam error. Show the message and the call that failed.
- Do not retry a write (create, update, subscribe, download) automatically. Read the item’s state first, then decide with the user. A failed upload after an item was created keeps that item’s id: the next attempt updates that id, and must never create a second item.
4. Route to a sub-skill
Section titled “4. Route to a sub-skill”| Job | Sub-skill | Impact |
|---|---|---|
| Lists, search, tags, item details, user lists, paging | steamworks-workshop-query |
Read-only |
Create an item, first upload of content and preview, set title/description/tags/visibility; shared workshop.py and per-item workshop/ layout |
steamworks-workshop-publish |
Submits remote content |
| Change an existing item, change note, upload progress and result check | steamworks-workshop-update |
Submits remote content |
Required items (dependencies) between Workshop items: read the links (returnChildren), add or remove them (addDependency, removeDependency) |
steamworks-workshop-update |
Submits remote content: changes what subscribers of the item install |
App dependencies of an item (addAppDependency, removeAppDependency, getAppDependencies); metadata, key-value tags, content descriptors and videos on an item (updateItem fields) |
steamworks-workshop-update |
Submits remote content |
Read an item’s app dependencies (getAppDependencies) or the user’s vote (getUserItemVote) |
steamworks-workshop-query |
Read-only |
| Subscribe, unsubscribe, download, install location, item state; the user’s votes, favorites and playtime tracking | steamworks-workshop-client-state |
Changes account subscriptions, votes, favorites or local files |
| Report of our published mods per game: one row per mod with subscriptions and favorites, change against the previous saved day in the user’s cache directory | steamworks-workshop-stats |
Read-only for Steam; writes its own daily cache files |
Other Steamworks modules (cloud, stats/achievements, identity/social, overlay/input) are planned as later phases and have no skill yet. Do not improvise them from this skill.
Two SDK areas are deliberately not wrapped: remote_storage publish and screenshot tagging. The decision and its reasons are in the README section “Not in scope: remote_storage publish and screenshots tagging”. Do not add calls for them without reopening that decision.
5. Operation impact rules
Section titled “5. Operation impact rules”- Read-only: queries,
state,installInfo,downloadInfo,getSubscribedItems. Run freely. - Account or local state:
subscribe,unsubscribe,download,setUserItemVote,addItemToFavorites,removeItemFromFavorites,startPlaytimeTracking,stopPlaytimeTracking. Show the targetpublishedFileIdand the expected effect, then wait for the user’s go-ahead. - Remote submission:
createItem(with an optionalfileType),updateItem(including its metadata, key-value tag, content descriptor and video fields),updateItemWithCallback,addAppDependency,removeAppDependency. Before calling, state the AppID, thepublishedFileId(or that a new item will be created), the content path, and the preview path. Steam documents that a submitted update cannot be cancelled, so get explicit confirmation of the exact content. Removing screenshots is also anupdateItem, withremoveAdditionalPreviewIndexes(0.1.5 or later): 0-based indexes intoadditionalPreviewsas read just before the call. Confirm the item and the file names first; the shared scripts do this throughworkshop.py images remove. - Destructive:
deleteItemappears in the typings but has no phase-1 skill. Do not call it without a per-item confirmation from the user that names the id. - Verify the outcome with a read (
getItem,state) after every write, and report the evidence, not the expectation.
6. Safety
Section titled “6. Safety”- Never print or commit Steam credentials, Web API keys or session tokens.
- Do not treat publisher administration (Workshop moderation, Publisher Web API keys) as client-side work. It needs a separate server-side process with its own access control.
Turn ideas into shipped software.
HagiCode is an agentic coding workspace. OpenSpec workflows plan the change, multi-agent execution carries it out, and Hero Scenario makes the long run visible, so ideas become shipped software.
- Smart
- OpenSpec workflows turn intent into a path from proposal to shipped change.
- Efficient
- Multi-agent execution runs research, build, and review in parallel.
- Fun
- Rich UI interactions make planning, agent work, and projects easier to follow.
© 2026 HagiCode | Powered By hagilight-starlight@0.23.0 | Branch: main | Commit: 7164ec7 | Built:
