Show Menu
Cheatography

Propmpts for programming Cheat Sheet (DRAFT) by

Useful and easy to use generic prompts for programmers

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Basic Prompt structure

Acting as a [ROLE] perform [TASK] in [FORMAT]

Act as [ROLE]

Website Designer
Therapist
Prompt Engineer
Project Manager
Mindset Coach
Lawyer
Journalist
Inventor
Ghostw­riter
Chief Financial
Officer
Best Selling Author
Analyst
Advertiser
Accountant
Marketer

Code Generation

Can you generate code for [add specific progra­mming task or problem] in [specify progra­mming language or framew­ork]?
[Example]: Can you generate code for a function that takes a list of n integers and returns a new list of only even numbers from the input list? I want you to create this function in the Python language.
What is the most efficient or elegant way to generate code for [insert specific progra­mming task or solution] in [insert progra­mming language or framew­ork]?
[Example]: What is the most efficient way to write code in JavaScript to find the sum of the list of integers?
Is there a library or tool that can assist with generating code for [insert specific progra­mming task or goal] in [insert progra­mming language or framew­ork]?
[Example]: Is there any library or tool that can help me generate code for working with dates in Java?
Write a [language] function to filter [data structure] based on [condi­tion] with the following inputs: [input variables] and expected output: [output descri­ption].
[Example]: Write a Python function to filter a list of integers based on whether they are greater than 5, with the following input variables: Input: list of integers Expected output: a new list containing only the integers greater than 5.
Design a [language] algorithm to solve [problem] using [strategy or techni­que].
[Example]: Design a C++ algorithm to find the maximum element in an array using the divide and conquer strategy.

Code Refact­oring

Suggest the refact­oring improv­ements for the following [language] code: [code snippet].
Optimize the following [language] code for lower memory usage: [code snippet].
Refactor the following [language] code to improve its error handling: [code snippet].

Natural Language Processing

Perform text classi­fic­ation of the following text: [text sample].
Analyze the sentiment of the following product review: [product review].
List out the key phrases in the social media posts: [social media post].

Person­alized Develo­pment Learning

What are the available free resources to learn [progr­amming langua­ge/­tec­hno­logy]?
What learning path should I follow to become a proficient [IT job role]?
Suggest coding challenges or compet­itions improve my [progr­amming langua­ge/­tec­hno­logy] skills.

Requir­ement Analysis

Analyze the following project requir­ements and suggest the technology stack: [project requir­eme­nts].
Interpret the following project requir­ements and provide a detailed project plan with milestones and delive­rables: [project requir­eme­nts].
Convert the following project requir­ements into user stories: [project requir­eme­nts].
 

Create a [TASK]

Summary
Social edia Post
SEO Keywords
Blog Post
Email Sequence
Essay
Recipe
Product
Descri­ption
Cover Letter
Analysis
Book Outline
Sales Copy
Article
Video Script
Headline

Code Completion

Complete the [language] code that [funct­ion]: code snippet
[Example]: Complete the Python code that takes the list of integers and returns the sum of all elements: def sum_li­st(­nums):
Complete the [language] code to convert [data structure] into [output format]: [code snippet].
[Example]: Complete the Java code to convert an integer into a string: import java.u­til.*; public class Example{
Finish the [language] implem­ent­ation of a multit­hre­ading solution for [problem]
[Example]: Finish the Java implem­ent­ation of a multit­hre­ading solution for a program that calculates the sum of even and odd numbers in a given range. import java.u­til.*; public class evenodd {

Automated Testing

Write a test script for the given [language] code that covers [funct­ion­al/­non­-fu­nct­ional] testing.
Design a perfor­mance testing strategy for a [web/m­obile] app for [resource usage, latency, and throug­hput].
Create a test suite for a [language] library or framework that validates its functi­onality and stability.
Create an end-to-end testing strategy for a [mobil­e/web] app that covers critical user workflows.

Code Transl­ation

Translate the following [language] code for calcul­ating the average of user input numbers into [desired language]: [code snippet].

Algorithm Develo­pment

Write a heuristic algorithm to solve a specific problem: [problem descri­ption]
[Example]: Write a heuristic algorithm to solve a travel salesman problem.
Analyze the following machine learning algorithm to improve its accuracy: [algor­ith­m/p­seu­doc­ode].
[Example]: Consider that we have a current algorithm that predicts customersā€™ sentim­ents. The text prompt would be: Analyze the following machine learning algorithm to improve its accuracy: Compile a database of client reviews together with the associated emotions (good or negative). Clean up the text and transform it to a numerical repres­ent­ation (such as bag-of­-words) to prepare the data. Create training and test sets from the dataset. Utilize the training set to train a Naive Bayes classi­fier. Use measures like accuracy, precision, recall, and F1 score to assess the classi­fier's perfor­mance on the test set.
Create a streaming algorithm to process data in real-time for [a specific purpose].
[Example]: Create a streaming algorithm to process data in real-time for the stock market.
Assess the trade-offs of the given algorithm in terms of perfor­mance and resource usage: [algorithm or pseudo­code].
[Example]: Asses the trade-offs of the following algorithm in terms of perfor­mance and resource usage:
 

Show as [FORMAT]

Spread­hseet
Code
Roch TEXT
Summary
XML
Graphs
CSV file
Gantt Chart
JSON
Plain Text
File
HTML
Markdown
A List
PDF
A Table

Networking and Security

Create a secure [language] function that performs [specific task] while preventing [security threat or vulner­abi­lity].
[Example]: Write a secure Python function or module that performs password hashing while preventing SQL injection attacks.
Design a secure protocol for [specific use case] for my [app/w­ebs­ite].
[Example]: Design a secure and efficient protocol for secure commun­ication between a client and a server over the Internet.
Evaluate the security of the given [language] code when intera­cting with [external servic­e/API].
[Example]: Evaluate the security of the given Python code when intera­cting with a database:

Networking and Security

Create a secure [language] function that performs [specific task] while preventing [security threat or vulner­abi­lity].
[Example]: Write a secure Python function or module that performs password hashing while preventing SQL injection attacks.
Design a secure protocol for [specific use case] for my [app/w­ebs­ite].
[Example]: Design a secure and efficient protocol for secure commun­ication between a client and a server over the Internet.
Evaluate the security of the given [language] code when intera­cting with [external servic­e/API].
[Example]: Evaluate the security of the given Python code when intera­cting with a database:

Code Review

Review the following [language] code for code smells and suggest improv­ements: [code snippet].
Review the following [language] code for scalab­ility issues: [code snippet].
Evaluate the following [language] code for compat­ibility with [techn­ology]: [code snippet].
Evaluate the test coverage of the [language] code: [code snippet].

Bug Detection

Locate any logical errors in the following [language] code snippet: [code snippet]
[Example]: Locate any logical errors in the following JavaScript code: [code snippet]
Find the perfor­mance issues in the [language] code: code snippet.
[Example]: Find the perfor­mance issues in the Python code: [code snippet]
Check for potential deadlock issues in the [language] code: code snippet.
Check the potential deadlock issues in Java code: [code snippet]
Analyze the following [language] code and determine potential SQL injection vulner­abi­lities: [code snippet]
[Example]: Analyze the following PHP code and determine potential SQL injection vulner­abi­lities: [code snippet]