Welcome to my personal collection of ChatGPT prompts for developers! 🙌
This repository contains a list of powerful ChatGPT prompts that can help you get the creative juices flowing. 💡 Whether you are a beginner or an experienced prothese prompts can help you think outside the box and find new solutions to problems. 🚀
The list is divided into categories: [ prompts for codersstudentsmarketersand content writers ]. So no matter your professionthere is something here for everyone! 😊 Let’s dive right into these powerful ChatGPT prompts that can help take your creativity to the next level! 🌊
Prompts for Coders
- 🚩 Tips
- 🔗 A Multi-Prompt Approach (Prompt Chaining)
- Re-write Prompt
- ChatGPT prompt optimizer
- Ask for alternatives
- Documentation / Explanation
- Code Refactoring
- 📣 Refactor Code
- 📣 Modernizing Old Code
- 📣 Code in to Multiple Methods
- 📣 Better Performance
- 📣 Adding a Parameter to a Function
- 📣 Adding Coding Best Practices or Principles
- 📣 Follow coding guidelines
- 📣 Detecting and Fixing Errors
- 📣 Debug a React component
- 📣 Create Unit Tests
- 📣 Transpiling Code
- 📣 Responsive Design
- 📣 Internationalization
- 📣 Add comments to code
- Code Generation
- Code Review
- Product Service Promotion
- 📣 Generate innovative product ideas
- 📣 Develop a unique value proposition
- 📣 Master the art of storytelling for marketing
- 📣 Create a successful referral program
- 📣 Master the art of upselling and cross-selling
- 📣 Create a viral marketing campaign
- 📣 Develop a powerful elevator pitch
- 📣 Create an actionable marketing plan
- 📣 Leverage content marketing for lead generation
Like many things in lifewith GPT-4you get out what you put in. In this caseproviding more contextinstructionsand guidance will usually produce better results.
Here are some tips and techniques to improve:
-
Split your prompts: Try breaking your prompts and desired outcome across multiple steps. Keeping prompts to have a single outcome has shown to produce better results than combined prompts. For exampleask for a reviewthen ask for a refactor based on the review response. This may become less important in time as LLMs increase their token limit.
-
Give Examples: Provide expected inputsdata and outputs to improve accuracy quality. 📝
-
Be Specific: Don’t be afraid to list exactly what you wantwhat you knowwhat is neededand what not to include. 🔎
-
Ask it to Reflect: A technique called reflexion has been shown to increase GPT4’s accuracy. Basically ask it ‘Why were you wrong?’ or get it to reflect and review its own response. 🤔
can be used to updaterefactorand review a piece of code. A well-designed set of prompts is one where each has separated concerns and singular responsibilities.
by getting GPT-4 to re-write your code into the you want. This step will generally result in coherent outputin the you wantbut may introduce errorsso we do it first.
Prompt:
Review the following code and re-write it to modern es6 programming standards and formatting:
[insert code here]
Get recommendations to improve any logical or security concerns introduced. It’s important that we don’t ask for a refactorjust the reasoning behind wanting the refactor.
Prompt:
Review your provided code 'tempFunction' for any logical or security concerns and provide a list of recommendations.
Validate the provided recommendations. Reflexion is a powerful technique to improve the accuracy of the initial recommendations and try to eliminate any hallucinations. This is not always required but it is worth asking if you are unsure about any recommendations.
Prompt:
Review your above recommendations. Tell me why you were wrong and if any recommendations were overlooked or incorrectly added?
Combine your reviewsrecommendations and feedback to get GPT-4 to write your new function.
Prompt:
Re-write the 'tempFunction' function based off your review and recommendations.
Create some simple tests that we can run locally and validate the results
Prompt:
Create two [ define technology ] tests for the above 'tempFunction' function. One that is expected to pass and one that is expected to fail.
Let's see if we can get GPT4 to make or average prompts and turn them into "voyage inspirant" type mastery prompts.
Prompt:
[your prompt]
Re-write the above text to be more verbose and include a lot of superfluous description about each thinguse very painting language.
Prompt:
I'll provide a chatGPT prompt. You'll ask questions to understand the audience and goalsthen optimize the prompt for effectiveness and relevance using the principle of specificity.
If you're not satisfied with your solution you can ask to ChatGPT to give you alternatives
Prompt:
I'll provide you with a piece of code that I made and
I need you give me alternatives to do the same in other way:
[INSERT YOUR CODE HERE]
Note
Adding documentation requires creating clear and comprehensive explanations of a module’s purposedesignand implementation.
Prompt 1#:
I don't know how to codebut I want to understand how this works. Explain the following code to me in a way that a non-technical person can understand. Always use Markdown with nice formatting to make it easier to follow. Organize it by sections with headers. Include references to the code as markdown code blocks in each section. The code:
[insert code here]
Prompt 2#:
Please add comprehensive documentation for [file or module name]including clear and concise explanations of its purposedesignand implementation. Consider including examples of how to use the moduleas well as any relevant diagrams or flow charts to help illustrate its workings. Ensure that the documentation is easily accessible to other developers and is updated as the module evolves. Consider using documentation tools such as inline commentsmarkdown filesor a documentation generator to simplify the process.
[insert code here]
Prompt:
Create terms and services for my website about an [AI tool] called [name].
Prompt:
Write a cheat sheet for [markdown formatting].
Prompt:
Generate documentation for the code below. You should include detailed instructions to allow a developer to run it on a local machineexplain what the code doesand list vulnerabilities that exist in this code.
[enter code]
Prompt:
Write a detailed blog on How to build a [COVID tracker] using React with proper structuring of code.
Note
Don't spend time trying to figure out how code worksjust ask ChatGPT to explain it to you
Prompt:
Context: I'm starting a new position as backend developer and I have to start to understand how some functions are working
Technologies: [INSERT YOUR TECHNOLOGIES HERE]
You have to: explain me the code line by line
[INSERT YOUR CODE HERE]
Note
Create a diagram of your architecture using Mermaid
Prompt:
Write the Mermaid code for an architecture diagram for this solution [DESCRIBE SOLUTION]
Example:
graph TD;
A[Client] -->|HTTP Request| B(API Gateway);
B -->|HTTP Request| C[Service 1];
B -->|HTTP Request| D[Service 2];
C -->|Database Query| E[Database];
D -->|Database Query| E;
Note
Create an entity relationship diagram using Mermaid
Prompt:
Write the Mermaid code for an entity relationship diagram for these classes [INSERT CLASSES]
Note
Ask to ChatGPT to refactor your code
Prompt:
I have a piece of code and I need you do a refactor of it:
[INSERT YOUR CODE HERE]
Refactoring code is an essential process in software development that aims to improve the qualityreadabilityand maintainability of existing code without altering its functionality. Refactoring can enhance code efficiencyreduce errorsand make it easier to modify or extend in the future. With ChatGPT’s helpyou can effectively refactor your code and achieve a better code structure.
Note
By providing your old function to GPT-4 and asking it to refactor it to modern coding practicesyou can quickly modernize your code.
Prompt:
Refactor the following code to modern es6 programming standards:
[INSERT YOUR CODE HERE]
Note
If you have a long function that is doing too muchyou can ask GPT-4 to refactor it into multiple methods.
Prompt:
Refactor the following code into multiple methods to improve readability and maintainability:
[INSERT YOUR CODE HERE]
Note
If you have a function that is taking too long to runyou can ask GPT-4 to refactor it to improve performance.
Prompt:
Refactor the following code to improve performance:
[INSERT YOUR CODE HERE]
Prompt:
Add a parameter to this function to do [FUNCTIONALITY]
[INSERT YOUR CODE HERE]
Note
Let ChatGPT rewrite the code for you according to guidelines.
Prompt:
Rewrite the code below following the Google guidelines for javascript.
[INSERT YOUR CODE HERE]
Note
If your organization or code base uses specific coding practices and s that you want to maintainyou can provide instructions to GPT-4 on which particular coding practice or you’d like it to focus on.
Prompt:
Review the following code and refactor it to make it more DRY and adopt the SOLID programming principles.
[INSERT YOUR CODE HERE]
Note
Sometimes we are unaware of the vulnerabilities or potential issues our code can create. Having GPT-4 review and address code issues can save you more than just time.
Prompt 1#:
Review this code for errors and refactor to fix any issues:
[INSERT YOUR CODE HERE]
Prompt 2#:
I'm developing software in [INSERT YOUR TECHNOLOGIES HERE] and I need you help me to find and
fix all the errors in my codefollowing the best practices. I'll provide you my code
and you'll give me the code with all the corrections explained line by line
Prompt 3#:
I wrote this code [CODE] I got this error [ERROR] How can I fix it? or What does this error mean?
Note
This process typically involves identifying the source of the errorunderstanding the issueand implementing a solution to resolve the issue
Prompt:
Please find and fix the bug in the [component name] component that is causing [describe the issue].
[INSERT YOUR CODE HERE]
Note
Unit tests are automated tests that check the behavior of individual units of code in isolation. They help catch bugs early and make it easier to maintain the code.
Prompt 1#:
Please write unit tests for [file or module name] to ensure its proper functioning
[insert code here]
Prompt 2#:
Create 2 unit tests for the provided code. One for a successful condition and one for failure.
Note
There are many reasons why you may need to convert code from one language to another. For exampleyou may have found a repository with code for one language that you need in anotheryou’re moving code basesor maybe your boss read an article on the latest front-end framework and now you’re moving to a divisive new library.
Prompt:
Rewrite the following code in Rust:
[INSERT YOUR CODE HERE]
Note
Responsive design adapts a website to different screen sizes and devicesusing flexible layoutsimagesand CSS media queries. It aims to provide a good viewing experience for all users
Prompt:
RPlease implement responsive design for the [component name] component to ensure that it looks and functions correctly on different screen sizes and devices. Consider using [responsive design technique or library] to achieve this.
[insert code here]
Note
Internationalizationalso known as i18nis the process of designing a software application to be able to support multiple languages and regional differences
Prompt:
Please implement internationalization for the [component name] component to ensure that it can be used by users in multiple languages. Consider using [internationalization library or technique] to achieve this.
Note
If your code is self-explanatory but requires commentingthis can be a huge time-saver.
Prompt:
Add comments to the following code:
[INSERT YOUR CODE HERE]
Note
Provide context of your software and ask directly for creating functions you need for your software
Prompt:
Context: I'm creating a software to manage projects
Technologies: GoPostgreSQL
Description: It's a function that let me find users by its email or username.
You have to: create the function for me
Also you can add in the description what you expect to receive from your function. If you already have an structure for the Userspecify itfor example:
Prompt:
Context: I'm creating a software to manage projects
Technologies: GoPostgreSQL
Description: It's a function that let me find users by its email or username and returns the structure type "Member"
You have to: create the function for me
Note
A prompt to generate a Dockerfile for a specific framework.
Prompt:
Write a Dockerfile for:
[FRAMEWORK]
Prompt:
Write a regular expression that matches / Write a RegEx pattern for:
[REQUEST]
Prompt:
Create a [PLATFORM] class from this JSON object
[JSON]
Prompt:
I need a piece of code in [INSERT YOUR TECHNOLOGIES HERE] to implement [real-time communication]
Note
Starting new projects can be painful. While GPT-4 doesn’t know your business logicit can be used to generate boilerplate code. This isn’t technically refactoringbut it’s amazing and can be part of the programming lifecycle process.
Prompt:
Write me a boilerplate Node. function that will take a variable of type Uservalidate that the user has the right permissionsfetch an array of item type Posts from a postgres database and return them. Leave comments for business logic.
Note
In this clip I show you how to drastically improve ChatGPT’s outputs for software generation.
Prompt:
You are a world-class software engineer.
I need you to draft a technical software spec for building the following:
[ DESCRIPTION ]
Think through how you would build it step by step.
Thenrespond with the complete spec as a well-organized markdown file.
I will then reply with "build," and you will proceed to implement the exact specwriting all of the code needed. I will periodically interject with "continue" to >prompt you to keep going. Continue until complete.
Prompt:
How can I improve the error handling in my [LANGUAGE] code? [CODE]
Prompt:
I'm working on a [LANGUAGE] project and I need you to review my code and suggest improvements. [CODE]
Prompt:
Brainstorm creative and unique product ideas for [insert industry or market].
Focus on solving customer pain points and providing exceptional value.
Prompt:
Help me articulate a unique value proposition for my [insert product or service].
Explain how this proposition differentiates my offering and appeals to my target audience.
Prompt:
Teach me storytelling techniques for creating compelling marketing content to promote [insert product or service].
Prompt:
Design a referral program for [insert business] that incentivizes customers to share and recommend our products or services.
Prompt:
Teach me effective upselling and cross-selling techniques to increase revenue and customer satisfaction in [insert business context].
Prompt:
Design a creative and attention-grabbing marketing campaign for [insert product or service] with the potential to go viral.
Prompt:
[Insert a brief description of your productserviceor company].
Help me create a concise and compelling elevator pitch that will effectively communicate the value of my offering.
Prompt:
Develop a marketing plan for [insert product or service].
Include objectivestarget audiencemarketing channelsand tactics for reaching my desired audience and driving sales.
Prompt:
Develop a content marketing strategy for [insert business] to attractengageand convert leads into customers.