Dnd5e srd

From Microck/ordinary-claude-skills · View interactive version

Dnd5e srd is an AI agent skill from the GitHub repository Microck/ordinary-claude-skills. Retrieval-augmented generation (RAG) skill for the D&D 5e System Reference Document (SRD). Use when answering questions about D&D 5e core rules, spells, combat, equipment, conditions, monsters, and other SRD content. This skill provides agentic search-based access to the SRD split into page-range ma

How to use this skill

Skill file

D&D 5e SRD RAG

This skill provides search-based retrieval access to the Dungeons & Dragons 5th Edition System Reference Document (SRD), organized by page ranges as markdown files in the references/ directory.

When to Use This Skill

Use this skill whenever answering questions about D&D 5e SRD content, including:

Search Strategy

Follow this agentic search process for D&D 5e SRD queries:

1. Identify Relevant Page Ranges

The SRD is organized by page ranges. Use this file index to locate content:

Important: Always use the Python search tool (scripts/search_with_positions.py) to get exact character positions for source citations.

File Index (by page range)

Note: Topics below follow your provided outline and are aligned to the actual file splits; where a topic spans multiple files, it's marked as continued.

2. Search Using the Python Tools

Primary method: use the search + expand workflow for accurate positions and structured context.

# Step 1: Search to find content with exact character positions
python /skills/dnd5e-srd/scripts/search_with_positions.py "search term" --all

# Step 2: If you need more context, expand specific result(s)
python /skills/dnd5e-srd/scripts/expand_context.py "search term" --result 3 --mode section --all

# Examples
# Search combat-related terms
python /skills/dnd5e-srd/scripts/search_with_positions.py "grapple" --all

# Search spells and expand result #1 by section
python /skills/dnd5e-srd/scripts/expand_context.py "fireball" --result 1 --mode section --all

# Search specific page ranges
python /skills/dnd5e-srd/scripts/search_with_positions.py "longsword" --pages 200-300

# Batch expand multiple results
python /skills/dnd5e-srd/scripts/expand_context.py "Attack" --results 1,3,5 --mode paragraph --all

The search tool returns:

The expand tool returns:

3. Expand Context When Needed

After searching, expand results that need deeper context:

4. Multi-hop Queries

For questions requiring multiple pieces of information:

  1. Break down the query into components
  2. Search for each component separately
  3. Synthesize the information from multiple sources

5. Provide Accurate Answers with Source Citations

After retrieving information:

Citation examples:

The spell Fireball deals 8d6 fire damage on a failed save. [DND5eSRD_293-312.md, chars 12000-12100]

A grapple check uses Athletics vs. the target's escape DC (see Conditions). [DND5eSRD_087-103.md, chars 5400-5600]

References Directory Structure

The references/ directory contains the SRD split into page-range files.

Files are named DND5eSRD_XXX-YYY.md where XXX-YYY is the page range.

To list all files:

ls -lh /skills/dnd5e-srd/references/

To find which file contains specific content:

grep -l "search term" /skills/dnd5e-srd/references/*.md

Python Tools

1. Search Tool (`search_with_positions.py`)

Features:

Usage:

# Basic search across all files
python scripts/search_with_positions.py "term" --all

# Search specific page range
python scripts/search_with_positions.py "term" --pages 200-300

# Control output
python scripts/search_with_positions.py "term" --all --max-results 10 --context 200

# Case-sensitive search
python scripts/search_with_positions.py "Attack" --all --case-sensitive

2. Context Expansion Tool (`expand_context.py`)

Features:

Usage:

# Expand a specific search result by section
python scripts/expand_context.py "fireball" --result 3 --mode section --all-search

# Expand multiple results at once
python scripts/expand_context.py "Attack" --results 1,3,5 --mode paragraph --all-search

# Direct expansion from known file position
python scripts/expand_context.py --file "DND5eSRD_121-137.md" --position 1234 --mode section

# JSON output for machine processing
python scripts/expand_context.py "wizard" --result 1 --all-search --format json

Best Practices

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.