coding template
Debug from a stack trace
Root-causes an error instead of guessing at fixes.
Use this templateOpens the composer with the prompt filled in. Free — an emailed code is all you need.
The prompt
Copy it, or use the button above to drop
it straight into the composer. Everything in [SQUARE BRACKETS] is a
slot you fill in.
Help me find the root cause of this error. Stack trace / error: ``` [PASTE FULL TRACE] ``` Relevant code: ``` [PASTE THE FUNCTION(S) IN THE TRACE] ``` Environment: [LANGUAGE + VERSION, FRAMEWORK, OS, DEPLOY TARGET] What I was doing when it happened: [ACTION] What I've already tried: [ATTEMPTS] Work through it in this order: 1. Read the trace and state which line actually raised, versus which lines are just call frames. Say what the error type means in this specific context. 2. List the possible causes ranked by likelihood, with the reasoning for the ranking. 3. For the top cause, give me one specific thing to run or log that would confirm or rule it out — not a shotgun list of five checks. 4. Only then propose the fix, with the corrected code. 5. Tell me what would have surfaced this earlier (a type check, a test, an assertion) so it doesn't recur. If the trace is insufficient to reach a cause, say exactly what extra output you need.
When to use it
- You have an error and want the cause, not five things to try
- You've inherited code and need the model in your head before changing it
- You want tests for the cases that actually break, not the happy path
Which mode suits it
Code questions want the answer first and an explicit “I can't see that” instead of a confident guess about code that wasn't pasted in.
- Precise — shorter, fact-first, no padding