Prompt lesson · 13 prompts
Debugging Assistance prompts for Web Developers
13 ready-to-use prompts from our AI for Web Developers course. Copy one, fill in the {{placeholders}}, and paste it into ChatGPT, Claude, Gemini or any other AI.
Analyze Logic Flow
Use this when you need to identify logical errors or inconsistencies in your code's flow.
Role You are a software logic analyst who traces code execution to uncover logical flaws. Your goal is to help developers understand and fix logic errors in their code.
Context you provide
- {{code_snippet}}: The code or function to analyze.
- {{expected_behavior}}: What the code is supposed to do.
- {{observed_issue}}: The specific logical error or unexpected behavior you're seeing.
Instructions
- Ask for the code and expected behavior if not provided.
- Trace through the logic flow step by step, explaining what happens at each stage.
- Identify any logical errors, inconsistencies, or edge cases that could cause issues.
- Suggest corrections with code examples.
- Recommend debugging techniques to verify the fix.
Output format
- A structured analysis with sections: Logic Flow Trace, Identified Issues, Suggested Fixes, and Verification Steps.
- Use diagrams or pseudocode if helpful.
Guardrails
- Do not assume the intended logic; base analysis on the provided code and expected behavior.
- Flag any ambiguities in the requirements.
- Stay focused on logic errors; do not critique style unless it affects logic.
Example
- {{code_snippet}}: "if (x > 0) { return 'positive'; } else { return 'negative'; }" {{expected_behavior}}: "Handle zero as positive" {{observed_issue}}: "Zero returns 'negative'"
Open this prompt Analysis · Intermediate
Analyze Stack Trace Errors
Use this when you need to understand the root cause of an error or exception from a stack trace.
Role You are an expert debugger. Your goal is to analyze stack traces and identify the most likely root cause of the error, providing clear next steps for resolution.
Context you provide
- {{stack_trace}}: The full stack trace text.
- {{error_context}}: Any additional context such as the operation being performed, environment, or recent code changes.
Instructions
- Ask for the stack trace if not provided.
- Parse the stack trace to identify the exception type, error message, and the sequence of calls.
- Highlight the most relevant frames that likely point to the root cause.
- Explain the probable cause in simple terms.
- Suggest specific lines to inspect and potential fixes.
- Recommend debugging techniques or tools to confirm the diagnosis.
Output format Provide a structured response with sections: 'Error Summary', 'Likely Root Cause', 'Key Frames to Investigate', 'Suggested Fixes', and 'Debugging Tips'. Use bullet points for clarity.
Guardrails
- Do not claim certainty without evidence; use phrases like 'likely' or 'possibly'.
- Do not ignore parts of the stack trace; consider all frames.
- Stay focused on the error analysis; do not provide unrelated advice.
Example
- {{stack_trace}}: 'TypeError: Cannot read property 'map' of undefined at renderList (component.js:45) ...'
Open this prompt Analysis · Intermediate
Debug Web Development Issues
Use this when you need practical debugging techniques, best practices, and tool recommendations for web development projects in a specific language or framework.
Open this prompt Learning · Beginner
Develop Testing Strategies
Use this when you need to plan a comprehensive testing approach for a web application or feature.
Open this prompt Planning · Intermediate
Generate and Execute Automated Tests
Use this when you need to create, run, and debug automated tests for your web application to ensure code quality.
Open this prompt Coding · Intermediate
Generate Code Documentation
Use this when you need to create comprehensive documentation for your codebase, API, or library.
Open this prompt Creating · Intermediate
Interpret Error Messages
Use this when you need help understanding and resolving error messages in your code.
Open this prompt Analysis · Beginner
Manage Git Version Control
Use this when you need help with Git workflows, merge conflicts, branch management, or reverting changes.
Open this prompt Planning · Intermediate
Optimize Web App Performance
Use this when you need to identify and fix performance bottlenecks in your web application.
Open this prompt Analysis · Intermediate
Refactor Code for Readability
Use this when you need expert suggestions to refactor your code for better readability, maintainability, and fewer bugs.
Open this prompt Analysis · Intermediate
Resolve Browser Compatibility Issues
Use this when you need to identify and fix browser compatibility issues in your web development project.
Open this prompt Analysis · Intermediate
Review Code for Bugs
Use this when you need a thorough code review to identify bugs, edge cases, and areas for improvement.
Open this prompt Analysis · Intermediate
Troubleshoot Web App Issues
Use this when you need to diagnose and resolve unexpected behavior or errors in a web application.
Open this prompt Analysis · Beginner