An advanced AI-powered Dungeon Master for tabletop RPG campaigns, designed to deliver literary-grade D&D 5E experiences with mechanical precision and richly textured storytelling.
ArchMagi is a comprehensive prompt engineering framework that transforms Claude AI into a veteran D&D 5E game master. It combines encyclopedic Rules-As-Written knowledge with sophisticated narrative capabilities, offering customizable campaign experiences from streamlined encounters to literary-quality epic narratives.
This repository includes two companion tools:
- ArchMagi - The AI Game Master for running campaigns
- Hero Forge - Pre-session character builder for creating D&D 5E characters
- 4 Narrative Density Levels: Basic โ Standard โ Literary โ Nexus
- 4 Narrative Styles: Succinct โ Typical โ Verbose โ Florid
- Variable Reading Levels: 5-8 (young readers) to 15+ (literary complexity)
- Dynamic Combat Narration: Off โ Brief โ Dramatic โ Epic
- Sophisticated scene construction with psychological depth and sensory richness
- Session Dashboard: Comprehensive campaign configuration and settings
- Party Status Tracking: Character stats, conditions, and health
- Combat System: Full D&D 5E combat with initiative tracking
- Inventory Management: Shared party inventory and individual character sheets
- Quest Journal: Multi-tier quest tracking (rumors โ side quests โ major arcs)
- XP Tracking: Automated experience point calculation and leveling
- Entity Register: NPC tracking with reputation, relationships, and voice patterns
- Campaign Journal: Chronological narrative history with location signatures
- Mathematically balanced encounter scaling
- Environmental modifiers and tactical positioning
- Fail-forward mechanics (failure advances story, never stalls)
- Lair actions and legendary actions support
- Automated dice rolling with advantage/disadvantage
- Procedurally generated persistent antagonists
- Dynamic personality traits and evolution
- Reputation-based relationship tracking (-100 to +100 scale)
- Narrative integration with psychological depth
- ElevenLabs text-to-speech integration for dramatic moments
- 30+ curated voice options (villains, monsters, narrators, heroes)
- Character voice consistency tracking
- Free tier: 10,000 characters/month
- Requires ElevenLabs API key and MCP configuration (see setup guide below)
Required:
- Claude AI account with Projects access
- Claude Opus 4.5 (best performance) or Claude Sonnet 4.5 (cost-effective)
Optional (for Audio Narration):
- ElevenLabs account (free tier available)
- Claude Desktop app with MCP (Model Context Protocol) support
- ElevenLabs MCP server configuration
If you want to enable audio narration for dramatic moments and NPC voices:
-
Get ElevenLabs API Key
- Sign up at ElevenLabs.io
- Navigate to your profile settings
- Generate an API key (free tier: 10,000 characters/month)
-
Easy Setup via Claude Desktop
The simplest way to add ElevenLabs support is through Claude Desktop's built-in MCP configuration:
- Open Claude Desktop settings
- Go to "Developer" โ "Edit Config"
- Add the ElevenLabs MCP server configuration:
{ "mcpServers": { "elevenlabs": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-elevenlabs" ], "env": { "ELEVENLABS_API_KEY": "your-api-key-here" } } } }- Replace
"your-api-key-here"with your actual ElevenLabs API key - Restart Claude Desktop
-
Alternative: Manual Setup
For advanced users who prefer manual installation, see the official ElevenLabs MCP repository.
-
Verify Setup
Once configured, ArchMagi can use commands like:
!voice [Voice ID] [Text to narrate]See
audio-narration-rules.mdfor a curated list of 30+ voices for villains, monsters, narrators, and heroes.
Note: Audio narration is entirely optional. ArchMagi works perfectly with text-only narration if you choose not to configure ElevenLabs.
You'll create two separate Claude Projects - one for character creation (Hero Forge) and one for gameplay (ArchMagi).
-
Create Claude Project
- Go to Claude.ai
- Create a new Project named "Hero Forge"
-
Add System Instructions
- Upload
hero-forge/heroforge-command-prompt.mdto Project Instructions
- Upload
-
Upload Knowledge Base Files
- Upload from
hero-forge/folder to Project Knowledge:heroforge-character-template.md(expanded sheet format)character-sheet-template.md(compact sheet format)
- Upload from
-
Create Characters
- Start a conversation and Hero Forge guides you through 12-step character creation
- Export the final character sheet as Markdown
-
Create Claude Project
- Create a new Project named "ArchMagi" (or your campaign name)
-
Add System Instructions
- Upload
00-archmagi-command-prompt.mdto Project Instructions
- Upload
-
Upload Knowledge Base Files
- Upload all root-level
.mdfiles to Project Knowledge (Files section):- Campaign configuration:
campaign-options.md - Rules systems:
encounter-rules.md,nemesis-rules.md,entity-framework.md,journal-rules.md,statblocks-rules.md - Narrative engine:
narrative-engine.md - Features:
audio-narration-rules.md,formatting-rules.md,import-export.md - Templates:
00_Session_Dashboard.mdthrough08_Campaign_Journal.md - Character template:
character-sheet-template.md - Dice engine:
dice-engine.md
- Campaign configuration:
- Upload all root-level
-
Import Characters
- Upload character sheets created with Hero Forge
- Or upload existing character sheets in Markdown format
-
Start Your Campaign
- Start a new conversation in your Project
- ArchMagi will automatically initialize using the instructions
- Follow the setup workflow to configure your campaign
Once your project is set up:
-
Configure Campaign: ArchMagi will guide you through campaign options
- Choose world setting, narrative style, tone, difficulty
- Set narrative density and reading level preferences
- Enable/disable nemesis system and audio narration
-
Create Characters:
- Upload existing character sheets (Markdown preferred)
- Or request pre-generated characters for your setting
-
Begin Adventure: ArchMagi initializes all tracking artifacts and presents your inciting incident
ArchMagi offers extensive customization through 11 different configuration categories:
Choose from classic and modern D&D settings:
- Forgotten Realms - High fantasy with divine intervention and ancient evils
- Greyhawk - Medieval authenticity with moral ambiguity
- Eberron - Post-war dieselpunk with dragonmarked houses
- Ravenloft - Gothic horror with tragic Darklords
- Planescape - Philosophical faction wars across infinite planes
- Dark Sun - Brutal post-apocalyptic desert survival
- Strixhaven - Magical university with academic competition
- Exandria - World rebuilding after divine calamity (Critical Role setting)
- Homebrew - Custom worlds limited only by imagination
- ...and 11 more official settings
- Basic - Lean, punchy narration for fast play
- Standard - Balanced description with clear exposition
- Literary - Rich sensory prose with layered detail
- Nexus - Highest-density poetic language with metaphor and multisensory imagery
Define your campaign's emotional landscape:
- Dark - Moral ambiguity, grim stakes, costly victories
- Classic - Traditional heroic fantasy, good vs evil
- Light - Upbeat, witty, low on gore
- Heroic - Bold exploits celebrated in song
- Gothic - Brooding atmospheres, decaying grandeur
- Horror - Haunting suspense, visceral shocks, survival-focused
- Pulp - High-octane action with cliff-hangers
- Noir - Cynical urban intrigue, flawed protagonists
- Epic - World-spanning conflicts, mythic stakes
- Clockwork - Industrial/steampunk aesthetics
- Cosmic - Lovecraftian entities, alien geometries, existential dread
- Cozy - Low-stress, slice-of-life, heartwarming
- Surreal - Dream-logic, uncanny juxtapositions
- Intrigue - Political maneuvering, espionage, double-crosses
- Brief - 1-2 focused sentences
- Standard - 1-2 paragraphs
- Detailed - 3-5 paragraphs with history and foreshadowing
- Rich - 5+ multisensory paragraphs for pivotal moments
- Off - Mechanics only, minimal description
- Brief - One-liner cinematic beats
- Dramatic - Paragraph vignettes with visceral sensations
- Epic - Sweeping slow-motion prose, cinematic finales
- Story - Ideal for new players, rarely lethal
- Easy - Light challenge, heroes feel powerful
- Standard - RAW 5E baseline
- Hard - High tension, resource attrition
- Hardcore - "Tomb of Horrors" mode, death matters
- 5-8 - Early reader, simple sentences
- 9-12 - Middle grade, familiar terms
- 12-15 - Young teen, moderate complexity
- 15-18 - Upper teen, richer vocabulary
- 18+ - Adult, full florid prose
- Enabled - 5-7 persistent antagonists with evolving grudges
- Disabled - Standard encounters only
- Enabled - ElevenLabs text-to-speech for dramatic moments (requires API key and MCP setup)
- Disabled - Text-only narration (default)
- Lines & Veils - Define content boundaries
- X-Card (โ๏ธ) - Instant pause & rewind for discomfort
- Customizable - Tailor to table preferences
All settings can be adjusted mid-session with voice commands (e.g., style verbose, tone gothic, combat epic)
Campaign configs allow you to customize ArchMagi for specific settings with race/class restrictions, magic system modifications, and genre conventions.
- Create a
00-campaign-config.mdfile with your setting rules - Upload it to your ArchMagi Claude Project's Project Knowledge
- ArchMagi automatically detects and enforces the config
- Race/Class Restrictions - Define allowed, reflavored, approval-required, and banned options
- Magic System Modifications - Corruption tracking, spell consequences, NPC reactions
- Faction Integration - Guild memberships, faction relationships, social dynamics
- Nemesis Filters - Restrict creature types and archetypes for the setting
- Tone Guidance - Adventure types, villain archetypes, narrative conventions
| Setting | File | Description |
|---|---|---|
| Lankhmar | campaigns/lankhmar/00-campaign-config.md |
Fritz Leiber's sword & sorcery - low magic, noir tone, human-centric with corruption mechanics |
Use the Lankhmar config as a template. Key sections:
## RACE OPTIONS
(Define allowed races with reflavoring notes)
## CLASS OPTIONS
(Categorize as โ
Unrestricted, โ ๏ธ Reflavored, ๐ฎ DM Approval, โ Banned)
## MAGIC SYSTEM
(Corruption rules, NPC reactions, item rarity)
## FACTIONS & ORGANIZATIONS
(Setting-specific groups and relationships)
## NEMESIS SYSTEM MODIFICATIONS
(Allowed/forbidden creature types, archetypes)Hero Forge is a companion tool for pre-session character creation. It provides a guided 12-step wizard that walks players through building complete D&D 5E characters.
- 21 Campaign Settings - Same settings as ArchMagi for consistency
- 54 Official Races - Complete list with sub-race support
- 13 Classes - All PHB classes with subclass selection
- 4 Ability Score Methods - Standard Array, Point Buy, 4d6-drop-lowest, 3d6-in-order
- Automatic Equipment - Level-appropriate gear and magic items
- Spell Preparation - Auto-generate or manually select spells
- Backstory Generation - Optional AI-generated backgrounds with story hooks
- Two Output Formats - Compact (quick reference) or Expanded (full detail)
- Campaign Context (setting selection)
- Ancestry & Culture (race/sub-race)
- Class & Role
- Ability Scores
- Gender
- Name (with race-flavored suggestions)
- Alignment
- Age
- Height & Weight
- Background
- Personality Hooks (Ideal, Bond, Flaw, Trait)
- Leveling & Starting Options
Characters are exported as Markdown files compatible with ArchMagi's import system.
00-archmagi-command-prompt.mdโ Goes in Project Instructions- Core system prompt and workflow orchestration
- Session initialization procedures
- Command registry and core principles
campaign-options.md- Campaign settings, narrative parameters, difficulty scalingencounter-rules.md- Combat mechanics, difficulty balancing, XP calculationnarrative-engine.md- Advanced narrative transformation algorithmsentity-framework.md- NPC persistence and personality consistency protocols
nemesis-rules.md- Persistent antagonist generation and evolutionjournal-rules.md- Campaign continuity and documentation standardsstatblocks-rules.md- Creature statistics formattingformatting-rules.md- Output standardization and visual hierarchyaudio-narration-rules.md- Voice generation integration guidelinesimport-export.md- Campaign persistence across sessions
Data structure definitions for all campaign tracking artifacts:
- 00 Session Dashboard - Campaign configuration center
- 01 Party Status - Character overview and conditions
- 02 Combat Tracker - Initiative and combat management
- 03 Inventory and Assets - Shared party loot
- 04 Quest Journal - Quest tracking and rumors
- 05 Game Console - Dice rolls and scratch calculations
- 06 XP Tracker - Experience point logging
- 07 Entity Register - NPC and faction tracking
- 08 Campaign Journal - Narrative history
dice-engine.md- Inline Python patterns for all dice rolls via bash_tool. Provides accurate D&D 5E dice rolling with proper probability distribution.character-sheet-template.md- Standardized character sheet format
heroforge-command-prompt.mdโ Goes in Project Instructionsheroforge-character-template.md- Expanded character sheet formatcharacter-sheet-template.md- Compact character sheet format
| Command | Function |
|---|---|
style [succinct|typical|verbose|florid] |
Adjust narrative verbosity |
narrate [basic|standard|literary|nexus] |
Set narrative density level |
combat [off|brief|dramatic|epic] |
Configure combat narration detail |
vivid [on|off] |
Toggle vivid combat descriptions |
tone [option] |
Change narrative tone |
stat {object} |
Display stat block |
party status |
Show party overview |
inventory |
Display party inventory |
quests |
Show quest journal |
recap |
Get story summary |
init nemesis |
Activate nemesis system |
safety [on|off|status] |
Manage content safety settings |
- Solo D&D Players seeking full campaign experiences
- DM Practice and scenario testing
- Campaign Development and worldbuilding
- Story-Focused Players wanting literary-quality narratives
- Tactical Players requiring mechanically precise combat
- Accessibility - adjustable reading levels and description lengths
- Epic high fantasy campaigns
- Gritty low-magic survival
- Political intrigue and diplomacy
- Dungeon crawls and exploration
- Mystery and investigation
- Horror and dark fantasy
- Mechanical Precision: Full D&D 5E RAW compliance
- Narrative Flexibility: Adjustable storytelling depth and complexity
- State Persistence: Comprehensive entity tracking across sessions
- Fail-Forward: Failure always advances narrative
- Separation of Concerns: Narrative in chat, mechanics in artifacts
- Main Chat: Story, narrative, dialogue, and roleplay
- Artifacts: Game mechanics, dice rolls, tables, tracking data
- Notifications: Artifact updates clearly announced
- Mechanical outcomes generate state vectors
- State vectors processed through narrative engine
- Density level determines transformation parameters
- Output calibrated to reading level
- Consistent voice maintained for recurring entities
All system documentation is embedded in the framework files:
- Comprehensive inline comments
- Configuration tables with explicit options
- Mathematical formulas for encounter balancing
- Probability tables for procedural generation
- Example scenarios and edge case handling
All dice rolling uses inline Python patterns from dice-engine.md via bash_tool:
- Standard notation support (1d20+5, 3d6, etc.)
- Advantage/disadvantage mechanics
- Critical hit/fumble detection
- Compound distribution handling
- Consistent output formatting:
ACTION: **Total** [roll] ยฑ modifier - No external files or skills required - all patterns are self-contained
Example:
python3 -c "import random as r; d=r.randint(1,20); print(f'ATTACK: {d+5} [{d}] +5')"See dice-engine.md for complete pattern library and examples.
Use import-export.md protocols to:
- Export complete campaign state between sessions
- Import previous game state with full context reconstruction
- Maintain narrative continuity across multiple plays
- Ensure data integrity for long-term campaigns
Basic: "You enter the tavern. It's crowded and noisy."
Standard: "You push through the heavy oak door into the tavern's warmth. The common room buzzes with conversation, and the smell of roasted meat fills the air."
Literary: "The tavern door yields with a groan of ancient hinges, and you cross the threshold into a fugue of sensationโwoodsmoke and spilled ale, the percussive din of too many voices in too small a space, and underneath it all, the primal comfort of rendered fat sizzling over open flame."
Nexus: "The tavern's threshold marks a liminal boundary between worldsโthe cold indifference of the street and the almost aggressive intimacy of this crowded sanctuary. You navigate the geography of bodies, each constellation of patrons its own microclimate of intent and history. The air itself seems textured, layered with the archaeological strata of a thousand nights just like this one, and fundamentally different."
This is a personal project framework. Feel free to fork and customize for your own campaigns.
ArchMagi v3.0 - May 2024
Created by 0xDarkMatter
ยฉ 2024 0xDarkMatter
- Start Simple: Begin with Standard narrative density and Typical style
- Experiment: Try different reading levels and combat narration settings
- Use Commands: Adjust settings mid-session to find your preferred experience
- Character Sheets: Markdown format enables better AI parsing
- Session Notes: Export campaign state regularly for continuity
- Nemesis System: Adds long-term narrative depth but increases complexity
- Artifacts: Check them regularly for updated game state
- Fail Forward: Embrace failed rollsโthey advance the story in interesting ways
- Claude Opus 4.5 or Sonnet 4.5: Opus 4.5 delivers best narrative quality; Sonnet 4.5 is cost-effective
- Project-Based: Works best as a Claude Project, not in standard chat
- Correct File Placement:
00-archmagi-command-prompt.mdโ Project Instructions- All other files โ Project Knowledge (Files)
- Artifact Support: Requires Claude's artifact feature for tracking systems
- Long-Form Play: Designed for extended campaigns with persistent state
Ready to begin your adventure? Upload the framework to Claude Projects and start your campaign!