Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use this skill when writing, improving, or debugging prompts for any AI model — Claude, GPT, Gemini, or Copilot. Also use when designing plan-before-execute workflows, verification patterns, self-improvement loops, or structuring AI instructions for maximum clarity and output quality. Trigger on keywords: prompt, prompt engineering, instruct AI, system prompt, few-shot, chain-of-thought, AI instruction, prompt template, prompt pattern.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 60% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-17 | ✓→✓ | = Same ✓ | 111% | 0% |
| case-22 | ✓→✓ | = Same ✓ | 74% | 0% |
| case-24 | ✓→✓ | = Same ✓ | 58% | 0% |
A great prompt is not a magic spell — it's a specification. The more precisely you define the goal, context, constraints, and output format, the more reliably the AI performs. Think of prompting like writing a function signature: the model is the implementation, you are the interface designer.
The Golden Rule: If the output isn't what you wanted, the problem is almost always in the prompt — not the model.
Every effective prompt has four components:
ROLE: Who the AI should be (expertise, perspective, voice)
GOAL: What you want done (specific, unambiguous task)
CONTEXT: Relevant background, data, constraints, examples
OUTPUT: Exact format, length, structure of the responseROLE: You are a senior TypeScript developer with expertise in React and Next.js.
GOAL: Review this component for performance issues and suggest specific improvements.
CONTEXT: This is a client component in Next.js 15 App Router.
Performance is critical — this renders on every keystroke.
[paste code here]
OUTPUT: List issues as BLOCKER / WARNING / SUGGESTION with specific fix for each.Ask directly with no examples. Works for well-understood tasks.
Write a conventional commit message for this diff: [diff]Provide 2–3 examples before the real task. Best for format-sensitive or pattern-matching tasks.
Examples:
Input: Added login form → Output: feat(auth): add login form with email/password
Input: Fixed null crash → Output: fix(api): handle null response from user endpoint
Now write a commit message for: [diff]Force step-by-step reasoning. Add "Think step by step" or "Reason through this before answering."
Is this API design RESTful? Think step by step before answering.Set expertise level and perspective upfront.
You are a security engineer specializing in OWASP Top 10.
Review this authentication code for vulnerabilities.Use clear separators to prevent the model from confusing instructions with content.
Refactor the following code:
"""
[code here]
"""
Rules: No external dependencies. TypeScript only. Preserve existing tests.For critical decisions, run the same prompt 3 times and take the majority answer. Reduces variance on high-stakes reasoning.
Force the model to explore multiple approaches before committing.
Propose three different approaches to solve this problem.
For each approach, list pros, cons, and implementation complexity.
Then recommend the best one with justification.Interleave reasoning with action steps. Best for agentic or multi-step tasks.
Thought: What do I need to understand before solving this?
Action: [tool or analysis]
Observation: [result]
Thought: Based on this, the next step is...Ask the model to critique its own output before finalizing.
After generating your answer, critically evaluate it:
- Are all steps logically valid?
- Are there unsupported assumptions?
- What could go wrong with this approach?
Correct any issues before presenting the final answer.Structured template for complex prompts:
Never let AI jump straight to implementation for non-trivial tasks.
Step 1 — Plan: Outline your approach step by step.
Do NOT write any code yet.
Step 2 — Review: I will confirm the plan before you proceed.
Step 3 — Execute: Implement each step from the approved plan.Always instruct the AI to verify its own work before presenting it.
Before finalizing your answer:
1. Check that all steps are logically sound
2. Verify no assumptions were made that weren't stated
3. Confirm the output matches the requested format
4. Correct any issues you find
Then present the final answer.For code specifically:
After writing the code:
1. Trace through it mentally with a simple test case
2. Check all edge cases (null, empty, boundary values)
3. Verify error handling is present
4. Confirm it matches the requirements exactlyWhen the AI makes a mistake, don't just fix it — extract the lesson:
I noticed an error in your previous response: [describe error]
1. Explain why this error occurred
2. State the general rule that would prevent it
3. Apply that rule to the corrected answerFor long sessions, maintain a lessons log:
Update your working notes with this lesson:
[lesson from the correction]
Apply this to all remaining tasks in this session.| Model | Strengths | Best Practices | |---|---|---| | Claude | Long context, nuanced reasoning, following complex instructions | Use XML-style tags for structure, provide CLAUDE.md for project context, explicit role assignment | | GPT-4/4o | Strict format adherence, JSON output, code generation | Put instructions at top, use delimiters, hint at language with imports | | Gemini | Research, citations, massive context windows, multi-modal | Request citations explicitly, define scope and time range, specify how to handle uncertainty | | Copilot | In-editor context awareness, code completion | Use .github/copilot-instructions.md for project context, be explicit about stack |
| Anti-Pattern | Problem | Fix | |---|---|---| | "Write code for X" | Too vague | Add role, constraints, output format | | Treating first answer as final | Misses errors | Always include verification step | | No examples for format-sensitive tasks | Wrong format | Add 2–3 few-shot examples | | Skipping role assignment | Generic tone/depth | Always assign a specific expertise persona | | Concatenating user input into system prompt | Prompt injection risk | Use delimiters, validate input, separate concerns | | Over-prompting simple tasks | Wastes tokens | Match prompt complexity to task complexity |
""" or XML tags to clearly separate instructions from user content.references/prompt-templates.md — Ready-to-use prompt templates for common dev tasksai-prompting-patterns skill — Agent communication and intent clarification patternsai-agent-design skill — Building full agentic systemsOther measured skills in the registry, with their headline benchmark lift.