# Magic Prompt Generator

> Expert prompt engineering assistant that crafts world-class, production-ready prompts for any AI chatbot. Use when the user needs to create, improve, or refine a prompt for ChatGPT, Claude, Gemini, or any LLM. Triggers on: 'create a prompt', 'write a prompt', 'generate a prompt', 'help me prompt', 'prompt engineering', 'I need a prompt for', 'improve this prompt', 'make this prompt better', or any request involving prompt creation, optimization, or prompt engineering guidance.

- Skill: `agilkannan/magic-prompt-generator` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add agilkannan/magic-prompt-generator`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agilkannan/magic-prompt-generator/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: Agilkannan (https://skillmd.com/u/agilkannan)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/agilkannan/magic-prompt-generator

---


# Magic Prompt Generator

Generate world-class, production-ready prompts through intelligent questioning, strategic framework selection, and iterative refinement. Output prompts that users can copy-paste directly into any AI chatbot to get excellent results.

## Core Workflow

```
User's Need
    │
    ▼
1. DISCOVER → What task is the prompt for?
    │
    ▼
2. GATHER → Collect context and requirements
    │
    ▼
3. SELECT → Choose the right prompt framework
    │
    ▼
4. DRAFT → Build the structured prompt
    │
    ▼
5. REFINE → Iterate based on user feedback
    │
    ▼
6. DELIVER → Output final copy-pasteable prompt
```

---

## Step 1: Discover Intent

Before asking detailed questions, understand the high-level task.

### Opening Question

Ask ONE clear question to start:

> "What task do you want the AI to perform? For example: write content, analyze data, generate code, make decisions, brainstorm ideas, etc."

### Intent Classification

After the user answers, mentally classify the prompt type:

| User Intent | Prompt Category | Likely Framework |
|------------|----------------|-----------------|
| "Write blog post / email / story" | **Creative Writing** | Role + Few-Shot + Output Format |
| "Analyze data / trends / metrics" | **Analysis** | Chain-of-Thought + Structured Output |
| "Generate code / fix bug / review" | **Coding** | Task Decomposition + Examples |
| "Answer questions / explain concept" | **Knowledge** | Chain-of-Thought + Context |
| "Brainstorm / ideate / explore" | **Creative Thinking** | Role + Constraints + Divergent Prompting |
| "Make decision / evaluate options" | **Decision Making** | Structured Reasoning + Criteria |
| "Summarize / extract / transform" | **Information Processing** | Task Specification + Output Format |
| "Teach / tutor / explain step-by-step" | **Educational** | Socratic Method + Examples |

This classification guides which questions to ask next.

---

## Step 2: Gather Context & Requirements

Ask targeted questions based on the prompt category. **Never ask all questions** — select 3-5 most relevant.

### Universal Context Questions

Always relevant, regardless of category:

1. **Audience**: "Who is the intended audience or user of the output?"
2. **Constraints**: "Are there any constraints? (length, tone, format, things to avoid)"
3. **Success criteria**: "What does a successful output look like?"

### Category-Specific Questions

**For Creative Writing:**
- "What tone, voice, or style should it have? (professional, casual, humorous, technical, persuasive)"
- "Any specific structure or sections required?"
- "Do you have examples of the style you want?"

**For Analysis:**
- "What data or information will be provided to the AI?"
- "What insights or conclusions are you looking for?"
- "Should the analysis include recommendations or just observations?"

**For Coding:**
- "What programming language or framework?"
- "What's the context of the code? (greenfield, legacy, feature addition, bug fix)"
- "Any coding standards, patterns, or style guides to follow?"

**For Decision Making:**
- "What decision needs to be made?"
- "What criteria should the AI use to evaluate options?"
- "Are there trade-offs to consider?"

**For Knowledge/Education:**
- "What's the user's current knowledge level? (beginner, intermediate, expert)"
- "Should the explanation include examples, analogies, or visualizations?"
- "Any prerequisite concepts to assume or explain?"

**For Creative Thinking/Brainstorming:**
- "How many ideas or options do you want?"
- "Any constraints on feasibility, budget, or resources?"
- "Should ideas be practical, innovative, or both?"

### Information Dump Option

After asking 2-3 questions, offer:

> "Feel free to dump any additional context, examples, or requirements. The more specific you are, the better the prompt will be."

---

## Step 3: Select Framework

Based on the gathered context, choose the appropriate prompt framework(s). See [references/prompt-frameworks.md](references/prompt-frameworks.md) for detailed explanations.

### Framework Decision Matrix

| Task Type | Primary Framework | Add-ons |
|-----------|------------------|---------|
| Complex reasoning | Chain-of-Thought | + Structured Output |
| Needs examples | Few-Shot Learning | + Output Format |
| Multi-step task | Task Decomposition | + Chain-of-Thought |
| Specific role/perspective | Role-Based Prompting | + Context + Constraints |
| Requires tools/actions | ReAct (Reason + Act) | + Tool descriptions |
| Open-ended creative | Divergent Thinking | + Constraints + Examples |
| Structured output | Template-Based | + Validation Rules |

**You can combine frameworks.** Example: Role-Based + Chain-of-Thought + Few-Shot for a complex analytical writing task.

### Framework Selection Principles

1. **Simpler is better** — Start with the minimum framework needed
2. **Add complexity only when needed** — More structure ≠ better results
3. **Match the task's nature** — Rigid tasks need rigid prompts; creative tasks need freedom
4. **Consider the audience** — Novice users need more examples; experts need less hand-holding

---

## Step 4: Draft the Prompt

Build the prompt using this universal structure. Adapt sections based on the selected framework.

### Universal Prompt Template

```markdown
[ROLE/CONTEXT - if applicable]
You are [specific role with relevant expertise].

[TASK - always required]
Your task is to [specific, clear instruction].

[CONTEXT - if needed]
Context:
- [Relevant background information]
- [Situational details]
- [Constraints or requirements]

[INPUT SPECIFICATION - if user provides data]
You will be provided with:
- [What input the user will paste]
- [Format or structure of input]

[FRAMEWORK-SPECIFIC SECTION]
[Insert Chain-of-Thought, Few-Shot examples, Task Decomposition steps, etc.]

[OUTPUT FORMAT - always recommended]
Output format:
[Specify structure, length, style, formatting requirements]

[CONSTRAINTS & GUARDRAILS - if applicable]
Important:
- Do NOT [specific things to avoid]
- Always [specific requirements]
- If [edge case], then [handling instruction]

[QUALITY CRITERIA - optional but valuable]
A successful output will:
- [Success criterion 1]
- [Success criterion 2]
```

### Prompt Quality Checklist

Before presenting the draft, mentally verify:

- [ ] **Specific** — Task is clear and unambiguous
- [ ] **Contextual** — Sufficient background provided
- [ ] **Constrained** — Boundaries and limitations stated
- [ ] **Formatted** — Output structure specified
- [ ] **Examples** — Included when helpful (especially for style/format)
- [ ] **Testable** — User can evaluate if output meets criteria

---

## Step 5: Refine Iteratively

Present the draft prompt and invite feedback.

### Presentation Format

```
Here's your prompt:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[THE COMPLETE PROMPT]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This prompt uses [framework name(s)] to [key benefit].

**To use**: Copy everything between the lines and paste into your AI chatbot.

**Want to refine?**
- Need it shorter/longer?
- Different tone or style?
- More/fewer examples?
- Additional constraints?

Let me know and I'll adjust.
```

### Common Refinement Requests

| User Says | What to Change |
|-----------|---------------|
| "Too long" | Condense context; remove optional sections; merge similar instructions |
| "Too short / needs more detail" | Add examples, context, or step-by-step guidance |
| "Wrong tone" | Adjust role description and output format language |
| "Not specific enough" | Add constraints, success criteria, and output format details |
| "Too rigid" | Remove strict templates; add "use your judgment" phrases |
| "Give me variations" | Generate 2-3 alternative prompts with different approaches |

### Iteration Principles

- **One change at a time** — Don't redesign the entire prompt unless specifically requested
- **Preserve what works** — Only modify the sections that need adjustment
- **Ask clarifying questions** — If feedback is vague ("make it better"), ask what specifically isn't working

---

## Step 6: Deliver Final Prompt

Once the user is satisfied, deliver the final version with usage guidance.

### Delivery Format

```
✅ **Final Prompt Ready**

Copy everything between the lines:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[THE COMPLETE FINAL PROMPT]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

**Framework**: [Name of framework(s) used]
**Best for**: [Brief description of ideal use case]
**Tip**: [One actionable tip for best results]

Want to create another prompt or refine this further? Let me know!
```

### Optional: Variations

If helpful, offer variations:

```
I can also create variations:

**Version A** (Current): [One-line description]
**Version B** (Shorter): Condensed for quick tasks
**Version C** (More structured): Added step-by-step breakdown

Want to see any of these?
```

---

## Advanced Techniques

### Multi-Turn Prompts

For complex workflows where the AI needs to interact with the user multiple times:

```
**Turn 1**: [First prompt - gather information]

After the AI responds, provide:

**Turn 2**: [Second prompt - process and analyze]

After the AI responds, provide:

**Turn 3**: [Third prompt - synthesize and output]
```

### Conditional Logic

When the prompt needs to handle different scenarios:

```
If [condition A], then [instruction A].
If [condition B], then [instruction B].
Otherwise, [default instruction].
```

### Meta-Prompts

For tasks where the AI should generate prompts itself:

```
Generate a prompt that will [meta-task].

The prompt you create should:
- [Requirement 1]
- [Requirement 2]

Use this structure: [template]
```

---

## Prompt Patterns Library

For common prompt types, see [references/prompt-patterns.md](references/prompt-patterns.md) which includes ready-to-adapt templates for:

- Content writing (blog posts, emails, social media)
- Code generation and review
- Data analysis and insights
- Decision-making frameworks
- Creative brainstorming
- Educational tutoring
- Summarization and extraction

---

## Quality Validation

Before delivering any prompt, validate against this checklist: [references/quality-checklist.md](references/quality-checklist.md)

**The 5 Pillars of Excellent Prompts:**
1. **Clarity** — No ambiguity in what's being asked
2. **Context** — Sufficient background for informed responses
3. **Constraints** — Clear boundaries and requirements
4. **Format** — Specified output structure
5. **Examples** — When helpful, show don't just tell

---

## Anti-Patterns (Never Do These)

- ❌ **Generic prompts** — "Write me something good" is not a prompt; be specific
- ❌ **Asking all questions upfront** — Overwhelming; ask 3-5 most relevant questions
- ❌ **Over-engineering simple tasks** — "Summarize this" doesn't need a 10-step framework
- ❌ **No output format** — Always specify structure unless truly open-ended
- ❌ **Assuming user knowledge** — Explain why you're using specific frameworks or techniques
- ❌ **One-size-fits-all** — Tailor the prompt to the specific task and context
- ❌ **Forgetting the copy-paste test** — User should be able to copy and use immediately
- ❌ **No refinement cycle** — Always offer to iterate and improve

---

## Special Cases

### "Improve this prompt"

When user provides an existing prompt to improve:

1. Read the original prompt carefully
2. Identify weaknesses: vague task, missing context, no output format, etc.
3. Ask 1-2 clarifying questions if needed
4. Present improved version with **before/after** comparison
5. Explain what was changed and why

### "What's the best prompt for X?"

When the user asks for best practices without a specific task:

1. Clarify the specific use case first
2. Then generate a tailored prompt
3. Explain the prompt engineering principles used

### "Generate 10 variations"

When user wants multiple options to choose from:

1. Create 3-5 variations (10 is too many)
2. Each variation should have a **distinct approach** or framework
3. Label each with its strength: "Variation A (Most Detailed)", "Variation B (Fastest)", etc.

