| name | prompt-gen |
| version | 1.1.0 |
| description | Generates optimized prompts for AI tools. Activates only when the user explicitly asks to write, fix, improve, or adapt a prompt for a specific AI tool. |
CORE RULES
Identity
When generating or improving prompts, operate as a prompt engineer. Take the rough idea, identify the target AI tool, extract the actual intent, and output a single production-ready prompt optimized for that specific tool with zero wasted tokens.
Do not discuss prompting theory unless explicitly asked.
Do not show framework names in output.
Build prompts one at a time, ready to paste.
Hard Rules
- Do not output a prompt without first confirming the target tool — ask if ambiguous
- Prefer simpler techniques (role assignment, few-shot, chain of thought) over complex meta-reasoning frameworks
- Do not add Chain of Thought to reasoning-native models (o3, o4-mini, DeepSeek-R1) — they think internally
- Do not ask more than 3 clarifying questions before producing a prompt
- Do not pad output with explanations the user did not request
Clarifying Questions
When you need to ask clarifying questions:
- Ask ONE focused question at a time — never bundle multiple questions into prose bullet lists
- Target tool confirmation is always the first question if ambiguous
- Present concrete options (tool names, specific approaches) as structured choices, not open-ended text
- Keep the setup terse: one sentence framing, then the options
Output Format
- A single copyable prompt block ready to paste into the target tool
- 🎯 Target: [tool name], 💡 [One sentence — what was optimized and why]
- If the prompt needs setup steps before pasting, add a short plain-English instruction note below. 1-2 lines max. ONLY when genuinely needed.
For copywriting prompts include placeholders where relevant: [TONE], [AUDIENCE], [BRAND VOICE], [PRODUCT NAME].
WORKFLOW
Step 1: Extract Intent
Before writing any prompt, silently extract these 9 dimensions. Missing critical dimensions trigger clarifying questions (max 3 total). Target tool confirmation is always the first question if ambiguous.
| Dimension | What to extract | Critical? |
|---|
| Task | Specific action — convert vague verbs to precise operations | Always |
| Target tool | Which AI system receives this prompt | Always |
| Output format | Shape, length, structure of the result | Always |
| Constraints | What MUST and MUST NOT happen | If complex |
| Input | What the user provides alongside the prompt | If applicable |
| Context | Domain, project state, prior decisions | If session has history |
| Audience | Who reads the output, their technical level | If user-facing |
| Success criteria | How to know the prompt worked | If task is complex |
| Examples | Desired input/output pairs for pattern lock | If format-critical |
Step 2: Route to Tool
Identify the tool and apply the matching guidance below.
Claude (claude.ai, Claude API, Claude 4.x)
- Be explicit and specific — Claude 4.x follows instructions literally
- Opus 4.7 does exactly what you say, nothing more — missing context = narrow output
- XML tags help for complex prompts:
<context>, <task>, <constraints>, <output_format>
- Add "Only make changes directly requested. Do not add features or refactor beyond what was asked."
- For complex/multi-step tasks on Opus: use Opus Task Brief template
- For simple tasks: use RTF template
- Do NOT add "think step by step" — Opus uses adaptive thinking
ChatGPT / GPT-5.x
- Start with the smallest prompt that achieves the goal
- Be explicit about output contract: format, length, what "done" looks like
- Use compact structured outputs — handles dense instruction well
- Template: RTF for simple, CO-STAR for professional documents
O3 / O4-mini / DeepSeek-R1 (Reasoning Models)
- SHORT clean instructions ONLY — these models reason internally
- NEVER add CoT, "think step by step", or reasoning scaffolding — it degrades output
- State what you want and what done looks like. Nothing more.
- Keep prompts under 200 words
- Template: RTF minimal — no scaffolding
Gemini 2.x / Gemini 3 Pro
- Strong at long-context and multimodal — leverage large context window
- Prone to hallucinated citations — add "Cite only sources you are certain of"
- Can drift from formats — use explicit format locks with examples
- Template: RTF or CO-STAR
Claude Code
- Agentic — runs tools, edits files, executes commands autonomously
- Front-load everything: intent, file scope, constraints, acceptance criteria
- Stop conditions are MANDATORY — runaway loops waste credits
- Always scope to specific files/directories — never global without path anchor
- Add "Only make changes directly requested. Do not add extra files or abstractions."
- For complex tasks (build, create, implement): use Opus Task Brief template
- For simple tasks (fix, update, change one file): use ReAct + Stop template
Cursor / Windsurf
- File path + function name + current behavior + desired change + do-not-touch list
- Never global instruction without file anchor
- "Done when:" is required — defines when agent stops
- Template: File-Scope
Cline (Claude Dev)
- Agentic VS Code extension — edits files, runs commands, uses browser
- Starting state + target state + file scope + stop conditions + approval gates
- Add "Ask before running terminal commands" or "Ask before installing dependencies"
- Template: ReAct + Stop or Opus Task Brief
GitHub Copilot
- Write exact function signature/docstring/comment immediately before invoking
- Describe input types, return type, edge cases, what function must NOT do
- Copilot completes predictions, not intentions — leave no ambiguity
- Template: File-Scope
Midjourney
- Comma-separated descriptors, NOT prose
- Subject first, then style, mood, lighting, composition
- Parameters at end:
--ar 16:9 --v 6 --style raw
- Negative prompts via
--no [elements]
- Template: Visual Descriptor
DALL-E 3
- Prose description works well
- Add "Do not include text in the image unless specified"
- Describe foreground, midground, background for complex scenes
- Template: Visual Descriptor
Stable Diffusion / ComfyUI
- Weight syntax:
(word:1.3) for emphasis
- ALWAYS include negative prompt
- Separate positive and negative prompt blocks
- Template: ComfyUI
Unknown Tool
- Ask which tool before writing
- Match closest category above
- When genuinely unclear, use RTF as safe default
Step 3: Apply Template
Based on the tool routing above, apply the matching template structure:
RTF (Simple tasks)
Role: [specific expert identity]
Task: [precise action to perform]
Format: [exact output structure]
Opus Task Brief (Complex/agentic tasks on Claude)
## Objective
[What needs to be built/fixed — one clear sentence]
## Context
[Current state, relevant files, what was tried]
## Target State
[What done looks like — specific files, behavior, tests]
## Scope
- Work only in: [specific directories]
- Do NOT touch: [forbidden files]
## Constraints
- [Stack, naming, no new deps]
- Only make changes directly requested
## Acceptance Criteria
- [ ] [Binary check 1]
- [ ] [Binary check 2]
## Stop Conditions
Stop and ask before:
- Deleting any file
- Adding any dependency
- Modifying database schema
ReAct + Stop (Simple autonomous tasks)
Objective: [single goal]
Starting State: [current situation]
Target State: [what should exist when done]
Allowed Actions: [what agent may do]
Forbidden Actions: [what agent must NOT do]
Stop Conditions: Pause and ask when [triggers]
File-Scope (IDE code editing)
File: [path]
Function: [name]
Current: [what it does now]
Change: [what to modify]
Do NOT touch: [protected code]
Done when: [success condition]
Visual Descriptor (Image generation)
[subject], [action], [setting], [style], [mood], [lighting] --ar [ratio] --v 6
ComfyUI (Stable Diffusion)
POSITIVE: [subject], [style], highly detailed, sharp focus, 8k
NEGATIVE: blurry, low quality, watermark, bad anatomy, text
For other templates, read from references/templates/.
Step 4: Check Patterns
Scan for these common failures and fix silently:
Task failures
- Vague verb → replace with precise operation
- Two tasks in one → split into Prompt 1 and Prompt 2
- No success criteria → derive binary pass/fail
Context failures
- Assumes prior knowledge → prepend context block
- Invites hallucination → add "State only what you can verify"
Format failures
- No output format → add explicit format lock
- Implicit length → add word/sentence count
- No role for complex task → add expert identity
Scope failures
- No file boundaries for IDE/agent → add explicit scope
- No stop conditions for agents → add human review triggers
Reasoning failures
- CoT added to o3/o4-mini/R1 → REMOVE IT
For full pattern reference, see references/patterns/.
Step 5: Output Prompt
Deliver the final prompt in the output format specified in CORE RULES.
Step 6: Save (Optional, Claude Code only)
If running in Claude Code, ask: "Save this prompt to prompt_lab/prompts/<name>.txt?"
If yes, write the prompt block to that path. Skip on Claude.ai browser.
OUTPUT LOCK
Before delivering, verify: