framework/engineering/skills/engineer-prompts-for-reasoning/SKILL.md
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.
npx skillsauth add korchasa/flow engineer-prompts-for-reasoningInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This 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?tools
Delegate a task to another AI IDE's CLI (codex / claude / opencode / cursor-agent) through an isolated-context subagent. Triggers on "delegate to <ide>", "have <ide> do <task>", "execute <task> in <ide>", "offload to <ide>". For one-shot relay or fan-out comparison use `ai-ide-runner` instead.
tools
Run prompts in Claude Code, OpenCode, Cursor, or Codex CLIs from the current session — pick one IDE, fan out across several, or compare models. You are a courier that relays the other runtime's stdout verbatim, do not synthesise your own answer. Use on "run in <ide>", "compare <ide> vs <ide>", "try on <model>", "which IDE handles X better", "run across models".
tools
Recommend which LLM model to use for a task. Use when asked "which model / best LLM for X", "pick a model for this task", or for a model shortlist ranked by live leaderboard evidence (coding, reasoning, agentic, tool-use, price, speed). Live-fetches public leaderboards and ranks models with per-axis rationale and citations.
development
Produce a comprehensive Product Requirements Document (PRD). Use when the user asks to write a PRD or formalize a feature's scope, goals, and success metrics.