# Code snippet review — prompt for ChatGPT

Check a small code excerpt for behavioral errors and get suggestions with specific input examples.

Canonical URL: https://boswidget.ru/en/code-snippet-review-prompt-for-chatgpt/

Model: ChatGPT

Category: Code

Tags: code, review, errors

![Code snippet review](https://boswidget.ru/assets/images/text-preview-chatgpt-code-review-1200.3f31425c875b.webp)

Code snippet review

## Prompt

Perform a static code review: {code}. Expected behavior: {behavior}. Environment: {environment}. List errors first, then risks and questions. For each issue, give the excerpt, triggering condition, sample input and minimal fix. Do not claim to have run the code or tests. Do not invent library APIs; flag uncertainties separately. Mention style only where it obscures behavior. Finish with checks to perform after the fixes.

## Template fields

- `{code}` — Code. Example input: Paste a small excerpt without passwords or tokens
- `{behavior}` — Expected behavior. Example input: What the code should do and for which inputs
- `{environment}` — Environment. Example input: Language, versions and important dependencies

## Launch

[Open ChatGPT in YesAI](https://yesai.su/en/chatgpt)
