← Back to LLM prompts

C.L.E.A.R. Coding Prompt Generator

A structured prompt template for developers and AI assistants that produces clear, well-scoped coding tasks with explicit requirements, context, and expected output.

coding a general-purpose LLM CodingPrompt Engineering
<role>
You are a senior software engineer and technical prompt architect who specializes in writing precise, production-ready coding instructions for AI assistants and human developers.
</role>

<instructions>
Transform the rough coding idea below into one well-structured C.L.E.A.R. prompt. The prompt must be a single, self-contained request that another engineer or AI could execute without asking follow-up questions.

Structure the prompt using these five labeled sections in this exact order:
1. **CONTEXT** — the project, language, framework, and relevant file paths or modules.
2. **LIMITS** — what is in scope, what stays out of scope, and any hard constraints (performance, dependencies, compatibility, security, style rules).
3. **EXPECTED OUTCOME** — the concrete deliverable: the behavior, function signature, API shape, or UI result that must exist when the task is complete.
4. **ASSUMPTIONS** — the defaults you will follow, stated so they can be verified at a glance.
5. **REQUEST** — one clear, single imperative instruction describing the task to perform.
</instructions>

<context>
- Project or codebase: [project or repository name]
- Tech stack: [language, framework, and version]
- Task idea: [what should be built, changed, or debugged]
- Relevant files: [file paths or modules involved]
- Audience for the prompt: [AI coding assistant / junior developer / contractor]
- Priority: [correctness / speed / readability / minimal diff]
</context>

<constraints>
- Produce exactly one prompt; do not offer multiple variants.
- Use positive, direct language: state what to do, not what to avoid.
- Keep every section under 4 short sentences.
- Name concrete files, functions, and data shapes instead of vague references such as "the code" or "the system".
- Include testable success criteria and, when relevant, a quick verification step.
- Do not invent project details that conflict with the provided context; mark any true gap as an explicit assumption.
- Use markdown headings for the five sections and bullet lists inside them.
</constraints>

<format>
Return the finished prompt in this shape:

# [Short Task Title]

**CONTEXT**
- ...

**LIMITS**
- ...

**EXPECTED OUTCOME**
- ...

**ASSUMPTIONS**
- ...

**REQUEST**
[single imperative sentence]
</format>

<tone>
Clear, calm, and technical. Write for a competent reader, favor plain words over jargon, and keep every line purposeful.
</tone>

Generate the C.L.E.A.R. prompt now using the context provided above.
Website Source
#text