<!--
ROBOTS ON PAYROLL / THE VAULT
What this is: the decoder prompt. Paste it, paste your error under it, and the AI diagnoses before it touches anything.
How to use it: download this file and give it to your AI (Claude, ChatGPT,
Cursor, Lovable chat) as a reference. Say: "Use this as my playbook for [task]."
Latest version + full guide: https://robotsonpayroll.com/resources/error-message-decoder
-->

# The Error Message Decoder Prompt

Three prompts, one rule: **the AI changes one thing at a time.** Never say "it's broken, fix it." That prompt gives the AI permission to rewrite everything, and rewriting everything is how one bug becomes four.

Pick the prompt that matches your situation:

1. **The Decoder** - you have an error message.
2. **The Blank Page Decoder** - no error, the page is just empty or white.
3. **The Stop-Digging Prompt** - you already tried to fix it twice and it's getting worse.

---

## 1. The Decoder (you have an error message)

Copy everything in the box, then paste your error message underneath it (the whole thing, even the ugly parts). Send.

```
I hit an error in my app. The full error message is pasted below.

Before you change ANY code, do this in order:

1. EXPLAIN: Tell me what broke in plain English. 2 sentences maximum,
   no jargon. Pretend I have never written code.

2. CLASSIFY: Tell me which of these it is (pick exactly one):
   a) A problem in the app's own code
   b) A missing or wrong key/credential (an API key, a password, a setting)
   c) An outside service being down or unreachable
   d) A limit being hit (rate limit, quota, plan limit, size limit)
   Say which one and why you think so.

3. PROPOSE: Describe the SINGLE smallest change that would fix it.
   One change only. If you think it needs several changes, tell me the
   first one and stop there.

4. WAIT-CHECK: If the fix requires something only I can do (paste a key,
   upgrade a plan, wait for a service to come back), say so and stop.
   Do not write workaround code for a problem that isn't code.

5. APPLY: Make only that one change. Do not refactor, do not clean up,
   do not improve anything else you noticed, do not touch any other file.

6. REPORT: Tell me exactly what you changed (which file, what it does now
   that it didn't before) and what I should see when I try again.

If the error message doesn't give you enough to be confident, say
"I'm not sure yet" and tell me the ONE thing to check or paste next.
Guessing is worse than asking.

HERE IS THE ERROR:
[PASTE YOUR FULL ERROR MESSAGE HERE]
```

**Why the order matters:** steps 1 and 2 force a diagnosis before surgery. Step 4 catches the most common wasted hour: the AI writing code to fix a problem that was actually a missing key or a dead service. Step 5 is the one-change rule in writing.

---

## 2. The Blank Page Decoder (no error, just... nothing)

A blank white page IS an error message. It means the app crashed before it could draw anything, and the real error is hiding one layer down. This prompt sends the AI to go find it instead of guessing.

```
My app shows a blank page (or a white screen). There is no error message
visible to me. Do NOT start changing code. A blank page means something
crashed before the screen could load, and the real error is hidden.
Find it first:

1. HUNT: Look for the hidden error. Check, in order:
   a) The browser console (the log web browsers keep of what went wrong;
      if I need to open it myself, tell me the exact keys to press:
      usually F12 or Cmd+Option+J, then the "Console" tab)
   b) The build or deploy logs (the record of what happened when the
      app was assembled and published)
   c) The server logs, if this app has a backend

2. If you can see those logs yourself, read them and quote the first
   red/error line you find. If you cannot see them, tell me exactly
   where to click to find them and what to copy back to you.

3. Once we have the real error, treat it like this: explain it in plain
   English (2 sentences max), classify it (app code / missing key /
   service down / limit hit), propose the single smallest fix, apply
   only that, and report what you changed.

Do not rewrite any component, page, or config "to be safe" while we
are still hunting. One error, one fix.
```

---

## 3. The Stop-Digging Prompt (two failed fixes, getting worse)

The rule of holes: when you're in one, stop digging. If the AI has tried twice and things are worse, the next "fix" will be built on top of two wrong guesses. This prompt makes it back out first.

```
STOP. We have tried to fix this at least twice and it is getting worse,
not better. Do not attempt another fix yet. Do this instead, in order:

1. LIST: Write out every change you have made since the original error
   first appeared. Every file touched, every setting changed, every
   package added. A numbered list. If you are not sure you remember
   them all, say so.

2. SORT: For each change, answer honestly: did it help, did it do
   nothing, or did it make things worse or add a new error?

3. REVERT: Put back everything that did not clearly help. I want to
   get back to having ONE problem, the original one, instead of the
   original problem plus your patches. Tell me each thing you put back.

4. CONFIRM: Tell me what the current error is NOW, after the cleanup.
   Quote it exactly. It may be the original error again. That is good.
   That is progress.

5. DIAGNOSE FRESH: Now treat that error as brand new. Explain it in
   plain English (2 sentences max), classify it (app code / missing
   key / service down / limit hit), and propose the single smallest
   fix. Do not apply it yet. Wait for my go.

Rule from here on: one change per attempt, and you report what changed
after each one. No batches.
```

**Note the ending:** this one makes the AI wait for your go before fixing. After two bad attempts, you want a checkpoint back in the loop.

---

## The one-change rule, in one line

If you remember nothing else: **never let the AI make two changes in one attempt.** One change, one test, one report. That's the whole system.

For the five errors you'll hit most often (with their exact fix prompts), see `five-classic-errors.md` in this same kit.
