What this prompt does
This prompt uses Gemini's multimodal vision to turn [image_count] screenshot(s) of [content_type] into clean, reviewed code. It asks the model to accurately transcribe all visible code, identify the language and framework, review for bugs, security issues, performance problems, and style violations, rewrite to [coding_standard] standards, add error handling and type annotations, suggest [improvement_count] improvements with explanations, generate unit tests, and return the final code in a copyable block. Anything unclear in the image gets flagged with a best-interpretation note.
The structure works because it treats the screenshot as a draft, not a source of truth. Transcription, review, and cleanup happen in one pass so you stop retyping code by hand from chat screenshots or whiteboard photos, but the explicit "flag what's unclear" step keeps the model honest about low-confidence regions. The [improvement_count] cap and the standards in [coding_standard] keep the output focused rather than an open-ended rewrite.
When to use it
- Someone sent you code as a screenshot and you'd rather not retype it.
- You photographed a whiteboard or notebook from a planning session and want runnable code.
- You're reviewing a snippet from a slide deck or video frame and want it cleaned up.
- You want a quick bug/security/style pass on code you can't easily copy as text.
- You need unit tests generated for transcribed code as a starting point.
- You want the model to tell you which parts of a blurry image it couldn't read confidently.
Example output
Expect a transcription of the visible code, a stated language/framework identification, a review grouped by bugs, security, performance, and style, a rewritten version following [coding_standard], [improvement_count] suggestions with rationale, generated unit tests, and a final copyable code block. Where the image was unclear, the model flags the region and offers its best interpretation rather than silently guessing.
Pro tips
- Use the highest-resolution image you can; transcription accuracy drops fast on blurry or low-contrast
[content_type]captures. - Always re-verify the security and type fixes before committing — transcription is a draft, and a confidently wrong fix is worse than an obvious typo.
- Set
[coding_standard]to your real conventions so the rewrite matches your codebase instead of a generic style. - Keep
[improvement_count]modest so the suggestions stay high-value rather than padding the response with trivia. - For multi-image inputs, set
[image_count]accurately and order the screenshots logically so the model reconstructs the code in sequence. - Treat generated tests as a scaffold; confirm they actually exercise the logic rather than asserting the obvious.