llm notes
Introduction
Below is a list of text expander prompts that I currently use with the MacOS and iOS level Text Replacements feature. They will work with any text expander that supports the <prompt> and </prompt> tags, unfortuntately the MacOS Text Expander app does't support JSON,and has a 2000 character limit, so when I want to strucuture them a bit more I'll use Raycast mostly and sometimes Alfred, depening on what machine I'm on. I've been using these for a while now and they've been working well for me.
Resources
- The Prompt Report by Sander Schulhoff, Michael Ilie, Nishant Balepur, Konstantine Kahadze, Amanda Liu, Chenglei Si, Yinheng Li, Aayush Gupta, HyoJung Han, Sevien Schulhoff, Pranav Sandeep Dulepet, Saurav Vidyadhara, Dayeon Ki, Sweta Agrawal, Chau Pham, Gerson Kroiz, Feileen Li, Hudson Tao, Ashay Srivastava, Hevander Da Costa, Saloni Gupta, Megan L. Rogers, Inna Goncearenco, Giuseppe Sarli, Igor Galynker, Denis Peskoff, Marine Carpuat, Jules White, Shyamal Anadkat, Alexander Hoyle, Philip Resnik
- Blog for structured prompting, Rémi Louf, Clément Vanden Driessche, Will Kurt, Daniel Gerlanc, Brandon T. Willard, Jeffrey Enos, Daniel Quernheim, Noé Gersanois, Aaron Schwartz, Maxime Lhoustau, and Schlager Gold
- How to write good prompts: using spaced repetition to create understanding, Andy Matuschak
- Prompting Fundamentals and How to Apply them Effectively, Eugene Yan
- Anthropic's Prompt Engineering Guide
- OpenAI's Six Strategies for Better Results
- OpenAI's Structured Outputs Guide
- OpenAI's Best Practices for Prompt Engineering
- Use the latest model: Newer models tend to be easier to prompt engineer.
- Place instructions at the beginning: Put instructions at the start of the prompt and use separators like ### or """ to distinguish between instructions and context.
- Be specific and detailed: Provide clear context, desired outcome, length, format, and style in your prompts.
- Articulate desired output format: Use examples to show the specific format requirements.
- Start simple, then refine: Begin with zero-shot prompts, move to few-shot if needed, and consider fine-tuning for complex tasks.
- Avoid imprecise descriptions: Use concrete terms and specific instructions instead of vague language.
- Provide alternatives: Instead of just saying what not to do, specify what to do instead.
- Use "leading words" for code generation: Guide the model towards specific patterns when generating code.
- How I Use "AI" by Nicholas Carlini
- Anthropic's Courses
- Jina AI Documentation
- Enhance Your Prompts with Meta Prompting
- Optimizing Prompts
Cursor Resources
Text Expander Prompts
Shortcuts
- /alt
- /bl
- /brow
- /bull
- /c
- /cite
- /code
- /counter
- /cur
- /debate
- /decide
- /eval
- /first
- /gametheory
- /git
- /golf
- /invert
- /meta
- /pplx
- /pr
- /pre
- /re
- /reo
- /scenario
- /second
- /simulate
- /step
- /story
- /sum
- /summ
- /think
- /time
- /visual
- /visualspace
- /webcode
- /phase1
- /phase2
- /phase3
- /phase4
- /phaseall
Prompt Details
- /alt: Please provide 2-3 alternative viewpoints or approaches to the topic/problem discussed in your last response. Explain the reasoning behind each alternative.
- /bl: Please output the latest version in a single code block for easy copying and pasting.
- /brow: use your browsing capability
-
/bull: Desired Output Format:
- Use lists for structured information.
- Follow a semantic tree-like format.
- Clarity:
- Make the prompt straightforward and easily understandable.
- Avoid complex language or jargon.
- Specificity:
- Include precise instructions and detailed descriptions.
- Specify context or background for tasks or questions.
- Hierarchy:
- Outline main points and sub-points clearly.
- Use indentation or numbering for readability.
- Relevance:
- Focus content solely on the core objective of the prompt.
- Remove unrelated information.
- Addressing Vagueness:
- Narrow down broad prompts by suggesting specific angles or perspectives.
- Enhancing Details:
- Add elements or questions to provide more depth.
- Clarifying Ambiguity:
- Identify ambiguous terms or phrases and clarify them.
- /c: continue and expand
- /cite: For the information provided in your last response, please cite relevant sources or references where possible. Use a standard citation format and provide links if available.
- /code: Please don't break any existing code and only refactor if necessary.
- /counter: Please present the strongest counterarguments or criticisms to the main points in your last response. For each counterargument, also provide a possible rebuttal.
- /cur: please write this out as a prompt optimized for an llm with read and write capabilites and these files in its context window.
-
/debate: Please present a debate on the topic of your last response. Provide arguments for both sides, structured as follows:
- Argument For:
- [Point 1]
- [Point 2]
- [Point 3]
- Argument Against:
- [Point 1]
- [Point 2]
- [Point 3]
- Argument For:
-
/decide: Based on the information in your last response, please outline a decision-making framework. Include:
- Key factors to consider
- Potential decision criteria
- Methods for weighing different options
- Strategies for handling uncertainty or conflicting priorities
- Potential pitfalls to avoid in the decision-making process
-
/eval: Please evaluate your previous response. Consider:
- Accuracy: Is all information correct?
- Completeness: Did you address all aspects of the query?
- Clarity: Was the explanation clear and easy to understand?
- Bias: Was there any unintended bias in the response?
- Improvements: How could the response be enhanced?
-
/first: Apply first principles thinking to the topic/problem discussed above. Follow these steps:
- Identify the fundamental truths or elements of the topic/problem.
- Question all assumptions and break down complex ideas into basic components.
- Rebuild the concept from the ground up using only essential elements.
- Propose innovative solutions or insights based on this fundamental understanding.
- Compare your first principles approach to conventional wisdom. What new perspectives emerge?
-
/gametheory: Please analyze the main concept from your last response using principles of game theory. Include:
- Who the 'players' are in this scenario
- What their potential strategies and payoffs might be
- Whether this represents a zero-sum or non-zero-sum game
- How different game structures (cooperative, competitive, etc.) might apply
- What equilibrium states might exist
- /git: I would like you to act as a copy editor for the following text. Please provide your suggested edits and changes in git diff format, using lines that start with `-` to indicate deletions and lines that start with `+` to indicate additions or changes. If you have comments about certain edits, you can include them after the relevant line starting with `#`. Here is the text to be edited: ``` [paste the text to be edited here] ``` Please provide your edits in a code block using git diff format.
-
/golf: Code Golf Challenge: Minimize Your Strokes!
- Objective:
- Welcome to our code golf tournament! Your mission is to refactor and simplify the provided code, aiming for the lowest 'stroke count' (i.e., number of characters) while maintaining or enhancing functionality and performance.
- Rules of the Game:
- Minimize the total character count, including spaces and newlines.
- Maintain all existing functionality without introducing bugs.
- Optimize for improved performance where possible (e.g., reduced time complexity, lower memory usage).
- Code must be valid and runnable in the original language.
- Readability is a nice-to-have but not required - clever 'one-liners' are welcome!
- Course Hazards (Constraints):
- No external libraries or functions unless already imported in the original code.
- Maintain the same input and output structure as the original code.
- Comments don't count towards the stroke total but should be minimal.
- Scoring:
- Primary: Total character count (lower is better)
- Bonus: Performance improvements (if demonstrable)
- Penalty: Introducing bugs or changing functionality
- Caddie Tip: Provide a brief explanation of your key optimizations and any clever tricks used in your solution.
- Example Hole:
- Original code (Python, 117 characters):
def calculate_sum(numbers): total = 0 for number in numbers: total = total + number return total result = calculate_sum([1, 2, 3, 4, 5]) print('The sum is:', result)
- Hole-in-one (29 characters):
print(sum([1,2,3,4,5]))
- Explanation: Used Python's built-in `sum()` function and removed unnecessary variables and strings, reducing from 117 to 29 characters while maintaining functionality.
- Original code (Python, 117 characters):
- Ready to tee off? Show us your best swing at optimizing the provided code. May the shortest code win!
- Objective:
-
/invert: Apply inversion thinking to the goal/problem discussed above. Follow this process:
- Clearly restate the original goal/problem.
- Invert the situation: What would cause the worst possible outcome?
- List potential pitfalls, obstacles, or undesired results.
- For each identified issue:
- Explain why it's problematic
- Suggest strategies to avoid or mitigate it
- Synthesize your findings into a robust plan that preemptively addresses these challenges.
- Reflect on how this inverted approach provides new insights or strategies.
-
/meta: Please provide a meta-analysis of your last response. Consider:
- The assumptions underlying your response
- Potential biases in the information or perspective provided
- Limitations of the current understanding or approach
- Areas where more research or information is needed
- How different disciplines or perspectives might approach this topic
-
/pplx: Please analyze and enhance the following prompt, considering these key aspects specific to Perplexity's capabilities:
- Clarity: Is the prompt clear and unambiguous? Suggest improvements if necessary.
- Specificity: Does it provide sufficient detail and context? Add necessary specifics.
- Relevance: Is all information pertinent to the task and suitable for Perplexity's internet-connected, reasoning, and programming capabilities? Remove any irrelevant details.
- Structure: Is it logically organized with a coherent flow? Propose structural improvements if needed.
- Constraints: Are appropriate boundaries and limitations set, considering Perplexity's 2000-token limit and source filtering options (e.g., social sources, scientific sources)? Define or adjust them as necessary.
- Examples: Would examples help illustrate the task? If so, suggest relevant ones.
- Tone and Style: Is the tone suitable for the intended audience and purpose? Adjust as required.
- Creativity Encouragement: For open-ended tasks, does it foster creative thinking while leveraging Perplexity's reasoning and programming capabilities? Enhance it to encourage creativity.
- Error Prevention: Does it preempt common misunderstandings, especially in the context of Perplexity's features? Clarify to prevent potential errors.
- Evaluation Criteria: Are success criteria or evaluation metrics provided, if applicable? Specify them clearly.
Original Prompt:
<prompt> - /pr: <prompt>
- /pre: </prompt>
-
/re: Analyze and enhance the given prompt:
- Structure: Assess organization, suggest improvements, recommend formatting.
- Content:
- Clarify ambiguities
- Evaluate detail level
- Remove unnecessary info, add crucial details
- Ensure appropriate constraints
- Suggest examples if needed
- Input Variables: Identify minimal set, ensure clear definition and placement.
- Instructions:
- Assess clarity and completeness
- Suggest steps for complex tasks
- Recommend error prevention
- Encourage creativity for open-ended tasks
- Output Format: Specify format, request justifications, include evaluation criteria if relevant.
- Tone: Ensure appropriate language and formality.
- Analyze original prompt
- Provide brief <Analysis>
- Rewrite in <Improved_Prompt>
- Summarize changes in <Explanation>
- Use <thinking> tags to reason through your analysis and improvements
- If you detect any mistakes, use <reflection> tags to correct yourself
- Provide your final, refined response in <output> tags
-
/reo: Analyze the following coding prompt and suggest improvements based on:
- Problem decomposition: Is the task broken into logical steps?
- Input/output: Are inputs and outputs clearly defined?
- Edge cases: Does it consider edge cases and error handling?
- Algorithm design: Does it encourage outlining the algorithm first?
- Code structure: Does it specify functions, classes, or modules?
- Performance: Does it address time and space complexity?
- Language features: Does it encourage idiomatic use?
- Scalability: Does it consider future extensibility?
-
/scenario: Based on the information in your last response, please provide a brief scenario analysis. Include:
- A best-case scenario
- A worst-case scenario
- A most likely scenario
-
/second: Apply second-order thinking to the decision/action discussed above. Follow these steps:
- Briefly recap the immediate or first-order effects of the decision/action.
- Identify potential second-order consequences:
- What are the likely reactions to the initial effects?
- How might these reactions create further changes or impacts?
- Explore third-order effects or beyond, if applicable.
- Consider both positive and negative potential outcomes.
- Analyze how different stakeholders might be affected over time.
- Propose strategies to maximize positive long-term impacts and mitigate negative ones.
- Reflect on how this second-order analysis changes your perspective on the initial decision/action.
-
/simulate: Please design a thought experiment or hypothetical scenario that explores the implications of the concept from your last response. Include:
- A clear setup of the hypothetical situation
- Key variables or factors to consider
- Potential outcomes under different conditions
- What insights this simulation provides about the original concept
-
/step: Solve a complex problem using this structured process to arrive at the single best solution:
Problem Definition (max 50 words): State the problem clearly. Provide essential context. List key constraints.
Idea Generation (5-7 ideas, 1-2 sentences each): Number each idea for easy reference.
Idea Evaluation (for each idea):
- Potential benefits (1-2 points)
- Potential drawbacks (1-2 points)
- Overall viability score (1-10 scale, 10 being best)
- Briefly justify your score
- Identify the top 2-3 ideas based on viability scores
- Analyze how these ideas could be combined or enhanced
- Synthesize them into a single, optimal solution
- Explain why this solution is superior to the individual ideas
- Address the main potential weakness of your chosen solution
- Explain how you'll leverage its key strength
- Briefly compare it to the next-best alternative, highlighting why your choice is better
- List 3-5 concrete action steps for your chosen solution
- Identify 1-2 potential obstacles for each step
- Briefly suggest how to overcome each obstacle
- Propose 2-3 specific, measurable success metrics for your solution
- Explain how each metric directly relates to solving the original problem
- Continuously focus on converging towards the single best solution
- Balance creativity with practicality
- Justify key decisions with clear reasoning
-
/story: Please reframe the information from your last response in the form of a story or narrative. Include:
- A clear beginning, middle, and end
- Characters or entities that represent key concepts
- A plot that illustrates the main points or processes
- A conclusion that reinforces the key takeaways
- /sum: Summarize all of my commands in this conversation into one prompt, that I can reuse later.
- /summ: 1.) Analyze the input text and generate 5 essential questions that, when answered, capture the main points and core meaning of the text. 2.) When formulating your questions: a. Address the central theme or argument b. Identify key supporting ideas c. Highlight important facts or evidence d. Reveal the author's purpose or perspective e. Explore any significant implications or conclusions. 3.) Answer all of your generated questions one-by-one in detail.
- /think: Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches. Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed. Use <count> tags after each step to show the remaining budget. Stop when reaching 0. Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress. Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process. Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach: 0.8+: Continue current approach 0.5-0.7: Consider minor adjustments Below 0.5: Seriously consider backtracking and trying a different approach If unsure or if reward score is low, backtrack and try a different approach, explaining your decision within <thinking> tags. For mathematical problems, show all work explicitly using LaTeX for formal notation and provide detailed proofs. Explore multiple solutions individually if possible, comparing approaches in reflections. Use thoughts as a scratchpad, writing out all calculations and reasoning explicitly. Synthesize the final answer within <answer> tags, providing a clear, concise summary. Conclude with a final reflection on the overall solution, discussing effectiveness, challenges, and solutions. Assign a final reward score.
- /time: Please provide a brief timeline or historical context for the topic discussed in your last response. Include key dates, events, or developments that have shaped our understanding of this subject.
- /visual: Please describe how the main concept from your last response could be represented visually. This could be in the form of a diagram, chart, or infographic. Provide enough detail that a graphic designer could potentially create the visual from your description.
-
/visualspace: Please explain the main concept from your last response using visual-spatial relationships. Describe:
- A mental image or diagram that represents the concept
- How different elements are arranged in space
- How movement or transformation within this visual representation illustrates key points
- Color, size, or shape analogies that enhance understanding
-
/webcode: Write complete, functional web code (Next.js, React, Vue, JS, HTML, CSS). Use Tailwind for styling. Incorporate shadcn/ui and Radix UI components when appropriate. Guidelines:
- Write entire code in one response. Use proper formatting.
- Include necessary imports and components.
- Add brief comments for complex logic.
- If cut off, continue without repeating.
- For Vue, focus on single-page components.
- Utilize Tailwind classes for styling.
- Prefer shadcn/ui components when available.
- Ensure responsive design.
- Handle basic error states.
- Briefly explain component purpose and usage.
Four-Phase Problem-Solving Approach
The following four prompts are designed to be used sequentially for a comprehensive problem-solving approach. They guide you through idea exploration, task decomposition, solution planning, and iterative refinement.
- List the primary goals and constraints.
- Analyze potential ideas for achieving these goals.
- Prioritize the most important aspects to focus on.
- Define each sub-task and its dependencies.
- Outline the specific operations and logic required for each sub-task.
- Integrate sub-tasks into a coherent sequence.
- Develop a comprehensive solution plan covering all aspects.
- Translate the plan into detailed pseudocode with specific actions.
- Ensure logical flow and coherence throughout the plan.
- Draft initial pseudocode based on the solution plan.
- Review and refine with feedback and error checks.
- Finalize with clear documentation for each step.
- List the primary goals and constraints.
- Analyze potential ideas for achieving these goals.
- Prioritize the most important aspects to focus on.
- Define each sub-task and its dependencies.
- Outline the specific operations and logic required for each sub-task.
- Integrate sub-tasks into a coherent sequence.
- Develop a comprehensive solution plan covering all aspects.
- Translate the plan into detailed pseudocode with specific actions.
- Ensure logical flow and coherence throughout the plan.
- Draft initial pseudocode based on the solution plan.
- Review and refine with feedback and error checks.
- Finalize with clear documentation for each step.