logo
P
Prompt Master

Prompt 大师

掌握和 AI 对话的艺术

Prompt Library

A collection of reusable, task-oriented prompt templates

This is your prompt arsenal. We've collected and organized the most practical, battle-tested prompt templates across the industry -- covering everything from basic text classification to complex code generation.

Prompt Lab

Turn this chapter's knowledge into practical skills

Enter the interactive lab and practice Prompt with real tasks. Get started in 10 minutes.

View Now

These templates aren't rigid rules. They're reusable starting points. Copy them, fill in your specific Context and Constraints, and you've got a high-quality prompt in seconds.


Why Use a Template Library?

AdvantageDescription
Save timeSkip the blank-page problem. Start with a proven framework.
Better qualityTemplates bake in techniques that work (Chain-of-Thought, Few-Shot, etc.).
StandardizationUnify your team's prompt style for easier maintenance and collaboration.
Fewer blind spotsGood templates remind you to include context and output format requirements.

Core Prompt Structure

A solid general-purpose prompt usually has four core elements (CRDO):

graph LR
    C[Context<br>Background info] --> P[Prompt]
    R[Role<br>Role assignment] --> P
    T[Task<br>Specific task] --> P
    O[Output<br>Output requirements] --> P

Or as a more intuitive text structure:

# Role
You are a [expert role] skilled in [core competency].

# Context
I'm facing [specific situation/problem] and need [specific goal].

# Task
Please complete the following:
1. [Step 1]
2. [Step 2]

# Constraints
- [Constraint 1, e.g., word limit]
- [Constraint 2, e.g., tone of voice]

# Output Format
Please output in [Markdown/JSON/list] format.

Template Library Navigation

We've organized prompts by task type. Click any link to jump to the template page.

📊 Classification & Analysis

For labeling, sentiment analysis, intent detection, and similar tasks.

🧠 Reasoning & Logic

For tasks that need logical thinking, math, or complex problem-solving.

📝 Generation & Creativity

For writing, brainstorming, image generation prompts, and more.

💻 Coding & Engineering

For code generation, explanation, debugging, and refactoring.

🛡️ Safety & Evaluation

Model security, red teaming, and output quality assessment.

⚠️ Note: Adversarial prompts are for Red Teaming and security research only. Don't use them for malicious purposes.


How to Use These Templates

  1. Copy: Find a template that matches your task, copy it.
  2. Fill: Replace the [variables] with your actual business content.
  3. Test: Run the prompt, observe the output.
  4. Iterate: If the result isn't great, tweak the Context or Constraints until you're happy.

🌟 Universal Starter Template

Not sure which template to use? Start here:

# Role

You are an experienced [domain expert] focused on providing high-quality solutions for [target audience].

# Task

Given the following [input content], perform [specific operation (e.g., analyze, summarize, rewrite)].

# Input Data

"""
[Paste your text/data here]
"""

# Constraints

-   Keep the tone [professional/friendly/objective].
-   Focus on [key point 1] and [key point 2].
-   If you encounter [situation A], then [response action].

# Output

Please output the result in [specific format].

Takeaways

  • Don't memorize templates: Understanding the logic behind them matters more than rote memorization.
  • Context is King: No matter how good the template is, providing accurate, rich context is always the key to better results.
  • Keep iterating: Prompt development is an experimental process. There's no perfect prompt -- only prompts that keep getting better.