← 返回 Skills 市场
wangjiaocheng

Gamebox

作者 波动几何 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
121
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install gamebox
功能描述
多人游戏引擎框架 — 5 款游戏共用一套回合/状态/消息系统。 支持文字冒险、狼人杀、小说接龙、夺旗战、文明模拟。 LLM 负责叙事和动态内容生成,脚本负责状态管理和规则执行。 纯 Python 标准库,零外部依赖,跨 Windows/macOS/Linux。 通信基于共享目录,多 Agent 可同时参与。
使用说明 (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
安全使用建议
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.
功能分析
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.
能力标签
crypto
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gamebox
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gamebox 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug gamebox
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Gamebox 是什么?

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

如何安装 Gamebox?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gamebox」即可一键安装,无需额外配置。

Gamebox 是免费的吗?

是的,Gamebox 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gamebox 支持哪些平台?

Gamebox 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gamebox?

由 波动几何(@wangjiaocheng)开发并维护,当前版本 v1.0.1。

💬 留言讨论