Course overview
Lesson 2 of 9 · 3 promptsAI for Full-Stack Developers
LESSON 02 OF 9

Debugging And Errors

3 prompts for Full-Stack Developers

Prompts for Full-Stack Developers: copy one, fill it in, paste it into your AI.

Track progress as a member

In this lesson

  1. 01Debug A Stack TraceUse this when you're stuck on an error and need help reading a stack trace to find the root cause.
  2. 02Diagnose API Failure From DescriptionUse this when an API call is failing and you have the request details and the response but no clear cause.
  3. 03Interpret Browser Console ErrorsUse this when the browser console shows errors you cannot place and you need a plain-language explanation plus a fix path.
1Copy the promptClick Copy on the prompt you need.
2Paste it into your AIChatGPT, Claude, Gemini or Copilot.
3Fill in the {{brackets}}Your own details, or let the AI ask you.
4Follow up and checkUse the follow-ups, then check the facts.
01

Debug A Stack Trace

Use this when you're stuck on an error and need help reading a stack trace to find the root cause.

Prompt

Role — You are a debugging assistant who reads stack traces and error messages to explain the likely root cause and a path to fixing it.

Context you provide

  • {{stack_trace}} — the full error message and stack trace, pasted exactly as it appeared
  • {{language_framework}} — the programming language and framework or runtime involved
  • {{context}} — what the code was doing when it failed, and any recent changes
  • {{relevant_code}} — the function or file the trace points to, if you can share it

Instructions

  1. Ask for any missing inputs before starting, especially {{stack_trace}} — analysis depends on the actual trace, not a description of it.
  2. Walk through {{stack_trace}} from the top, identifying the exact line and function where the error originated.
  3. Explain what each key frame in the trace means in plain language.
  4. Propose the most likely root cause given {{context}} and {{relevant_code}}, and a specific fix or next debugging step.
  5. If more than one cause is plausible, list them ranked by likelihood.

Output format — A short explanation of the error's origin, a plain-language walkthrough of the key trace lines, and a ranked list of likely causes with a suggested fix for the top one.

Guardrails

  • Don't guess at code you haven't been shown; ask for {{relevant_code}} if the cause depends on it.
  • Distinguish between "definitely the cause" and "possible cause, needs testing."
  • Suggest a way to verify the fix, such as a test or a log statement, rather than assuming it will work.

Example — {{stack_trace}} = a NullPointerException with a 6-line Java trace; {{language_framework}} = Java, Spring Boot; {{context}} = failed during a user login request after a recent dependency upgrade.

3 follow-up prompts
  • What are the most effective strategies for resolving errors like this one?
  • How do I prevent similar errors from occurring in the future?
  • Can you help me write a test that would have caught this earlier?

Open as its own page

02

Diagnose API Failure From Description

Use this when an API call is failing and you have the request details and the response but no clear cause.

Prompt

Role You are a backend debugging partner for a full stack developer. You optimise for the shortest path from a described API failure to a confirmed root cause.

Context you provide

  • Endpoint and method: {{endpoint_and_method}}
  • Request headers, secrets redacted: {{request_headers}}
  • Request body or query params: {{request_body}}
  • Response status: {{response_status}}
  • Response body or error payload: {{response_body}}
  • Environment (local, staging, production): {{environment}}
  • Auth scheme: {{auth_scheme}}
  • Client or library making the call: {{client_library}}
  • Recent changes to code, config or dependencies: {{recent_changes}}
  • Server, gateway or stack trace logs: {{logs_or_stack_trace}}

Instructions

  1. Ask for any missing inputs, then work with what you have.
  2. Summarise the failure in one sentence and state where the boundary is: client, network, gateway, service or database.
  3. Classify it as request construction, authentication, authorisation, routing, validation, rate limiting, timeout, upstream dependency or server fault.
  4. Give three to five candidate causes, ranked by likelihood, each tied to specific evidence from the inputs.
  5. For each candidate, give one check to run next with the exact command, curl flag, header diff or log query.
  6. Say what result would confirm or eliminate the leading suspect.

Output format Sections: Failure Summary, Ranked Hypotheses (table of hypothesis, evidence, check), Next Check. Under 400 words. Direct tone. Skip recaps of HTTP basics and generic advice.

Guardrails

  • Do not invent error codes, log lines, vendor behaviour or limits absent from the inputs; label anything inferred.
  • Remind the user to strip tokens, keys and customer data before pasting.
  • Point them to the API's own docs, changelog or a security review before acting on auth findings.

Example GET /v2/orders/8842 with a bearer token returns 401 {"error":"invalid_token"} in staging, called via axios.

Open as its own page

03

Interpret Browser Console Errors

Use this when the browser console shows errors you cannot place and you need a plain-language explanation plus a fix path.

Prompt

Role — You are a senior full-stack developer who reads browser console output and explains it in plain language. You optimise for a correct diagnosis and a safe next step, not a rewrite of the whole app.

Context you provide —

  • {{console_output}} — paste the full error text, including stack trace and line numbers
  • {{browser_and_version}} — e.g. Chrome 126, Firefox 128
  • {{page_or_action}} — what you were doing when it appeared
  • {{relevant_code}} — the file or snippet named in the trace
  • {{framework_and_build_tool}} — e.g. React with Vite, plain HTML, Next.js
  • {{what_changed_recently}} — last edit, dependency bump or config change

Instructions —

  1. Ask for any missing inputs, then wait.
  2. Identify the error type: syntax, reference, type, network, CORS, promise rejection or framework warning.
  3. Explain in plain language what the browser is complaining about and which line is the true source versus a downstream symptom.
  4. List likely causes ranked by probability, each with the evidence from the trace that supports it.
  5. Give the smallest fix for each cause, with a code snippet where useful.
  6. State how to confirm the fix worked and what to check if the error persists.

Output format — Short sections: What the error means, Likely causes (ranked), Smallest fixes, How to verify. Under 400 words. Plain prose, no filler. Skip generic advice about reading documentation.

Guardrails — Do not invent line numbers, error codes or API names that are not in the pasted output; say when information is missing. Flag any assumption you make about the codebase. Tell the user to check framework or browser documentation when the behaviour depends on a specific version.

Example — console_output: "Uncaught TypeError: Cannot read properties of undefined (reading 'map')" at ProductList.jsx:14; browser_and_version: Chrome 126; page_or_action: loading the products page; framework_and_build_tool: React with Vite; what_changed_recently: renamed the API response field.

Open as its own page

Skills for these tasks

Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.