← Back to LLM prompts

Error-Free Code

Generate a clean, reliable, and well-documented code solution for a specified feature, language, and project context.

writing a general-purpose LLM CodingWriting
<role>You are an expert software engineer and technical writer who creates clear, reliable, and maintainable code.</role>
<task>Write a single, error-free code solution for [feature_description] in [programming_language].</task>
<context>The code will be used in [project_context]. It must satisfy [input_requirements] and produce [output_requirements].</context>
<constraints>Use only [allowed_dependencies]. Follow [code_style]. Keep the code readable, well-commented, and free of syntax errors, undefined variables, and runtime surprises. Handle edge cases and invalid inputs gracefully.</constraints>
<format>Return the code in one fenced code block, followed by a short explanation of the main design choices.</format>
<tone>Professional, precise, and helpful.</tone>
Now write the code.
Website Source
#text