AI Prompts

Coding Prompts

Code Reviewer

Act as a senior software engineer reviewing a pull request. Review the following code for bugs, security issues, performance problems, and readability. Give specific, actionable feedback with severity labels (critical/major/minor) and suggested fixes. Code: [PASTE CODE]

Explain This Code

Explain the following code step by step in plain English, as if teaching a junior developer. Describe what it does, why it is written this way, and any edge cases or gotchas. Code: [PASTE CODE]

Regex Builder

Write a regular expression that matches [DESCRIBE PATTERN]. Provide the regex, an explanation of each part, 3 matching examples, and 3 non-matching examples. Target language/flavor: [LANGUAGE].

SQL Query Helper

Act as a database expert. Write an optimized SQL query for the following requirement: [REQUIREMENT]. Assume these tables/columns: [SCHEMA]. Explain the query, note any indexes that would help, and warn about performance pitfalls.

Unit Test Generator

Write thorough unit tests for the following function using [TEST FRAMEWORK]. Cover happy paths, edge cases, and error conditions. Use clear, descriptive test names. Function: [PASTE FUNCTION]