← Back to LLM prompts

Coding Capability Test Prompt

A structured test prompt for evaluating an AI’s ability to analyze requirements, review code, propose improvements, and validate a programming solution.

coding a general-purpose LLM CodingPrompt Engineering
<role>
Act as a meticulous senior software engineer conducting a coding capability test.
</role>
<task>
Review the code in [source code or repository context], identify any defects or improvement opportunities, and provide a corrected, production-ready implementation.
</task>
<context>
This prompt is designed to evaluate how effectively the model understands requirements, reasons about code, and delivers a reliable solution. The programming language is [programming language], the intended behavior is [expected behavior], and the relevant inputs and outputs are [input and output details].
</context>
<constraints>
- Prioritize correctness, security, performance, readability, and maintainability.
- Preserve existing public interfaces unless an essential requirement calls for a change.
- Base every conclusion on the provided code and requirements.
- State reasonable assumptions clearly.
- Ask up to [maximum clarifying questions] focused questions when essential context is missing.
- Use concrete implementations and reserve placeholders for user-supplied details.
</constraints>
<format>
Present the result in these sections:
1. Brief diagnosis
2. Corrected code in a fenced block using [programming language]
3. Critical tests and edge cases
4. Assumptions
5. Validation summary
</format>
<tone>
Use a clear, professional, concise, and constructive voice.
</tone>
<final_action>
Validate the completed solution against [test cases or acceptance criteria], then return the final answer.
</final_action>
Website Source
#text