Back to ContextClean

Examples

Debugging prompt examples for build errors, runtime crashes, and failing tests

The fastest way to explain a good AI debugging prompt is to show one. These examples use a simple pattern: tell the model what job you want it to do, preserve the real error, identify the relevant file or command, and add the smallest amount of human context needed to frame the failure.

They are not strict templates. They are examples of how to keep prompts tight enough to be readable while still being specific enough to be useful.

Build failure prompt

Please debug this build error.
Command: npm run build
Relevant file: src/app/layout.tsx
Recent change: moved a shared stylesheet
Error: Module not found: Can't resolve './globals.css'

Runtime crash prompt

Please find the likely root cause.
Relevant file: src/api/user.ts
Expected behavior: API should return a valid user object
Error: TypeError: Cannot read properties of undefined

Test failure prompt

Please explain why this test fails and suggest the minimal fix.
Job: test
File: src/user.test.ts
Error: Expected 200 but received 500

Related reading

Last reviewed: May 25, 2026. Maintained as part of the ContextClean resource library.