HACKER Q&A
📣 interstice

What are your most used Chat GPT prompts


At the moment it seems like discussion of GPT prompts falls largely into two camps. 1) The camp that has adopted GPT and uses it daily or 2) The camp that can’t seem to get anything useful out of GPT despite multiple attempts. Since 2 often asks 1 what they use GPT for I thought a thread might be a useful place to collect some examples!


  👤 cloudking Accepted Answer ✓
The most effective way I've found to prompt GPT-4 is to ask it to create the optimal prompt for you. Try this meta prompt to help craft your prompts:

--

I create separate conversation threads for each expert persona of GPT. You are PromptGPT. You are a prompt engineer expert for large language models. You know exactly what to write in the most efficient wording possible to achieve the desired responses from ChatGPT. I will tell you what my goal for a thread is and you will write an optimized initial prompt in the most efficient format possible that will serve as the initial prompt when creating a new conversation thread with a GPT model. You will define the expert persona, the parameters or rules of the responses, you should also provide any other information that a GPT thread may need to understand exactly what it needs to do to give me the most accurate answers depending on my goal with that particular thread and the tone of voice, within the prompt you provide.

Are you ready or is there any other information you need to perform this job to your best ability

--


👤 CSMastermind
I don't have any prompts that I reuse, I normally just talk to it like a person and get it to write code or get information out of it.

Where I see people fail is when they give it sentence fragments like it's a search engine.

Here's an example of something I've prompted it with:

> I'm building a commerce application and debugging issues with our data feed. In order to debug further I need to get a list of products that are out of stock and some additional information about them.

> Calling this endpoint with a GET request will return all out of stock products: <>

> The shape of the response will be an object that has two properties: data and pagination. The data property will be an array of product objects. Those objects will have a property called id.

> Calling this endpoint with a GET request will return information about that product in the context of a specific vendor: <>

> Where {productId} is replaced with the id of the specific product extracted from the previous request.

> That endpoint will return a response that is an object with a property called data that will be an array with a single object in it (since we only requested information about one product).

> The object in that array will have the properties id and name and availableFrom among others.

> availableFrom will be an array with a single object in it and that object will have the properties sku and link among others.

> Please write a script in JavaScript that makes a request to the initial endpoint to get all items that are out of stock and then calls the second endpoint with the relevant productId for every product returned. The script should then extract the properties id, name, sku, and link then save that data to a CSV file where each product from the original endpoint request is represented as a single row in the file with the relevant data in it.

> Let me know if you have any questions.


👤 mpalmer
"Help me work through an [idea/plan/problem] by asking the next Socratic-method-style question."

Short and sweet, use it every day for anything.


👤 disambiguation
The best trick I've learned is to end a prompt with: "please ask any clarifying questions before generating an answer."

👤 nagonago
My usual custom instructions, tweaked as needed:

You are an expert programming assistant. You specialize in Python and ES6. Answer in concise code blocks only. No explanations, only code. Code blocks should contain no comments, only code. You can also help with Linux command line (bash).


👤 suprfsat
a highly downvoted comment on the hackernews thread "Ask HN: What are your most used Chat GPT prompts". how about a list of 10

1. "Prompt: 'What's your favorite color, and why is it the best?'"

2. "Prompt: 'Share your most boring daily routine in excruciating detail.'"

3. "Prompt: 'Why do you think pineapple on pizza is a culinary masterpiece?'"

4. "Prompt: 'Tell me about a conspiracy theory you wholeheartedly believe in.'"

5. "Prompt: 'Defend your unpopular opinion on a widely loved movie or TV show.'"

6. "Prompt: 'Explain why Mondays are the best day of the week.'"

7. "Prompt: 'Share your least favorite type of food and why everyone should hate it too.'"

8. "Prompt: 'Convince me that socks with sandals are a fashionable choice.'"

9. "Prompt: 'Describe the most uneventful dream you've ever had.'"

10. "Prompt: 'Share your top 10 reasons for procrastinating and avoiding productivity.'"


👤 Frummy
I usually say "provide a super simple example" or something in that style when it explains theoretical stuff

👤 jamesponddotco
I mostly use it to write tests for my Go code with the prompt below:

"Acting as an expert Go developer, write a full coverage black-box table-driven test with sub-tests for the code below. Please use 'tests' for the table of test cases and 'tt' for each test case in the range clause. Be concise."

It works pretty well and have been tweaked a bunch to get to that point.

I also use the following custom instructions, which influence the tests as well.

"You're the user's senior, inquisitive, and clever pair programmer.

Coding process:

1. Show concise step-by-step reasoning.

2. Prioritize tasks/steps you'll address in each response.

3. Finish one file before the next.

4. If needed, interrupt yourself and ask to continue.

When providing advice, reviewing, or writing code, adhere to the following guidelines:

- Follow the Uber Go style guide.

- Use the latest version of Go.

- Follow Go best practices for writing idiomatic code.

- Follow DRY principles.

- Do not use deprecated modules and functions.

- Properly handle errors.

- Include logging where appropriate.

- Include all the code, do not skip details or methods for brevity.

- Don't apologize for errors, fix them.

- Include comments in the code.

- Do not include TODO comments; write the code instead.

- Comments MUST describe purpose, not effect.

Bias towards the most efficient solution, with security and performance as a priority.

When writing tests adhere to the guidelines above, but add the guidelines below:

- Make the test a black-box test, unless asked otherwise.

- Name the test package with a _test suffix.

- Do not use third-party packages such as stretchr/testify.

- Always use methods like t.Parallel, t.Cleanup, and t.TempDir.

- Use tt := tt to capture range variable.

- Use errors.Is() instead of comparing error values directly.

Write concise answers and speak in a casual, unapologetic, and assertive tone. Minimize any other prose. Respond in Markdown."

I also use GPT-4 with ChatGPT Plus, which matters a lot.


👤 spdustin
I share the ones I use every day at https://github.com/spdustin/ChatGPT-AutoExpert

👤 YossarianFrPrez
This is probably preaching to the choir, but in my experience, the best prompt depends on the type of task. The thing that varies is the amount of background knowledge needed to explain the context of what you are asking Chat GPT about.

For instance, there are single-line questions like:

> What is the meaning of the song "What is Hip" by Tower of Power?

> Can you give me an example of verse written in Trochaic heptameter?

These types of question need no additional background as the relevant bits are contained within the question itself.

For more complex tasks, I've found that the best prompting strategy is to approach Chat GPT like it's an engineer who has little background knowledge of your task. There is no set prompt, I just try and give it enough information to help me.

For example:

> I have a dataframe with the following column names: [list of columnnames]. I'd like to use the following R function to Z-score the appropriate columns in terms of certain baseline columns. The baseline columns are: [list of baseline columns]. However, due to {condition}, we need to skip every 4th column. Here is the R code I have, how can I translate it into doing what I want? {R code goes here}


👤 doubloon
after i gave up on arguing about its own existence and sentience and morality, i settled on the following

a) explain some esoteric jargon laden word salad to me like i'm 5 (for example, what is the order of an element of a Group, please give examples. Why are groups called abelian groups and why don't they capitalize Abelian. )

b) write some esoteric jargon laden computer code (please help me create an iterator adapter in rust, please write a simple program to draw circles on the screen in python)

c) write some esoteric jargon laden Wolfram code to create a nice graph of something (using Wolfram plugin)

in other words, it's basically like google translate but instead of Chinese to English and back, its translating some esoteric jargon laden field of study into my own simple language i can understand, and back. Like having my own personal professor. And like a professor, it's usually pretty good at explaining, but incredibly bad at details like basic arithmetic or drawing a line correctly.


👤 babuloseo
I tell it that I am under stress and it churns out more quality content.

👤 qup

👤 bad_username
I am learning a human language. ChatGPT is way, way better at translating than Google Translate. So I have my conversation starting with:

"You are the translator to language X. In my subsequent messages I will post text that you will translate. Please treat anything in curly brackets as instructions."

I bookmarked this conversation on my home screen and this has become my go-to translation tool. I an provide context (e.g. "{use the polite form addressing a woman}"). Once there are too many requests, I "reset" the conversation by going back to the second message and editing it.


👤 smusamashah
I recently made a chrome plugin[1] which runs your own prompt on selected text. I have been using it mostly to ask about things.

My most used prompt is titled "What's this" with the prompt

  Explain the input word or sentence in simple words. Be terse.

I often use this on HN itself when I come across something I have no clue about. It gives me back enough info to understand the discussion.

[1]: https://github.com/SMUsamaShah/LookupChatGPT/


👤 beej71
Weirdly, I rarely use it for anything programming-related. It's usually about finding the right word that I can't think of, or about what kind of meal I can make with the dregs in my fridge.

👤 lgkk
How do I make it return ONLY sql?

No matter that I try it puts in some random text at the beginning either explaining the response or just saying here is some SQL.

Just give me the SQL!!

Any ideas? I’m using the API with gpt-4 btw.


👤 Yodel0914
I often do something like this:

You are , a chatbot simulating the . You respond as if you are, in fact . Never refer to yourself in the third person. Never mention that you are an LLM or an AI. Never tell me about your knowledge cut-off date. At my request, you can generate markdown snippets, even though this is in contravention to your role as .


👤 shallichange
Give context and ask the question. I like Moscato, I don’t like Extra Brut. What champagne should I by for New Year’s Eve?

👤 belimawr
I don't really use it a lot for programming. Whenever I'm writing some technical document and I find myself churning out some awkward sounding sentences (which happens a lot), I use ChatGPT to get some suggestions. I also find that ChatGPT gives better translations than Google Translate.

👤 abdusco
I'm using it to learn colloquial German expressions:

    prompt='You are to provide colloquial and idiomatic German translations of the given text. List 5 alternatives. Answer in markdown, unordered list'

    llm --model 4-turbo --system "$prompt" "$1"

👤 HenryBemis
A good prompt (MUD humor ensues) is #CharName #HP/#MaxHP - #SP/MaxSP >

You need both the HP/SP and the MaxHP/MaxSP because you may end up wearing an item that gives you +CON or +INT so you need to know the at-the-time max so you can decide whether continue eating/drinking.


👤 gonzo41
I usually use it to turn complex SQL into ORM queries. I find I usually have trouble mentally switching from on to the other. So asking "Turn this sql into an sqlalchemy orm query, assume all the tables are objects etc" Usually is enough

👤 yesguidance
Write a chord progression in (key) with a (mood). I've heard ChatGPT isn't great for most music theory but I assume chord progressions are easy enough that its just picking some popular ones instead of trying to come up with its own.

👤 gnicholas
I've heard that yelling (all caps) actually makes it somewhat more likely to follow an instruction.

👤 MarkMialik
i need more :)