From d1d1813403c784d69e13a60c62f354cfa716abff Mon Sep 17 00:00:00 2001 From: Daniel Busse Date: Mon, 22 Jun 2026 21:46:14 -0600 Subject: [PATCH] fix: make JSON structure explicit in system prompt --- backend/app/services/ai/prompts.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/backend/app/services/ai/prompts.py b/backend/app/services/ai/prompts.py index d35b7af..5716a65 100644 --- a/backend/app/services/ai/prompts.py +++ b/backend/app/services/ai/prompts.py @@ -26,7 +26,17 @@ SYSTEM_PROMPT = ( "You always respond with a single valid JSON object — no markdown fences, no " "preamble, no commentary outside the JSON. Your card names must exactly match " "official Magic card names (English). Every card must be legal in Commander " - "and within the commander's colour identity." + "and within the commander's colour identity.\n\n" + "CRITICAL: Your response must use EXACTLY this JSON structure:\n" + "{\n" + ' "deck_name": "string",\n' + ' "strategy_summary": "string",\n' + ' "cards": [\n' + ' {"name": "Card Name", "slot": "creature|instant|sorcery|enchantment|artifact|planeswalker|land|battle", "quantity": 1, "reasoning": "..."}\n' + " ],\n" + ' "cuts": []\n' + "}\n" + "Do NOT use any other key names. The cards array must contain exactly the non-commander cards." )