Library › Coding AI › Software developers

Hotfix a checkout outage at 6pm Friday without touching anything else

  • For Software developers
  • You practice Setting limits and rules
  • Time about 5 minutes
  • Level Intermediate

About this exercise

It is Friday 6pm and checkout is failing for every customer since the 5:40pm deploy. The on-call lead has set the rules: smallest possible fix, change only the line that crashes, valid orders must return exactly what they returned before, and no refactor or new imports. End every line you change with the comment # HOTFIX-2291 and add no other comments. Return the whole calculate_order_total function in exactly 1 code block of at most 24 lines, then one sentence under 25 words that starts with "Cause:" and names the cause.

Common mistakes when you ask AI for this

  • Rewriting the whole function. Asked to fix a bug, the AI tidies everything: Decimal money, input validation, try/except, type hints, a docstring. Try: Say: "Change only the line that crashes. No refactor, no Decimal, no validation, no new imports."
  • Fixing a different problem. The AI guesses at the bug and may patch the sale price or promo code instead of the tax line in the trace. Try: Point at it: "The crash is the tax line: tax_rate now arrives as a string."
  • Commenting everything. The AI explains its work in comments and the team can no longer see what the hotfix touched. Try: Say: "End only the changed line with # HOTFIX-2291. Add no other comments."
  • Extra code blocks and an essay. You get the fix, a test, a second version and three paragraphs on why money should use Decimal. Try: Say: "One code block, then one sentence naming the cause. Nothing else."
  • No cause for the incident channel. The lead needs one line to paste in the channel; the AI buries the cause in prose or leaves it out. Try: Add: "Finish with one sentence starting \"Cause:\"."

What a strong prompt includes

  • Says the smallest fix only
  • Names the crashing line or cause
  • Keeps behavior and bans extras
  • Gives the comment tag
  • Limits the output

Practice this now ↑

Related exercises