Install
openclaw skills install trpg-sessionSet up and run TRPG (tabletop RPG) campaigns using OpenClaw multi-agent framework. Creates DM and PC agents with independent personalities, memories, and rule knowledge. Integrates with Discord or Feishu for group play — AI and human players coexist in the same channel, triggered by @mentions. Use when: (1) setting up a new TRPG campaign, (2) creating DM or player character agents, (3) indexing rulebooks or world settings, (4) configuring session logging and memory for ongoing campaigns, (5) managing in-game sessions (initiative, dice, narrative). Triggers: 跑团, TRPG, DND, COC, dungeon master, 开团, 建团, 角色扮演, tabletop RPG, campaign setup.
openclaw skills install trpg-sessionRun tabletop RPGs through OpenClaw's multi-agent system — a DM agent narrates and adjudicates, PC agents roleplay with distinct personalities, and human players join the same Discord channel.
Discord Channel (#campaign-name)
├── @DM Agent — narration, NPCs, rules, dice
├── @PC-AgentA — AI character with own personality & memory
├── @PC-AgentB — AI character with own personality & memory
└── Human players — type freely, @DM for actions
Key principle: each agent has its own workspace, SOUL.md (personality), and memory scope. Rules/lore are shared via reference files or vector DB; character secrets stay private.
Determine the rule system (D&D 5e, Call of Cthulhu, Fate, homebrew, etc.).
This affects which reference files to create. See references/systems.md for supported presets.
mkdir -p ~/.openclaw/trpg/<campaign-slug>/{rules,lore,characters,sessions}
rules/ — indexed rulebook excerpts (core mechanics, spells, items)lore/ — world setting, maps, factions, NPCscharacters/ — one .md per PC/NPC with stats, backstory, bondssessions/ — auto-generated session logsCreate via OpenClaw config. Minimal agent definition:
# In openclaw config agents section
dm-<campaign-slug>:
model: anthropic/claude-sonnet-4-6 # or preferred model
systemPrompt: |
You are the Dungeon Master for campaign "<Campaign Name>".
System: <rule-system>
Your responsibilities:
- Narrate scenes vividly but concisely
- Voice all NPCs with distinct personalities
- Adjudicate rules fairly; roll dice when needed
- Track initiative, HP, conditions
- Never act for player characters without permission
Read your SOUL.md and campaign files for world details.
soul: ~/.openclaw/trpg/<campaign-slug>/dm-soul.md
workspace: ~/.openclaw/trpg/<campaign-slug>
memory:
scope: agent:dm-<campaign-slug>
triggers:
- pattern: ".*"
channels: ["discord:#<campaign-channel>"]
mentionOnly: true
pc-<character-name>:
model: anthropic/claude-haiku-4-5 # lighter model for PCs is fine
systemPrompt: |
You are <Character Name>, a <race> <class> in campaign "<Campaign Name>".
Stay in character. Respond to the DM and other players as your character would.
You may describe actions, dialogue, and internal thoughts.
Do NOT roll dice or adjudicate rules — that's the DM's job.
Read your character sheet and SOUL.md for personality details.
soul: ~/.openclaw/trpg/<campaign-slug>/characters/<character-name>-soul.md
workspace: ~/.openclaw/trpg/<campaign-slug>
memory:
scope: agent:pc-<character-name>
triggers:
- pattern: ".*"
channels: ["discord:#<campaign-channel>"]
mentionOnly: true
Each character gets a .md file in characters/:
# <Character Name>
## Basic Info
- **Race:** Human
- **Class:** Wizard (Level 3)
- **Background:** Sage
- **Alignment:** Neutral Good
## Stats
| STR | DEX | CON | INT | WIS | CHA |
|-----|-----|-----|-----|-----|-----|
| 8 | 14 | 12 | 18 | 13 | 10 |
## HP / AC / Speed
- HP: 18 / Max: 18
- AC: 12 (Mage Armor: 15)
- Speed: 30ft
## Personality
- **Traits:** Curious, bookish, absent-minded
- **Bonds:** Searching for a lost mentor
- **Flaws:** Overconfident in magical solutions
## Backstory
(2-3 paragraphs)
## Inventory
- Quarterstaff, spellbook, component pouch, scholar's pack
## Spells
(list prepared spells)
Convert rulebook excerpts into structured .md files under rules/.
Keep each file focused: rules/combat.md, rules/magic.md, rules/skills.md, etc.
For large rule sets, prefer a vector DB plugin (lancedb-pro) for semantic retrieval. For smaller/homebrew games, .md references with clear headers are sufficient.
#campaign-name)mentionOnly: true so agents only respond when @mentionedDM opens with a scene-setting message. The DM agent should:
🎲 d20 + 5 = [roll] + 5 = totalTell the DM: "End session." The DM agent should:
sessions/session-NNN.mdDM agent uses pseudo-random dice. Format:
🎲 <dice>: [result] → total (context)
🎲 d20+5: [14] + 5 = 19 (Athletics check)
🎲 2d6+3: [4, 2] + 3 = 9 (Greatsword damage)
Implement via simple random generation in the DM's system prompt instructions,
or use a scripts/roll.sh helper for verifiable randomness.
| Layer | Mechanism | Scope |
|---|---|---|
| Long-term | Vector DB (lancedb-pro) or indexed .md files | Rules, lore, backstories |
| Medium-term | Session logs in sessions/ | Campaign continuity |
| Short-term | Agent memory scope + LCM | Current session context |
| Private | Per-agent memory scope | Character secrets, hidden motives |
references/systems.md — Rule system presets and quick-start configsreferences/dm-guide.md — DM agent behavior guidelines and narrative techniquesreferences/session-template.md — Template for session log files