home / skills / openclaw / skills / dnd

This skill provides a comprehensive D&D 5e toolkit to roll dice, lookup spells and monsters, generate characters, encounters, and NPCs.

npx playbooks add skill openclaw/skills --skill dnd

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
4.0 KB
---
name: dnd
description: D&D 5e toolkit for players and DMs. Roll dice, look up spells and monsters, generate characters, create encounters, and spawn NPCs. Uses the official D&D 5e SRD API.
version: 1.0.0
author: captmarbles
---

# D&D 5e Toolkit

Your complete Dungeons & Dragons 5th Edition assistant! Look up spells, monsters, roll dice, generate characters, encounters, and NPCs.

## Features

šŸŽ² **Dice Roller** - Roll any dice with modifiers  
✨ **Spell Lookup** - Search the entire SRD spell list  
šŸ‘¹ **Monster Stats** - Get full stat blocks for any creature  
āš”ļø **Character Generator** - Random characters with stats  
šŸ—”ļø **Encounter Builder** - Generate balanced encounters by CR  
šŸ‘¤ **NPC Generator** - Create random NPCs with personality  

## Usage

All commands use the `dnd.py` script.

### Roll Dice

```bash
# Roll 2d6 with +3 modifier
python3 dnd.py roll 2d6+3

# Roll d20
python3 dnd.py roll 1d20

# Roll with negative modifier
python3 dnd.py roll 1d20-2

# Roll multiple dice
python3 dnd.py roll 8d6
```

**Output:**
```
šŸŽ² Rolling 2d6+3
   Rolls: [4 + 5] +3
   Total: 12
```

### Look Up Spells

```bash
# Search for a spell
python3 dnd.py spell --search fireball

# Direct lookup
python3 dnd.py spell fire-bolt

# List all spells
python3 dnd.py spell --list
```

**Output:**
```
✨ Fireball
   Level: 3 Evocation
   Casting Time: 1 action
   Range: 150 feet
   Components: V, S, M
   Duration: Instantaneous
   
   A bright streak flashes from your pointing finger to a point 
   you choose within range and then blossoms with a low roar into 
   an explosion of flame...
```

### Look Up Monsters

```bash
# Search for a monster
python3 dnd.py monster --search dragon

# Direct lookup
python3 dnd.py monster ancient-red-dragon

# List all monsters
python3 dnd.py monster --list
```

**Output:**
```
šŸ‘¹ Adult Red Dragon
   Huge Dragon, chaotic evil
   CR 17 (18,000 XP)
   
   AC: 19
   HP: 256 (19d12+133)
   Speed: walk 40 ft., climb 40 ft., fly 80 ft.
   
   STR 27 | DEX 10 | CON 25
   INT 16 | WIS 13 | CHA 21
   
   Special Abilities:
   • Legendary Resistance (3/Day): If the dragon fails a saving throw...
   
   Actions:
   • Multiattack: The dragon can use its Frightful Presence...
```

### Generate Random Character

```bash
# Generate character with rolled stats
python3 dnd.py character
```

**Output:**
```
āš”ļø  Elara
   Race: Elf
   Class: Wizard
   
   Stats:
   STR: 10 (+0)
   DEX: 15 (+2)
   CON: 12 (+1)
   INT: 16 (+3)
   WIS: 13 (+1)
   CHA: 8 (-1)
```

### Generate Random Encounter

```bash
# Generate encounter with challenge rating
python3 dnd.py encounter --cr 5

# Random CR
python3 dnd.py encounter
```

**Output:**
```
šŸŽ² Random Encounter (CR ~5)

   2x Troll (CR 5)
      AC 15, HP 84
   1x Ogre (CR 2)
      AC 11, HP 59
```

### Generate Random NPC

```bash
python3 dnd.py npc
```

**Output:**
```
šŸ‘¤ Finn Shadowend
   Race: Halfling
   Occupation: Merchant
   Trait: Curious
```

## Example Prompts for Clawdbot

- *"Roll 2d20 with advantage"* (I'll roll twice!)
- *"Look up the Fireball spell"*
- *"Show me stats for a Beholder"*
- *"Generate a random character"*
- *"Create an encounter for level 5 party"*
- *"Give me an NPC for my tavern scene"*

## JSON Output

Add `--json` to any command for structured output:

```bash
python3 dnd.py roll 2d6 --json
python3 dnd.py spell --search fireball --json
python3 dnd.py character --json
```

## API Source

Uses the official [D&D 5e API](https://www.dnd5eapi.co/) which includes all System Reference Document (SRD) content.

## Tips

- **Spell names** use lowercase with hyphens: `fireball`, `magic-missile`, `cure-wounds`
- **Monster names** same format: `ancient-red-dragon`, `goblin`, `beholder`
- **Search** if unsure of exact name: `--search dragon` will show all dragons
- **Dice format** is flexible: `1d20`, `2d6+5`, `3d8-2`, `100d100`

## Future Ideas

- Initiative tracker
- Treasure generator
- Quest/plot hook generator
- Random dungeon generator
- Party manager
- Campaign notes

Enjoy your adventure! šŸ‰āš”ļøāœØ

Overview

This skill is a Dungeons & Dragons 5e toolkit for players and DMs that rolls dice, looks up SRD spells and monsters, and generates characters, encounters, and NPCs. It queries the official D&D 5e SRD API for accurate stat blocks and supports JSON output for integration. The tool is command-line driven and designed for quick tabletop assistance.

How this skill works

Commands run via a single Python script that parses user input and calls the SRD API for spells and monsters, or runs local generators for dice, characters, encounters, and NPCs. Dice expressions like 2d6+3 support modifiers and large counts; add --json to any command to receive structured output. Search flags allow partial matches when exact SRD names are unknown.

When to use it

  • Rolling complex dice expressions during play (e.g., advantage, many dice, or modifiers).
  • Quickly retrieving spell descriptions and casting details from the SRD.
  • Looking up full monster stat blocks and challenge ratings for encounters.
  • Generating balanced encounters by CR for a session or one-shot.
  • Creating random NPCs and quick character templates for NPCs or players.

Best practices

  • Use lowercase hyphenated names for direct lookups (fireball, ancient-red-dragon).
  • Use --search when you only know part of a name to return matches before selecting.
  • Add --json for integrations, bots, or saving structured data to files.
  • Validate large dice rolls or many simultaneous rolls to avoid overwhelming results.
  • Use encounter --cr to iterate on difficulty and adjust monster counts for party size.

Example use cases

  • Roll initiative or attack rolls with handy dice expressions and modifiers.
  • Lookup a spell mid-session to confirm range, components, and effects.
  • Pull a monster stat block for challenge balancing and read special abilities.
  • Generate a random NPC with occupation and a trait to populate a tavern scene.
  • Create a CR-based encounter for a level 5 party in under a minute.

FAQ

Can I get structured output for automation?

Yes — append --json to any command to receive machine-readable JSON suitable for bots and tools.

Where does monster and spell data come from?

All lookups use the official D&D 5e SRD API to ensure accurate stat blocks and spell text available in the SRD.

How do I search if I don't know the exact name?

Use the --search flag with a keyword (for example --search dragon) to list matching entries, then pick the desired result.