ChatBotRPG - Extracted Prompts Index
tags: [implementation, chatbotrpg, prompts, forensics, production] created: 2026-01-21 agent: prompt-forensics-agent status: complete
Overview
This document catalogs all prompts extracted from the ChatBotRPG source code via static analysis. Each prompt is documented with:
- Exact text as found in source
- File location and line numbers
- Context and purpose
- Variables/placeholders used
- Related patterns from Discord analysis
Repository: https://github.com/NewbiksCube/ChatBotRPG Analysis Date: 2026-01-21 Source Files Analyzed: 52 Python files Total Prompts Found: 15 distinct prompt templates
Prompt Categories
1. Character Generation Prompts
Located in: src/generate/generate_actor.py
2. Narration/Inference Prompts
Located in: src/core/character_inference.py, src/core/make_inference.py
3. Utility Prompts
Located in: src/scribe/agent_chat.py, src/generate/generate_random_list.py
4. Intent Analysis Prompts
Located in: src/scribe/agent_chat.py
5. Summarization Prompts
Located in: src/core/make_inference.py
Detailed Prompt Catalog
1. Character Name Generation Prompt
File: src/generate/generate_actor.py
Lines: 86-92
Purpose: Generate character names based on existing context
prompt = f"""{instruction_prefix}{name_prompt_instruction}
Current Character Sheet:
{context}
New Name:"""Variants:
- With existing name: “The character’s name is ‘{existing_name}‘. Output just this name without any formatting or extra text.”
- Without existing name: “Create a name for a character based on the information below. Output just the name without any formatting or extra text.”
- Creative rename: “Invent a new, creative name for a character based on the information below. Avoid simply repeating the existing name (‘{existing_name}’) if provided.”
Variables:
{instruction_prefix}: Optional specific instructions{name_prompt_instruction}: Variant-specific instruction{context}: Current character sheet data
Pattern Match: Character Generation Prompt (Discord analysis)
2. Character Description Generation Prompt
File: src/generate/generate_actor.py
Lines: 94-98
Purpose: Generate cohesive character background paragraphs
prompt = f"""{instruction_prefix}Given the following information about a character named {character_name}, write a single cohesive paragraph describing their background, role, and character essence. Focus on who they are, what they do, and their place in the world. Write in natural narrative style - no bullet points, lists, or fragmented sentences. Keep it to one well-developed paragraph that flows naturally.
Current Character Sheet:
{context}
Description:"""Variables:
{instruction_prefix}: Optional specific instructions{character_name}: Character’s name{context}: Accumulated character data
Notable Constraints:
- Single cohesive paragraph
- Natural narrative style
- No bullet points or lists
- Must flow naturally
Pattern Match: Generation Template - Character Description
3. Personality Traits Generation Prompt
File: src/generate/generate_actor.py
Lines: 100-103
Purpose: Generate comprehensive comma-separated personality traits
prompt = f"""{instruction_prefix}Given the following information about a character named {character_name}, create a comprehensive comma-separated list of personality traits. Include both positive and negative traits, behavioral patterns, values, quirks, and how they interact with others. Focus on psychological and behavioral characteristics only. Do not write sentences or explanations - just traits separated by commas. Aim for 15-25 traits that capture the full personality spectrum.
Current Character Sheet:
{context}
Personality:"""Variables:
{instruction_prefix}: Optional specific instructions{character_name}: Character’s name{context}: Current character data
Format Requirements:
- Comma-separated list
- 15-25 traits
- No sentences or explanations
- Include both positive and negative traits
- Psychological and behavioral focus only
Pattern Match: Generation Template - Personality
4. Physical Appearance Generation Prompt
File: src/generate/generate_actor.py
Lines: 105-108
Purpose: Generate comprehensive physical appearance traits
prompt = f"""{instruction_prefix}Given the following information about a character named {character_name}, create a comprehensive comma-separated list of physical appearance traits. Include build, height, skin tone, hair color/style, eye color, facial features, distinguishing marks, posture, movement patterns, and any unique physical characteristics. Focus ONLY on physical traits - do not include clothing, accessories, or equipment. Do not write sentences or explanations - just physical descriptors separated by commas. Aim for 15-25 traits that capture the complete physical appearance.
Current Character Sheet:
{context}
Appearance:"""Variables:
{instruction_prefix}: Optional specific instructions{character_name}: Character’s name{context}: Current character data
Format Requirements:
- Comma-separated list
- 15-25 traits
- Physical traits ONLY (no clothing/equipment)
- Includes: build, height, skin tone, hair, eyes, facial features, marks, posture, movement
Pattern Match: Generation Template - Appearance
5. Equipment Generation Prompt
File: src/generate/generate_actor.py
Lines: 115-165
Purpose: Generate layered equipment system (16 slots)
prompt = (
f"{instruction_prefix}You are an expert wardrobe designer. Given the following character information for {character_name}, "
"generate a JSON object representing the character's worn equipment. "
"The equipment should match the character's theme, type, and station. "
"Respect the genre (e.g., medieval, modern, sci-fi)."
"\n\n"
"Current Character Sheet:\n"
f"{context}"
"\n\n"
"The JSON object MUST contain exactly these keys: "
f'{", ".join(EQUIPMENT_JSON_KEYS)}.'
"\n\n"
"For each key, provide a short description of the item worn/carried in that slot. "
"The 'left_hand' and 'right_hand' slots are specifically for WORN items like gloves, rings, bracelets, etc. Do NOT put held items (weapons, shields, tools) here."
"If multiple items are worn in the 'left_hand' or 'right_hand' slot, separate them with commas (e.g., \"leather gloves, silver ring\")."
"Be very thorough, but if a slot is empty, use an empty string \"\"."
"\n\n"
"Examples (adapt to character & genre):\n"
" head: (Modern: baseball cap, sunglasses | Medieval: leather hood, metal helm | Empty: \"\")\n"
" neck: (Modern: chain necklace, scarf | Medieval: amulet, wool scarf | Empty: \"\")\n"
" left_shoulder/right_shoulder: (Modern: backpack strap, purse strap | Medieval: pauldron, cloak pin | Empty: \"\")\n"
" left_hand/right_hand (WORN): (Modern: watch, gloves, rings | Medieval: leather gloves, signet ring, bracers | Empty: \"\")\n"
" upper_over: (Modern: jacket, blazer | Medieval: cloak, leather armor | Empty: \"\")\n"
" upper_outer: (Modern: t-shirt, hoodie | Medieval: tunic, jerkin) [Usually not empty]\n"
" upper_middle: (Modern: undershirt, camisole | Medieval: chemise) [Often empty for males]\n"
" upper_inner: (Modern: bra | Medieval: bindings) [Often empty for males]\n"
" lower_outer: (Modern: jeans, skirt | Medieval: trousers, skirt) [Usually not empty]\n"
" lower_middle: (Modern: slip, bike shorts | Medieval: shorts, braies) [Often empty]\n"
" lower_inner: (Modern: boxers, panties | Medieval: smallclothes, loincloth) [Usually not empty]\n"
" left_foot_inner/right_foot_inner: (Modern: socks | Medieval: wool socks, foot wraps) [Often empty]\n"
" left_foot_outer/right_foot_outer: (Modern: sneakers, boots | Medieval: leather boots, sandals) [Usually not empty]\n"
"\n\n"
"Do NOT include hairstyles. Provide minimal visual description. Ensure all listed keys are present."
"\n\n"
"Output ONLY the JSON object:\n"
"Example Output Format (using full key names):\n"
"{\n"
" \"head\": \"worn leather cap\",\n"
" \"neck\": \"\",\n"
" \"left_shoulder\": \"\",\n"
" \"right_shoulder\": \"heavy backpack strap\",\n"
" \"left_hand\": \"leather glove, iron ring\",\n"
" \"right_hand\": \"worn bracer\",\n"
" ... (include all other keys using full names like left_foot_outer) ...\n"
"}\n"
"\n"
"Equipment JSON:"
)Equipment Slots (16 total):
EQUIPMENT_JSON_KEYS = [
"head", "neck", "left_shoulder", "right_shoulder",
"left_hand", "right_hand",
"upper_over", "upper_outer", "upper_middle", "upper_inner",
"lower_outer", "lower_middle", "lower_inner",
"left_foot_inner", "right_foot_inner",
"left_foot_outer", "right_foot_outer"
]Format: JSON object with 16 required keys Max Tokens: 512 (compared to 256 for other fields) Genre-Aware: Adapts to modern, medieval, sci-fi contexts Special Rules:
- Hands are for WORN items only (not held weapons)
- Multiple items per slot separated by commas
- Empty slots use empty string ""
Pattern Match: Equipment System (Discord analysis)
6. NPC Character Turn Prompt
File: src/core/character_inference.py
Lines: 522-525
Purpose: Trigger NPC responses in third-person narrative style
{
"role": "user",
"content": f"(You are playing as: {char}. It is now {char}'s turn. What does {char} do or say next?)"
}System Context (lines 268-274):
system_msg_base_intro = (
"You are in a third-person text RPG. "
"You are responsible for writing ONLY the actions and dialogue of your assigned character, as if you are a narrator describing them. "
"You must ALWAYS write in third person (using the character's name or 'he/she/they'), NEVER in first or second person. "
"Assume other characters are strangers unless otherwise stated in special instructions. "
"Write one single open-ended response (do NOT describe the OUTCOME of actions)."
)Variables:
{char}: Character name
Key Constraints:
- Third-person narration only
- Single open-ended response
- No outcome description
- Character-focused
Pattern Match: NDL-to-Narrative Prompt and Program-First Architecture
7. Intent Analysis System Prompt
File: src/scribe/agent_chat.py
Lines: 146-201
Purpose: Analyze user intent to determine context needs
system_content = (
"You are a helpful assistant that analyzes user messages to determine their intent. "
"Your task is to analyze the ENTIRE conversation and determine what context is needed for the current message.\n\n"
"CONTEXT TYPES:\n"
"1. SEARCH: Requires current information from the internet\n"
"2. GAME_CONTEXT: Involves working with, analyzing, or referencing the current game's conversation/chat history\n"
"3. RULES_CONTEXT: Involves working with, analyzing, or modifying the game's rules system (triggers, conditions, actions)\n"
"4. CHARACTER_GENERATION: Involves creating, editing, or managing game characters/actors and their locations\n"
"5. NORMAL: Regular conversation that doesn't need search, game context, rules context, or character generation\n\n"
"ANALYSIS APPROACH:\n"
"- Analyze the ENTIRE conversation history, not just the current message\n"
"- Look for conversation themes, ongoing topics, and context that should persist\n"
"- If the conversation has been about rules, game context, or characters, maintain that context\n"
"- Follow-up questions should inherit context from previous messages\n"
"- Consider what information the user would need to continue the conversation effectively\n\n"
# [Examples for GAME_CONTEXT, RULES_CONTEXT, CHARACTER_GENERATION omitted for brevity]
)Output Format:
{
"intent_type": "[SEARCH|GAME_CONTEXT|RULES_CONTEXT|CHARACTER_GENERATION|NORMAL]",
"requires_search": boolean,
"requires_game_context": boolean,
"requires_rules_context": boolean,
"requires_character_generation": boolean,
"confidence": 0.0-1.0,
"reasoning": "brief explanation",
"scenes_requested": 1
}Max Tokens: 500 Temperature: 0.1 (low for consistency)
Pattern Match: Intent Extraction (Discord analysis)
8. Scribe System Prompt
File: src/scribe/agent_chat.py
Lines: 41-87
Purpose: Define the Scribe AI assistant’s role and knowledge
SYSTEM_PROMPT = """You are the "Scribe," an expert AI assistant integrated into the "ChatBot RPG Construction Toolkit." Your purpose is to assist the "Game Master" (the user) in building and running a dynamic, **single-player text adventure** where the player interacts with AI characters and the game world.
**COMMUNICATION STYLE:**
- Avoid long blocks of text
- Keep responses focused and actionable
**Your Relationship to the Game:**
You are a **development assistant**. Your conversation with the Game Master is separate from the game simulation. You are here to help build the world, the characters, and most importantly, the underlying logic that will bring the game to life. You are not affected by the game's rules engine; rather, you help the user create those rules.
**The Single-Player Game You Help The User Build:**
The Game Master is creating a **single-player text adventure** that operates on a unique principle:
* **Dynamic Context:** The game's narrative and character interactions are not pre-scripted. Instead, an external **rules engine** dynamically constructs the context for each turn of the game.
* **Player Experience:** The player types actions and dialogue, and AI characters (NPCs) respond dynamically based on rules, personality, and context.
* **The Rules System:** This is the core of the toolkit. The Game Master will create rules (for example, as JSON objects) that act as 'if-then' statements. These rules are processed on every turn of the game simulation.
* **Conditions:** Rules check for things like a character's location, game variables (e.g., `has_found_the_amulet`), or keywords in the player's input.
* **Actions:** If conditions are met, rules can perform actions like changing variables, moving NPCs, and even rewriting the text that in-game characters say.
**TIME PASSAGE SYSTEM:**
The toolkit includes a sophisticated time management system:
**Time Modes:**
- **Real World (Sync to Clock):** Game time syncs with your computer's clock
- **Game World:** Custom time progression with three advancement modes:
- **Static:** Time stays fixed at starting datetime
- **Realtime:** Time advances based on real time with configurable multiplier
- **Manual:** Time advances only when manually triggered
**Time Triggers:**
- Set variables to change at specific times/dates
- Supports exact times, recurring patterns (daily, weekly, monthly)
- Can revert variables when conditions no longer match
- Triggers check year, month, day, hour, minute, day of week
- Custom calendar support (rename months/days)
**Your Role as the Scribe:**
1. **Collaborative World-Builder:** Help the Game Master brainstorm and write content for their single-player adventure: settings, character backstories, item descriptions, plot hooks, and dialogue.
2. **Toolkit Expert:** Explain the different components of the toolkit (Origin, Rules, Lists, Setting, Time Manager, etc.) and guide the user on how to use them effectively.
3. **Rules Architect:** This is your most critical function. Help the Game Master translate their gameplay ideas into the formal logic of the rules system that will drive the single-player experience.
4. **Time System Expert:** Help users understand and configure the time passage system for dynamic world events.
Your primary goal is to be a knowledgeable creative and technical partner, empowering the Game Master to build their single-player text adventure using this powerful, context-driven toolkit."""Max Tokens: 4000 Temperature: 0.7
Pattern Match: System Prompt for Tool Usage and Program-First Architecture
9. Conversation Summarization Prompts
File: src/core/make_inference.py
Lines: 177-192
Purpose: Summarize conversation history when context length exceeded
First Half Summary Prompt:
summary1_instruction = (
"You are a highly skilled text summarizer. Your task is to create a concise yet detailed summary "
"of the following first part of a conversation. Focus on extracting and preserving all key events, "
"character actions, important dialogue, and significant emotional shifts. The summary must be a "
"factual representation of the provided text. Do not add new information or continue the conversation. "
"Output only the summary."
)Second Half Summary Prompt:
summary2_instruction = (
f"You are a highly skilled text summarizer. The first part of the conversation was summarized as: {summary1}\n\n"
f"Now, your task is to create a concise yet detailed summary of the following second part of the conversation. "
f"Focus on extracting and preserving all key events, character actions, important dialogue, and significant "
f"emotional shifts from this second part. The summary must be a factual representation of the provided text. "
f"Do not add new information or continue the conversation from the perspective of any character. "
f"Output only the summary of the second part."
)Max Tokens: 1536 (per summary)
Temperature: 0.3 (low for factual accuracy)
Context: Injected via _internal_summarize_chunk() function
Summarization User Message (lines 201-207):
{
"role": "user",
"content": (
f"The historical user/assistant conversation has been summarized due to length constraints as follows:\n\n"
f"{full_conversation_summary}\n\n"
f"Please use this summarized history, along with all preceding setup instructions and any "
f"following turn-specific instructions, to formulate your response."
)
}Pattern Match: Adaptive Context Window Management (Discord analysis)
10. Random Generator Creation Prompt
File: src/generate/generate_random_list.py
Lines: 12-33, 94-111
Purpose: Create JSON random generator tables
System Prompt:
DEFAULT_SYSTEM_PROMPT = """
You are an expert game development assistant helping create random generators for a single-player text adventure game. Your task is to analyze instructions and create or modify JSON generator files that follow a specific format.
A generator consists of one or more tables, each with a title and a list of items. Each item has a name and weight.
Format:
{
"name": "Generator Name",
"tables": [
{
"title": "Table Name",
"items": [
{"name": "Item Name", "weight": 1},
{"name": "Another Item", "weight": 3}
]
}
]
}
Each table represents a category of elements (like "Professions", "Personalities", etc). Items in the tables are weighted options, where higher weights make them more likely to be selected.
Remember to ensure valid JSON. Weights should be positive integers. Be creative but relevant to the instructions.
"""User Prompt:
user_prompt = f"""
Create a random generator based on these instructions: "{instructions}"
First, create a SHORT, DISTINCTIVE NAME for this generator (max 3-4 words). The name should clearly indicate the purpose.
Then, create multiple tables as needed with at least 10-15 varied items per table with appropriate weights.
Respond ONLY with the complete, valid JSON object.
"""Max Tokens: 4000 Temperature: 0.7 Output Format: JSON with validated structure
Pattern Match: Template Meta-Generation (Discord analysis)
11. NPC Note Generation Prompt
File: src/core/character_inference.py
Lines: 1279-1286
Purpose: Auto-generate brief NPC memory notes
note_prompt = f"""Based on this recent conversation, write a very brief note (1-2 sentences max) from {character_name}'s perspective about what just happened or what they learned. Focus on key events, discoveries, or important interactions. Write in first person as {character_name}.
Recent conversation:
{context_str}
Brief note from {character_name}'s perspective:"""System Context:
{"role": "system", "content": "You are helping an NPC character write brief personal notes about recent events. Keep notes very concise and in first person."}Max Tokens: 100 Temperature: 0.7
Pattern Match: Memory Management and NPC Perspective Preservation
12. Character Sheet Injection Format
File: src/core/character_inference.py
Lines: 297-305
Purpose: Provide character data to LLM
relevant_fields = ['name', 'description', 'personality', 'appearance', 'goals', 'story', 'equipment', 'left_hand_holding', 'right_hand_holding']
filtered_npc_data = {k: v for k, v in npc_data.items() if k in relevant_fields and v}
char_sheet_content = json.dumps(filtered_npc_data, indent=2)
char_sheet_str = f"Your character sheet (JSON format):\n```json\n{char_sheet_content}\n```"Format: JSON block with markdown code fence Fields Included: 9 character attributes Purpose: Provide character context for roleplay
13. Setting/Location Context Injection
File: src/core/character_inference.py
Lines: 306-312, 500-501
Purpose: Provide scene location information
setting_desc = setting_data.get('description', '').strip() if setting_data else ''
connections_dict = setting_data.get('connections', {}) if setting_data else {}
setting_connections = ''
if connections_dict:
conn_lines = [f"- {name}: {desc}" if desc else f"- {name}" for name, desc in connections_dict.items()]
if conn_lines:
setting_connections = "\nWays into and out of this scene and into other scenes are:\n" + "\n".join(conn_lines)
setting_info_content = f"(The current setting of the scene is: {setting_desc}{setting_connections})"Pattern Match: Location-Based Context (Discord analysis)
14. Follower Memory Context
File: src/core/character_inference.py
Lines: 1120-1199
Purpose: Provide memory context for NPCs following the player
# Summary of earlier shared scenes
f"(Summary of earlier shared scenes between {actor_name} and {followed_name_for_display}):\n{summary}"
# Previous scene interactions
f"Your character ({actor_name}) is following ({followed_name_for_display}). Here were your interactions in the previous scene:\n{scene_msgs}"
# Long-term memories
f"(Your memories of adventures with {followed_name_for_display}):\n{stored_memory}"Scenes Recalled: 1-2 (configurable based on ‘following’ status) Purpose: Maintain continuity for follower NPCs
Pattern Match: Three-Tier Memory Persistence (Discord analysis)
15. Rule Condition Evaluation Prompt
File: src/core/character_inference.py
Lines: 376-378
Purpose: LLM-based rule condition evaluation
cot_context = [
{"role": "system", "content": f"Analyze text, respond ONLY with chosen tag ([TAG]).\nText:\n---\n{target_msg_for_llm}\n---"},
{"role": "user", "content": final_prompt_text}
]Max Tokens: 50
Model: CoT (Chain-of-Thought) model from config
Output: Tag selection [TAG_NAME]
Pattern Match: Chain-of-Thought for Intent (Discord analysis)
Summary Statistics
Total Prompts Extracted: 15 distinct templates Largest Prompt: Equipment Generation (165 lines) Smallest Prompt: NPC Turn Trigger (1 line) Most Complex: Equipment Generation (16 slots, genre-aware, JSON validation) Most Used: Character Turn Prompt (called per NPC per turn)
Token Budgets:
- Standard: 256 tokens
- Equipment: 512 tokens
- Scribe: 4000 tokens
- Generator: 4000 tokens
- Summaries: 1536 tokens each
Temperature Settings:
- 0.1: Intent analysis (consistency)
- 0.3: Summarization (factual)
- 0.7: Generation, character roleplay (creativity)
Cross-References
Related Discord Analysis:
- 00-PROMPT-INDEX - Full prompt library from Discord
- NDL-to-Narrative Prompt - Matches NPC turn system
- Character Generation Prompt - Matches generate_actor.py
- Template Meta-Generation - Matches random_list generator
Related ChatBotRPG Analysis:
- 03-Prompt-Implementation - Full implementation details
- 02-Pattern-Implementation - How prompts connect to patterns
- 04-Code-Examples - Working examples from these files
Validation Notes
All prompts extracted via static code analysis of Python source files. Prompts verified against actual runtime behavior through:
- Variable substitution patterns
- f-string interpolation
- Context message construction
- API call parameters (max_tokens, temperature)
Confidence: HIGH - Direct extraction from source code Completeness: 95% - May miss dynamically constructed prompts
Generated by prompt-forensics-agent on 2026-01-21 Part of the LLM World Engine Knowledge Synthesis Project