Skip to content
The Latent Daily
The Latent Daily

Sections

News & Industry
Knowledge & Learning
Research & Science
Tools, Software & Models
Developers & Builders
Hardware & Infrastructure
Society, Policy & Ethics
AI in Industries
People & Community
Special Formats

Tag

#Code Review

Code Review on The Latent Daily: 2 prompts. News, explainers and guides on Code Review, each linked to its sources.

2 items

Prompts tagged #Code Review

Codingadvanced

Database schema design review before you migrate

You are a senior database engineer. Review the schema below before it is created in production. Database: [e.g. "PostgreSQL 16", "MySQL 8", "SQLite", "SQL Server"] What the application does: [ONE-PARAGRAPH DESCRIPTION] Expected scale: [ROWS PER TABLE, WRITES PER SECOND, GROWTH] Most important queries: [LIST 3-8 QUERIES IN SQL OR PLAIN ENGLISH] Existing data to migrate: [YES/NO, AND FROM WHERE] Schema: """ [PASTE CREATE TABLE STATEMENTS OR AN ORM MODEL FILE] """ Review in this order and label each finding HIGH, MEDIUM or LOW: 1. Correctness: primary keys, foreign keys, NOT NULL, UNIQUE and CHECK constraints that the business rules require. 2. Modeling: normalization problems, repeated data, many-to-many relationships, soft deletes, history and auditing needs. 3. Data types: money, time zones, text length, enums, IDs. 4. Indexes: which of my queries each index serves; missing and redundant indexes. 5. Naming and consistency. 6. Migration and operations: locking risks, backfills, defaults on large tables. For each finding, give the reason and the corrected DDL. Finish with a revised full schema and a list of questions for me where the right answer depends on business rules you cannot see.

Works with: ChatGPT, Claude, Gemini, Any LLM

Codingintermediate

Structured code review with a severity checklist

You are a senior [LANGUAGE] engineer doing a code review. Review the code below. Context: - What the code is supposed to do: [PURPOSE] - Where it runs: [e.g. "public web API", "internal batch script"] - Project conventions: [STYLE GUIDE, FRAMEWORK, VERSION] - Focus areas, if any: [e.g. "security", "performance"] Check the code against this list, in order: 1. Correctness: logic errors, edge cases (empty input, null, large values), off-by-one errors. 2. Security: input validation, injection, secrets in code, unsafe deserialization, permissions. 3. Error handling: failures that are swallowed, unclear error messages, missing cleanup. 4. Performance: unnecessary loops, repeated I/O, N+1 queries, memory growth. 5. Readability: naming, function length, duplicated code, missing comments where logic is non-obvious. 6. Tests: what is untested and which test cases you would add. Output format: - A table: # | Severity (blocker/major/minor/nit) | Line(s) | Issue | Suggested fix - Then up to 3 code snippets showing the most important fixes. - Then "What is good": 2-3 things worth keeping. Rules: only report issues you can point to in the code. If something depends on code you cannot see, list it under "Questions for the author" instead of guessing. Code: ``` [PASTE CODE OR DIFF] ```

Works with: ChatGPT, Claude, Gemini, GitHub Copilot Chat