{
"id": "99A588E0-0632-4297-B245-9E47DA63430E",
"kind": "workflow",
"name": "D&D Character Prompt Forge",
"author": {
"address": "0x425E78375336d1938cf0eaE5c40aa86CbE1C2eBB",
"signature": "bfb6bcbdafb11eca96e2e3124443c005b135ea520570bbe3ba5e513a9ac1ad46544006e318086568bbb319357aebada215df824133b63c7894d1c7227b12a2f31c"
},
"format": "osaurus.template",
"summary": "Pick character options in a form, roll fate's dice, and get a rich roleplay system prompt for your D&D character.",
"version": 1,
"workflow": {
"edges": [
{
"to": "fate",
"from": "form"
},
{
"to": "persona",
"from": "fate"
}
],
"nodes": [
{
"id": "form",
"kind": "dialog",
"name": "Character form",
"input": {},
"retry": {
"max_attempts": 1,
"backoff_seconds": 1
},
"dialog": {
"title": "⚔️ Forge your adventurer",
"fields": [
{
"key": "race",
"type": "choice",
"label": "Race",
"default": "Surprise me",
"options": [
"Human",
"Elf",
"Dwarf",
"Halfling",
"Gnome",
"Half-Orc",
"Tiefling",
"Dragonborn",
"Half-Elf",
"Aasimar",
"Tabaxi",
"Goliath",
"Warforged",
"Surprise me"
],
"required": true,
"persistence": "always_ask",
"prefill_last": true
},
{
"key": "char_class",
"type": "choice",
"label": "Class",
"default": "Surprise me",
"options": [
"Barbarian",
"Bard",
"Cleric",
"Druid",
"Fighter",
"Monk",
"Paladin",
"Ranger",
"Rogue",
"Sorcerer",
"Warlock",
"Wizard",
"Artificer",
"Surprise me"
],
"required": true,
"persistence": "always_ask",
"prefill_last": true
},
{
"key": "alignment",
"type": "choice",
"label": "Alignment",
"default": "Surprise me",
"options": [
"Lawful Good",
"Neutral Good",
"Chaotic Good",
"Lawful Neutral",
"True Neutral",
"Chaotic Neutral",
"Lawful Evil",
"Neutral Evil",
"Chaotic Evil",
"Surprise me"
],
"required": true,
"persistence": "always_ask",
"prefill_last": true
},
{
"key": "background",
"type": "choice",
"label": "Background",
"default": "Surprise me",
"options": [
"Acolyte",
"Charlatan",
"Criminal",
"Entertainer",
"Folk Hero",
"Guild Artisan",
"Hermit",
"Noble",
"Outlander",
"Sage",
"Sailor",
"Soldier",
"Urchin",
"Haunted One",
"Surprise me"
],
"required": true,
"persistence": "always_ask",
"prefill_last": true
},
{
"key": "personality",
"type": "choice",
"label": "Personality vibe",
"default": "Surprise me",
"options": [
"Gruff but kind",
"Cheerful optimist",
"Brooding loner",
"Silver-tongued schemer",
"Absent-minded scholar",
"Zealous true believer",
"Nervous wreck",
"Theatrical show-off",
"Cold and calculating",
"Surprise me"
],
"required": true,
"persistence": "always_ask",
"prefill_last": true
},
{
"key": "tone",
"type": "choice",
"label": "Story tone",
"default": "Heroic high fantasy",
"options": [
"Heroic high fantasy",
"Grimdark",
"Lighthearted & comedic",
"Gothic horror",
"Swashbuckling adventure",
"Mystery & intrigue"
],
"required": true,
"persistence": "always_ask",
"prefill_last": true
},
{
"key": "role",
"type": "choice",
"label": "How will the prompt be used?",
"default": "NPC the AI plays for my table",
"options": [
"Player character I roleplay as",
"NPC the AI plays for my table",
"Companion who chats with me"
],
"required": true,
"persistence": "always_ask",
"prefill_last": true
},
{
"key": "level",
"help": "1 to 20",
"type": "number",
"label": "Level",
"default": 3,
"required": false,
"persistence": "always_ask",
"prefill_last": true
},
{
"key": "name",
"help": "Leave blank and one will be invented",
"type": "text",
"label": "Name (optional)",
"required": false,
"persistence": "always_ask"
},
{
"key": "quirk",
"help": "e.g. talks to their sword, collects teeth",
"type": "text",
"label": "Signature quirk (optional)",
"required": false,
"persistence": "always_ask"
},
{
"key": "notes",
"help": "Setting, campaign details, backstory hooks",
"type": "long_text",
"label": "Anything else? (optional)",
"required": false,
"persistence": "always_ask"
}
],
"message": "Choose the bones of your character. The dice and the bard will do the rest."
},
"intent": "Ask the person to pick race, class, alignment, background, personality, tone, role, optional name/quirk/notes",
"timeout": 120,
"output_schema": {
"type": "object",
"required": [
"race",
"char_class",
"alignment",
"background",
"personality",
"tone",
"role"
],
"properties": {
"name": {
"type": "string"
},
"race": {
"type": "string"
},
"role": {
"type": "string"
},
"tone": {
"type": "string"
},
"level": {
"type": "number"
},
"notes": {
"type": "string"
},
"quirk": {
"type": "string"
},
"alignment": {
"type": "string"
},
"background": {
"type": "string"
},
"char_class": {
"type": "string"
},
"personality": {
"type": "string"
}
}
}
},
{
"id": "fate",
"code": {
"source": "async function run(input, ctx) {\n const c = Object.assign({}, input.choices || {});\n const pick = a => a[Math.floor(Math.random() * a.length)];\n const d6 = () => 1 + Math.floor(Math.random() * 6);\n const pools = {\n race: ['Human','Elf','Dwarf','Halfling','Gnome','Half-Orc','Tiefling','Dragonborn','Half-Elf','Aasimar','Tabaxi','Goliath','Warforged'],\n char_class: ['Barbarian','Bard','Cleric','Druid','Fighter','Monk','Paladin','Ranger','Rogue','Sorcerer','Warlock','Wizard','Artificer'],\n alignment: ['Lawful Good','Neutral Good','Chaotic Good','Lawful Neutral','True Neutral','Chaotic Neutral','Lawful Evil','Neutral Evil','Chaotic Evil'],\n background: ['Acolyte','Charlatan','Criminal','Entertainer','Folk Hero','Guild Artisan','Hermit','Noble','Outlander','Sage','Sailor','Soldier','Urchin','Haunted One'],\n personality: ['Gruff but kind','Cheerful optimist','Brooding loner','Silver-tongued schemer','Absent-minded scholar','Zealous true believer','Nervous wreck','Theatrical show-off','Cold and calculating']\n };\n const surprises = [];\n for (const k of Object.keys(pools)) {\n if (!c[k] || c[k] === 'Surprise me') { c[k] = pick(pools[k]); surprises.push(k); }\n }\n let level = Number(c.level); if (!level || level < 1) level = 3; if (level > 20) level = 20; c.level = Math.round(level);\n const names = ['STR','DEX','CON','INT','WIS','CHA'];\n const parts = names.map(n => { const r = [d6(),d6(),d6(),d6()].sort((a,b)=>a-b); const s = r[1]+r[2]+r[3]; const m = Math.floor((s-10)/2); return n + ' ' + s + ' (' + (m>=0?'+':'') + m + ')'; });\n const secrets = ['Is secretly the heir to a fallen house','Owes a life-debt to a hag','Once sold out a friend to save themselves','Hears a voice in their dreams that knows their future','Is wanted under a different name in a distant city','Made a pact they do not fully remember','Carries a letter they have never dared to open','Was raised by a cult that still searches for them'];\n const flaws = ['Cannot resist a wager','Trusts no one who smiles too much','Panics around deep water','Lies reflexively, even when the truth is easier','Holds grudges for decades','Is dangerously curious about forbidden magic','Gives away money they do not have','Freezes when someone cries'];\n const omens = ['A raven follows them from town to town','Candles gutter when they are angry','They were born during an eclipse','Their shadow sometimes moves a moment too late','Flowers wilt where they sleep','Cats bow to them','Thunder rumbles when they lie','They cannot be seen in still water'];\n const trinkets = ['a glass eye that is warm to the touch','a tiny brass key with no lock','a map of a city that does not exist','a music box that plays a tune no one recognizes','a dried hand that twitches on full moons','a coin minted with their own face','a jar of fireflies that never die','a chess piece carved from bone'];\n return { ...c, surprises, stat_block: parts.join(' · '), secret: pick(secrets), flaw: pick(flaws), omen: pick(omens), trinket: pick(trinkets) };\n}",
"network": [],
"secrets": [],
"timeout": 30
},
"kind": "code",
"name": "Roll the dice of fate",
"input": {
"choices": "{{nodes.form.output}}"
},
"retry": {
"max_attempts": 1,
"backoff_seconds": 1
},
"intent": "Roll ability scores and draw random secret, flaw, omen, trinket",
"timeout": 120,
"output_schema": {
"type": "object",
"required": [
"race",
"char_class",
"alignment",
"background",
"personality",
"tone",
"role",
"level",
"stat_block",
"secret",
"flaw",
"omen",
"trinket"
],
"properties": {
"flaw": {
"type": "string"
},
"name": {
"type": "string"
},
"omen": {
"type": "string"
},
"race": {
"type": "string"
},
"role": {
"type": "string"
},
"tone": {
"type": "string"
},
"level": {
"type": "number"
},
"notes": {
"type": "string"
},
"quirk": {
"type": "string"
},
"secret": {
"type": "string"
},
"trinket": {
"type": "string"
},
"alignment": {
"type": "string"
},
"surprises": {
"type": "array",
"items": {
"type": "string"
}
},
"background": {
"type": "string"
},
"char_class": {
"type": "string"
},
"stat_block": {
"type": "string"
},
"personality": {
"type": "string"
}
}
}
},
{
"id": "persona",
"kind": "inference",
"name": "Write the persona",
"input": "Race: {{nodes.fate.output.race}}\nClass: {{nodes.fate.output.char_class}} (level {{nodes.fate.output.level}})\nAlignment: {{nodes.fate.output.alignment}}\nBackground: {{nodes.fate.output.background}}\nPersonality vibe: {{nodes.fate.output.personality}}\nStory tone: {{nodes.fate.output.tone}}\nPrompt use: {{nodes.fate.output.role}}\nRequested name: {{nodes.fate.output.name}}\nSignature quirk: {{nodes.fate.output.quirk}}\nExtra notes: {{nodes.fate.output.notes}}\nAbility scores: {{nodes.fate.output.stat_block}}\nHidden secret: {{nodes.fate.output.secret}}\nFlaw: {{nodes.fate.output.flaw}}\nOmen: {{nodes.fate.output.omen}}\nTreasured trinket: {{nodes.fate.output.trinket}}",
"retry": {
"max_attempts": 1,
"backoff_seconds": 1
},
"intent": "Local model writes the system prompt, tagline, opening line, sample lines",
"timeout": 600,
"inference": {
"mode": "generate",
"model_slot": "main",
"temperature": 0.9,
"instructions": "You are a veteran Dungeon Master and character writer. From the character sheet in the user message, create a vivid D&D 5e character and write a roleplay SYSTEM PROMPT that an AI will follow to become this character.\n\nRules:\n- If the requested name is empty or 'null', invent a fitting, memorable name.\n- Weave in every element: race, class, level, alignment, background, personality, tone, quirk, notes, the secret, the flaw, the omen and the trinket. Let the ability scores shape them (low INT = simpler speech, high CHA = magnetic, etc.).\n- Match the story tone throughout.\n- The system_prompt is written in second person ('You are ...') and uses markdown headings in this order: ## Identity, ## Appearance, ## Backstory (2–3 short paragraphs), ## Personality & Voice (speech patterns, catchphrases, verbal tics), ## Motivations & Fears, ## Secret (what it is and how guarded they are about it), ## Abilities (what they can do at this level, in story terms), ## Relationships, ## Roleplay Rules.\n- Roleplay Rules depend on use: for a player character, help the player speak and act as them; for an NPC, stay in character, never reveal the secret unless earned, react to the party, and never narrate player actions; for a companion, chat warmly in character and remember shared adventures. Always: stay in character, keep replies concise, never mention being an AI.\n- tagline: one punchy line, like a movie poster.\n- opening_line: the first thing they say on meeting someone, in their own voice.\n- sample_lines: 3 short quotes in their voice, each showing a different mood."
},
"output_schema": {
"type": "object",
"required": [
"character_name",
"tagline",
"system_prompt",
"opening_line",
"sample_lines"
],
"properties": {
"tagline": {
"type": "string"
},
"opening_line": {
"type": "string"
},
"sample_lines": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 3,
"minItems": 3
},
"system_prompt": {
"type": "string"
},
"character_name": {
"type": "string"
}
},
"additionalProperties": false
}
}
],
"output": {
"tagline": "{{nodes.persona.output.tagline}}",
"stat_block": "{{nodes.fate.output.stat_block}}",
"opening_line": "{{nodes.persona.output.opening_line}}",
"sample_lines": "{{nodes.persona.output.sample_lines}}",
"system_prompt": "{{nodes.persona.output.system_prompt}}",
"character_name": "{{nodes.persona.output.character_name}}"
},
"secrets": [],
"examples": [
{
"name": "Tiefling pirate bard NPC",
"input": {}
}
],
"model_slots": [
{
"slot": "main",
"locality": "local_only",
"preferred": "OsaurusAI/gemma-4-26B-A4B-it-mxfp4",
"strictness": "preferred",
"needs_tool_use": false
}
],
"input_schema": {
"type": "object",
"x-order": [],
"properties": {},
"additionalProperties": false
},
"output_schema": {
"type": "object",
"required": [
"character_name",
"tagline",
"stat_block",
"system_prompt",
"opening_line",
"sample_lines"
],
"properties": {
"tagline": {
"type": "string",
"title": "Tagline"
},
"stat_block": {
"type": "string",
"title": "Ability scores"
},
"opening_line": {
"type": "string",
"title": "Opening line"
},
"sample_lines": {
"type": "array",
"items": {
"type": "string"
},
"title": "Sample dialogue"
},
"system_prompt": {
"type": "string",
"title": "System prompt"
},
"character_name": {
"type": "string",
"title": "Character name"
}
},
"additionalProperties": false
},
"requirement_notes": {}
},
"changelog": "First version: character form → dice of fate (stats, secret, flaw, omen, trinket) → local model writes a full roleplay system prompt.",
"created_at": "2026-10-07T19:16:35Z",
"content_hash": "sha256:82b410dc190e997e1071b03cab13656df61eeed1c39524ccb3b7431a794f5ec8",
"requirements": {
"notes": {},
"models": [
{
"slot": "main",
"locality": "local_only",
"preferred": "OsaurusAI/gemma-4-26B-A4B-it-mxfp4",
"strictness": "preferred",
"needs_tool_use": false
}
],
"network": [],
"plugins": [],
"secrets": [],
"knowledge": [],
"mcp_servers": [],
"permissions": []
},
"format_version": 1,
"available_to_orchestrator": true
}