← Back to Skills Marketplace
wangjiaocheng

Gamebox

by 波动几何 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
121
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install gamebox
Description
多人游戏引擎框架 — 5 款游戏共用一套回合/状态/消息系统。 支持文字冒险、狼人杀、小说接龙、夺旗战、文明模拟。 LLM 负责叙事和动态内容生成,脚本负责状态管理和规则执行。 纯 Python 标准库,零外部依赖,跨 Windows/macOS/Linux。 通信基于共享目录,多 Agent 可同时参与。
README (SKILL.md)

\r \r

gamebox — 多人游戏引擎\r

\r

定位\r

\r 一个自包含的多人游戏引擎框架,通过共享目录实现多 Agent 对局。LLM 负责叙事和创意内容,脚本负责状态管理和规则执行。\r \r

核心规则\r

\r

  1. 共享目录 — 所有玩家必须能访问同一目录\r
  2. 先创建后加入 — 创建者控制游戏生命周期\r
  3. LLM + 脚本协作 — 脚本管规则,LLM 管叙事\r \r

支持的游戏\r

\r | 游戏 | 类型 | 人数 | 核心玩法 |\r |------|------|------|---------|\r | 文字冒险 (rpg) | 单人/多人 | 1-20 | LLM 当 DM,探索/战斗/对话 |\r | 狼人杀 (werewolf) | 多人对抗 | 5-18 | 角色推理,白天讨论+夜晚行动 |\r | 小说接龙 (story_relay) | 多人协作 | 2-10 | 轮流写段落,LLM 调和风格 |\r | 夺旗战 (ctf) | 竞速 | 1-20 | 解题抢分,支持动态出题 |\r | 文明模拟 (civilization) | 多人策略 | 2-8 | 资源/科技/外交/战争,回合制 |\r \r

快速上手\r

\r

# 创建游戏\r
python scripts/manager.py '{"action":"create","game_type":"werewolf","user":"alice"}'\r
\r
# 加入游戏\r
python scripts/manager.py '{"action":"join","game_id":"abc12345","user":"bob"}'\r
\r
# 启动游戏\r
python scripts/manager.py '{"action":"start","game_id":"abc12345","user":"alice"}'\r
\r
# 执行动作(通过引擎统一接口)\r
python scripts/action.py '{"game_id":"abc12345","user":"alice","action_name":"vote","params":{"target":"bob"}}'\r
\r
# 发送/接收消息\r
python scripts/message.py '{"game_id":"abc12345","user":"alice","action":"send","content":"我觉得 bob 很可疑"}'\r
python scripts/message.py '{"game_id":"abc12345","user":"bob","action":"receive"}'\r
\r
# 回合控制\r
python scripts/turn.py '{"game_id":"abc12345","action":"status"}'\r
python scripts/turn.py '{"game_id":"abc12345","action":"next"}'\r
```\r
\r
## 脚本清单\r
\r
| 脚本 | 功能 |\r
|------|------|\r
| `common.py` | 公共工具层(JSON 协议、文件操作、时间戳) |\r
| `manager.py` | 游戏管理(创建/加入/启动/结束/列出/详情/退出) |\r
| `turn.py` | 回合控制(推进/阶段切换/超时跳过/状态查询) |\r
| `action.py` | 统一动作接口(执行/历史/撤销) |\r
| `message.py` | 消息系统(发送/接收/频道列表,支持公共/私聊/角色频道) |\r
| `games/__init__.py` | 游戏模块注册表 |\r
| `games/rpg.py` | 文字冒险游戏逻辑 |\r
| `games/werewolf.py` | 狼人杀游戏逻辑 |\r
| `games/story_relay.py` | 小说接龙游戏逻辑 |\r
| `games/ctf.py` | 夺旗战游戏逻辑 |\r
| `games/civilization.py` | 文明模拟游戏逻辑 |\r
\r
## LLM 提示词\r
\r
各游戏的 LLM 叙事提示词模板位于 `references/games/`:\r
- `rpg.md` — DM 叙事风格指南\r
- `werewolf.md` — 主持人播报模板\r
- `story_relay.md` — 编辑顾问响应模板\r
- `ctf.md` — 出题人/裁判模板\r
- `civilization.md` — 历史记录者叙事模板\r
\r
## 目录结构\r
\r
```\r
.gamebox/                        ← game_dir(共享目录)\r
├── games/                        ← 所有游戏实例\r
│   └── {game_id}/\r
│       ├── meta.json             ← 游戏元信息\r
│       ├── state.json            ← 游戏状态\r
│       ├── actions/              ← 动作记录\r
│       ├── messages/             ← 消息\r
│       │   ├── public/           ← 公共频道\r
│       │   ├── private/{user}/   ← 私聊\r
│       │   ├── role/{role}/      ← 角色频道\r
│       │   └── system/           ← 系统消息\r
│       └── logs/                 ← 事件日志\r
```\r
\r
## JSON 协议\r
\r
- **输入**:JSON 字符串(CLI 第一个参数 或 stdin)\r
- **输出**:`{"status":"ok","data":{...}}` 或 `{"status":"error","code":N,"message":"..."}`\r
- **共享目录**:通过 `game_dir` 参数指定,默认 `.gamebox/`\r
Usage Guidance
This skill appears coherent and local-only, but review and run with caution: it will create and modify files under a game directory (default .gamebox) and can delete a game's folder when the last player leaves. Recommended precautions: (1) inspect the remaining omitted files before use, (2) run the scripts in an isolated directory (set game_dir to a dedicated sandbox) and with a non-privileged account, (3) don't point game_dir at system or sensitive locations, and (4) if you need stronger assurance, run the code in a disposable VM/container. No network access or credentials are requested by the provided files.
Capability Analysis
Type: OpenClaw Skill Name: gamebox Version: 1.0.1 The 'gamebox' skill bundle implements a multi-player game engine using local file storage for state management. While the game logic appears benign, the code contains a significant path traversal vulnerability. In 'scripts/common.py' and 'scripts/manager.py', user-provided parameters such as 'game_id' and 'game_dir' are used to construct file paths without consistent sanitization, despite a 'safe_id' validation function being defined. This flaw could allow an attacker to read or write arbitrary JSON files, or even delete directories via the 'shutil.rmtree' call in 'manager.py'. No evidence of intentional malice or data exfiltration was found, so it is classified as suspicious due to these high-risk implementation flaws.
Capability Tags
crypto
Capability Assessment
Purpose & Capability
Name/description (multiplayer game engine using a shared directory) matches the actual files and behavior: scripts manage games, turns, messages, actions and implement five game types. No unrelated binaries or credentials are requested.
Instruction Scope
SKILL.md instructs CLI usage and a shared directory (.gamebox) and the scripts follow that protocol. The runtime instructions and code operate on local JSON files and logs only; they do not read unrelated system configuration or attempt to transmit data externally.
Install Mechanism
There is no install spec (instruction-only in registry), but the package includes Python scripts. The code uses only the Python standard library. Note: since code files are included, the agent (or user) will run these local scripts — there is no automatic installer or external download.
Credentials
The skill requires no environment variables, credentials, or config paths. All operations use a configurable local game_dir (default .gamebox). No secret-like env names are present.
Persistence & Privilege
always:false and the skill does not request permanent platform privileges. It writes and modifies files only under the configured game_dir and may remove a game directory when the last player leaves (shutil.rmtree on that game folder) — behaviour consistent with its purpose.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gamebox
  3. After installation, invoke the skill by name or use /gamebox
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
gamebox 1.0.1 - 修改默认共享目录名称,由 .game-engine/ 变更为 .gamebox/ - 项目文档与描述同步更新以统一 “gamebox” 命名
v1.0.0
- Initial release of gamebox, a multiplayer game engine framework supporting 5 different games with unified turn/state/message handling. - Supports text adventure, Werewolf, story relay, capture the flag, and civilization simulation. - LLM handles storytelling and dynamic content generation; scripts enforce rules and manage state. - Uses only standard Python libraries with zero external dependencies; compatible across Windows, macOS, and Linux. - Multiplayer communication achieved through a shared directory, allowing multiple agents to participate concurrently. - Provides unified command-line scripts for game management, actions, messaging, and turn control.
Metadata
Slug gamebox
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Gamebox?

多人游戏引擎框架 — 5 款游戏共用一套回合/状态/消息系统。 支持文字冒险、狼人杀、小说接龙、夺旗战、文明模拟。 LLM 负责叙事和动态内容生成,脚本负责状态管理和规则执行。 纯 Python 标准库,零外部依赖,跨 Windows/macOS/Linux。 通信基于共享目录,多 Agent 可同时参与。 It is an AI Agent Skill for Claude Code / OpenClaw, with 121 downloads so far.

How do I install Gamebox?

Run "/install gamebox" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Gamebox free?

Yes, Gamebox is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Gamebox support?

Gamebox is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Gamebox?

It is built and maintained by 波动几何 (@wangjiaocheng); the current version is v1.0.1.

💬 Comments