Guide to writing prompts for reasoning models (Gemini Pro, GPT-4o, Claude Sonnet), focused on structure and context. Use when the user is writing or tuning prompts for a reasoning or smart model.
54
60%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./plugins/flowai-engineering/skills/engineer-prompts-for-reasoning/SKILL.mdThis guide helps you get the best out of "smart" models (like Gemini 1.5 Pro, Claude 3.5 Sonnet, GPT-4o). These models are capable of complex logic, coding, and creative work, but they need Context and Structure to stay on track.
Reasoning models thrive when you organize information clearly. Think of it like briefing a senior colleague. You don't just give an order; you explain the Background, the Goal, and the Constraints.
We use XML-style tags (like <context>, <rules>) to help the model
understand the structure of your prompt.
Copy this structure for complex tasks.
# ROLE
You are an expert [Role Name].
# GOAL
<objective>
[Clearly state what you want to achieve in 1-2 sentences]
</objective>
# CONTEXT (The "Why" and "What")
<context>
[Provide background info. Who is the audience? What is the current state? What are the definitions?]
</context>
# RULES & CONSTRAINTS
<rules>
1. [Constraint 1 - e.g., Code style]
2. [Constraint 2 - e.g., Word count limit]
3. [Constraint 3 - e.g., "Do not use external libraries"]
</rules>
# INSTRUCTIONS (The "How")
<instructions>
1. First, analyze the request and the context.
2. Think step-by-step about the best approach.
3. [Specific Step 1]
4. [Specific Step 2]
5. Output the final result in [Format].
</instructions>Tags like <context>, <code_snippet>, <examples> help the model separate
different parts of your prompt. It prevents the model from getting confused
between instructions and data.
For coding or writing tasks, ask the model to outline its plan or "think" before generating the final output.
<plan> tags, then write the code."Tell the model exactly what "good" looks like.
# ROLE
You are a Senior TypeScript Engineer.
# GOAL
<objective>
Refactor the provided legacy function to be more readable and performant.
</objective>
# CONTEXT
<context>
This function is part of a high-traffic e-commerce checkout. It handles cart validation.
We are moving to functional programming patterns.
</context>
# RULES
<rules>
1. Use arrow functions.
2. Add JSDoc comments.
3. Do not change the external API signature.
4. Return early to avoid deep nesting.
</rules>
# INPUT CODE
<code_snippet> function validate(cart) { // ... messy code ... } </code_snippet>
# INSTRUCTIONS
<instructions>
1. Analyze the complexity of the current function.
2. Refactor step-by-step.
3. Explain why the new version is better.
</instructions>Before sending your prompt, ask yourself:
<tags> to organize big blocks of text?b4ba256
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.