diff --git a/upstream/corralm-awesome-prompting/README.md b/upstream/corralm-awesome-prompting/README.md new file mode 100644 index 0000000..3e86672 --- /dev/null +++ b/upstream/corralm-awesome-prompting/README.md @@ -0,0 +1,775 @@ +--- +title: "💬 Awesome Prompting" +task: "" +persona: "Sherlock Holmes" +lineage_type: import +upstream_source: https://github.com/corralm/awesome-prompting/blob/a89c511e/README.md +upstream_sha: a89c511e +imported_at: 2026-06-26 +prompt_class: prompt +upstream_changes: accepted +author: upstream +validated: false +--- + +# 💬 Awesome Prompting + +Prompt engineering involves designing effective queries for large language models (LLMs) to generate desired outputs. This guide shares a catalog of patterns and techniques for getting better results from LLMs. + +> Creativity and an openness to exploration are really, really important with these tools. The creativity of the human that's putting in the words for the prompts, who's deciding what goes into that prompt, what gets asked, and what instructions are given are fundamentally important for using these tools effectively. – Dr. Jules White, Vanderbilt University. + +## Table of Contents + +- [Prompt Pattern Catalog](#prompt-pattern-catalog) +- [Prompting Techniques](#prompting-techniques) +- [References](#references) + +## Prompt Pattern Catalog + +Prompt patterns are instructions guiding AI responses for specific tasks and are defined by core *contextual statements* that enhance the precision and relevancy of an output from an LLM. + +There are six categories of prompt patterns in the classification framework defined in [A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT](https://arxiv.org/abs/2302.11382). + +- [Output Customization](#output-customization) +- [Input Semantics](#input-semantics) +- [Prompt Improvement](#prompt-improvement) +- [Interaction](#interaction) +- [Context Control](#context-control) +- [Error Identification](#error-identification) + +### Output Customization + +- [Persona](#persona-pattern) +- [Audience Persona](#audience-persona-pattern) +- [Output Automator](#output-automator-pattern) +- [Visualization Generator](#visualization-generator-pattern) +- [Recipe](#recipe-pattern) +- [Template](#template-pattern) +- [Tail Generation](#tail-generation-pattern) + +[Back to the TOC](#table-of-contents) + +#### Persona Pattern + +Contextual statements: + +- Act as Persona *X*. +- Perform task *Y*. + +Examples: + +```text +Act as Sherlock Holmes. Solve a mystery involving a stolen MacBook. +``` + +```text +Act as a personal trainer. Design a beginner-friendly workout routine for weight loss. +``` + +```text +Act as a Michelin-starred chef. Create a gourmet menu using locally-sourced ingredients. +``` + +```text +Guide me through a meditation practice. Assume you are a soothing meditation coach. +``` + +#### Audience Persona Pattern + +Contextual statements: + +- Explain *X* to me. +- Assume that I am Persona *Y*. + +Examples: + +```text +Explain the importance of eating vegetables to me. Assume that I am a skeptical child. +``` + +```text +Explain the plot of the "Game of Thrones" series to me. +Assume that I am someone who has never watched a single episode. +``` + +```text +Explain the process of photosynthesis. +Assume that I am a curious elementary school student. +``` + +#### Output Automator Pattern + +Contextual statements: + +- Whenever you produce an output that has at least one step to take and the following properties (alternatively, always do this). +- Produce an executable artifact of type *X* that will automate these steps. + +Examples: + +```text +From now on, whenever you create a meal plan with various ingredients for each meal, +generate a Python script that will populate a shopping list with the ingredients. + +The list should adjust quantities based on the number of servings specified. +``` + +```text +From now on, whenever you generate a study schedule for my upcoming exams, +produce a series of Google Calendar events that correspond to each study session. + +Each event should include the subject, study focus, and duration of the study session. +The artifact should be a Google Calendar event. +``` + +```text +Whenever you generate a list of contacts from networking events I've attended, +create a Salesforce script that will update or add these contacts to my CRM. + +Each entry should include the contact's name, company, and role. +The artifact should be a script compatible with Salesforce. +``` + +#### Visualization Generator Pattern + +Contextual statements: + +- Generate an *X* that I can provide to tool *Y* to visualize it. + +Examples: + +```text +Whenever we are discussing a data distribution or statistical information, +generate Python code using matplotlib or seaborn to create a corresponding plot. + +For instance, if we're talking about a dataset with age distributions, +generate Python code that I can use with the pandas library to read the data and +matplotlib or seaborn to create a histogram representing this data distribution. +``` + +```text +Whenever we are talking about certain weather patterns or climate data, +generate an input suitable for a data visualization tool like Tableau. + +For instance, if we're discussing annual rainfall data for different regions, +generate a CSV that I can use in Tableau to create a visualization. +``` + +```text +Whenever I discuss a complex mathematical function, +generate an input for the Desmos Graphing Calculator. + +For example, if I mention the function 'y = sin(x)', +generate a corresponding input that can be directly used in Desmos to plot the function. +``` + +#### Recipe Pattern + +Contextual statements: + +- I would like to achieve *X*. +- I know that I need to perform steps *A*, *B*, *C*. +- Provide a complete sequence of steps for me. +- Fill in any missing steps. +- (Optional) Identify any unnecessary steps. + +Examples: + +```text +I want to become a professional photographer. +I know that I need to buy a camera and start selling my photos. + +Provide a complete sequence of steps for me. Fill in any missing steps. + +- Research different types of cameras +- Buy a camera +- Practice photography regularly +- Create a portfolio +``` + +```text +I would like to drive to San Diego from San Francisco. +I know that I want to go through Big Sur and stay close to the coast as much as possible. + +Provide a complete itinerary. +``` + +#### Template Pattern + +Contextual statements: + +- I am going to provide a template for your output. +- *X* is my placeholder for the content. +- Try to fit the output into one or more of the placeholders that I list. +- Please preserve the formatting and overall template that I provide. +- This is the template: *PATTERN* with *PLACEHOLDERS*. + +Examples: + +```text +Generate a one-day travel itinerary for New York City. + +My placeholders are: +- for the day of the travel plan +- for the place to visit +-