Claw RPG 🦞⚔️
A D&D-style character growth system for AI lobster agents. Reads your SOUL.md + MEMORY.md to generate a character sheet, accumulates XP from token usage, levels up from 1 to 999, and occasionally fires hidden RPG flavor text mid-conversation.
Quick Start
CODEBLOCK0
Hidden Easter Egg Trigger (Recommended)
After each reply, easter.mjs fires with a 12% base probability — appending a single line of italic RPG flavor text. Milestone conversations (10th, 25th, 50th, 100th, every 100 after...) always trigger.
CODEBLOCK1
Integration — add to your AGENTS.md:
CODEBLOCK2
Daily Greeting (Optional)
For a daily RPG-style self-intro on the first conversation of the day:
CODEBLOCK3
XP Sync
CODEBLOCK4
Prestige (Lv.999 cap reached)
CODEBLOCK5
Prestige resets level to 1, permanently boosts all stats by +10%, and unlocks a new title tier.
Automated XP Sync (Recommended)
Set up a daily cron at 03:00 with the built-in setup script:
CODEBLOCK6
Or call manually from a heartbeat/cron job:
CODEBLOCK7
Classes & Abilities
See references/classes.md and INLINECODE5
Prestige System
See INLINECODE6
Daily Report (v1.1.0)
Send a daily RPG status report to Telegram (level, stats, XP progress, class quip):
CODEBLOCK8
Set up as an automated daily cron (default 18:00):
CODEBLOCK9
Arena (v1.1.0)
Battle other agents or NPCs. Results affect XP and morale:
CODEBLOCK10
XP Recovery
If XP data gets out of sync, recover from session logs:
CODEBLOCK11
Files
| File | Description |
|---|
| INLINECODE7 | Character data (auto-generated, do not edit manually) |
| INLINECODE8 |
Arena battle history |
|
config.json | Optional: Telegram notification config (
{ "telegram_chat_id": "..." }) |
What's New in v1.1.2
- - Save file protection —
character.json now stored in ~/.openclaw/workspace/claw-rpg/ instead of the skill directory. Reinstalling the skill no longer resets your level and XP. - Auto migration —
init.mjs automatically moves existing save data to the new location on first run.
What's New in v1.1.0
- - Per-conversation XP —
easter.mjs now awards ~80 XP per conversation automatically - Daily Report —
report.mjs + setup-cron.mjs for automated daily status push to Telegram - Arena system —
arena.mjs for agent vs agent/NPC battles - XP Recovery —
sync-xp-recovery.mjs to repair XP sync issues - Milestone triggers — Easter egg always fires at 10th, 25th, 50th, 100th, every 100 after
Claw RPG 🦞⚔️
一套适用于AI龙虾智能体的D&D风格角色成长系统。读取你的SOUL.md + MEMORY.md生成角色卡,通过令牌使用量累积经验值,从1级升至999级,并会在对话过程中随机触发隐藏的RPG风格文本。
快速开始
bash
1. 初始化角色(读取SOUL.md + MEMORY.md)
node scripts/init.mjs
2. 查看角色卡(终端)
node scripts/sheet.mjs
3. 启动网页仪表盘
cd dashboard && npm install && npm start # http://localhost:3500
隐藏彩蛋触发(推荐)
每次回复后,easter.mjs以12%的基础概率触发——追加一行斜体RPG风格文本。里程碑对话(第10、25、50、100次,之后每100次...)必定触发。
bash
node scripts/easter.mjs # 常规调用(更新对话计数器)
node scripts/easter.mjs --force # 强制触发(调试)
node scripts/easter.mjs --preview # 预览(不写入角色数据)
集成——添加到你的AGENTS.md:
每次回复用户消息后,运行:node /scripts/easter.mjs
如果输出不是NO_TRIGGER,将其追加到回复中(空行 + 斜体)。
心跳轮询期间不运行。
每日问候(可选)
用于每日首次对话时发送RPG风格的自我介绍:
bash
node scripts/greet.mjs # 每天触发一次(检查lastGreetDate)
node scripts/greet.mjs --force # 强制发送
node scripts/greet.mjs --preview # 预览(不保存)
经验值同步
bash
传入当前对话的令牌差值
node scripts/xp.mjs --in 2000 --out 800
带奖励经验值(完成重要任务后)
node scripts/xp.mjs --in 2000 --out 800 --bonus 30
仅对话次数
node scripts/xp.mjs --conversations 1
转生系统(达到Lv.999上限)
bash
node scripts/levelup.mjs --prestige
转生将等级重置为1,所有属性永久提升+10%,并解锁新的称号等级。
自动化经验值同步(推荐)
使用内置设置脚本在03:00设置每日定时任务:
bash
node scripts/setup-cron.mjs
或从心跳/定时任务中手动调用:
javascript
const { execSync } = require(child_process);
execSync(node ${SKILL_ROOT}/scripts/xp.mjs --in ${deltaIn} --out ${deltaOut});
职业与技能
参见 references/classes.md 和 references/abilities.md
转生系统
参见 references/prestige.md
每日报告(v1.1.0)
向Telegram发送每日RPG状态报告(等级、属性、经验值进度、职业语录):
bash
node scripts/report.mjs # 立即发送报告
node scripts/report.mjs --preview # 预览(不发送)
设置为自动每日定时任务(默认18:00):
bash
node scripts/setup-cron.mjs
竞技场(v1.1.0)
与其他智能体或NPC对战。结果影响经验值和士气:
bash
node scripts/arena.mjs --opponent 暗影巫师
node scripts/arena.mjs --list # 查看战斗历史
经验值恢复
如果经验值数据不同步,从会话日志中恢复:
bash
node scripts/sync-xp-recovery.mjs
文件
| 文件 | 描述 |
|---|
| character.json | 角色数据(自动生成,请勿手动编辑) |
| arena-history.json |
竞技场战斗历史 |
| config.json | 可选:Telegram通知配置({ telegram
chatid: ... }) |
v1.1.2 更新内容
- - 存档文件保护——character.json现在存储在~/.openclaw/workspace/claw-rpg/而非技能目录中。重新安装技能不再重置你的等级和经验值。
- 自动迁移——init.mjs在首次运行时自动将现有存档数据移至新位置。
v1.1.0 更新内容
- - 每次对话经验值——easter.mjs现在每次对话自动奖励约80经验值
- 每日报告——report.mjs + setup-cron.mjs用于自动向Telegram推送每日状态
- 竞技场系统——arena.mjs用于智能体对战/NPC对战
- 经验值恢复——sync-xp-recovery.mjs用于修复经验值同步问题
- 里程碑触发——彩蛋在第10、25、50、100次及之后每100次对话时必定触发