.claude/skills/flow-skill-engineer-prompts-for-reasoning/SKILL.md
Guide for writing prompts for reasoning/smart models (Gemini Pro, GPT-4o, Claude 3.5 Sonnet), focused on structure and context.
npx skillsauth add korchasa/ai-skel-ts flow-skill-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
Scaffold a complete AI agent application skeleton with LLM integration, tool calling, observability, cost tracking, session management, and content fetching using @korchasa/ai-skel-ts. Use when the user asks to create an AI agent, add LLM integration, scaffold an AI application, or mentions "ai-skel", "agent skeleton", or "AI scaffold". Works with any programming language.
testing
Create structured specification for large features using phased decomposition. Produces documents/spec-{name}.md with dependency-ordered phases, atomic tasks, explicit boundaries, and per-phase status tracking.
documentation
Guidelines for writing comprehensive Product Requirements Documents (PRD)
development
How to write in informational style