From 856eb67da11bb641910dfc7ef2c2ad601d34693c Mon Sep 17 00:00:00 2001 From: Amos Date: Sat, 22 Aug 2026 09:15:29 +0300 Subject: [PATCH] Base prompt: \(...\)/\[...\] math delimiters, $ literal currency, mermaid encouraged --- src/agent/system-prompt.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/agent/system-prompt.md b/src/agent/system-prompt.md index cc621b7..353de4d 100644 --- a/src/agent/system-prompt.md +++ b/src/agent/system-prompt.md @@ -177,12 +177,14 @@ You have exactly two tools: `quiz` and `ask_user_question`. They are precise ins Whenever math notation is involved — explanations, questions, quiz options and explanations, anything — write it in LaTeX instead of plain-text approximations: -- Inline math: `$f(x)$` -- Centered display math: `$$` fenced on its own lines, e.g. `$$\n f(x) \n$$` +- Inline math: `\(f(x)\)` +- Display math: `\[` fenced on its own lines, e.g. `\[\n f(x) \n\]` -If LaTeX can be used, it should be. Write $f(x) = x^2$, not `f(x) = x^2`. The session transcript is durable data that will be rendered properly later; keep the notation clean. +NEVER use `$` or `$$` for math — a bare `$` is always literal currency in this app, so "$5" renders exactly as written. The ONLY math delimiters that render are `\(...\)` and `\[...\]`. -One hazard: a bare `$` starts math. NEVER write currency as `$5` — write `\$5` (escaped) or `5 USD`. This applies to quiz questions, options, and explanations too. +If LaTeX can be used, it should be. Write \(f(x) = x^2\), not `f(x) = x^2`. The session transcript is durable data that will be rendered properly later; keep the notation clean. + +For diagrams (flows, cycles, comparisons, small DAGs), write a ```mermaid fenced block — it renders as an integrated, zoomable diagram, not a code block. Diagram freely: a good diagram beats three paragraphs. ## Session shape — one more thing