Skip to content
FreeAIDevTools

AI Prompt Generator

Updated

How do you write a good prompt? A good prompt names a role, states the task, sets constraints and fixes the output format. The generator below puts those four parts together for you: describe the task and pick a tone and format, and it writes a structured prompt that works in ChatGPT, Claude and Gemini. It runs in your browser, and nothing you type is sent anywhere.

Tone:
Format:
Generated Prompt
Your prompt appears here. Fill in the task, and add a role, constraints or examples if you have them.

The Inference Report · Every Tuesday

Know when AI prices change.

One short email every Tuesday: new models, price moves and free tiers that were cut or added. Five minutes, no fluff.

No spam. Unsubscribe anytime.

What is a prompt?

A prompt is the instruction sent to an LLM that tells the model what to produce. Structured prompts compose four explicit pieces: a role, a task, constraints, and an output format. Unstructured prompts skip three of the four and hope the model guesses correctly. We rarely find the guessing pays off.

Compare two versions of the same request. The vague version reads “write me an email about a refund” with no role, no audience, no length cap, and no format. The structured version reads: role, customer-service writer; task, draft a refund email for an order shipped late; constraints, under 100 words, polite tone, no jargon, no apology theater past the first line; format, markdown body only, no subject line. The vague version returns whatever the model defaults to that day. The structured version comes back in the same shape on GPT, Claude and Gemini models, run after run.

How structured prompts work

The role-task-format pattern is the smallest viable scaffold. Role pins the model into a perspective (“senior backend engineer” reads code differently than “junior developer”). Task names the deliverable in one sentence. Format names the shape: bullet list, JSON object, markdown table, single paragraph. Three pieces, three lines, and the model already has more signal than most production prompts ship with.

The RISEN framework extends the same idea into five pieces: Role, Instructions, Steps, End goal, Narrowing. Role and Instructions cover the top of the funnel. Steps decompose the instructions into numbered sub-tasks the model executes in order, which materially reduces hallucination on multi-step reasoning. End goal names the success criterion in measurable terms. Narrowing constrains the output: length, tone, allowed vocabulary, forbidden vocabulary.

A worked code-review prompt: Role, senior backend engineer with 10 years of Python experience. Instructions, identify performance issues in the supplied function. Steps, (1) read the function end to end, (2) flag any O(n^2) or worse complexity, (3) flag any unnecessary I/O inside loops, (4) flag any allocations in hot paths. End goal, a triage list a reviewer can act on in 5 minutes. Narrowing, Python 3.11 only, no third-party libraries assumed, output as a bullet list with each finding tagged severity (low / medium / high). Same model, same code, that prompt produces a structured triage list every time.

Common pitfalls

  • Vague tone with no constraints. “Make it sound professional” gives the model no measurable target. “Professional” could mean a corporate memo, a legal brief, or a technical RFC. We replace tone adjectives with concrete bounds: “under 150 words, second-person prose, no rhetorical questions, no exclamation marks.”
  • Embedding examples without delimiters. When few-shot examples are pasted inline with the instructions, the model cannot reliably tell where the example ends and the actual input begins. We wrap examples in clear delimiters (XML tags for Claude, markdown code fences for GPT) so the boundary is unambiguous.
  • Mixing user content with instructions in one block. Always separate user-variable input from static scaffolding. The system prompt holds the role, constraints, and format, and our system prompt builder gives each one its own tagged section. The user message holds only the variable input. Concatenating the two invites prompt-injection attacks and makes iteration painful, since changing one line of the scaffold means re-pasting the entire conversation.

When to use this tool

We built the generator for three concrete workflows. The first is a team standardizing prompts across multiple agents. When five different engineers ship five different prompts for “summarize this support ticket,” the outputs diverge and so does the eval surface. A shared generator pins everyone to the same role-task-constraints-format scaffold, so the only thing that varies is the variable input. The second is an engineer iterating on a prompt before production deployment. Cutting three versions of the same prompt, running each against a fixed eval set on a cheap model (or on one of the free LLM APIs), and promoting the winner to the production model is a 30-minute loop with the generator and a half-day loop without. Count the tokens in your prompt for each version too, since the shortest one that passes the same tests is the cheapest on every call. The third is teaching prompt engineering to new hires by showing the pieces explicitly. Trainees who see the role / task / constraints / format slots laid out as separate fields internalize the structure faster than trainees handed a finished prompt and told to imitate it.

Frequently asked

What makes a good AI prompt?

Five parts: a concrete role, a specific task, explicit constraints, a named output format and, when the format matters, one or two examples. Compare "write an email about a refund" with "role: customer-service writer; task: draft a refund email under 100 words; format: markdown body only." The second version gives every model the same target, so the output stops changing shape from run to run.

Should I use few-shot examples?

Yes when output structure matters: data extraction, classification, JSON generation and structured rewrites. Two or three examples usually beat a long list of rules and use fewer tokens. Skip them for open-ended creative writing, where examples lock the model into one style, and for genuinely new tasks, where an example can pull the model toward a pattern that doesn't apply.

How long should a prompt be?

Long enough to state the role, task, constraints and format, and no longer. Most production prompts land between 100 and 500 tokens, and below 50 you usually lose precision. Past about 2,000 tokens, split it into a cached system prompt plus a short user message, and measure both in the Token Counter so you know what each call costs.

Do prompts work across different models?

The structure (role, task, constraints, format) carries over well; tone and formatting need light tuning per model family. Claude follows XML tags such as <task>...</task> cleanly, GPT models do well with markdown headings and numbered lists, and Gemini handles plain instructional prose. We keep one main prompt per task plus a short adapter per provider, rather than one giant prompt that tries to please everyone.

Is the RISEN framework worth using?

Yes if you are new to prompt engineering. RISEN (Role, Instructions, Steps, End goal, Narrowing) is a checklist that stops you from forgetting one of the five pieces, which is the most common failure. Experienced prompt writers cover the same ground without naming it; the framework is optional, but the parts it names are not.

Sources: OpenAI's prompt engineering guide · Anthropic's prompt engineering overview · Google's Gemini prompting strategies. How we check our data