Coding
Review code by risk first
Find correctness, security and maintainability issues before discussing style.
Create a reproducible debugging path and rank likely causes before changing code.
Act as a senior software engineer debugging a production issue. Do not jump straight to a fix. Expected behavior: [EXPECTED] Actual behavior: [ACTUAL] Steps to reproduce: [STEPS] Environment and versions: [ENVIRONMENT] Relevant code/logs: [PASTE] First, restate the failure precisely. Then rank the three most likely root causes, citing evidence for and against each. Propose the smallest diagnostic test for each cause. After that, recommend the lowest-risk fix and provide a focused regression test. Call out any assumption you cannot verify from the information provided.
Replace the [BRACKETED PARTS] with specific context. Better inputs create more relevant answers.
Include exact error text and version numbers.
Share the smallest relevant code sample.
Run diagnostics before accepting the proposed fix.