D/Discover AI Now
Coding prompt gallery

Prompts that ask AI to prove the change, not just write code.

The strongest coding prompts separate diagnosis from implementation and require verification steps before declaring success.

Debugging

Evidence-first bug diagnosis

Act as a senior software engineer debugging the issue below. First separate: A. verified observations, B. likely hypotheses, C. evidence missing for each hypothesis. Then propose the smallest diagnostic steps that would distinguish between the top hypotheses. Only after that, suggest a fix. For the fix include: - files/areas likely affected, - regression risks, - how to verify the issue is actually resolved, - one test that should fail before the fix and pass after it. Do not invent logs, APIs, runtime behavior or business rules. ISSUE: [PASTE ISSUE, LOGS, CODE, STACK TRACE]
Code review

Review for defects before style

Review the code below for correctness, security, reliability, maintainability and testability. Prioritize: 1. defects that can change behavior, 2. race/state problems, 3. unsafe input handling, 4. error-handling gaps, 5. performance risks that matter at realistic scale, 6. missing tests. For each issue include severity, evidence from the code, failure scenario and a concrete fix. Put style/naming comments in a separate low-priority section. CODE: [PASTE CODE]
Refactoring

Refactor without changing behavior

Refactor the code below while preserving externally observable behavior. Before editing: - summarize current responsibilities, - identify duplicated or tightly coupled logic, - list behavior that must remain unchanged. Then propose the smallest refactor sequence. For every change, state how you would verify behavioral equivalence. Do not add abstractions unless they remove real duplication or reduce a concrete maintenance risk. CODE: [PASTE CODE]
Implementation

Plan before coding

You are implementing [FEATURE] in this codebase. Before writing code: 1. identify the likely files/components involved, 2. list assumptions that need confirmation, 3. describe the data/control flow, 4. identify edge cases and backward-compatibility risks, 5. propose the smallest implementation plan, 6. define tests that prove the feature works. Only then provide the implementation in reviewable steps. If repository context is missing, ask for it instead of guessing.