4.1 KiB
4.1 KiB
Game Extension Workflow
Use this workflow whenever adding, renaming, removing, or substantially changing a game.
Add a New Game
- Create installer script:
- Path:
.install/<Game Name>.sh - Keep first line active (do not start with
#//). - Reuse manager helpers (
check_architecture,check_dependencies,download,download_named,get_installer,ui_*). - Install into a deterministic path under
${installPath}.
- Create launcher definition:
- Path:
.launch/<Game Name>.game - Keep base filename identical to installer (
<Game Name>). - Include an explicit install-path variable based on
installPath, for example:
gamePath="${installPath}/MyGame"
- Run the game from that path.
- Optional update script:
- Path:
.update/<Game Name>.sh - Implement
run_update()(required by update flow).
- Let installer create runnable launcher entry:
- The manager auto-creates
.launch/<Game Name>.shsymlink when installer completes and.gameexists.
Rename a Game Safely
- Rename
.install/<Old>.shto.install/<New>.sh. - Rename
.launch/<Old>.gameto.launch/<New>.game. - Rename
.update/<Old>.shif present. - Remove stale
.launch/<Old>.shif still present. - Re-run catalog audit and manual checks.
Remove a Game From Repo
- Delete
.install/<Game>.sh. - Delete
.launch/<Game>.game. - Delete
.launch/<Game>.shif tracked. - Delete
.update/<Game>.shif present. - Run catalog audit to confirm no orphan entries remain.
Disable Policy (Important)
When a request says "disable " without more detail:
- Default behavior: disable installs only.
- Add
#//to first line of.install/<Game Name>.sh. - Do not disable
.launch/<Game Name>.gameby default. - This preserves playability for users who already have the game installed.
- If user explicitly requests complete disable:
- Add
#//to first line of both:.install/<Game Name>.sh.launch/<Game Name>.game
- If wording is ambiguous but could imply full disable/removal:
- Ask a short clarification question before changing launcher/removal behavior.
Manual Validation Checklist
- Run installer flow:
./linux-game-manager.sh -i
- Confirm launcher files exist:
ls ".launch/<Game Name>.game" ".launch/<Game Name>.sh"
- Run launcher flow:
./linux-game-manager.sh
- Run removal flow:
./linux-game-manager.sh -r
- If updater exists, run update flow:
./linux-game-manager.sh -u
- Run consistency audit:
python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py
Script Authoring Rules
- Use camelCase variable names.
- Use snake_case for function names.
- Keep scripts robust when sourced in the manager shell.
- Avoid introducing unnecessary colorized output.
- For edited bash scripts, run shellcheck and fix all errors.
- If
shellcheckis not installed, prompt the user to install it first (seereferences/tooling-prereqs.md).
Pattern: uv + Host Python speechd Bindings
Use this pattern for Python games installed with uv when runtime speech support depends on import speechd.
- In installer script:
- Check dependencies:
git,uv, and host python binding import (python-speechd:speechd). - Clone game repository into
${installPath}/<GameRepoDir>. - Run
uv syncin the project directory that containspyproject.toml. - Resolve speechd source path from host Python via:
python3 -c 'import pathlib,speechd; print(pathlib.Path(speechd.__file__).resolve())'
- Copy the module/package into a game-local directory such as:
${installPath}/<GameRepoDir>/<RuntimePath>/.host-python/
- Fail with a clear message if import or copy fails.
- In launcher script:
- Export
PYTHONPATHwith the game-local.host-pythondirectory prepended. - Launch via
uv run ...from the same directory used foruv sync.
- Removal safety:
- Ensure first
installPathline in launcher points to a path that letsgame_removalinfer the game root correctly. - Do not put
installPathin comments above that path line, because removal currently grabs the first matching line.