openword-player
Original:🇺🇸 English
Translated
1 scripts
Operate OpenWord end-to-end for live adventure sessions. Use when Codex needs to download/install/start OpenWord, guide a human player in the browser, or play autonomously through REST API (create/load game, do_action loop, state/image retrieval), including configuring GEMINI_API_KEY and sharing interesting scenes and choices during play.
5installs
Sourcedinghuanghao/openword
Added on
NPX Install
npx skill4agent add dinghuanghao/openword openword-playerTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →OpenWord Player
Read before running a session.
Treat repository as the source of truth for install/startup/API details, and re-check it when commands fail or look outdated.
references/session-runbook.mdREADME.mdSession Workflow
- Ask the user which mode to run before gameplay starts.
- Prepare runtime (download/install/start, browser, key setup).
- Branch to human-guided mode or AI REST mode.
- Keep the user involved during play, including AI-driven sessions.
Use this exact mode-selection question:
这局你想怎么进行:你自己玩(我引导)还是我用 REST API 代玩?If the user does not choose, default to human-guided mode.
Runtime Preparation
- If repository does not exist locally, run:
git clone https://github.com/dinghuanghao/openword.git - Install and start:
npm installThen proactively opennpm run devfor the user (defaulthttp://127.0.0.1:<PORT>).30000 - load order is: shell environment variable -> repo
GEMINI_API_KEY-> key modal/Settings..env - is optional (default
PORT); ensure browser opens30000.http://127.0.0.1:<PORT> - Confirm the game can reach interactive state before sending turns.
Human-Guided Mode
- Confirm user can input actions in the browser.
- Help user craft opening world prompt and style.
- For each turn, provide a short recap and 3 action options with different risk/reward.
- Let the user pick or rewrite the action.
- Remind controls only when relevant:
toggles built-in Auto Player,
机器人按钮exits auto mode/panels, Settings hasEsc.Connect API Bridge
AI REST Mode
- Ensure one browser tab is online at (default
http://127.0.0.1:<PORT>).30000 - BFF/should be connected by default; do not ask the user to click it unless troubleshooting a bridge failure.
Connect API Bridge - Check server health ().
GET /health - Start or resume game via REST (or
create_game).load_game - Loop:
call -> choose next action -> call
get_current_game_state.do_action - Use to share scene visuals with the user.
last_scene_image_path - Recommended style keywords for REST :
create_game(clay) andClaymation(voxel).3D Pixel Art
Use first (curl-only, Python-free).
If is not , set:
.
scripts/openword_rest.shPORT30000OPENWORD_BASE_URL="http://127.0.0.1:<PORT>"REST API Schema
| Method | Path | Body | Success fields |
|---|---|---|---|
| | none | |
| | | |
| | none | |
| | | |
| | none | |
| | | |
Interaction Contract
Never run long silent streaks. Keep the user in the loop even when AI plays.
- Share updates at least every 1-2 turns.
- At meaningful branch points, ask user preference before committing.
- Surface scene image paths and display scene images when possible.
- Highlight interesting moments: scene changes, risky decisions, major rewards, unexpected twists.
Failure Handling
- : first verify the game tab is open and
NO_BRIDGEstatus; only then ask user to enableGET /healthin Settings for troubleshooting.Connect API Bridge - Bridge occupied: another tab owns the bridge; disconnect that tab first.
- Missing key/model errors: check in shell env first, then repo
GEMINI_API_KEY; if still missing, ask user to configure key modal/Settings..env - Slow/timeout calls: increase timeout, avoid overlapping requests.