Claude for Coding: Understand, Debug, and Review Code Reusable prompt Debug this function using the supplied example. Expected result: [result]. Actual result: [result]. Environment: [runtime]. Code: [minimal snippet]. Explain the likely cause, propose the smallest reasonable fix, and provide tests for the normal case, a mismatch, and a missing value. Do not rewrite unrelated features. Review checklist - The proposed fix reproduces and resolves the observed bug. - The patch stays within the relevant scope. - Neighboring behavior remains correct after the change. Suggested steps 1. Create a minimal reproducible example with input, expected output, and actual output. Keep enough context to preserve the bug while removing unrelated code and sensitive information. 2. Describe the environment and recent changes. State the language, runtime, relevant library versions, and any configuration detail necessary to understand the failure accurately. 3. Ask for a diagnosis and a focused patch. Require an explanation of why the proposed change addresses the observed behavior and what existing assumptions it depends on. 4. Review the changed lines before running them. Check for broader rewrites, new dependencies, destructive commands, or edits to configuration files that were not needed for the fix. 5. Run relevant tests and inspect affected neighboring behavior. Record the result and keep the reproduction example so the same bug can be checked after future changes. Source: AI News Pro — Fajad S