diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b35b58d Binary files /dev/null and b/.DS_Store differ diff --git a/Google-Prompts-Engineering/gemini-for-google-workspace-prompting-guide-101.md b/Google-Prompts-Engineering/gemini-for-google-workspace-prompting-guide-101.md new file mode 100644 index 0000000..aac91e2 --- /dev/null +++ b/Google-Prompts-Engineering/gemini-for-google-workspace-prompting-guide-101.md @@ -0,0 +1,3280 @@ +A quick-start handbook +for effective prompts + +October 2024 edition + +1 + + Writing effective prompts + +From the very beginning, Google Workspace was built to allow you to collaborate in real time with other people. + +Now, you can also collaborate with AI using Gemini for Google Workspace to help boost your productivity and + +creativity without sacrificing privacy or security. The embedded generative AI-powered features can help you + +write, organize information, create images, accelerate workflows, have richer meetings, and much more, all + +while using your favorite apps like Gmail, Google Docs, Google Drive, Google Sheets, Google Meet, Google + +Slides, and Gemini Advanced (the standalone chat experience available at gemini.google.com with enterprise- + +grade security). Gemini is accessible right where you are doing your work — with access to your personal + +knowledge base in Drive, Docs, Gmail, and more — so you can enhance and create powerful workflows across + +the Workspace apps with less tab switching and interruption. + +This guide provides you with the foundational skills to write effective prompts when using Gemini for Workspace. + +You can think of a prompt as a conversation starter with your AI-powered assistant. You might write several + +prompts as the conversation progresses. While the possibilities are virtually endless, you can put consistent + +best practices to work today. + +The four main areas to consider when writing an effective prompt are: +• + + Persona + +• + +• + +• + + Task + + Context + + Format + +Here is an example of a prompt using all four areas that could work well in Gmail and Google Docs: + + You are a program manager in [industry]. Draft an executive summary email to [persona] based on [details + + about relevant program docs]. Limit to bullet points. + +You don’t need to use all four in every prompt, but using a few will help! Always remember to include a verb or + +command as part of your task; this is the most important component of a prompt. + +Contact sales to get started with + +Gemini for Workspace today. + +2 + + + Here are quick tips to get you started with Gemini for Google Workspace: + +1. Use natural language. Write as if you’re speaking to another person. Express complete thoughts in + +full sentences. + +2. Be specific and iterate. Tell Gemini what you need it to do (summarize, write, change the tone, create). + +Provide as much context as possible. + +3. Be concise and avoid complexity. State your request in brief — but specific — language. Avoid jargon. + +4. Make it a conversation. Fine-tune your prompts if the results don’t meet your expectations or if you believe + +there’s room for improvement. Use follow-up prompts and an iterative process of review and refinement to + +yield better results. + +5. Use your documents. Personalize Gemini’s output with information from your own files in Google Drive. + +6. Make Gemini your prompt editor. When using Gemini Advanced, start your prompts with: “Make this a + +power prompt: [original prompt text here].” Gemini will make suggestions on how to improve your prompt. + +Ensure it says what you need, and then paste it back into Gemini Advanced to get an output. + +Prompting is a skill we can all learn. You don’t have to be a prompt +engineer to use generative AI. However, you will likely need to try a few +different approaches for your prompt if you don’t get your desired +outcome the first time. Based on what we’ve learned from our users +so far, the most fruitful prompts average around 21 words with relevant +context, yet the prompts people try are usually less than nine words. + +Generative AI and all of its possibilities are exciting, but it’s still new. Even +though our models are getting better every day, prompts can sometimes +have unpredictable responses. + +Before putting an output from Gemini for Workspace into action, review it +to ensure clarity, relevance, and accuracy. And of course, keep the most +important thing in mind: Generative AI is meant to help humans but the +final output is yours. + +The example prompts in this guide are meant for illustrative purposes. + +3 + + Table of contents + +Writing effective prompts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 2 + +Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 5 + +Administrative support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 7 + +Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 11 + +Customer service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 15 + +Executives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 20 + +Frontline management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 28 + +Human resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 32 + +Marketing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 37 + +Project management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 46 + +Sales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 50 + +Small business owners and entrepreneurs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 58 + +Startup leaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 62 + +Leveling up your prompt writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 67 + +4 + + Introduction +Gemini for Google Workspace: Prompting 101 + +Gemini for Workspace is your AI-powered assistant integrated into the apps you use every day — Gmail, Google + +Docs, Google Sheets, Google Meet, Google Slides, and Gemini Advanced (the standalone chat experience + +available at gemini.google.com with enterprise-grade security). This means the apps you know and use will work + +together smoothly so you can collaborate with Gemini right where you are. You can have fewer interruptions to + +your focus and workflow, helping you complete tasks and do things you might not have initially known how to do. + +You can access the features of Gemini for Workspace in multiple ways. Engaging with Gemini in the side panel + +of your Workspace apps allows you to create highly personalized generative AI outputs that are based on your + +own files and documents — even if they aren’t Google Docs. You can generate personalized emails in seconds + +referencing your own Docs to pull in relevant context, generate Slides that are based on information directly + +from your own briefs or reports, and so much more. + +Understanding what makes an effective prompt and learning to craft prompts on the fly can boost your + +productivity and creativity. Gemini for Workspace can help you: + +• Improve your writing + +• Organize data + +• Create original images + +• Summarize information and surface insights + +• Have better meetings with automatic note taking + +• Research unfamiliar topics easily + +• Spot trends, synthesize information, and identify business opportunities + +For 25 years, Google has built helpful, secure products that give users choice and control over their data. It’s a + +bedrock principle for us. This was the case back when we first launched Gmail in 2004, and it remains true in the + +era of generative AI. This means your data is your data and does not belong to Google. Your data stays in your + +Workspace environment. Your privacy is protected. Your content is never used for targeting ads or to train or + +improve Gemini or any other generative AI models. + +5 + + How to use this prompt guide + +This guide introduces you to prompting with Gemini for Workspace. It includes + +strong prompt design examples to help you get started. Additionally, it covers + +scenarios for different personas, use cases, and potential prompts. + +You will notice a variety of prompt styles. Some prompts have brackets, which + +indicate where you would fill in specific details or tag your own personal files by + +typing @file name. Other prompts are presented without variables highlighted to + +show you what a full prompt could look like. All of the prompts in this guide are + +meant to inspire you, but ultimately they will need to be customized to help you + +with your specific work. + +To get started, use the role-specific suggested prompts as inspiration to help you + +unlock a new and powerful way of working. + +Next, learn how you can get +started with different features +by visiting g.co/gemini/features. + +6 + + Administrative +support + +As an administrative support professional, you + +are responsible for keeping teams on track. + +You’re required to stay organized and efficient + +— even under pressure — while juggling many + +priority tasks. + +This section provides you with simple ways to + +integrate prompts in your daily tasks. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning + +of this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +NEW + +Use case: Plan agendas (offsite, meetings, and more) + +You’re planning a three-day offsite meeting. To build an agenda, you brainstorm with Gemini Advanced. + +You type: + + I am an executive administrator to a team director. Our newly formed team now consists of content + + marketers, digital marketers, and product marketers. We are gathering for the first time at a three-day + + offsite in Washington, DC. Plan activities for each day that include team bonding activities and time for + + deeper strategic work. Create a sample agenda for me. (Gemini Advanced) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +7 + + Gemini Advanced + +This is a helpful start to your planning. You need to generate specific ideas for the team bonding activities. + +You type: + + Suggest three different icebreaker activities that encourage people to learn about their teammates’ + + preferred working styles, strengths, and goals. Make sure the icebreaker ideas are engaging and can be + + completed by a group of 25 people in 30 minutes or less. (Gemini Advanced) + +Gemini Advanced + +You are happy with the agenda as a starting point. You now want to reformat Gemini’s response into a table. + +You type: + + Organize this agenda in a table format. Include one of your suggested icebreakers for each day. + +(Gemini Advanced) + +8 + + Gemini Advanced + +You select Export to Docs. You open the newly created Doc. Now, you want to bring in detailed summaries + +for the strategy sessions using your existing files in Google Drive to provide more context for what will be + +discussed. You prompt Gemini in Docs and tag your relevant files by typing @file name. + + Use @[2024 H2 Team Vision] to generate a summary for the opening remarks on Day 1 of this agenda. + +(Gemini in Docs) + +Example use cases + +Executive administrators and executive business partners +NEW + +Use case: Manage multiple email inboxes + +After returning from vacation, you have many unread, unsorted emails. You prompt Gemini in the Gmail side + +panel. You type: + +Summarize emails from [manager] from the last week. (Gemini in Gmail) + +Gemini returns short summaries of each message. To directly access a message, you click on Sources and see + +tiles that bring you to specific emails. You select the most important one. Once the email thread opens, you see + +that many messages were exchanged. You prompt Gemini in Gmail: + +Summarize this email thread and list all action items and deadlines. (Gemini in Gmail) + +9 + + You owe a response to a question, which you believe is best answered by a document in your Drive. You prompt + +Gemini in the Gmail side panel. You type: + +Generate a response to this email and use @[file name] to describe how the [initiative] can complement + +the workstream outlined in [colleague’s name]’s message. (Gemini in Gmail) + +Gemini in Gmail returns a suggested email that pulls directly from your own Doc. After reading it over, you select + +the Copy icon in the side panel and paste it directly into your message. + +NEW + +Use case: Plan business travel + +Your manager has an upcoming meeting that is out of town. You are responsible for booking travel + +arrangements and creating a personalized itinerary. You need to research places to eat. You brainstorm with + +Gemini Advanced. You type: + +I am an executive assistant. I need to create an itinerary for a two-day business trip in [location] during + +[dates]. My manager is staying at [hotel]. Suggest different options for breakfast and dinner within a + +10-minute walk of the hotel, and find one entertainment option such as a movie theater, a local art show, + +or a popular tourist attraction. Put it in a table for me. (Gemini Advanced) + +You continue your conversation until you are happy with the itinerary. Before you make reservations, you want + +to share the draft with your manager. You select Share & export and select Draft in Gmail. Once the drafted + +email is created, you put the final touches on the message and send. + +NEW + +Use case: Track travel and entertainment budget + +You want to create a spreadsheet to keep track of all of the travel expenses incurred. You open a new Google + +Sheet and prompt Gemini in the Sheets side panel. You type: + +Create a budget tracker for business travel. It should include columns for: date, expense type (meal, + +entertainment, transportation), vendor name, and a description. (Gemini in Sheets) + +Gemini returns a tracker that is now ready for you to enter data. + +10 + + + Communications + +As a communications professional, you are + +responsible for ensuring your business is well + +understood by the public. You have to stay up to + +date with the trends, communicate clearly and + +effectively with many stakeholders, and build + +compelling narratives. + +This section provides you with simple ways to + +integrate prompts in your daily tasks. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of + +this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +NEW + +Use case: Create a press release + +You are in charge of public relations at a company in the personal care industry. The company you work for has + +just acquired a smaller brand, and you need to craft a press release. You’ve completed interviews with your + +company’s CEO, CFO, and the acquired company’s CEO. You’ve stored all of the most important quotes in one + +Doc. You also have a Doc with all of the information about the acquired brand, its vision, how it got started, and + +stats. You open a new Doc and prompt Gemini in the Docs side panel and type @file name to reference your + +relevant files. You type: + + I’m a PR manager. I need to create a press release with a catchy title. Include quotes from + + @[VIP Quotes Acquisition]. (Gemini in Docs) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +11 + + Gemini in Docs + +[Gemini returns a response] + +Now you have a starting place for the press release, but you want to include more details about the brand that is + +being acquired and its founder. This information is stored in your Drive in another file. In the press release Doc, + +you prompt Gemini in the Docs side panel. You type: + + Use @[Biography and Mission Statement] to add more information about the company that is being + +acquired, its mission, and how it got started. (Gemini in Docs) + +Gemini in Docs + +The generated paragraphs are a good starting place, so you select Insert to add them into your draft, and you + +begin making edits to the press release. + +12 + + Example use cases + +Analyst and public relations +NEW + +Use case: Prepare for analyst or press briefings + +You need to create a brief to prepare a spokesperson for an upcoming meeting with analysts and the media + +for a new product launch. You open a new Doc and prompt Gemini in the Docs side panel. You type: + +Generate a brief template to prepare [spokesperson] for an upcoming media and analyst briefing for + +@[Product Launch]. Include space for a synopsis, key messages, and supporting data. (Gemini in Docs) + +This gives you a starting point to pull in additional information from your files. You prompt Gemini in the Docs + +side panel and tag your relevant files by typing @file name. You type: + +Craft a synopsis of the product launch in three main points using @[Product Launch - Notes]. + +(Gemini in Docs) + +You click Insert before repeating the process to fill out the rest of the briefing document. Next, you need to + +create a spreadsheet of media and analyst contacts. You open a new Google Sheet and prompt Gemini in the + +Sheets side panel. You type: + +Organize my media and analyst contacts from @[Analyst and Journalist Contact Notes] for a new product + +briefing. I need to keep track of their names, type of contact (analyst or journalist), focus area, the name + +of the outlet, agency or firm that they work for, and a place where I can indicate the priority level of their + +attendance at this briefing (low, medium, high). (Gemini in Sheets) + +Gemini in Sheets returns a spreadsheet, and you can go through and indicate priority level for each contact. + +Next, you want to create a slideshow to use during the briefing. You open a new Google Slide and prompt Gemini + +in the Slides side panel. You tag relevant files by typing @file name in the prompt. You type: + +Create a slide describing what [product] is from @[Product Launch - Notes]. Make sure it is short and + +easily understood by a broad audience. (Gemini in Slides) + +Gemini returns a Slide. You continue to build your presentation by using this method to generate + +additional Slides. + +13 + + NEW + +Use case: Create mock interview questions to prepare spokespeople + +Now, you need to prepare your company’s spokesperson for interviews that will follow the briefing. To generate + +a list of mock interview questions, you decide to chat with Gemini Advanced. You type: + +I am a [PR/AR] manager at [company name]. We just launched [product] and had a briefing where we + +discussed [key messages]. I am preparing [spokesperson and role/title] for interviews. Generate a list of + +mock interview questions to help [spokesperson] prepare. Include a mixture of easy and hard questions, + +with some asking about the basics of [product] and some asking about the long-term vision of [product]. + +(Gemini Advanced) + +Gemini returns a list of questions that can help you prepare your company’s spokesperson. You refine the + +suggested questions by continuing the conversation with Gemini. Then you select Share & export and Export + +to Docs. You open the newly created Doc, prompt Gemini in the Docs side panel, and tag relevant files by typing + +@file name. You type: + +Use @[Product Launch Notes] to write suggested answers for these questions. Write the talking points + +as if you are [title of spokesperson] at [company]. (Gemini in Docs) + +Gemini in Docs returns suggested talking points, and you select Insert to add them into your draft. Now you’re + +ready to continue tweaking the interview prep for your spokesperson. + +Communications manager +NEW + +Use case: Craft internal communications + +Your company has redesigned its intranet to be more user friendly. You’re in charge of internal communications + +for the launch. You want help drafting this message. You open a new Google Doc and prompt Gemini in the Docs + +side panel. You type: + +I need to draft a company-wide memo unveiling our relaunched intranet. The [new page] addresses + +[common feedback we heard from employees] and aims to create a more user friendly experience. + +Draft an upbeat memo announcing [the new site] using @[Intranet Launch Plan Notes]. (Gemini in Docs) + +Gemini in Docs returns a drafted memo. You refine and edit the text to be exactly as you need it. + +14 + + Customer service + +As a customer service professional, you strive + +to deliver service that’s effortlessly efficient, + +consistently delightful, and powered by a + +proactive, helpful team. This section provides + +you with simple ways to integrate prompts in + +your daily tasks. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of + +this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +Use case: Draft customer communications + +You’re a customer service representative, and you’re responsible for responding directly to customer inquiries + +and concerns. You just received an email from a customer who received damaged goods. You open a new + +Google Doc and click on Help me write to prompt Gemini in Docs. Type the following: + + Help me craft an empathetic email response. I am a customer service representative, and I need to + + create a response to a customer complaint. The customer ordered a pair of headphones that arrived + + damaged. They’ve already contacted us via email and provided pictures of the damage. I’ve offered a + + replacement, but they’re requesting an expedited shipping option that isn’t typically included with their + + order. Include a paragraph that acknowledges their frustration and three bullet points with potential + + resolutions. (Gemini in Docs) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +Gemini in Docs: [Drafts email copy] + +15 + + Gemini in Docs + +You like the email that Gemini in Docs created so you select Insert. But you want to brainstorm ways to resolve + +the issue without offering expedited shipping. You prompt by selecting Help me write. You type: + + Suggest 10 alternative options in place of expedited shipping to resolve the customer’s frustration about + + receiving the damaged package. (Gemini in Docs) + +Gemini in Docs: [List of alternative solutions] + +Gemini in Docs + +These 10 suggestions are helpful. You click Insert to add the text into your draft. + +16 + + Example use cases + +Customer Service Manager or Representative +NEW + +Use case: Respond to complex customer issues using FAQ documents + +A customer has reached out with a multi-part, complex question. You need to find and use information that is + +spread across multiple documents in order to respond accurately. You prompt Gemini in the Drive side panel. + +You type: + +Summarize information about [product name] including the product’s specific [return policy], + +[ingredients], and [certifications]. (Gemini in Drive) + +Gemini returns a summary and links to relevant files, which you can directly click into from the side panel. + +You read the information before returning to your email to generate a response to the customer. You open the + +message and prompt Gemini in the Gmail side panel and tag relevant files by typing @file name. You type: + +Generate a response to the customer question about our [return policy] and [product certifications] + +based on @[Customer FAQ Document]. Use a helpful and professional tone. (Gemini in Gmail) + +Use case: Standardize communication frameworks + +You’re a customer service team manager. You need to create scalable resources to standardize your team’s + +communications. You open a new Google Doc. You brainstorm by prompting Gemini in the Docs side panel. + +You type: + +Draft templates for three different types of customer communication. Create templates for apology + +emails, order confirmation messages, and thank you notes for loyal customers. Keep each template to + +one paragraph and use a friendly tone. (Gemini in Docs) + +The suggested templates offer a starting point for you to begin editing and personalizing with elements + +consistent with your company’s brand and policies. Now you want to outline your team’s communication best + +practices for onboarding. You open a new Doc and prompt Gemini in Docs. You type: + +Craft a list of customer communication best practices that can be used to train new team members. + +Outline three sections, including how to handle happy customer inquiries, neutral customer inquiries, + +and dissatisfied customer inquiries. (Gemini in Docs) + +17 + + You also want to support the team with standardized language that they can use when interacting with + +customers on phone calls. You prompt Gemini Advanced: + +I am a [customer service manager]. I am trying to create standardized language that the team can + +use when interacting with customers on phone calls. Generate templates for common call openings, + +greetings, and closures for a customer service representative at a retail store. These templates should + +allow for personalization with customer details. The goal is to ensure consistency and professionalism + +while allowing for differentiation with specific customer information. (Gemini Advanced) + +Use case: Improve customer service + +You’ve noticed an uptick in customer complaints. You need to collaborate across departments to address + +recurring issues. You prompt Gemini in Gmail. You type: + +Draft an email to my colleagues proposing a meeting to discuss customer experience improvement + +initiatives. Request that marketing, sales, and product stakeholders meet in the next week to get a clear + +sense of roles and responsibilities. (Gemini in Gmail) + +You edit the email and send it to your colleagues. Now you want to create a spreadsheet that you can use to + +track progress on this cross-departmental initiative. You open a Google Sheet and prompt Gemini in the Sheets + +side panel. You type: + +Create a table to track the progress and impact of different customer experience improvement tactics + +using relevant metrics, including support ticket volume and priority level (high, medium, low). + +(Gemini in Sheets) + +Customer Support Specialist +NEW + +Use case: Analyze customer feedback + +You have a spreadsheet that tracks customer feedback. You want to analyze it and brainstorm potential reasons + +for the trends. You chat with Gemini Advanced. You upload the file and type: + +I am a customer support specialist. Using the attached spreadsheet, identify trends and patterns in our + +[customer feedback] by [category] over [time period]. Identify areas where [customer outreach] has + +increased significantly and investigate potential reasons. (Gemini Advanced) + +18 + + Use case: Enable customer self-service + +Customer feedback has consistently said your return policy guidelines are unclear. You open a Doc that states + +the return, refund, and store credit policies. You prompt Gemini in Docs by selecting Help me write. You type: + +Summarize this content to write a clear and concise product return policy and outline 5 steps for + +customers to take in sequential order. (Gemini Docs) + +You like how simple the steps are. You repeat the process for your refund policy and store credit policy. Now, + +you want to use the newly simplified content to create a blog post for customers. Using your Google Doc with + +the newly written guidance, you prompt Gemini in Google Docs. You type: + +Take this content and turn it into a short blog with the title “Resolve Common Issues Without Agent + +Assistance.” Have separate sections for our return policy, our refund policy, and our store credit policy. + +(Gemini in Docs) + +Now you want to create an email template that the team can use when they receive customer questions around + +these three areas. You open a new Google Doc and prompt Gemini in Docs using Help me write. You type: + +Draft an email template to a customer that highlights self-service resources referencing [blog link] for + +[support issues]. Thank the customer for their business and assure them of our commitment to meeting + +their needs. (Gemini in Docs) + +Use case: Conduct voice of the customer research + +You want to email a dissatisfied customer to attempt to make things right. You open an email that includes a + +customer complaint. You prompt Gemini in Gmail by selecting Help me write. You type: + +Request a follow-up conversation on [date] at [time] with this customer who provided negative feedback + +to understand their concern and offer resolutions. Include example solutions. (Gemini in Gmail) + +The drafted response is a nice start, but you want to refine the language. You iterate by prompting Gemini + +in Gmail using Refine and Elaborate. Next, you want to create a short survey that you can send after each + +follow-up customer call. You open a new Google Doc and prompt Gemini in Docs. You type: + +Create five different questions to customers who have just spoken to an agent on the phone. Questions + +should gauge how effective the call was, if the customer’s concern was addressed, and if they would + +recommend our business to others. (Gemini in Docs) + +19 + + Executives + +As an executive, your time is incredibly + +constrained. Every decision you make can impact + +growth, innovation, and the trajectory of your + +business. Understanding your market and making + +informed, strategic decisions is paramount, and + +so is getting urgent tasks done while you’re on + +the go. + +This section provides you with simple ways to + +integrate prompts in your daily tasks. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of + +this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +Use case: Communicate on the go + +You are an executive about to board a long flight, and you just received an invitation for the next board meeting + +with an agenda. You have a couple of comments, and you want to propose adding a few topics to the agenda. + +You open Gmail, and you prompt Gemini in Gmail. You type: + + Draft an email confirming that I will be at the board meeting. Ask if we can adjust the agenda to give 15 + minutes to [urgent topics]. (Gemini in Gmail) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +Gemini in Gmail: [Drafts an email] + +20 + + + Gemini in Gmail + +The email looks good, but you want to make sure the tone is as formal as possible. You select Refine + +and Formalize. + +Gemini in Gmail: [Formalizes tone] + +Gemini in Gmail + +You read the email and select Insert. Before sending it, you make a light edit to thank the team for keeping you + +on track while traveling. + +21 + + Example use cases + +Chief Executive Officer +NEW + +Use case: Enhance personal productivity and time management + +You have important email threads that have numerous responses. You need to quickly catch up. You open + +the message in Gmail and read the automatically generated summary from Gemini in the Gmail side panel. To + +respond, you prompt Gemini in the Gmail side panel and tag relevant files by typing @file name. You type: + +Generate a response to [person] about [topic]. Include details on [deliverable] and [timeline] using + +@[Project A Status Report]. (Gemini in Gmail) + +NEW + +Use case: Create outlines of presentations in seconds + +Your team will pull together a presentation for you, and you want to provide an outline to get them started. You + +want to generate an outline using Gemini Advanced. You select the microphone icon and use your voice to + +prompt. You say: + +I’m the CEO giving a presentation to [audience] at [event], and I want to create a detailed outline for my + +team to get started. I want to include a few important topics, including [areas of focus] and how our + +company is innovating with [company initiatives]. I’m envisioning time for a customer Q&A to end the + +presentation. Include suggested questions we could ask of a customer from the [industry] industry about + +how they are using our [product] to achieve [business outcome]. (Gemini Advanced) + +Chief Operating Officer +Use case: Prepare challenging employee communications + +You’re hosting a quarterly town hall meeting with the entire company. You want to write uplifting remarks to open + +the meeting. You open a new Doc and prompt Gemini in the Docs side panel. You type: + +Write two uplifting paragraphs for employees who have just finished a challenging quarter. Acknowledge + +[difficulties] and emphasize [positives] for the upcoming quarter. Use a tone that is motivating, optimistic, + +and fosters a sense of unity and collaboration. (Gemini in Docs) + +22 + + You want to brainstorm and practice how you will respond empathetically to potentially tough questions. You go + +to Gemini Advanced and type: + +I’m the COO of a mid-sized company. I am hosting a quarterly town hall meeting with the entire + +company. I want to brainstorm and practice how I will respond to potentially tough questions. Help me + +write challenging questions that employees may ask at the upcoming town hall about [URL of company + +announcement]. Generate potential answers for each question that use a confident but firm tone. The + +responses should acknowledge the concern and let the employees know that we are striving to do our + +best for the entire company. (Gemini Advanced) + +Use case: Streamline responses on the go + +Your plans have changed, and you can’t attend a meeting. You need to provide the team with answers on a + +few key items. You open Gmail and use a voice command to prompt Gemini in Gmail. You say: + +Draft an email to [project lead] letting them know I will not be in the meeting due to an urgent matter. + +Ask them to take detailed notes and to ensure the team arrives at a decision on [key topic] in addition + +to assigning ownership of the postmortem report to [colleague]. (Gemini in Gmail) + +Chief Marketing Officer +NEW + +Use case: Perform market research and campaign planning + +You’re starting annual planning. You want to conduct research on your target audience. You chat with Gemini + +Advanced. You type: + +I’m a marketing leader conducting analysis in preparation for next year’s [launch]. Define my target + +audiences [audiences], for my new line of [product]. Include interests, relevant marketing channels, and + +top trends that drive their consideration and purchase behavior. (Gemini Advanced) + +Next, you export your findings to a Doc by selecting Share & export and Export to Docs. Now, you want to pull + +in relevant data from your own files by typing @file name. You prompt Gemini in the Docs side panel. You type: + +Brainstorm value props for my [target audiences] based on features from @[Product Requirements + +Document]. Include a section on campaign learnings from @[Campaign Performance]. (Gemini in Docs) + +23 + + Use case: Brainstorm content and thought leadership + +You finished a meeting with your social media team leads. You took notes in a Doc about what resonates with + +your audience, trending topics, target audience data, and keywords that are effective in driving engagement + +with your brand. You want to brainstorm potential thought leadership pieces using these insights. You prompt + +Gemini in the Docs side panel. You type: + +Generate a list of four relevant and engaging thought leadership blog post ideas for [company] based on + +trending topics, target audience analysis, and brand keywords. (Gemini in Docs) + +During the same conversation, the team discussed launching a new brand campaign. You know that your + +customers value your reliable and unique services, and your company has a long history of delivering for + +customers. You need help getting started with ideas on a new campaign tagline. You open a new Google Doc + +and select Help me write. You type: + +Generate three options for a new slogan emphasizing reliability, innovation, and a long history of + +popularity for [company]. (Gemini in Docs) + +The slogans help you get started with the creative process. You have upcoming events that could be the perfect + +place to test elements of a new campaign. You want to mock up ideas for booth graphics for your events team. + +You open a new presentation in Google Slides and select Create image with Gemini. You type: + +Create an image of a trade show booth using orange and blue colors. The booth should be modern and + +showcase interactive computer stations. (Gemini in Slides) + +Use case: Conduct competitive analysis + +Your team is considering expanding into a new line of business. To research, you go to Gemini Advanced, and + +you type: + +I am a CMO conducting a competitive analysis. My company is considering expanding into [a new line of + +business]. Generate a list of the top five competitors in the [industry] industry and include their pricing, + +strengths, weaknesses, and target audience. (Gemini Advanced) + +After going deeper in your research, you decide to create a five-year strategy to see what this could look like for + +the company. You type: + +Okay, I am going to try to convince my CEO that we should expand into [line of business]. Draft a concise, + +competitive strategy outline for the next five years for the [industry] industry across North America + +markets with potential goals, strategies, and tactics. (Gemini Advanced) + +24 + + After iterating to generate an appropriate outline, you fill in additional details and thoughts to make the + +document your own. + +Chief Technology Officer +Use case: Summarize emerging technology trends + +You need to catch up on emerging technology trends as the landscape is shifting quickly. You open Gemini + +Advanced, and you type: + +I am the CTO of [company] in [industry]. I want to understand emerging technology trends. Summarize + +the top five emerging technologies with the most significant potential impact on [industry]. For each + +technology, list its potential benefits and challenges, and suggest how it could impact [company] in the + +next two to three years. (Gemini Advanced) + +You want to dig deeper on specific topics, so you continue the conversation by typing: + +Recommend three areas where [my company] can take proactive steps to stay ahead of the curve on + +[specific areas]. (Gemini Advanced) + +Chief Information Officer +NEW + +Use case: Communicate technical topics to non-technical audiences + +You’re making the case to digitally transform your company by adopting generative AI solutions. You need to + +present to the CEO and other leadership. You want help in communicating technical topics to non-technical + +audiences. You chat with Gemini Advanced. You type: + +I am the CIO at [company], and I am trying to build the case to [adopt generative AI solutions]. I need to + +explain the technical concept of generative AI to a non-technical audience (the CEO and board). Help me + +write talking points that will help me convey what generative AI is, ways it could help us digitally transform, + +and why it’s important to our growth as a company. Include details about how it could potentially refocus + +our technical talent on more strategic work, help enhance our workforce’s productivity, and help us better + +serve our global workforce and customers. (Gemini Advanced) + +Gemini provides suggested ways to discuss the topic. You continue your brainstorm and then export your + +conversation by clicking Share & export and Export to Docs. Then, to build a presentation, you open a new + +Google Slide and prompt Gemini in the Slides side panel and tag relevant files by typing @file name. You type: + +I need to build a presentation to explain a technical topic to a non-technical audience. Generate + +an [introduction slide] that [describes what generative AI is] using @[Gen AI Explanation Notes]. + +(Gemini in Slides) + +25 + + You continue to use the same prompt, adjusting the topic to generate more slides for your presentation based + +on your notes. + +NEW + +Use case: Research vendor products, services, and features + +You’re working on a report to make a vendor recommendation. You visit Gemini Advanced and type: + +I am the CIO at [company]. We are currently evaluating vendor options to [replatform our intranet]. Right + +now, we use [vendor], but we are looking to switch because [we are unhappy with limited functionality and + +account support]. Suggest additional vendor options to consider and include descriptions of their product + +and services and key features. (Gemini Advanced) + +Use case: Develop technical summaries + +Your team just provided a lengthy technical report. You need to summarize it for your CEO. You open the Google + +Doc with the full report, and you prompt Gemini in the Docs side panel. You type: + +Summarize the key findings and implications of this report for [audience]. Focus on the main + +[vulnerabilities] identified and the recommended actions to address them. Use a formal tone. + +(Gemini in Docs) + +You make light edits to the summary and include it as an executive summary. + +Use case: Track IT assets + +Your company needs a quick way to track software access for new hires. You open a new Google Sheet and + +prompt Gemini in the Sheets side panel. You type: + +Create a tracker of software licenses for employees and include columns for license types, usage rights, + +and renewal dates. (Gemini in Sheets) + +Chief Human Resources Officer +Use case: Demonstrate employee appreciation + +You want to set up a new program to help everyone feel included, appreciated, and acknowledged across the + +organization. To brainstorm, you open a new Google Doc and prompt Gemini in the Docs side panel. You type: + +Brainstorm 10 employee appreciation ideas based on diverse employee interests such as cooking, + +gardening, sports, reading, and traveling. (Gemini in Docs) + +26 + + Gemini in Docs kick-starts your creativity, and now you have ideas for employee interest clubs and events. + +You also want to ensure your leadership team is regularly encouraging managers to recognize talent on their + +teams, so you create email templates they can use as inspiration. You prompt Gemini in Docs by selecting + +Help me write, and you type: + +Draft an email template that thanks [employee] for their hard work and [recent accomplishments]. Offer + +them an extra perk for their dedication, such as [a coffee gift card]. Use an upbeat and professional tone. + +(Gemini in Docs) + +Use case: Assess employee satisfaction + +You want to draft an anonymous survey that allows people to openly and honestly assess how they are feeling. + +To draft questions, you open a new Google Doc and prompt Gemini in the Docs side panel. You type: + +Draft an anonymous employee satisfaction survey with questions and answer options that touch upon + +key areas like workload, work-life balance, compensation, and career growth opportunities. Ensure the + +questions are clear, concise, and avoid leading answers. (Gemini in Docs) + +You received feedback from 15 senior leaders, and you’ve gathered all of the anonymous results in a Doc. + +You want to create a summary that you can use in your next call. You prompt Gemini in the Docs side panel. + +You type: + +Summarize the results of the employee feedback to identify key themes. (Gemini in Docs) + +27 + + Frontline +management + +As a frontline worker manager, your team’s work + +is indispensable to your organization — your team + +may not primarily complete its day’s work on a + +computer, but communication and collaboration + +remains key. + +This section provides you with simple ways to + +integrate prompts in your daily tasks. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of + +this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +NEW + +Use case: Find accurate information quickly + +A customer just approached you with a question about an ongoing sale. You could use help navigating the + +numerous files you have access to so that you find the right information quickly. You prompt Gemini in the Drive + +side panel. You type: + + Find the document that details the [company name]’s [holiday] sale details. (Gemini in Drive) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +28 + + Gemini in Drive + +Gemini in Drive returns suggested relevant files. From the side panel, you can directly summarize the files or you + +can click into a specific document. You open a suggested Doc to help answer the question. You prompt Gemini + +in the Docs side panel. You type: + + How much can customers save on [product type] during this sale? (Gemini in Docs) + +Gemini in Docs + +Gemini returns a response, which helps you answer your customer’s question in a timely manner. + +29 + + Example use cases + +Retail associate +NEW + +Use case: Improve team collaboration by finding + +and sharing information easily + +Your store recently updated its return and exchange policies. To find the information, you prompt Gemini in the + +Drive side panel. You type: + +Find the document that discusses our new return and exchange policies. (Gemini in Drive) + +Gemini returns suggested files that are related to the new policies. You directly click into the relevant file. Now, + +you want to send an email summarizing the document for your colleagues’ future reference. You open your + +email and prompt Gemini in the Gmail side panel. You type: + +Write an email to my new colleagues summarizing @[Updated Return and Exchange Policy H2 2024]. + +(Gemini in Gmail) + +You select Insert and further personalize the message before sending it. + +NEW + +Use case: Streamline task management + +You have a list of opening and closing duties that you must perform depending on what shift you are working. + +You want to keep yourself organized, so you create a tracker using the duties listed in your onboarding Doc. You + +open a new Google Sheet and prompt Gemini in the Sheets side panel and tag relevant files by typing + +@file name. You type: + +I am a retail manager and I need to create a checklist for my opening and closing duties. Create a + +template with columns for [opening and closing duties] from @[Onboarding New Hire Information]. + +(Gemini in Sheets) + +Gemini creates a spreadsheet. As you go through your day, you mark different tasks as complete. You have to + +leave your shift early, but you first need to communicate to the rest of the team what still needs to be done. You + +open your Gmail and prompt Gemini in the Gmail side panel and tag the spreadsheet you just created. You type: + +Write an email to the team telling them what still needs to be done from the AM shift from @[Opening and + +Closing Duties Tracker]. (Gemini in Gmail) + +30 + + Warehouse worker +NEW + +Use case: Manage inventory + +A customer wants to place a bulk order. You need to check the store’s inventory to see if you have enough to + +fulfill it. You open your inventory spreadsheet that tracks this information and prompt Gemini in the Sheets side + +panel. You type: + +How many [units] of [product] do we have left in our inventory? (Gemini in Sheets) + +NEW + +Use case: Manage audits + +Your warehouse is undergoing an inventory audit, and you’re in charge of verifying any numbers that are + +misaligned between your inventory tracker product total and what was counted during the audit. You prompt + +Gemini in the Sheets side panel. You type: + +Create a formula that helps me calculate the difference between two columns. Which items have a + +discrepancy in [the total number counted] versus [the quantity on hand]? (Gemini in Sheets) + +You verify Gemini’s response that there are only a few items whose count did not align to your inventory + +tracker’s total. You need to write a message to your supervisor telling them that you’re looking into the issue. + +You open your Gmail and prompt Gemini in the Gmail side panel. You type: + +I’m a warehouse worker managing an audit. Write a message to my supervisor to let them know that I am + +looking into the products whose counts are incorrect. (Gemini in Gmail) + +The drafted email looks good to go, so you hit send after reviewing. + +31 + + Human resources + +As an HR professional, you’re the backbone + +of your organization, and you deal with a large + +volume of confidential and sensitive information. + +You shape company culture, find and nurture + +talent, and ensure a positive employee + +experience. These are no small feats. + +This section provides you with simple ways to + +integrate prompts in your day-to-day tasks. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of + +this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +Use case: Welcome new employees + +You’re an HR manager working on a presentation script. You have a Google Doc full of notes, bullet points, and + +topics that you would like to cover. You begin by opening your Google Doc with notes, and you prompt Gemini + +in Docs. + + I am an HR manager, and I am developing a script for my presentation for new hires. I need to create the + + script for an onboarding presentation about our company’s commitment to employee development and + + well-being. Help me draft talking points that showcase why employee mentorship and development are + + core values for our company using @[Mission Statement and Core Values]. (Gemini in Docs) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +Gemini in Docs: [Drafts talking points] + +32 + + Gemini in Docs + +You select Insert. Now, you want to add more targeted talking points. You type: + + Add four talking points for a new section of the presentation script that explains how we support our + + employees’ development. Mention our training and certification programs and mentorship opportunities + +using @[Learning and Development Paths], and write a strong closing statement about our expectation + +that everyone contributes to a respectful and welcoming workplace. Use a professional tone. + +(Gemini in Docs) + +Gemini in Docs: [Adds talking points] + +You add in more details and then you’re ready to create a draft of the Google Slides that will accompany your + +talking points. + +Example use cases + +Recruiter +NEW + +Use case: Report on recruitment metrics + +The business is growing, and you have a large hiring effort underway. You want to see a holistic view of how your + +hiring efforts are going. You open your Google Sheet and prompt Gemini in the Sheets side panel. You type: + +Help me create a formula to calculate the total total number of [hires] by [department]. + +(Gemini in Sheets) + +33 + + You continue your conversation by prompting additional questions. You type: + +In what month did we hire the most people? (Gemini in Sheets) + +You continue with your line of questions until you feel ready to write your report. + +Use case: Manage the recruiting process + +You want to brainstorm potential ways the company can better manage the recruiting process. You open the + +team’s Google Doc with recruiting strategies. You prompt Gemini in the Docs side panel. You type: + +Create a list of strategies our recruiters can use to improve our existing recruiting process and identify + +potential job candidates. (Gemini in Docs) + +After creating a short recommendation for leadership on how the team will improve existing recruiting + +processes, the team receives guidance for a job opening for a content marketing manager. You open a new + +Doc and prompt Gemini in Docs. You type: + +I am opening a new job position on the marketing team. Write a compelling role description for a content + +marketing manager. Highlight key responsibilities [insert] and requirements, including B2B and B2C + +content creation, a minimum of five years experience, and a portfolio of writing examples. + +(Gemini in Docs) + +Use case: Manage the interview process + +You want to prepare questions for phone screen interviews. You decide to prepare by using Gemini Advanced. + +You upload the relevant file and type: + +I am a recruiter, and I am preparing for candidate interviews. Using the job description in the file I’m + +uploading, write a list of 20 open-ended interview questions that I can use to screen candidates. + +(Gemini Advanced) + +Use case: Communicate with candidates + +The team has made its hiring decisions. You open the Google Doc with notes on each candidate. You prompt + +Gemini in Docs by selecting Help me write. You type: + +I am writing an email to a job candidate who just finished the interview process. Create a template for + +an offer letter for the [selected candidate] for the [position] with a request to schedule a call to discuss + +benefits, compensation, and start date. (Gemini in Docs) + +34 + + Now, you want to generate personalized, empathetic email copy to send to the job candidates who will not + +receive an offer. You prompt Gemini in Docs by selecting Help me write. You type: + +I am writing an email to job candidates who finished the interview process, but who were not selected. + +Help me write a rejection letter for [candidate] for the [position]. Use an empathetic tone. + +(Gemini in Docs) + +HR Manager +NEW + +Use case: Conduct employee engagement and satisfaction surveys + +You are in charge of building a survey that will go out to all employees. You want to brainstorm ideas on + +questions to ask. You visit Gemini Advanced and type: + +I am an HR manager in charge of running our enterprise-wide survey at [company] to gauge employee + +engagement and satisfaction. Generate a list of questions I can use to build the survey. + +(Gemini Advanced) + +Your company has completed its annual employee engagement and satisfaction survey. Now, you want to clean + +up the data before you analyze it. You go to Gemini Advanced, upload the relevant file, and type: + +Help me clean my employee survey spreadsheet. Specifically, fill any blank values in the name column with + +“Anonymous,” and if the region column shows Headquarters, replace that with HQ. Finally, remove any + +rows where the satisfaction column is blank. Please generate a new file for me with my cleaned data. + +(Gemini Advanced) + +Use case: Create individualized learning and development plans + +NEW + +You have all of your company’s learning resources stored in your Google Drive. For each new hire, you want to + +create a tailored learning and development plan. To do this, you prompt Gemini in the Drive side panel. You type: + +Create a personalized learning and development plan for a new hire who needs to learn about [topic]. + +Organize it by day and suggest relevant files. (Gemini in Drive) + +Use case: Onboard employees + +The recruiters have just filled the company’s two open roles. Now, you’re in charge of ensuring the candidates + +have a smooth onboarding experience. You need help in structuring information for the new hires, so you open + +a Google Sheet and prompt Gemini in the Sheets side panel. You type: + +Create a table that outlines a new employee’s first-week schedule, including key meetings, training + +sessions, and introductions. Provide a column for key contacts and priority level (low, medium, high) for + +each activity. (Gemini in Sheets) + +35 + + Gemini in Sheets returns a formatted Google Sheet that you can now fill in with key contacts, meetings, and + +activities. The conditional formatting makes it easy for you to sort tasks by priority level with color-coded visual + +cues. Next, you need to create ways for the team to bond. You open a new Google Doc and prompt Gemini in + +the Docs side panel. You type: + +Design a team-bonding activity, such as an office scavenger hunt, to have team members work together + +during their team meeting. (Gemini in Docs) + +Gemini in Docs provides suggestions that help you brainstorm about the scavenger hunt. You tweak the outputs + +and get the idea approved by the team lead. Now, you need to communicate with the new hires about their first + +day when they will meet the team. You open Gmail and prompt Gemini in Gmail by selecting Help me write. + +You type: + +Draft an email to the new employees on the [team] to meet the rest of their team and explain the team- + +building purposes of the meeting. (Gemini in Gmail) + +Use case: Communicate key findings and draft follow-up surveys + +Now that you’ve finished onboarding new employees, you need to focus on ensuring that the latest company + +research data is easily understood by leadership. You’re committed to creating a welcoming environment for all + +employees where they can develop their skills. You open the Google Doc with the finalized report. You prompt + +Gemini in Docs by selecting Help me write. You type: + +Draft an email to senior leadership that summarizes the key findings from our [report]. Include a short + +introductory paragraph with bullet points on the most important findings. (Gemini in Docs) + +Gemini in Docs returns a summary with bullet points. You edit it and then use it to email the leadership team. + +As a follow-up action, you want to understand how changes made to company policies impact the employee + +experience. You open Gemini in Docs to begin drafting a survey. You select Help me write and type: + +Draft an anonymous employee survey with questions and answer options to monitor company progress on + +[topics]. (Gemini in Docs) + +36 + + Marketing + +As a marketing professional, you’re the creative + +force behind captivating campaigns, brand + +experiences, lead generation, and more. You + +understand the power of data-driven insights, + +compelling messaging, and connecting with your + +audience on a deeper level. + +This section provides you with simple ways to + +integrate prompts in your day-to-day tasks. For + +chief marketing officer (CMO) use cases, visit the + +Executives section of the guide. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of + +this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +Use case: Develop a visual identity + +You own your own consulting business and are often hired to function as a brand manager for your clients. + +You help businesses in a variety of industries. Your customer is getting ready to launch a coffee shop and video + +game cafe, and you need to kick-start the creative process by developing a visual identity. You want to ideate + +and provide early thoughts to the rest of the team. You decide to chat with Gemini Advanced. You type: + + Generate ideas for a creative and eye-catching logo for my new business, a coffee shop combined with + + a video game cafe. Generate a logo considering the following: + + Dual Concept: The logo needs to clearly signal both the coffee and gaming aspects of the business + + without being too cluttered. + + Target Audience: Appeal to a wide range of gamers (casual and enthusiast), as well as coffee lovers + + seeking a unique hangout spot. + +37 + + Style Options: I’m open to these approaches — let’s get a few examples in each of these three styles to + + compare: Modern and Playful: Bold colors, fun graphics, maybe a pixel art aesthetic. Retro-Cool: Think + + classic arcade style — chunky lettering, neon color inspiration. Sleek and Minimalist: Clean lines, + + geometric shapes, a more subtle nod to both themes. (Gemini Advanced) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +Gemini Advanced + +You like the retro-cool options. You continue your conversation and you type: + + I like the retro-cool options. Can you provide three more in that same style? (Gemini Advanced) + +Gemini Advanced + +Now that you have a sense of what the logo could look like, you want to brainstorm names. You type: + + Write a tagline and 10 potential names for the business to go with these logos. (Gemini Advanced) + +38 + + Gemini Advanced + +Example use cases + +Brand Manager +NEW + +Use case: Develop brand strategy + +You are working to refresh your company’s brand architecture and messaging frameworks. To get started, + +you visit Gemini Advanced and type: + +I am a brand manager at [company]. Help me define a clear and effective brand architecture for + +[company], considering its diverse products and service portfolio. For additional context, here is our + +current brand portfolio: [List all existing brands, products, and services]. Here is our company mission + +and vision: [Provide a brief overview of the company’s mission and vision]. And these are our target + +audience(s): [describe target audience(s)]. Our desired brand positioning is [explain how the company + +wants to be perceived in the market]. (Gemini Advanced) + +Use case: Brainstorm brand partnerships + +NEW + +You are working on a new brand campaign. You want to identify influencers or complementary brands you could + +partner with as part of the social amplification plan. You visit Gemini Advanced and type: + +I am a [brand manager] at [company] working to launch a new campaign focused on [topic]. Identify + +potential types of influencers and complementary brands that [company] could partner with to amplify + +the [campaign] on social media channels. The goal is to reach a wide audience of [audiences], while + +building credibility and driving engagement. (Gemini Advanced) + +39 + + Use case: Conduct market research and identify trends + +The landscape in your industry is rapidly changing, and you need to conduct market research to better identify + +and understand emerging trends. You go to Gemini Advanced, and you type: + +I need to do market research on [industry] industry to identify new trends. Use [URLs] to uncover + +emerging trends and shifting consumer preferences. (Gemini Advanced) + +After completing your research, you and the team have new messaging that you want to A/B test. You want to + +generate multiple variations of ad copy using Gemini Advanced. You type: + +I need to A/B test new messaging. Here is our messaging: [messaging]. Generate three different variations + +of ad copy. (Gemini Advanced) + +Use case: Create and manage content and distribution + +A customer has exciting organizational changes underway. You need to create content to shape the brand + +narrative of the company as it enters its next era. You open a Google Doc to get started on a blog draft. + +You prompt Gemini in Docs by selecting Help me write. You type: + +Create a blog draft announcing that [name] is joining [company] as [position]. [Share two or three + +details from their bio, such as their previous position and company, their involvement in professional + +organizations, etc.]. (Gemini in Docs) + +You also want a way to efficiently track how and where this content is amplified, so you open a Google Sheet. + +You prompt Gemini in the Sheets side panel. You type: + +Create a project tracker for content amplification and include columns for channel, owner, URL, + +and priority level (low, medium, high). (Gemini in Sheets) + +Marketing Specialist +NEW + +Use case: Improve collaboration with customers, agencies, and teams + +You are hosting a meeting discussing an upcoming project with multiple teams and an agency that will complete + +the project’s design work. You use Gemini in Google Meet and select Take notes with Gemini so that all + +participants can give their undivided attention to the conversation. After the meeting, Gemini provides a + +summary of the discussion and pulls out action items to keep the team on track. (Gemini in Meet) + +40 + + From the generated Doc with call notes, you want to create a spreadsheet to help keep the team on track. + +You open a new Google Sheet and prompt Gemini in the Sheets side panel and tag relevant files by typing + +@file name. You type: + +Generate a project tracker using the action items from @[Meeting Notes from Gemini]. + +(Gemini in Sheets) + +NEW + +Use case: Analyze social media trends and other data to reduce + +time to market + +You want to analyze different data sources and collate findings to help you reduce your time to market. + +You open Gemini Advanced and type: + +I am a [marketing specialist] at [company]. We are working on our [go to market] plans for [type of + +product]. Help me research social media trends around [topics]. Be specific about trending keywords, + +top influencer voices, and common themes in popular content. (Gemini Advanced) + +You verify Gemini’s response by selecting the Double-check response option beneath Gemini’s response. + +Now, you want to review a report you’ve commissioned that surveyed customers from different industries. + +You continue your conversation with Gemini. You upload the relevant file and type: + +Analyze the findings in this [report]. I am especially interested in any common themes about [topic] that + +stand out to you that will help me better position [marketing materials] for [product] for [target audience]. + +(Gemini Advanced) + +NEW + +Use case: Perform audience research and develop personas + +You need to refresh your audience research and persona development as the team updates webpage copy, + +pitch decks, and other marketing assets. You brainstorm and research using Gemini Advanced. You type: + +I am a marketing specialist focused on [area] at [company]. I need to conduct in-depth audience + +research so that I can develop convincing marketing artifacts for [personas]. To start, help me generate + +a comprehensive profile of [target audience]. Include core demographics and psychographics, online + +platforms they frequent, key pain points [product] could solve, and language and messaging that + +resonates with them. (Gemini Advanced) + +41 + + + Digital Marketing Manager +NEW + +Use case: Create and optimize copy for search engine marketing (SEM) + +You want to create a robust list of keywords and long-tail keywords and phrases to uncover new opportunities + +for SEM targeting. You go to Gemini Advanced and type: + +I am a digital marketing manager at [company]. I am working on SEM ads for [product]. Here are my seed + +keywords: [list keywords]. Help me generate a list of additional keywords and long-tail keywords and + +phrases that can help me maximize ad performance. (Gemini Advanced) + +After you finish brainstorming your keywords list, you want to generate a few variations of ad copy. You type: + +For my SEM campaign, use these keywords as inspiration to generate multiple ad copy variations + +with different headlines, descriptions, and calls to action for [product]. Use a [tone] tone in the copy. + +(Gemini Advanced) + +You want to further refine the text according to different audiences, so you type: + +Do the same thing, except write new options for [audience], adjust the tone to be [tone] and focus + +the copy on highlighting [feature] of [product]. (Gemini Advanced) + +Use case: Draft customer acquisition communications + +Email is one of your company’s main channels of direct communication with prospects and customers. You want + +help getting started with copy for a new email campaign. You open a new Google Doc, and you prompt Gemini in + +Docs by selecting Help me write. You type: + +Write three different email subject lines that reference [audience segments] and our [product]. Make them + +catchy but professional. (Gemini in Docs) + +Now you want to share the proposed email subject lines with the copywriting team. You open Gmail, and you + +select Help me write. You type: + +Write an email proposing [suggested email subject lines] to the copywriting team. Keep the email short + +and simple and request feedback by the end of week. Thank them for their help. (Gemini in Gmail) + +42 + + Use case: Generate inbound marketing campaigns + +The team created a new ebook on best practices for executives using our new solution. You’re creating a landing + +page to house the gated asset, and you need engaging copy. You open a new Google Doc and select Help me + +write. You type: + +Create compelling copy for a landing page promoting a new [ebook/webinar/free trial and details] + +designed for an executive target audience. Highlight key benefits and encourage conversions with + +persuasive calls to action. (Gemini in Docs) + +The webpage launched, and you’re now running an inbound marketing campaign. You need to nurture the leads + +that downloaded your latest ebook. You open a new Google Doc, and you prompt Gemini in Docs by selecting + +Help me write. You type: + +Generate copy for a sequence of five automated emails to nurture leads after they download the ebook + +on [topic]. Personalize emails and encourage further engagement [with other valuable resources or + +offers]. (Gemini in Docs) + +Content Marketing Manager +NEW + +Use case: Deliver personalized content to customers at scale + +You want to create copy for a five-step email nurture cadence for your new product. You open a new Google + +Doc and prompt Gemini in the Docs side panel and tag relevant files by typing @file name. You type: + +Create a 5-step nurture email cadence to [prospective customers] who have signed up for [our + +newsletter], with the goal of getting them to [purchase] [product] using @[Product Specific Notes] + +and @[Product FAQ]. (Gemini in Docs) + +NEW + +Use case: Create visuals for ad campaigns + +You want to create visuals to help your creative agency better understand the team’s direction for an upcoming + +campaign. You open a new Google Slide and prompt Gemini in Slides. You type: + +Help me create inspirational images for a marketing campaign for [type of product]. Images should use + +[colors] and [natural elements, such as clouds]. Use a [photorealistic] style. (Gemini in Slides) + +43 + + Use case: Generate inspiration for your blog + +You work for a travel company as the content marketing manager for the company’s blog channel. You need + +to kick-start the brainstorming process for a new blog post. You decide to gather ideas by collaborating with + +Gemini Advanced. You type: + +Suggest blog post topics that would be interesting for people passionate about travel and the tourism + +industry. Here’s what I want you to focus on: Make the topics unique. There are lots of tourism blogs out + +there — let’s come up with fresh angles that would stand out. Keep the topics relevant. Tap into current + +trends or recent challenges/innovations within the tourism industry when brainstorming. I’d like each topic + +to include: + +Target audience: Who would this topic specifically appeal to? + +Content outline: A few bullet points with the main ideas the blog post would discuss. + +Call to action: Suggest one way to engage the reader at the end of the post. (Gemini Advanced) + +You love the initial ideas you were able to create. You also need to focus on generating creative imagery to + +accompany the copy in the blog. You type: + +Create an image of a plane flying above the clouds over mountains and rivers during sunrise that I can use + +in the marketing campaign to promote my travel company. (Gemini Advanced) + +Use case: Create social media posts + +You’re focused on creating content that is optimized for social media channels. You need to gather ideas for + +content targeted to distinct audiences. You open a new Google Doc and prompt Gemini in Docs by selecting + +Help me write. You type: + +Write three engaging social media posts about [product/service/topic] that would appeal to [target + +audience]. Keep each social media post to two sentences and include a call to action to visit [our website]. + +(Gemini in Docs) + +You also need to craft social media posts to drive registration for an upcoming event targeting recent grads. + +You open a new Google Doc and you prompt Gemini in Docs by selecting Help me write. You type: + +Create a social media post promoting our upcoming [event name]. Include attention-grabbing language + +and relevant hashtags for [audience]. (Gemini in Docs) + +44 + + Use case: Create a strategic marketing plan + +Your company is launching a new app. You need a robust marketing plan, but you want ideas to get started. + +You chat with Gemini Advanced. You type: + +I’m developing a marketing plan for a new app that provides [functionality]. My target audience is + +[audience]. Help me create a plan with a focus on [marketing channels]. Here’s what I’d like you to cover: + +competitor analysis, ideal marketing channel mix with rationale, budget recommendations, key messaging + +ideas, and proposed campaign timeline with KPIs. (Gemini Advanced) + +The responses from your chat are helpful in shaping your marketing plan. You need to get the high-level details + +to your chief marketing officer (CMO). You open Gmail and prompt Gemini in Gmail by selecting Help me write. + +You type: + +Draft an email to the CMO telling them that I will provide a one-pager with a strategic marketing plan for + +the new app launch project by [date], and it will include an executive summary, overview of the competitive + +landscape, top marketing channels, and the target demographic for all South American markets. + +(Gemini in Gmail) + +45 + + Project +management + +As the conductor of complex, ever-evolving + +projects, your mission is to navigate timelines, + +coordinate teams, and ensure your programs + +deliver the intended impact. + +This section provides you with simple ways to + +integrate prompts in your daily tasks. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of + +this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +Use case: Generate user acceptance tests + +Your team completed the registration form for a new website, and now you need to generate user acceptance + +tests (UATs). To start, you visit Gemini Advanced and type: + + Create a table with 10 user acceptance tests (UAT) for the website registration form. (Gemini Advanced) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +Gemini Advanced + +46 + + You think the results are a helpful starting point, so you copy the results to a Google Sheet before drafting an + +email to your colleague who is running the UATs. You want to explain what they need to do. You continue your + +conversation with Gemini Advanced. You type: + + Draft an email to [my colleague] who is running this UAT and explain what they need to do next. + +(Gemini Advanced) + +Gemini Advanced + +The drafted email provides a helpful starting point, so you export the results to Gmail, and you make edits + +directly before sending the message to your colleague. + +Example use cases + +Project Manager +Use case: Report on project status + +You just had a lengthy call with all of your project stakeholders, and now you want to summarize what was discussed +and follow up with assigned action items. In the Google Doc with the meeting transcript, you prompt Gemini in Docs. +You type: + +Summarize this call transcript in a short paragraph. In bullet points, highlight the action items, decisions + +made, and owners for each item based off of [call transcript]. (Gemini in Docs) + +47 + + You need to update your manager based on the activity from the last call. You want to templatize how your + +project status updates are delivered. You open a new Google Doc, and you prompt Gemini in Docs by selecting + +Help me write. You type: + +Draft a project status update email template to send to my manager. Include sections for a summary of + +key accomplishments this week, any challenges faced, and the top three priorities for next week. + +(Gemini in Docs) + +The team just hit its key milestones an entire week early. It’s been a challenging project, so you want to gather + +everyone to celebrate together. You open Gmail and prompt Gemini in Gmail by selecting Help me write. + +You type: + +Write an invitation for a team lunch to celebrate the progress made on a project and include [date, time, + +and location]. Thank them for all of their hard work and acknowledge that this has been a challenging + +project. (Gemini in Gmail) + +Use case: Create a project retrospective + +You’ve just wrapped the project, and your senior leadership team needs a project retrospective. To kick-start + +the process of gathering feedback, you open a Google Doc and prompt Gemini in Docs by selecting Help me + +write. You type: + +I need to write a report detailing the successes, failures, and lessons learned from [project]. Draft a list + +of 20 questions to guide a cross-team process investigation. Include questions to uncover what worked, + +what didn’t, specific process breakdowns, technical issues, communication gaps, or any other potential + +contributing factors to the problem or success of the project. (Gemini in Docs) + +The questions give you a great starting place. You edit them before sharing with the team for their input. After + +you gather everyone’s feedback, you want help structuring the report. You prompt Gemini in Docs by selecting + +Help me write. You type: + +Summarize this document in two paragraphs. Include high-level information about the project’s goals, + +the main contributors, the outcomes of the project, and any key successes or failures. (Gemini in Docs) + +Use case: Develop an issue tracker and related communications + +You need to create a project issue tracker to keep track of risks and solve them in a timely manner. You want + +to create a template quickly, so you open a new Google Sheet and prompt Gemini in the Sheets side panel. + +You type: + +Create a spreadsheet to track project issues, including descriptions, status, assigned owner, and action + +items for resolution. (Gemini in Sheets) + +48 + + Before the project fully kicks off, you want to have standardized communication templates at your disposal. + +For example, you want an email that can be used if an issue arises. You open a new Google Doc and prompt + +Gemini in Docs by selecting Help me write. You type: + +Draft an email template to announce when an issue arises and include causes, solutions, and timelines + +to resolve it. (Gemini in Docs) + +You like the template that Gemini in Docs creates, and you want to create an additional, slightly different email + +template. In the same Google Doc, you prompt Gemini in Docs by selecting Help me write. You type: + +Draft an email template to a stakeholder to escalate a critical project issue, outlining the impact and + +proposed solution. (Gemini in Docs) + +Technical Project Manager +NEW + +Use case: Create a workback schedule + +You are the technical project manager for a software release. You already have the scope of the project + +documented. Now, you want to get started on building a workstream tracker and workback schedule. + +You go to Gemini Advanced and type: + +I am a [technical project manager] at [company] overseeing [project and brief project description]. + +The project has the following scope: [scope]. Our project goals are: [project goals]. Our project + +deliverables are: [project deliverables]. Our budget is [budget], and our delivery date is [delivery date]. + +Help me create a workback schedule to keep the team on track. Include dates for key milestones and + +demos. (Gemini Advanced) + +49 + + Sales + +Understanding your customers inside and out + +is your ticket to success. You’re in charge of + +maintaining critical relationships, deciphering + +buying signals, crafting tailored solutions, driving + +revenue for the business, and more. + +This section provides you with simple ways to + +integrate prompts in your daily tasks. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of + +this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write + +follow-up prompts to build on the initial generated response. + +Prompt iteration example +Use case: Conduct customer research + +You’re an account executive, and you’ve just been assigned to a new customer. You need a research assistant. + +You will need to get to know key contacts at the account to begin building trust between your teams, but first, + +you want to send an introductory email, so you open Gmail and prompt Gemini in Gmail by selecting Help me + +write. You type: + + Write an email to [name], the new [title] at [company]. Congratulate them on their new role. Introduce me + + as their contact point at [company name]. Invite them to lunch next week and check if they prefer Monday + + or Tuesday. (Gemini in Gmail) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +Gemini in Gmail: [Drafts email] + +50 + + Gemini in Gmail + +This provides a helpful starting point, but you want to try getting an even better response. You click Refine + +and Formalize. + +Gemini in Gmail: [Generates refined email suggestions] + +Gemini in Gmail + +You’re happy with the email, so you click Insert. You read the message one last time, make final light edits + +directly, and then send the message. Now, you want to learn more about the customer and how it markets itself. + +To research, you visit Gemini Advanced and type: + + I am an account executive in charge of a new account, [customer name]. I need to do initial research. + + What is the market strategy of [customer]? (Gemini Advanced) + +51 + + Gemini Advanced + +Gemini provides you with useful information to get started in your research. You continue your research by first + +focusing on news announcements. You gather a list of URLs, and you paste them into your conversation with + +Gemini Advanced. You type: + + [URLs] Summarize these articles. Provide key insights and contextualize why these announcements are + + important. (Gemini Advanced) + +Now you have a clear summary of what was announced, why the news is important, and additional insights. Next, +you want to better understand the executive who will be your main point of contact. You find a recorded interview +featuring the executive. You paste the YouTube URL into your conversation with Gemini Advanced and type: + + [YouTube URL] Summarize this interview and tell me more about [executive name]. What does [executive] + + care about? (Gemini Advanced) + +You continue the conversation with additional lines of questioning to build familiarity with your key contact and + +the account. You prompt: + + Tell me how [company] can help [customer company] with achieving their goals. (Gemini Advanced) + +Once you wrap up your conversation, you export your results into a Google Doc. You open the Google Doc and + +prompt Gemini in Docs. You type: + + Create an email draft for [customer] explaining why [your company] is the perfect partner for them to + + achieve their market goals. (Gemini in Docs) + +52 + + Example use cases + +Customer Success Manager +NEW + +Use case: Map customer journeys + +It’s your first time onboarding a new customer, and you realize you could benefit from creating custom-tailored + +assets. You open a new Doc and prompt Gemini in the Docs side panel and tag relevant files by typing @file + +name. You type: + +Create personalized onboarding materials for [customer]. Use @[Standard Onboarding Documents] and @ + +[New Customer Migration Notes] to personalize the assets. (Gemini in Docs) + +Sales Manager +NEW + +Use case: Manage the request for proposal (RFP) process + +You’ve just received an RFP, and you want to quickly ingest the request as part of your information gathering + +process. First, you want to do basic research on the company that issued the request. You visit Gemini + +Advanced and you type: + +I just received an RFP from [company]. Before I dive into the RFP, I want your help in conducting research. + +Give me a business profile of the company including all of the basics (where they are located, what they + +provide for customers, who their target audience is, any recent news from the company). Be as detailed + +as possible as I want to see a full view of [the company]. (Gemini Advanced) + +Once you finish your research on the company, you want to summarize the RFP. You continue your conversation + +with Gemini. You type: + +[URL or uploaded file] I am a sales manager at [company], and this is the RFP we’ve received from + +[company]. Summarize this content in a few paragraphs. What is the customer seeking, what is the + +budget, and when is a response due by? (Gemini Advanced) + +NEW + +Use case: Access information and tools on your phone while on the go + +You are working remotely from your phone. From the mobile app, you open a thread in Gmail and select the + +Gemini chip to Summarize this email. Gemini quickly provides you with a summary of the back and forth so + +that you can focus on the most important points. (Gemini in Gmail) + +Now, you want to generate a response acknowledging the latest developments. You prompt Gemini in Gmail. + +You type: + +Write a response to this email letting [them] know that I’ve received the message and will take [action] + +by [Friday]. (Gemini in Gmail) + +53 + + Use case: Develop customer relationships + +Your annual conference is coming up, and your most important prospects will be there. You want to personally + +invite them to a happy hour. You open Gmail and prompt Gemini in Gmail by selecting Help me write. You type: + +Write an email inviting people interested in [focus area] to our happy hour taking place on [date, time] at + +[trade show event]. Include that we specialize in [focus area]. (Gemini in Gmail) + +Now that the event is over, you want to follow up with customers who came to the happy hour. You open Gmail + +and prompt Gemini in Gmail by selecting Help me write. You type: + +Draft an email thanking customers for their time at the happy hour on [date, time, location]. End with an + +invitation to continue the conversations in the next few weeks. Use a friendly tone. (Gemini in Gmail) + +You want to check in with the customers who attended workshops at the conference because their early + +feedback is important. You prompt Gemini in Docs. You type: + +Draft 10 questions that I can use to survey customers about their recent experience with our [product/ + +service]. Include questions to gauge how useful [the product] is, what they liked, and what they thought + +could use improvement. (Gemini in Docs) + +Use case: Support the sales team + +You need to contact all of your team leads in the Southeast region to provide immediate guidance on how to + +proactively reach out to customers about an ongoing issue. You open Gmail and prompt Gemini in Gmail by + +selecting Help me write. You type: + +Draft an email to all Southeast region sales leads. Inform them of [issues]. Advise them to communicate + +with their teams to contact their customers and offer a 20% discount on a future order as an apology. + +(Gemini in Gmail) + +Now, you need to email all of the regional team members. You open Gmail and prompt Gemini in Gmail by + +selecting Help me write. You type: + +Draft an email to the regional sales representatives about an urgent meeting that needs to take place next + +week about the [issues]. Ask them to provide availability on Monday or Tuesday. (Gemini in Gmail) + +Use case: Coach and train the sales team + +You’ve heard from many team members that they want more learning opportunities. You’re organizing a half-day + +learning program to support this request. You need to create a schedule, so you open a new Google Doc and + +54 + + prompt Gemini in Docs by selecting Help me write. You type: + +Create a half-day agenda for an educational session on our latest technology [products] for sales teams. + +Include time for the product development team to present and include time for lunch. (Gemini in Docs) + +As a follow up to the team meeting, you want to highlight different learning opportunities available. You open + +Google Sheets and prompt Gemini in the Sheets side panel. You type: + +Create a spreadsheet that tracks online courses for sellers. Include columns for the course’s main topic, + +price, duration, and priority level. (Gemini in Sheets) + +Account Manager and Account Executive +NEW + +Use case: Improve collaboration and execution by customizing + +sales materials + +You are having an important meeting with a customer. From Google Meet, you turn on Transcription and + +activate Gemini in Meet by selecting Take notes with Gemini. The transcript provides an unedited Doc of + +what was said. The Take notes with Gemini file will generate notes recapping the meeting, important topics + +discussed, and action items. Now, you can fully engage with the customer conversation. (Gemini in Meet) + +After the call, you want to send a recap message to the customer. You open a new message and prompt Gemini + +in the Gmail side panel and tag relevant files by typing @file name. You type: + +Write a message to [customer] thanking them for their time at our last [meeting]. Provide a quick + +summary of the meeting and acknowledge any pain points discussed. Ask for additional time to + +discuss our [solution] using @[Customer Meeting Gemini Notes]. (Gemini in Gmail) + +In preparation for your next meeting, you want to use the transcript and your existing sales materials to generate + +a customized asset that showcases how your company’s product solves the customer’s pain points mentioned + +during the call. To do this, you open a new Doc and prompt Gemini in the Docs side panel and tag relevant files + +by typing @file name. You type: + +I am an [account manager] and I just finished a call with [customer]. I want to summarize the [pain points] + +mentioned by [customer] during our last meeting. Provide a list of direct quotes from @[Customer Call + +Transcript] where [customer] discusses what they are trying to solve. (Gemini in Docs) + +You read through the summary of pain points and see that they capture what was discussed. You click Insert + +from the side panel. Then, you want to use your existing files to generate custom responses to each of their pain + +points. You prompt Gemini in the Docs side panel again and tag relevant files. You type: + +I need to create convincing reasons why [customer] should adopt [product] to solve for [their pain points]. + +Write specific reasons why [product] from [company] could help them achieve their [business goals] using + +@[Product Sales Kit Full Assets]. (Gemini in Docs) + +55 + + Use case: Build customer relationships + +You just had a great call with a customer and now you want to use the notes you took from the meeting in + +Google Docs to draft an email to the customer. In the Google Doc with your notes, you prompt Gemini in Docs + +by selecting Help me write. You type: + +Compose a personalized follow-up email to [client] following an initial conversation. Summarize the key + +points we discussed and address any outstanding questions. (Gemini in Docs) + +The account has just adopted one of the company’s service offerings and you need to ensure that they feel + +supported during the onboarding process. You want to make sure you check in on how things are progressing + +once a week, but you want to explore what the emails could look like. You open a new Google Doc and prompt + +Gemini in Docs by selecting Help me write. You type: + +Draft four email templates to check in on my customer weekly now that they have purchased our new + +[service]. Use one value proposition (cost, ease of use, security, availability, and customization) as the + +main topic for each email, and include [call to action] in each message. (Gemini in Docs) + +Use case: Prepare for new customer calls + +You have an upcoming call with a prospect. This is a brand new use case for you, and you need help preparing + +for the call. You visit Gemini Advanced, and you type: + +Draft a customized script for me to follow during my sales call with a prospect. The call will happen over + +a video call and is set to last 30 minutes. Make sure to add the following in the script: how [company + +products/solutions] can help address potential customer’s pain points, how [company]’s delivery system + +guarantees seamless and timely delivery, competitive pricing and volume-discount table, and space for + +a customer reference in the [customer’s industry] industry. (Gemini Advanced) + +Now that you’ve done initial research, you export your findings to a new Google Doc. You open the Google Doc + +and continue working. Now, you want to create a tailored pitch. Using the Google Doc with all of your research + +notes, you prompt Gemini in Docs by selecting Help me write. You type: + +Generate an elevator pitch for [product name] and include key benefits, competitive points of + +differentiation, and the pain points that [product name] solves for. (Gemini in Docs) + +56 + + You have a great start to your elevator pitch and short talking points. You want to use this to further anticipate + +how the customer call might go. You resume your meeting preparation by returning to Gemini Advanced. + +You type: + +I have an upcoming call with a prospect. [Use case] is a new use case for me, and I need help preparing for + +the call. List the most likely objections [customer] might have for me during a sales call, with suggestions + +on how to respond to them. I work in [industry], and I am trying to sell [product]. Also provide ideas on how + +to handle objections and suggest ways to respond. (Gemini Advanced) + +Business Development Manager +Use case: Nurture relationships, personalized outreach, and +thought leadership + +You’re hoping to build deeper relationships with prospective customers that you recently met. You want to draft + +a template that you can customize for multiple contacts. You open a new Google Doc, and you prompt Gemini in + +Docs. You type: + +Draft an outreach email template to industry influencers. Express gratitude that we connected at [event], + +and propose collaboration opportunities such as [opportunities]. (Gemini in Docs) + +After having a successful call with prospective customers, you want to follow up with thought leadership content + +from your founder that they may find interesting. You open the Google Doc with the blog post, and prompt + +Gemini in Docs by selecting Help me write. You type: + +Summarize this blog content in bullet points and generate three ideas for follow-up questions I can ask my + +customers about their thoughts. (Gemini in Docs) + +Use case: Generate personalized customer appreciation materials + +You want to personally thank your customers and check in. You open Gmail and prompt Gemini in Gmail by + +selecting Help me write. You type: + +Generate a personalized email for [customer] on their one-month anniversary working with [company]. + +Thank them for being a customer. Ask them if they have any questions. Include information about [other + +product]. (Gemini in Gmail) + +You also want to send these customers a gift to thank them. You open a Google Sheet and prompt Gemini in the + +Sheets side panel. You type: + +Give me a list of gifts to send new clients that are under $200 and can be shipped to offices. + +(Gemini in Sheets) + +57 + + Small business +owners and +entrepreneurs + +As the owner of a business, getting the most + +out of your working hours is critical when you’re + +juggling multiple roles and responsibilities. + +Understanding your market, delivering for + +your customers, and staying on top of many + +competing priorities is critical. + +This section introduces you to AI prompts designed to simplify complex choices with AI data analysis, + +streamline your email inbox, and help you stand out with creative marketing tactics. Discover how Gemini for + +Google Workspace can help you unlock deep insights, foster collaboration, and help propel your company to + +new heights. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning + +of this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Workspace. The prompt iteration example shows how you could write follow-up + +prompts to build on the initial generated response. + +Prompt iteration example +Use case: Create pricing comparison + +You are the owner of a local spa. You are evaluating offers you’ve received from two different cleaning + +companies. You want to find a company with the right price, flexibility, and level of service. You open a new Doc + +and prompt Gemini in the Docs side panel and tag relevant files by typing @file name in your prompt. You type: + + I’m a business owner and I’m trying to determine the right cleaning vendor using + + @[Company A Proposal] and @[Company B Proposal]. I need someone to come twice a week, + + and I want them to vacuum, mop, dust, clean the windows, and wipe down all surfaces. If available, + + include information about the booking and cancellation policy. Create a comparison table between + + the two companies’ proposals. (Gemini in Docs) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +58 + + Gemini in Docs + +Gemini returns a formatted table comparing the two proposals. After you make your decision, you go to your + +email and prompt Gemini in the Gmail side panel. You type: + + Write an email to Company A thanking them for their time and their proposal. Ask for a few times + + to meet to schedule cleanings. (Gemini in Gmail) + +Gemini in Gmail + +59 + + Example use cases + +Owner +Use case: Enhance personal productivity + +You have many important email messages to catch up on. You open your email and select an important thread. + +You open Gemini in the Gmail side panel, and it automatically summarizes the content. (Gemini in Gmail) + +Use case: Brainstorm and generate marketing content + +As the business owner, you are also responsible for marketing your services via your social channels, + +your email-based newsletter, and email marketing. You aren’t sure where to start, so you chat with + +Gemini Advanced. You type: + +I own a [type of business] in [location]. I am working on marketing materials to advertise [event/sale] on + +[services]. I want to focus on using this sale to bring in repeat customers who haven’t purchased in a while + +and new customers alike. I want the social posts to feel [inspirational] and [fun]. Suggest some social copy + +I can use on [social platform] with relevant hashtags, suggested newsletter copy, and two email drafts + +(one for existing customers and one for new customers). (Gemini Advanced) + +You like the suggestions Gemini provided, so you select Share & export and Export to Docs. You want to + +continue your brainstorm, so you ask Gemini: + +What are some other effective [event/sale] tactics I can use to bring in new customers? I don’t always want + +to offer discounts. Are there other incentives I am overlooking? (Gemini Advanced) + +You continue your conversation with Gemini and are able to create a solid list of marketing tactics to try. + +Use case: Develop a competitive analysis + +You started a company, and your online business is gaining traction. You have always dreamed of opening a + +brick-and-mortar store, and now might be the perfect time. You want a thought partner to help you better + +understand the current landscape. You open Gemini Advanced, and you type: + +I am an online business owner. I am considering opening a brick-and-mortar store. Conduct an analysis + +into the competitive landscape focusing on [focus area]. Provide the strengths and weaknesses of + +[key competitors] in this area, including their specific strategies, tactics, and results. Identify actionable + +insights and recommendations for how [my company] can improve its approach and gain a competitive + +advantage. (Gemini Advanced) + +60 + + You gathered useful information from your discussion with Gemini Advanced. You want to go deeper in your + +brainstorming around two competitors in particular. You type: + +Generate a competitive analysis of [company] versus [competitor] within the current market landscape. + +(Gemini Advanced) + +You select Share & export and Export to Docs. + +Use case: Conduct fundraising and investor relations + +You’re ready to reach out to potential investors to make your brick-and-mortar store a reality. You want help + +getting started on an email to investors, so in the same Google Doc with your competitive analysis research, you + +prompt Gemini in Docs. You type: + +Draft a personalized email template to potential investors, highlighting [company’s] unique value + +proposition and recent progress on [initiatives]. Request a time to meet to discuss opportunities to + +collaborate in the next month. (Gemini in Docs) + +The email template gives you a starting place. You tweak the draft and continue to add a few personal touches + +before sending the email to the potential investors. After a successful meeting with them a month later, you want + +to draft a thank you message. You open your Google Doc with the meeting transcript and notes. You prompt + +Gemini in Docs to help you write an email draft. You type: + +Draft an email thanking a potential investor for the call and ask for time to schedule a follow-up meeting to + +address [questions and concerns]. (Gemini in Docs) + +Use case: Manage time off policies and tracking + +You have a lengthy handbook detailing all of your company’s policies and procedures. You want to make the + +time-off request policy easily digestible for new hires. You open the Google Doc with the handbook. You prompt + +Gemini in Docs by selecting Help me write. You type: + +Generate a step-by-step checklist summarizing the company’s time-off request policy. Ensure it is written + +in plain language and easy for employees to understand. (Gemini in Docs) + +You need a quick way to track staffing each week because many of your employees are shift-based. You open + +Gemini in the Sheets side panel. You type: + +Create a table that tracks weekly staffing. Create columns for date, name, shift (AM or PM), and notes. + +(Gemini in Sheets) + +61 + + Startup leaders + +You thrive in fast-paced, dynamic environments + +where you can wear many hats and make a + +tangible impact. You’re driven by a passion + +for innovation, a desire to learn and grow, and + +a tolerance for risk. Your work is unique in its + +variety, its potential for high reward, and its direct + +connection to the company’s success. You’re not + +just executing tasks; you’re building something + +from the ground up, shaping the future of + +your company, and potentially disrupting + +entire industries. + +Gemini for Google Workspace can help you redefine productivity and foster meaningful connections with + +investors, customers, and coworkers. This section provides practical prompts and real-world use cases + +designed specifically for you and your team. Learning to write effective prompts with Gemini for Workspace + +will help improve your productivity and streamline your everyday tasks, giving you more time to focus on + +strategic work. + +Getting started + +First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning + +of this guide. + +Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can + +collaborate with Gemini for Workspace. The prompt iteration example shows how you could write follow-up + +prompts to build on the initial generated response. + +Prompt iteration example +Use case: Brainstorm business and strategy + +You just had a productive planning and strategy brainstorming session with colleagues and you took many notes + +physically on a whiteboard. You snap a quick image with your phone and upload it directly to Gemini Advanced. + +You type: + + I am a founder at a startup focused on [industry]. I was brainstorming with colleagues about [topic], and + + we took notes on this whiteboard. Turn these notes into text. (Gemini Advanced) + +• + + Persona + +• + + Task + +• + + Context + +• + + Format + +62 + + Gemini Advanced + +Now you want to proactively continue brainstorming before you recap all of the ideas and notes for the group in + +a follow-up email. You continue the conversation and type: + + Suggest follow-up items we could discuss for our [topic of brainstorm session]. What was not covered + + that could have been, and what are we potentially missing? (Gemini Advanced) + +Gemini Advanced + +63 + + You save all of your notes by clicking Share & export and Export to Docs. You are ready to send the recap + +message to the team, so you open your email and prompt Gemini in the Gmail side panel and tag the relevant + +file of notes by typing @file name. You type: + + Use @[Brainstorm Notes and Ideas 9/1/24] to write a meeting recap to the team using an upbeat and + + friendly tone. Share some of the ideas I have for our next meeting to discuss [topic]. (Gemini in Gmail) + +Gemini in Gmail + +Example use cases + +Founder +Use case: Create an elevator pitch (speech to text) + +You’re scheduled to present to a group of prospective investors. This will be your first time discussing your + +business with this audience. You need to work on your elevator pitch, so you chat with Gemini Advanced using + +your voice to prompt. You select the microphone icon and say: + +I’m the founder of [startup] in [industry], and I need help creating a short elevator pitch for [company + +and product description]. I need to make the pitch relevant to [audience] and I want to especially highlight + +[key features of product] because I want them to [take this action]. Include a compelling hook and + +anticipate questions an investor might have. Make the tone professional but relaxed and confident. + +(Gemini Advanced) + +64 + + Use case: Develop your personal brand + +As your company grows, you’re working on increasing your social media presence, so you want to define and + +hone your personal brand. To brainstorm, you turn to Gemini Advanced. You type: + +Help me grow my personal brand. I am the founder of [a startup] in [industry]. I am passionate about + +[topics]. I want to inspire [audience] with business tips and lessons I’ve learned from starting my own + +company. My goals are to build a following so that I can [generate more media] for the business. + +What are some ideas you have for how to accomplish this? (Gemini Advanced) + +Gemini returns insights into how you can begin to build messaging and content that aligns to your personal + +brand and that can help you achieve your goals. + +Head of Operations +Use case: Communicate and negotiate with vendors + +You’ve received a quote from two different manufacturers to create packaging for the company’s new product. + +You want to compare and contrast the offers before you negotiate. You open a new Doc and prompt Gemini in + +the Docs side panel and reference relevant files by typing @file name. You type: + +I need to make a vendor decision for packaging manufacturing. Create a table that compares the two + +proposals I’ve received @[Company A’s Proposal] and @[Company B’s Proposal]. (Gemini in Docs) + +Gemini creates a table comparing the two different proposals. You make a decision, but now you want to see + +if you can negotiate with your preferred vendor. You go to your inbox and start a new email draft. You prompt + +Gemini in the Gmail side panel. You type: + +Create an email draft to [selected vendor] telling them that I’ve decided to move forward with them as the + +[packaging] vendor, but I would like to negotiate [a bulk pricing discount]. Use a collaborative tone. + +(Gemini in Gmail) + +Gemini in Gmail returns a drafted message that is ready to send. You select Insert and send the email. + +Use case: Plan and track budgets + +You’re in planning mode and you first want to understand where previous years’ budgets were spent. You have + +all of this data in a Sheet. You decide to chat with Gemini Advanced. You upload the Sheet and prompt Gemini + +by typing: + +Using the attached spreadsheet, identify trends and patterns in our expenses by category over the last + +three years. Identify areas where costs have increased significantly and investigate potential reasons. + +(Gemini Advanced) + +65 + + Gemini returns a response that helps inform your budget proposal for next year. + +Head of Product +Use case: Develop a product launch plan + +Your team is creating a new product, and you want to conduct research to inform your launch plan in + +collaboration with the marketing team. Using Gemini, you want to simulate different launch scenarios based on + +factors like pricing, marketing strategies, and target audience. You go to Gemini Advanced to conduct research + +and type: + +I am head of product at [startup] in [industry] industry. We are building a product launch plan for + +[product]. I want to brainstorm a few different scenarios. We are considering offering the [product] at two + +different price points [A and B] and we are considering launching in [December or January]. Provide pros + +and cons of each scenario and suggest different ideas we may not have considered. (Gemini Advanced) + +You want to continue market research brainstorming. You type: + +How do these prices compare to [competitor products’] prices? Detail what pricing strategies + +[competitors] use for [products], and list any common tactics they use (such as free trials, discounts, etc.). + +Summarize how they position the product to [audience]. Cite your sources. (Gemini Advanced) + +Your research helps you refine your pricing structure and go-to-market strategy for your most important + +target audience. + +Use case: Develop product strategy and roadmap + +You want to refine your product strategy and roadmap. You’ve collected user feedback in a spreadsheet, and + +you want to clean it up so that it is ready for deeper analysis. You chat with Gemini Advanced and upload a file. + +You type: + +Help me clean my [user feedback] survey spreadsheet. Specifically, fill any blank values in the name + +column with “Anonymous,” then if the [recommend] column shows [Yes], replace that with [Y]. Finally, + +remove any rows where the satisfaction column is blank. Please generate a new file for me with my + +cleaned data. (Gemini Advanced) + +66 + + Gemini returns a clean file for you to conduct deeper analysis on, and from this file, you notice a few trends. + +You have alignment from the team on features to address recurring user feedback, and now you want to build a + +high-level roadmap that you can use as a starting point. You continue your conversation with Gemini Advanced. + +You type: + +I am head of product at [startup] in the [industry] industry. We are adding [features] to our [product] to + +address recurring user feedback, including [feedback trends]. Build a high-level roadmap that will keep us + +on track for a Q4 delivery. Put it in a table format. (Gemini Advanced) + +Gemini returns a helpful starting point. You want to save the work so you click Export to Docs. + +Leveling up your prompt writing + +This guide is meant to serve as inspiration, and the possibilities are nearly endless with Gemini for Google + +Workspace. Build on your prompt-writing skills using these tips. + +• Break it up. If you want Gemini for Workspace to perform several related tasks, break them into + +separate prompts. + +• Give constraints. To generate specific results, include details in your prompt such as character count limits + +or the number of options you’d like to generate. + +• Assign a role. To encourage creativity, assign a role. You can do this by starting your prompt with language + +like: “You are the head of a creative department for a leading advertising agency …” + +• Ask for feedback. In your conversation with Gemini Advanced, tell it that you’re giving it a project, include all + +the relevant details, and then describe the output you want. Continue the conversation by asking questions + +like, “What questions do you have for me that would help you provide the best output?” + +• Consider tone. Tailor your prompts to suit your intended audience. Ask for outputs to have a specific tone, + +such as formal, informal, technical, creative, or casual. + +• Say it another way. Fine-tune your prompts if the results don’t meet your expectations or if you believe + +there’s room for improvement. An iterative process of review and refinement often yields better results. + +67 + + Generative AI and all of its possibilities are exciting, but it’s still new. +Even though our models are getting better every day, prompts can +sometimes have unpredictable responses. + +Before putting an output from Gemini for Workspace into action, review +it to ensure clarity, relevance, and accuracy. And of course, keep the +most important thing in mind: Generative AI is meant to help humans, +but the final output is yours. + +The example prompts in this guide are meant for illustrative purposes. + +Stay up to date +workspace.google.com +workspace.google.com/blog + +Happy prompting! + +68 + + \ No newline at end of file diff --git a/Google-Prompts-Engineering/gemini-for-google-workspace-prompting-guide-101.pdf b/Google-Prompts-Engineering/gemini-for-google-workspace-prompting-guide-101.pdf new file mode 100644 index 0000000..6641337 Binary files /dev/null and b/Google-Prompts-Engineering/gemini-for-google-workspace-prompting-guide-101.pdf differ diff --git a/Google-Prompts-Engineering/prompts-advance-tutorial.md b/Google-Prompts-Engineering/prompts-advance-tutorial.md new file mode 100644 index 0000000..38c5ed1 --- /dev/null +++ b/Google-Prompts-Engineering/prompts-advance-tutorial.md @@ -0,0 +1,156 @@ +# Advanced Prompting Tutorial for Gemini for Google Workspace + +This advanced tutorial builds upon the foundational skills for writing effective prompts, delving deeper into techniques to collaborate with Gemini for Google Workspace for enhanced productivity and creativity across complex tasks. + +## Mastering the Four Pillars of an Effective Prompt + +While the basic structure involves Persona, Task, Context, and Format, mastering them involves nuance and strategic application. Effective prompts often weave these elements together seamlessly. + +**Key Principle:** The more clarity and relevant detail you provide, the better Gemini can understand your intent and deliver high-quality, relevant results. Remember, a clear **Task** (usually starting with a verb) is always essential. + +### 1. Persona: Guiding Gemini's Voice and Expertise + +Defining a persona helps Gemini adopt a specific viewpoint, style, and knowledge base. This goes beyond just a job title. + +* **Specificity is Key:** Instead of just "You are a manager," try "You are a seasoned project manager in the software development industry, known for clear communication with both technical and non-technical stakeholders." +* **Implied Persona:** Sometimes the persona is implied by the task and context, but explicit definition yields more tailored results, especially for communication tasks. + +**Advanced Examples:** + +* **Executive Comms:** "You are the CEO of a rapidly growing tech startup. Draft an inspiring yet candid internal memo to all employees addressing the recent market downturn and our strategy for navigating it. Focus on resilience and innovation." (Combines persona with tone and complex context). +* **Technical Explanation:** "You are a senior cybersecurity analyst. Explain the concept of zero-trust architecture to a board of directors who have limited technical background. Use analogies and focus on business benefits. Format as a 2-page briefing note." (Persona influences complexity of explanation and language choice). +* **Creative Brainstorming:** "You are a lead game designer for a fantasy RPG. Brainstorm three unique questlines for a newly introduced desert region, considering lore consistency and player engagement for level 15-20 characters." (Persona drives creative output style). + +### 2. Task: Defining Clear and Actionable Objectives + +The task is the core instruction. It should be an unambiguous command. + +* **Use Strong Verbs:** "Draft," "Analyze," "Compare," "Generate," "Summarize," "Brainstorm," "Translate," "Outline," "Create a plan for..." +* **Compound Tasks:** For highly complex requests, it's often better to break them into smaller, sequential tasks (see "Advanced Techniques" below). + +**Advanced Examples:** + +* **Data Analysis (Sheets):** "Analyze the sales data in @[Q3 Sales Report Spreadsheet]. Identify the top 3 performing product categories by revenue and calculate their percentage growth compared to @[Q2 Sales Report Spreadsheet]. Then, generate a bar chart visualizing this growth." +* **Strategic Planning (Docs/Advanced):** "Develop a comprehensive go-to-market strategy outline for a new B2B SaaS product targeting small to medium-sized enterprises in the healthcare sector. Include sections for target audience, value proposition, pricing strategy, marketing channels, and sales strategy based on insights from @[Market Research Report] and @[Competitive Analysis Doc]." +* **Content Creation (Slides/Docs):** "Generate a 5-slide presentation outline for a workshop on 'Effective Time Management for Remote Teams.' For each slide, provide a title, 3-4 key bullet points, and a suggestion for a relevant visual. The target audience is newly remote employees." + +### 3. Context: Providing the Necessary Background and Data + +Context is crucial for relevance and accuracy. The richer and more specific the context, the better the output. + +* **Leverage Your Data with `@` Mentions:** The ability to reference your documents in Google Drive (e.g., `@[My Project Plan Doc]`, `@[Customer Feedback Sheet]`) is a powerful way to ground Gemini's responses in your specific information. +* **Provide Key Details:** Include names, dates, goals, constraints, previous discussions, relevant URLs, or snippets of text. +* **Implicit vs. Explicit:** While Gemini can infer some context from an ongoing conversation, explicitly stating or referencing key contextual elements is more reliable. + +**Advanced Examples:** + +* **Personalized Email (Gmail):** "Draft a follow-up email to [Client Name] after our meeting on [Date] regarding [Project X]. Reference their concerns about [specific concern mentioned, e.g., budget constraints from @[Meeting Notes Doc]] and reiterate how our proposed solution in @[Proposal Document] addresses these. Maintain a confident and solution-oriented tone." +* **Report Generation (Docs):** "Using the data from @[Annual Employee Survey Results Sheet] and the summary of findings in @[HR Analysis Report Doc], draft an executive summary for the leadership team. Highlight key trends in employee satisfaction, identify top 3 areas for improvement, and suggest one actionable recommendation for each. Format as a one-page memo." +* **Cross-Document Synthesis (Drive/Advanced):** "Compare the Q4 financial forecasts from @[Finance Q4 Forecast Sheet] with the actual Q4 performance data in @[Actuals Q4 Data Sheet]. Identify key variances (greater than 10%) by department and provide a brief potential explanation for each variance, drawing insights from the commentary in @[Q4 Departmental Reports Folder]." + +### 4. Format: Shaping the Output for Clarity and Usefulness + +Specifying the format ensures the output is structured in a way that meets your needs. + +* **Common Formats:** Bullet points, numbered lists, tables, email, memo, report, script, blog post, summary, outline, code block. +* **Constraints:** Word count, paragraph limits, number of suggestions, specific sections to include. + +**Advanced Examples:** + +* **Comparative Analysis (Docs/Sheets):** "Create a comparison table of three competing software products: [Product A], [Product B], and @[Product C Internal Spec Sheet]. Columns should include: Key Features, Pricing Model, Target Audience, and a 'Pros/Cons' summary for our company's use case detailed in @[Internal Needs Assessment Doc]." +* **Structured Brainstorming (Docs):** "Generate a list of 10 potential names for a new eco-friendly cleaning product line. For each name, provide a brief rationale (1-2 sentences) and a suggested tagline. The names should evoke themes of nature, purity, and effectiveness." +* **Meeting Agenda (Docs/Gmail):** "Draft a detailed agenda for a 1-hour project kick-off meeting for [Project Alpha]. Include time allocations for: Introductions (5 min), Project Goals & Scope overview (from @[Project Charter Doc]) (15 min), Roles & Responsibilities (10 min), Key Milestones & Timeline (15 min), Q&A (10 min), and Next Steps (5 min). Assign [Team Lead Name] to present the goals and scope." + +## Leveling Up Your Prompt Writing: Advanced Techniques + +Based on the insights from the "Gemini for Google Workspace Prompting Guide" (page 67), here are techniques to further enhance your prompts: + +1. **Break It Up (Sequential Prompting):** + * **Explanation:** For complex tasks involving multiple steps or outputs, break them into a series of smaller, more focused prompts. This allows for iterative refinement and better control over each part of the process. + * **Example:** Instead of "Write a complete marketing plan for a new product including research, strategy, content, and budget," try: + 1. "Conduct market research for a new [product type] targeting [audience]. Identify 3 key competitors and their main strengths/weaknesses." + 2. (After reviewing) "Based on the previous research and our product features in @[Product Spec Doc], outline a marketing strategy focusing on [channel1] and [channel2]." + 3. (And so on for content, budget, etc.) + +2. **Give Constraints:** + * **Explanation:** To get more specific and usable results, include limitations or requirements in your prompt. + * **Examples:** + * "Summarize @[Long Research Paper] in 500 words or less." + * "Generate 5 distinct subject lines for an email campaign announcing a new feature." + * "Draft three alternative opening paragraphs for this blog post, each with a different hook." + +3. **Assign a Role (Enhanced Persona):** + * **Explanation:** This is a deeper application of the Persona pillar. By explicitly telling Gemini to act as a specific professional, you guide its tone, style, and the type of expertise it should draw upon. + * **Example:** "You are the head of a creative department for a leading advertising agency. Brainstorm a tagline and a visual concept for a campaign promoting sustainable travel to millennials." + +4. **Ask for Feedback (Clarifying Questions from Gemini):** + * **Explanation:** In a conversational platform like Gemini Advanced, you can encourage Gemini to ask clarifying questions to better understand your needs before generating a full response. + * **Example:** "I need to create a presentation on the impact of AI on the retail industry for a mixed audience of executives and store managers. The goal is to both inform and inspire action. What questions do you have for me that would help you provide the best outline and key talking points?" + +5. **Consider and Specify Tone:** + * **Explanation:** The tone of the generated content can significantly impact its effectiveness. Explicitly request the desired tone. + * **Examples:** + * "Draft a response to this customer complaint. Use an empathetic and apologetic tone." (From Customer Service section) + * "Write an upbeat memo announcing the new intranet site using @[Intranet Launch Plan Notes]." (From Communications section) + * "Generate potential answers for each question that use a confident but firm tone." (From Executives section, COO Town Hall) + +6. **Say It Another Way (Iterate and Rephrase):** + * **Explanation:** If the initial output isn't what you expected, don't just give up. Rephrase your prompt, add more context, clarify your task, or adjust the persona or format. Iteration is key. + * **Example (Conceptual):** + * *Initial Prompt:* "Write about our new product." + * *Refined Prompt:* "You are a marketing copywriter. Draft a 200-word promotional blurb for our new product, @[Product X Details Doc], highlighting its top 3 benefits for busy professionals. The tone should be exciting and benefit-driven. Format for a website landing page." + +## Crafting Conversational Prompts & Iteration: A Walkthrough + +Many of the most powerful interactions with Gemini involve a conversation—a series of prompts that build on each other. Let's look at an example adapted from the "Startup Leaders" section (pages 62-64) of the guide: + +**Scenario:** A startup founder wants to process notes from a whiteboard brainstorming session and then ideate further. + +**Initial Prompt (Multi-modal - if using Gemini Advanced with image upload):** + +``` +I am a founder at a startup focused on [sustainable packaging solutions]. I was brainstorming with colleagues about [our Q3 marketing strategy], and we took notes on this whiteboard. [Uploads image of whiteboard notes] Turn these notes into structured text, categorizing by main themes if possible. +``` +* **Persona:** `I am a founder at a startup focused on [sustainable packaging solutions].` +* **Task:** `Turn these notes into structured text, categorizing by main themes if possible.` +* **Context:** `I was brainstorming with colleagues about [our Q3 marketing strategy]... [Uploads image of whiteboard notes]` +* **Format:** `structured text, categorizing by main themes` + +**(Gemini Advanced processes the image and provides a text output of the notes, possibly categorized.)** + +**Follow-up Prompt 1 (Deepening the Brainstorm):** + +``` +Thanks, that's a great transcription. Now, based on these notes and our focus on [sustainable packaging solutions], suggest three follow-up strategic items we should discuss for our [Q3 marketing strategy]. Specifically, what potential blind spots or missed opportunities might exist in our initial brainstorm regarding reaching [target audience: e.g., eco-conscious SMEs]? +``` +* **Task:** `suggest three follow-up strategic items... what potential blind spots or missed opportunities might exist...` +* **Context:** `Based on these notes (previous output) and our focus on [sustainable packaging solutions]... regarding reaching [target audience: e.g., eco-conscious SMEs]` +* **Persona:** (Implied continuation from the founder persona) +* **Format:** (Implied list or descriptive paragraphs) + +**(Gemini provides suggestions and points out potential gaps.)** + +**Follow-up Prompt 2 (Generating Actionable Output):** + +``` +Excellent points. Now, please draft a concise meeting recap email to the team based on the transcribed whiteboard notes and your suggested follow-up items. Use an upbeat and collaborative tone. The email should clearly list: 1. Key takeaways from the whiteboard session. 2. The three strategic follow-up items you identified. 3. A call to action to prepare thoughts on these items for our next meeting on [Date]. +``` +* **Task:** `draft a concise meeting recap email...` +* **Context:** `based on the transcribed whiteboard notes and your suggested follow-up items... next meeting on [Date].` +* **Format:** `concise email... upbeat and collaborative tone... clearly list: 1. Key takeaways... 2. Three strategic follow-up items... 3. Call to action...` + +This iterative process allows for deeper exploration and leads to a more refined and useful final output. + +## Final Review: The Human Element + +Even with advanced prompting, always critically review Gemini's output. Check for: +* **Accuracy:** Are the facts and figures correct, especially when drawing from provided documents? +* **Relevance:** Does the output directly address your prompt and meet your underlying need? +* **Clarity & Coherence:** Is the language clear, well-structured, and easy to understand? +* **Completeness:** Does it cover all aspects of your request? +* **Tone:** Is the tone appropriate for the intended audience and purpose? + +Generative AI is a powerful collaborator, but the final judgment and responsibility for the output remain with you. + +--- +*This advanced tutorial is inspired by and expands upon the principles and examples in the "Gemini for Google Workspace: A quick-start handbook for effective prompts, October 2024 edition."* \ No newline at end of file diff --git a/Google-Prompts-Engineering/prompts-tutorial.md b/Google-Prompts-Engineering/prompts-tutorial.md new file mode 100644 index 0000000..e73abd7 --- /dev/null +++ b/Google-Prompts-Engineering/prompts-tutorial.md @@ -0,0 +1,52 @@ +# Effective Prompting Tutorial for Gemini for Google Workspace + +This tutorial provides foundational skills for writing effective prompts when using Gemini for Google Workspace, enabling you to collaborate with AI to boost productivity and creativity. + +## Understanding Prompts + +A prompt is a conversation starter with your AI-powered assistant. You might write several prompts as the conversation progresses. While possibilities are virtually endless, consistent best practices can be applied. + +## The Four Pillars of an Effective Prompt + +When writing an effective prompt, consider these four main areas. You don't need to use all four in every prompt, but incorporating a few will significantly improve the results. **Always remember to include a verb or command as part of your task; this is the most important component of a prompt.** + +1. **Persona:** Define the role or perspective you want Gemini to adopt. +2. **Task:** Clearly state what you need Gemini to do. +3. **Context:** Provide relevant background information, details, or specific documents (e.g., by typing `@file name` to reference your files in Google Drive). +4. **Format:** Specify the desired structure or style of the output. + +### Example of a Prompt Using All Four Pillars + +This prompt could work well in Gmail and Google Docs: + +``` +You are a program manager in [industry]. Draft an executive summary email to [persona] based on [details about relevant program docs]. Limit to bullet points. +``` + +Let's break this example down: + +* **Persona:** `You are a program manager in [industry].` + * This tells Gemini to adopt the mindset, knowledge, and communication style of a program manager in a specific industry. +* **Task:** `Draft an executive summary email...` + * This is a clear command, telling Gemini the primary action to perform (draft an email) and the type of content (executive summary). +* **Context:** `...to [persona] based on [details about relevant program docs].` + * This provides crucial background: who the email is for (`[persona]`) and the source material Gemini should use (`[details about relevant program docs]`). Referencing specific documents with `@` is a powerful way to provide context. +* **Format:** `Limit to bullet points.` + * This specifies how the output should be structured, ensuring conciseness and readability. + +## Quick Tips for Getting Started with Gemini for Google Workspace + +1. **Use natural language:** Write as if you're speaking to another person. Express complete thoughts in full sentences. +2. **Be specific and iterate:** Tell Gemini exactly what you need it to do (e.g., summarize, write, change the tone, create). Provide as much context as possible. If the initial results aren't perfect, refine your prompt and try again. +3. **Be concise and avoid complexity:** State your request in brief—but specific—language. Avoid jargon where possible, or explain it if necessary. +4. **Make it a conversation:** Fine-tune your prompts if the results don't meet your expectations or if you believe there's room for improvement. Use follow-up prompts and an iterative process of review and refinement to yield better results. +5. **Use your documents:** Personalize Gemini's output with information from your own files in Google Drive by referencing them with `@file name`. +6. **Make Gemini your prompt editor (in Gemini Advanced):** When using Gemini Advanced (gemini.google.com), you can start your prompts with: "Make this a power prompt: [original prompt text here]." Gemini will suggest improvements to your prompt. Review the suggestions, ensure they align with your needs, and then use the improved prompt. + +## Key Takeaway + +Prompting is a learnable skill. While you don't need to be a prompt engineer, experimenting with different approaches and iterating on your prompts is key to achieving desired outcomes. The most effective prompts often provide sufficient detail and context (averaging around 21 words, based on user experience) rather than being overly brief. + +Remember to always review Gemini's output for clarity, relevance, and accuracy before using it. + +*This tutorial is based on the "Gemini for Google Workspace: A quick-start handbook for effective prompts, October 2024 edition."* \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..72c147c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Tony Cai + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2157f7c --- /dev/null +++ b/README.md @@ -0,0 +1,308 @@ +# AI Coding Prompt Guides + +A comprehensive collection of AI prompts and communication strategies designed to help developers learn to code, solve problems efficiently, and work effectively with AI assistants across different roles and technologies. + +## 🎯 Quick Start + +### 1. **Master AI Communication First** +Start with **[LLM Communication Techniques for Developers](llm-communication-techniques-for-developers.md)** - Essential foundation for effective AI interaction using frameworks like CLEAR, PREP, STAR, and First Principles thinking. + +### 2. **Choose Your Learning Path** +- **New to Coding**: [LearnToCode.md](LearnToCode.md) + [Learning to Code Guide](learning-to-code-guide.md) +- **Specific Role**: Browse [Job-Specific Prompts Index](job-specific-prompts-index.md) +- **General Development**: [Ultimate Coding Prompt Guide](ultimate-coding-prompt-guide.md) + +## 📚 Core Guides + +### Communication & Learning Foundations +- **[LLM Communication Techniques for Developers](llm-communication-techniques-for-developers.md)** ⭐ **START HERE** + - 32 advanced communication strategies for robust development + - CLEAR, PREP, STAR, and First Principles frameworks + - Context management, debugging communication, architecture discussions + - Socratic method, rubber duck debugging, collaborative problem solving + +- **[LearnToCode.md](LearnToCode.md)** - Comprehensive learning guide + - Curated AI prompts for programming fundamentals + - Code quality, troubleshooting, and learning strategies + - Extensive glossary of 100+ technical terms + - Best practices for working with AI coding assistants + +### Scenario-Based Development Guides +- **[Ultimate Coding Prompt Guide](ultimate-coding-prompt-guide.md)** - Index to scenario-specific guides: + - **[Writing New Code](writing-new-code.md)** - Feature development and implementation + - **[Modifying Existing Code](modifying-existing-code.md)** - Refactoring and improvements + - **[Troubleshooting](troubleshooting.md)** - Debugging and problem resolution + - **[Learning to Code Guide](learning-to-code-guide.md)** - Structured learning approach + +## 🛠️ Job-Specific Prompt Guides + +### **[Job-Specific Prompts Index](job-specific-prompts-index.md)** - Complete navigation hub + +### Frontend Development +- **[Frontend React/Next.js Engineer](frontend-react-nextjs-prompts.md)** (25 prompts) + - Component development, custom hooks, state management + - Next.js SSR/SSG, dynamic routing, API routes + - Performance optimization, testing, accessibility + - UI/UX implementation with modern design patterns + +### Backend Development +- **[Rust Backend Engineer (RIG + Actix-web)](rust-backend-engineer-prompts.md)** (32 prompts) + - Actix-web server development and middleware + - RIG integration for AI capabilities + - Database integration with SQLx, authentication + - Performance optimization and deployment strategies + +- **[Node.js Sails.js Backend Engineer](nodejs-sailsjs-backend-prompts.md)** (33 prompts) + - Sails.js MVC architecture and conventions + - Waterline ORM and database integration + - Real-time features with Socket.io + - RESTful API development and GraphQL integration + +### Blockchain & Web3 +- **[Blockchain Architect](blockchain-architect-prompts.md)** (30 prompts) + - Blockchain architecture design and technology stack selection + - Smart contract architecture and DeFi protocol design + - Consensus mechanisms, scalability, and security frameworks + - Infrastructure, governance, tokenomics, and interoperability + +### Design & User Experience +- **[UI Designer (Figma)](ui-designer-figma-prompts.md)** (30 prompts) + - Interactive prototype creation and design systems + - Component design and responsive layouts + - Accessibility, usability testing, design handoff + - Performance optimization and conversion rate optimization + +### Quality Assurance & Testing +- **[Test Engineer (Pytest)](test-engineer-pytest-prompts.md)** (33 prompts) + - Pytest framework setup and organization + - Unit, integration, and API testing strategies + - UI/E2E testing with Selenium and Playwright + - Performance testing, CI/CD integration, test data management + +### Product Management +- **[Product Manager](product-manager-prompts.md)** (30 prompts) + - Interactive prototype creation and MVP definition + - User research, personas, and journey mapping + - Feature planning, prioritization frameworks, market research + - Product strategy, roadmapping, go-to-market planning + +### Human Resources & Talent +- **[HR Manager (Hiring & Recruitment)](hr-manager-hiring-prompts.md)** (30 prompts) + - Job description creation and optimization + - Talent sourcing, recruitment strategies, interview design + - Candidate assessment, employer branding, diversity initiatives + - Compensation strategy, onboarding, recruitment analytics + +## 🚀 Getting Started + +### Installation +```bash +git clone https://github.com//.git +cd +``` + +### Recommended Learning Path +1. **Foundation**: [LLM Communication Techniques](llm-communication-techniques-for-developers.md) +2. **Role-Specific**: Choose your guide from [Job-Specific Index](job-specific-prompts-index.md) +3. **Scenario-Based**: Use [Ultimate Coding Prompt Guide](ultimate-coding-prompt-guide.md) for specific tasks +4. **Deep Learning**: [LearnToCode.md](LearnToCode.md) for comprehensive understanding + +### Usage Examples +```bash +# For effective AI communication +open llm-communication-techniques-for-developers.md + +# For role-specific prompts +open job-specific-prompts-index.md + +# For learning fundamentals +open LearnToCode.md + +# For specific development scenarios +open ultimate-coding-prompt-guide.md +``` + +## 📊 Guide Statistics + +| Category | Guides | Total Prompts | Key Features | +|----------|--------|---------------|--------------| +| **Communication** | 1 | 32 | CLEAR, PREP, STAR, First Principles | +| **Learning** | 5 | 50+ | Fundamentals, scenarios, glossary | +| **Frontend** | 1 | 25 | React, Next.js, performance | +| **Backend** | 2 | 65 | Rust, Node.js, databases, APIs | +| **Blockchain** | 1 | 30 | Architecture, DeFi, smart contracts | +| **Design** | 1 | 30 | Figma, prototypes, design systems | +| **Testing** | 1 | 33 | Pytest, automation, CI/CD | +| **Product** | 1 | 30 | Strategy, research, roadmapping | +| **HR** | 1 | 30 | Hiring, recruitment, talent | +| **Total** | **13** | **325+** | **Comprehensive coverage** | + +## 🎯 Quick Reference by Use Case + +### Learning to Code +```bash +# Complete beginner +open LearnToCode.md +open learning-to-code-guide.md + +# Structured learning with AI communication +open llm-communication-techniques-for-developers.md +``` + +### Building Features +```bash +# Planning and implementation +open writing-new-code.md + +# Role-specific development +open job-specific-prompts-index.md +``` + +### Debugging & Troubleshooting +```bash +# General troubleshooting +open troubleshooting.md + +# Advanced debugging communication +open llm-communication-techniques-for-developers.md +``` + +### Code Maintenance +```bash +# Refactoring and improvements +open modifying-existing-code.md + +# Code review and quality +open llm-communication-techniques-for-developers.md +``` + +### Architecture & Design +```bash +# System design +open blockchain-architect-prompts.md # For blockchain +open llm-communication-techniques-for-developers.md # General architecture + +# UI/UX design +open ui-designer-figma-prompts.md +``` + +## 🔧 Technology Coverage + +### Programming Languages +- **JavaScript/TypeScript**: React, Next.js, Node.js, Sails.js +- **Rust**: Actix-web, RIG, SQLx +- **Python**: Pytest, testing frameworks +- **Solidity**: Smart contracts, blockchain development + +### Frameworks & Tools +- **Frontend**: React, Next.js, Figma +- **Backend**: Actix-web, Sails.js, Express +- **Testing**: Pytest, Selenium, Playwright +- **Blockchain**: Ethereum, DeFi protocols, Web3 +- **Databases**: PostgreSQL, MongoDB, Redis, SQLx + +### Development Areas +- **Web Development**: Full-stack applications +- **Blockchain**: DeFi, smart contracts, tokenomics +- **Testing**: Automation, performance, CI/CD +- **Design**: UI/UX, prototypes, design systems +- **Product**: Strategy, research, management +- **HR**: Hiring, recruitment, talent acquisition + +## 🌟 What's New + +### Latest Additions +- **NEW**: [LLM Communication Techniques](llm-communication-techniques-for-developers.md) - 32 advanced communication strategies including CLEAR framework, PREP method, STAR approach, First Principles thinking, Socratic method, and collaborative problem solving +- **NEW**: [HR Manager Hiring Guide](hr-manager-hiring-prompts.md) - 30 comprehensive prompts for job descriptions, talent sourcing, interview design, candidate assessment, employer branding, and legal compliance +- **NEW**: [Blockchain Architect Guide](blockchain-architect-prompts.md) - 30 specialized prompts for blockchain architecture, smart contracts, DeFi protocols, consensus mechanisms, and tokenomics +- **NEW**: [UI Designer Figma Guide](ui-designer-figma-prompts.md) - 30 prompts for interactive prototypes, design systems, accessibility, and design handoff +- **NEW**: [Test Engineer Pytest Guide](test-engineer-pytest-prompts.md) - 33 prompts for test automation, performance testing, and CI/CD integration +- **NEW**: [Product Manager Guide](product-manager-prompts.md) - 30 prompts for product strategy, user research, and stakeholder communication + +### Recent Updates +- Enhanced job-specific index with cross-role collaboration prompts +- Added comprehensive technology coverage across all guides +- Improved navigation and quick reference sections +- Updated learning paths and getting started guidance + +## 🤝 Contributing + +We welcome contributions! Here's how to help: + +### Adding New Communication Techniques +1. Follow the structured format in [LLM Communication Techniques](llm-communication-techniques-for-developers.md) +2. Include practical templates and real-world examples +3. Focus on developer-specific scenarios and challenges + +### Adding New Job-Specific Guides +1. Follow the established format with 25-35 prompts +2. Include role-specific scenarios and technology focus +3. Provide template and example prompts +4. Add best practices and workflow guidance + +### General Contributions +1. Fork the repository +2. Create a feature branch (`git checkout -b feature-name`) +3. Make your changes and test them +4. Submit a pull request with clear description + +### Contribution Guidelines +- Maintain consistent formatting and structure +- Include practical, actionable prompts +- Provide real-world examples and use cases +- Focus on developer productivity and learning +- Test prompts with high-quality AI models (Claude Sonnet 3.5+) + +## 🗺️ Roadmap + +### Upcoming Communication Guides +- Advanced Debugging Communication Patterns +- Team Collaboration with AI Assistants +- Code Review Communication Strategies +- Technical Documentation with AI + +### Upcoming Job-Specific Guides +- **Python Backend Engineer** (Django/FastAPI) +- **DevOps Engineer** (Docker, Kubernetes, CI/CD) +- **Mobile Developer** (React Native/Flutter) +- **Data Engineer** (Python, SQL, ETL pipelines) +- **Machine Learning Engineer** (Python, TensorFlow, PyTorch) +- **UX Researcher** (User research, usability testing, analytics) + +### Planned Features +- Interactive prompt builder tool +- Technology-specific prompt collections +- Integration examples with popular AI assistants +- Video tutorials for complex workflows +- Community-contributed prompt library + +## 📖 Additional Resources + +### User Stories & Use Cases +See [user-story.md](user-story.md) for detailed user personas and their goals when using these guides. + +### Best Practices +- **Use high-quality AI models** (Claude Sonnet 3.5+ recommended) +- **Provide context** in your prompts for better results +- **Start with communication fundamentals** before diving into specific roles +- **Customize prompts** based on your specific needs and constraints +- **Practice iterative refinement** of your communication approach + +### Model Recommendations +- **Primary**: Claude Sonnet 3.5 (best for code generation and explanation) +- **Alternative**: GPT-4 (good for general development tasks) +- **Avoid**: GPT-3.5, basic models (insufficient for complex coding tasks) + +## 📄 License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## 🙏 Acknowledgments + +- Inspired by the AI coding community and best practices +- Built for developers who want to work more effectively with AI +- Continuously updated based on real-world usage and feedback + +--- + +**Start your journey**: Begin with [LLM Communication Techniques](llm-communication-techniques-for-developers.md) to master AI communication, then explore role-specific guides based on your needs. Happy coding! 🚀 \ No newline at end of file diff --git a/blockchain-architect-prompts.md b/blockchain-architect-prompts.md new file mode 100644 index 0000000..4ae8b27 --- /dev/null +++ b/blockchain-architect-prompts.md @@ -0,0 +1,864 @@ +# Blockchain Architect Prompts Guide + +A comprehensive collection of AI prompts specifically designed for Blockchain Architects to design robust technology stacks, architect distributed systems, and implement cutting-edge blockchain solutions. + +## Table of Contents +1. [Blockchain Architecture Design](#blockchain-architecture-design) +2. [Technology Stack Selection](#technology-stack-selection) +3. [Smart Contract Architecture](#smart-contract-architecture) +4. [Consensus Mechanism Design](#consensus-mechanism-design) +5. [Scalability & Performance](#scalability--performance) +6. [Security & Cryptography](#security--cryptography) +7. [Interoperability & Cross-Chain](#interoperability--cross-chain) +8. [DeFi & Protocol Design](#defi--protocol-design) +9. [Infrastructure & DevOps](#infrastructure--devops) +10. [Governance & Tokenomics](#governance--tokenomics) + +--- + +## Blockchain Architecture Design + +### 1. Comprehensive Blockchain System Architecture + +**Prompt Template:** +``` +You are an expert blockchain architect. Design a comprehensive blockchain system architecture for [use case/industry] with these requirements: +- Use case: [specific application or problem to solve] +- Scale requirements: [transaction throughput, user base, data volume] +- Performance needs: [latency, finality time, availability] +- Security level: [enterprise/consumer/critical infrastructure] +- Regulatory compliance: [specific regulations or standards] + +Include: +- Overall system architecture and component design +- Blockchain layer selection and configuration +- Consensus mechanism recommendation +- Data storage and management strategy +- API and integration layer design +- Security framework and threat model +- Scalability roadmap and optimization strategies +``` + +**Example:** +``` +You are an expert blockchain architect. Design a comprehensive blockchain system architecture for supply chain traceability with these requirements: +- Use case: End-to-end tracking of pharmaceutical products from manufacturing to patient +- Scale requirements: 10M+ products tracked, 1000+ participants, 100K+ transactions/day +- Performance needs: <5 second confirmation time, 99.9% uptime, real-time tracking +- Security level: Enterprise-grade with regulatory compliance (FDA, EU MDR) +- Regulatory compliance: 21 CFR Part 11, GDPR, serialization requirements + +Include: +- Hybrid blockchain architecture with permissioned consortium chain +- Proof of Authority consensus with enterprise validator nodes +- IPFS for document storage with on-chain hash verification +- RESTful APIs with GraphQL for complex queries +- Zero-knowledge proofs for privacy-preserving verification +- Multi-signature wallets and role-based access control +- Horizontal scaling through sharding and layer-2 solutions +``` + +### 2. Distributed System Architecture + +**Prompt:** +``` +Design a distributed blockchain system architecture for [application type] that: +- Handles high availability and fault tolerance +- Ensures data consistency across nodes +- Implements efficient peer-to-peer networking +- Supports dynamic node discovery and management +- Provides robust monitoring and observability + +Include: +- Network topology and node architecture +- Data replication and synchronization strategies +- Fault detection and recovery mechanisms +- Load balancing and traffic management +- Monitoring, logging, and alerting systems +- Disaster recovery and backup procedures +``` + +### 3. Microservices Blockchain Architecture + +**Prompt:** +``` +Create a microservices-based blockchain architecture for [platform/application] that: +- Separates concerns into independent services +- Enables independent scaling and deployment +- Supports multiple blockchain protocols +- Implements service discovery and communication +- Ensures data consistency across services + +Include: +- Service decomposition and boundaries +- Inter-service communication patterns +- Data management and consistency strategies +- API gateway and service mesh configuration +- Container orchestration and deployment +- Testing and quality assurance approaches +``` + +--- + +## Technology Stack Selection + +### 4. Blockchain Platform Evaluation + +**Prompt Template:** +``` +Evaluate and recommend blockchain platforms for [project requirements] considering: +- Technical requirements: [performance, scalability, features needed] +- Business constraints: [budget, timeline, team expertise] +- Ecosystem factors: [developer tools, community, documentation] +- Long-term considerations: [roadmap, sustainability, upgradability] +- Integration needs: [existing systems, third-party services] + +Compare platforms including: +- Ethereum and Layer 2 solutions +- Hyperledger Fabric/Besu +- Polygon, Solana, Avalanche +- Cosmos SDK, Polkadot Substrate +- Enterprise solutions (R3 Corda, JPM Coin) + +Provide detailed analysis with pros/cons and final recommendation. +``` + +**Example:** +``` +Evaluate and recommend blockchain platforms for a decentralized identity management system considering: +- Technical requirements: 10K+ TPS, sub-second finality, privacy features, smart contracts +- Business constraints: $500K budget, 12-month timeline, team experienced in JavaScript/TypeScript +- Ecosystem factors: Strong developer tools, active community, comprehensive documentation +- Long-term considerations: Sustainable tokenomics, regular upgrades, enterprise adoption +- Integration needs: OAuth/SAML compatibility, mobile SDKs, cloud infrastructure + +Compare platforms including: +- Ethereum with Polygon Layer 2 for cost efficiency +- Hyperledger Indy for identity-specific features +- Solana for high performance and low costs +- Cosmos SDK for custom blockchain development +- Microsoft ION on Bitcoin for enterprise trust + +Provide detailed technical analysis, cost comparison, and implementation roadmap. +``` + +### 5. Development Framework Selection + +**Prompt:** +``` +Select and configure development frameworks for [blockchain project] that: +- Accelerate development and reduce time-to-market +- Provide robust testing and debugging capabilities +- Support multiple deployment environments +- Enable efficient smart contract development +- Integrate with existing development workflows + +Evaluate frameworks such as: +- Truffle, Hardhat, Foundry for Ethereum +- Anchor for Solana development +- CosmWasm for Cosmos ecosystem +- Substrate for Polkadot parachains +- Hyperledger Composer for Fabric + +Include setup instructions, best practices, and toolchain integration. +``` + +### 6. Infrastructure Technology Stack + +**Prompt:** +``` +Design infrastructure technology stack for [blockchain application] that includes: +- Cloud platform selection and configuration +- Container orchestration and management +- Database and storage solutions +- Monitoring and observability tools +- CI/CD pipeline and deployment automation +- Security and compliance tools + +Consider: +- Multi-cloud and hybrid deployment strategies +- Auto-scaling and resource optimization +- Backup and disaster recovery +- Cost optimization and budget management +- Performance monitoring and optimization +- Security scanning and vulnerability management +``` + +--- + +## Smart Contract Architecture + +### 7. Smart Contract System Design + +**Prompt:** +``` +Design a smart contract system architecture for [DApp/protocol] that: +- Implements modular and upgradeable contract design +- Ensures security and gas optimization +- Supports complex business logic and workflows +- Enables efficient state management +- Provides comprehensive testing and verification + +Include: +- Contract architecture and interaction patterns +- Upgrade mechanisms and governance +- Security patterns and access controls +- Gas optimization strategies +- Testing framework and coverage +- Formal verification approaches +``` + +### 8. DeFi Protocol Architecture + +**Prompt Template:** +``` +Create a DeFi protocol architecture for [financial product/service] with these specifications: +- Protocol type: [DEX, lending, yield farming, derivatives, insurance] +- Supported assets: [tokens, NFTs, real-world assets] +- Liquidity mechanisms: [AMM, order book, liquidity mining] +- Risk management: [collateralization, liquidation, insurance] +- Governance model: [DAO structure, voting mechanisms, treasury] + +Include: +- Core protocol smart contracts and interactions +- Tokenomics and incentive mechanisms +- Oracle integration for price feeds +- Security measures and audit requirements +- User interface and experience design +- Integration with other DeFi protocols +``` + +**Example:** +``` +Create a DeFi protocol architecture for a decentralized lending platform with these specifications: +- Protocol type: Over-collateralized lending with flash loans +- Supported assets: ETH, WBTC, USDC, USDT, and governance token +- Liquidity mechanisms: Liquidity mining rewards, dynamic interest rates +- Risk management: 150% collateralization ratio, automated liquidations, insurance fund +- Governance model: Token-based DAO with time-locked proposals and treasury management + +Include: +- LendingPool, CollateralManager, LiquidationEngine, and InterestRateModel contracts +- Dual-token system with utility and governance tokens +- Chainlink price oracles with fallback mechanisms +- Multi-signature admin controls and emergency pause functionality +- React-based frontend with Web3 wallet integration +- Composability with Uniswap, Compound, and Aave protocols +``` + +### 9. NFT and Digital Asset Architecture + +**Prompt:** +``` +Design NFT and digital asset architecture for [marketplace/platform] that: +- Supports multiple NFT standards and formats +- Implements efficient minting and trading mechanisms +- Enables royalty distribution and creator economics +- Provides metadata management and IPFS integration +- Supports fractionalization and derivative products + +Include: +- NFT contract standards and customizations +- Marketplace smart contract design +- Metadata schema and storage strategy +- Royalty enforcement mechanisms +- Cross-chain compatibility considerations +- User experience and wallet integration +``` + +--- + +## Consensus Mechanism Design + +### 10. Custom Consensus Algorithm + +**Prompt:** +``` +Design a custom consensus algorithm for [specific use case] that: +- Optimizes for specific performance requirements +- Addresses unique security and trust assumptions +- Balances decentralization with efficiency +- Supports the target network topology +- Enables future upgrades and modifications + +Consider: +- Consensus algorithm type (PoW, PoS, DPoS, PBFT, etc.) +- Validator selection and rotation mechanisms +- Finality guarantees and fork resolution +- Network partition tolerance +- Economic incentives and penalties +- Implementation complexity and verification +``` + +### 11. Proof of Stake Implementation + +**Prompt:** +``` +Implement a Proof of Stake consensus mechanism for [blockchain network] that includes: +- Validator selection and staking requirements +- Slashing conditions and penalty mechanisms +- Reward distribution and inflation model +- Delegation and liquid staking support +- Governance integration and voting power + +Design: +- Staking contract architecture +- Validator node requirements and setup +- Economic security analysis +- Attack vector mitigation +- Upgrade and parameter adjustment mechanisms +- Performance benchmarks and optimization +``` + +### 12. Hybrid Consensus Design + +**Prompt:** +``` +Create a hybrid consensus mechanism for [enterprise/consortium blockchain] that: +- Combines multiple consensus algorithms +- Adapts to different network conditions +- Supports permissioned and permissionless modes +- Enables gradual decentralization +- Maintains regulatory compliance + +Include: +- Multi-layer consensus architecture +- Transition mechanisms between modes +- Governance and decision-making processes +- Performance and security trade-offs +- Implementation roadmap and migration strategy +- Compliance and audit considerations +``` + +--- + +## Scalability & Performance + +### 13. Layer 2 Scaling Solution + +**Prompt Template:** +``` +Design a Layer 2 scaling solution for [blockchain/application] with these requirements: +- Scaling approach: [state channels, sidechains, rollups, plasma] +- Performance targets: [TPS, latency, cost reduction] +- Security model: [trust assumptions, fraud proofs, validity proofs] +- User experience: [seamless onboarding, fast withdrawals] +- Interoperability: [cross-L2 communication, L1 settlement] + +Include: +- Technical architecture and protocol design +- Smart contract implementation strategy +- Bridge and settlement mechanisms +- Economic model and fee structure +- Developer tools and SDK design +- Migration and adoption strategy +``` + +**Example:** +``` +Design a Layer 2 scaling solution for a gaming platform with these requirements: +- Scaling approach: Optimistic rollup with custom fraud proofs +- Performance targets: 10,000+ TPS, <100ms latency, 99% cost reduction +- Security model: 7-day challenge period with economic incentives +- User experience: Instant deposits, fast withdrawals for small amounts +- Interoperability: Cross-game asset transfers, NFT marketplace integration + +Include: +- Custom rollup architecture with game-specific optimizations +- EVM-compatible execution environment with gaming primitives +- Optimized bridge contracts with batched settlements +- Tiered withdrawal system based on amount and urgency +- Unity/Unreal Engine SDKs with wallet abstraction +- Gradual migration from L1 with backward compatibility +``` + +### 14. Sharding Architecture + +**Prompt:** +``` +Implement a sharding architecture for [blockchain network] that: +- Partitions state and computation efficiently +- Maintains security across shards +- Enables cross-shard communication +- Supports dynamic shard management +- Provides data availability guarantees + +Design: +- Shard allocation and management algorithms +- Cross-shard transaction protocols +- State synchronization mechanisms +- Validator assignment and rotation +- Data availability and recovery procedures +- Performance monitoring and optimization +``` + +### 15. Performance Optimization Strategy + +**Prompt:** +``` +Create a comprehensive performance optimization strategy for [blockchain system] that: +- Identifies bottlenecks and performance constraints +- Implements caching and data optimization +- Optimizes network communication and protocols +- Reduces computational overhead +- Monitors and measures performance improvements + +Include: +- Performance profiling and analysis tools +- Database and storage optimization +- Network protocol improvements +- Smart contract gas optimization +- Load testing and capacity planning +- Continuous performance monitoring +``` + +--- + +## Security & Cryptography + +### 16. Cryptographic Protocol Design + +**Prompt:** +``` +Design cryptographic protocols for [blockchain application] that: +- Implement zero-knowledge proofs for privacy +- Use advanced signature schemes and multi-party computation +- Provide quantum-resistant security measures +- Enable efficient verification and validation +- Support regulatory compliance and auditability + +Include: +- Cryptographic primitive selection and implementation +- Zero-knowledge circuit design and optimization +- Key management and rotation strategies +- Privacy-preserving computation protocols +- Post-quantum cryptography integration +- Security analysis and formal verification +``` + +### 17. Security Framework Implementation + +**Prompt Template:** +``` +Implement a comprehensive security framework for [blockchain platform] that addresses: +- Threat modeling: [identify attack vectors and vulnerabilities] +- Access control: [authentication, authorization, role management] +- Data protection: [encryption, privacy, confidentiality] +- Network security: [DDoS protection, secure communication] +- Smart contract security: [formal verification, audit processes] + +Include: +- Security architecture and design principles +- Threat detection and response procedures +- Incident response and recovery plans +- Security testing and penetration testing +- Compliance and regulatory requirements +- Security training and awareness programs +``` + +**Example:** +``` +Implement a comprehensive security framework for a DeFi lending protocol that addresses: +- Threat modeling: Flash loan attacks, oracle manipulation, governance attacks, smart contract bugs +- Access control: Multi-signature admin controls, time-locked operations, role-based permissions +- Data protection: User privacy, transaction confidentiality, off-chain data encryption +- Network security: Front-running protection, MEV mitigation, secure RPC endpoints +- Smart contract security: Formal verification, multiple audits, bug bounty programs + +Include: +- Defense-in-depth architecture with multiple security layers +- Real-time monitoring with automated threat detection +- Emergency pause mechanisms and circuit breakers +- Comprehensive testing including fuzzing and property-based testing +- SOC 2 Type II compliance and regular security assessments +- Security-focused developer training and secure coding practices +``` + +### 18. Privacy-Preserving Architecture + +**Prompt:** +``` +Design privacy-preserving architecture for [blockchain application] that: +- Protects user identity and transaction privacy +- Implements selective disclosure mechanisms +- Enables compliance with privacy regulations +- Maintains auditability for authorized parties +- Supports efficient verification and validation + +Include: +- Privacy protocol selection and implementation +- Zero-knowledge proof systems and circuits +- Confidential transaction mechanisms +- Identity management and selective disclosure +- Regulatory compliance and audit trails +- Performance optimization for privacy features +``` + +--- + +## Interoperability & Cross-Chain + +### 19. Cross-Chain Bridge Architecture + +**Prompt:** +``` +Design a cross-chain bridge architecture for [blockchain ecosystems] that: +- Enables secure asset transfers between chains +- Supports multiple token standards and protocols +- Implements robust validation and consensus mechanisms +- Provides efficient liquidity management +- Ensures decentralization and trustlessness + +Include: +- Bridge protocol design and security model +- Validator network and consensus mechanisms +- Liquidity pool management and optimization +- User interface and experience design +- Risk management and insurance mechanisms +- Monitoring and incident response procedures +``` + +### 20. Multi-Chain Protocol Design + +**Prompt:** +``` +Create a multi-chain protocol for [application/service] that: +- Operates seamlessly across multiple blockchains +- Maintains state consistency and synchronization +- Enables efficient cross-chain communication +- Supports chain-specific optimizations +- Provides unified user and developer experience + +Design: +- Protocol architecture and communication patterns +- State management and synchronization mechanisms +- Chain-specific adapter and integration layers +- Unified API and SDK design +- Deployment and governance strategies +- Performance optimization and monitoring +``` + +### 21. Interoperability Standards + +**Prompt:** +``` +Develop interoperability standards for [blockchain ecosystem] that: +- Define common protocols and data formats +- Enable seamless integration between different chains +- Support standardized asset and data transfers +- Provide compatibility with existing standards +- Enable future extensibility and upgrades + +Include: +- Protocol specification and documentation +- Reference implementation and test suites +- Compliance and certification procedures +- Adoption and migration strategies +- Governance and evolution mechanisms +- Community engagement and feedback processes +``` + +--- + +## DeFi & Protocol Design + +### 22. Automated Market Maker (AMM) Design + +**Prompt Template:** +``` +Design an innovative AMM protocol for [trading/liquidity] with these features: +- Pricing mechanism: [constant product, stable swap, concentrated liquidity] +- Fee structure: [dynamic fees, LP rewards, protocol revenue] +- Liquidity incentives: [yield farming, liquidity mining, bribes] +- Impermanent loss mitigation: [insurance, hedging, alternative models] +- MEV protection: [batch auctions, commit-reveal, private mempools] + +Include: +- Mathematical models and pricing algorithms +- Smart contract architecture and gas optimization +- Liquidity provider experience and incentives +- Integration with aggregators and other protocols +- Risk management and security measures +- Governance and parameter adjustment mechanisms +``` + +**Example:** +``` +Design an innovative AMM protocol for stablecoin trading with these features: +- Pricing mechanism: Hybrid curve combining constant product and stable swap +- Fee structure: Dynamic fees based on volatility and volume with 50% to LPs +- Liquidity incentives: Gauge-based voting for reward distribution +- Impermanent loss mitigation: Insurance fund and IL protection tokens +- MEV protection: Commit-reveal scheme with time-weighted average pricing + +Include: +- StableSwap curve with reduced slippage for correlated assets +- Multi-token pool architecture with efficient rebalancing +- Vote-escrowed governance token with time-locked rewards +- Automated insurance payouts based on IL thresholds +- Integration with Flashbots and private mempool solutions +- DAO governance with parameter optimization and fee adjustment +``` + +### 23. Yield Farming Protocol + +**Prompt:** +``` +Create a yield farming protocol for [asset type/strategy] that: +- Implements innovative yield generation strategies +- Provides sustainable and attractive returns +- Manages risk through diversification and hedging +- Enables composability with other DeFi protocols +- Supports governance and community participation + +Include: +- Yield strategy design and implementation +- Risk assessment and management framework +- Token economics and reward distribution +- Smart contract architecture and security +- User interface and experience optimization +- Integration and partnership strategies +``` + +### 24. Derivatives and Synthetic Assets + +**Prompt:** +``` +Design a derivatives protocol for [financial instruments] that: +- Creates synthetic exposure to various assets +- Implements efficient collateralization mechanisms +- Provides accurate price discovery and oracle integration +- Enables complex trading strategies and products +- Manages counterparty and systemic risks + +Include: +- Synthetic asset creation and management +- Collateral and liquidation mechanisms +- Oracle design and price feed aggregation +- Trading interface and order management +- Risk management and insurance protocols +- Regulatory compliance and reporting +``` + +--- + +## Infrastructure & DevOps + +### 25. Blockchain Node Infrastructure + +**Prompt:** +``` +Design blockchain node infrastructure for [network/application] that: +- Provides high availability and reliability +- Supports efficient synchronization and consensus +- Enables monitoring and observability +- Implements security and access controls +- Supports scaling and resource optimization + +Include: +- Node architecture and configuration +- Network topology and peer management +- Storage and database optimization +- Monitoring and alerting systems +- Backup and disaster recovery procedures +- Performance tuning and optimization +``` + +### 26. DevOps and CI/CD Pipeline + +**Prompt Template:** +``` +Implement DevOps and CI/CD pipeline for [blockchain project] that: +- Automates testing, building, and deployment +- Supports multiple environments and networks +- Implements security scanning and compliance checks +- Enables rapid iteration and continuous delivery +- Provides comprehensive monitoring and logging + +Include: +- Pipeline architecture and workflow design +- Testing strategies including unit, integration, and security tests +- Deployment automation and environment management +- Security scanning and vulnerability assessment +- Monitoring, logging, and alerting configuration +- Documentation and team collaboration tools +``` + +**Example:** +``` +Implement DevOps and CI/CD pipeline for a DeFi protocol that: +- Automates Solidity testing, compilation, and deployment across testnets and mainnet +- Supports staging environment with forked mainnet for realistic testing +- Implements Slither, MythX, and custom security checks +- Enables safe mainnet deployments with multi-signature approvals +- Provides real-time monitoring of protocol metrics and user activity + +Include: +- GitHub Actions workflow with Hardhat and Foundry integration +- Comprehensive test suite with fuzzing and property-based testing +- Automated security scanning with manual audit integration +- Gnosis Safe integration for production deployments +- Grafana dashboards with protocol TVL, volume, and health metrics +- Slack/Discord integration for alerts and team communication +``` + +### 27. Monitoring and Observability + +**Prompt:** +``` +Create monitoring and observability system for [blockchain infrastructure] that: +- Tracks network health and performance metrics +- Monitors smart contract execution and gas usage +- Provides real-time alerting and incident response +- Enables capacity planning and optimization +- Supports debugging and troubleshooting + +Include: +- Metrics collection and aggregation strategy +- Dashboard design and visualization +- Alerting rules and escalation procedures +- Log management and analysis tools +- Performance profiling and optimization +- Incident response and post-mortem processes +``` + +--- + +## Governance & Tokenomics + +### 28. DAO Governance Architecture + +**Prompt:** +``` +Design DAO governance architecture for [protocol/organization] that: +- Implements democratic and efficient decision-making +- Balances stakeholder interests and participation +- Provides transparency and accountability +- Enables evolution and adaptation over time +- Manages treasury and resource allocation + +Include: +- Governance token design and distribution +- Voting mechanisms and proposal processes +- Delegation and liquid democracy features +- Treasury management and spending controls +- Dispute resolution and appeals processes +- Governance evolution and upgrade mechanisms +``` + +### 29. Tokenomics Design + +**Prompt Template:** +``` +Create comprehensive tokenomics for [protocol/platform] with these parameters: +- Token utility: [governance, fees, staking, rewards] +- Supply mechanics: [total supply, inflation, burning] +- Distribution: [team, investors, community, treasury] +- Incentive alignment: [user rewards, validator incentives, developer grants] +- Value accrual: [fee sharing, buybacks, staking yields] + +Include: +- Economic model and mechanism design +- Token flow analysis and simulations +- Incentive structure and game theory analysis +- Launch strategy and distribution timeline +- Governance integration and voting power +- Long-term sustainability and evolution +``` + +**Example:** +``` +Create comprehensive tokenomics for a decentralized storage protocol with these parameters: +- Token utility: Storage payments, validator staking, governance voting, network fees +- Supply mechanics: 1B max supply, 2% annual inflation, storage fee burning +- Distribution: 20% team (4yr vest), 15% investors, 40% mining rewards, 25% ecosystem +- Incentive alignment: Storage rewards, retrieval incentives, developer grants +- Value accrual: Fee burning, staking yields, governance premium + +Include: +- Storage mining algorithm with proof-of-spacetime rewards +- Token flow model with supply/demand dynamics simulation +- Game theory analysis of storage provider and user incentives +- Phased launch with testnet rewards and mainnet migration +- Quadratic voting for governance with delegation mechanisms +- Sustainability analysis with fee market and inflation adjustment +``` + +### 30. Economic Security Model + +**Prompt:** +``` +Develop economic security model for [blockchain protocol] that: +- Analyzes attack vectors and economic incentives +- Calculates security budgets and validator rewards +- Models token price impact on network security +- Designs slashing and penalty mechanisms +- Ensures long-term economic sustainability + +Include: +- Security analysis and threat modeling +- Economic incentive design and game theory +- Validator economics and profitability analysis +- Attack cost calculations and security margins +- Token price sensitivity and stability mechanisms +- Long-term sustainability and adaptation strategies +``` + +--- + +## Best Practices Reminders + +When using these prompts, remember to: + +1. **Security First** - Always prioritize security in architecture decisions +2. **Scalability Planning** - Design for future growth and adoption +3. **Interoperability** - Consider integration with existing systems and protocols +4. **Regulatory Compliance** - Address legal and regulatory requirements early +5. **User Experience** - Focus on usability and developer experience +6. **Economic Sustainability** - Design sustainable tokenomics and incentive structures +7. **Community Governance** - Plan for decentralized governance and community participation + +## Example Workflow for Blockchain Architects + +``` +1. Start with Architecture Design for overall system structure +2. Select Technology Stack based on requirements and constraints +3. Design Smart Contract Architecture for core functionality +4. Choose Consensus Mechanism for network security and performance +5. Plan Scalability Solutions for future growth +6. Implement Security Framework for comprehensive protection +7. Design Interoperability for ecosystem integration +8. Create DeFi Protocols for financial functionality +9. Set up Infrastructure for reliable operations +10. Establish Governance for sustainable evolution +``` + +## Blockchain Technology Integration + +- **Layer 1 Protocols** - Ethereum, Bitcoin, Solana, Avalanche, Cosmos +- **Layer 2 Solutions** - Polygon, Arbitrum, Optimism, StarkNet +- **Development Frameworks** - Hardhat, Truffle, Foundry, Anchor +- **Infrastructure Tools** - IPFS, The Graph, Chainlink, Alchemy +- **Security Tools** - Slither, MythX, Certora, OpenZeppelin +- **Monitoring Solutions** - Tenderly, Blocknative, Dune Analytics + +## Integration with Development Teams + +### Collaboration with Smart Contract Developers +- Use smart contract architecture prompts for secure and efficient code +- Implement testing frameworks for comprehensive coverage +- Provide security guidelines and best practices + +### Working with Frontend Developers +- Design APIs and SDKs for seamless integration +- Create user experience guidelines for Web3 applications +- Implement wallet integration and transaction management + +### Partnership with DevOps Engineers +- Use infrastructure prompts for reliable deployment and operations +- Implement monitoring and alerting for blockchain networks +- Create disaster recovery and backup procedures + +--- + +*This guide is designed to help Blockchain Architects build secure, scalable, and innovative blockchain solutions. Customize the prompts based on your specific project requirements, technology preferences, and business objectives.* \ No newline at end of file diff --git a/frontend-react-nextjs-prompts.md b/frontend-react-nextjs-prompts.md new file mode 100644 index 0000000..0481b15 --- /dev/null +++ b/frontend-react-nextjs-prompts.md @@ -0,0 +1,515 @@ +# Frontend React/Next.js Engineer Prompts Guide + +A comprehensive collection of AI prompts specifically designed for Frontend React/Next.js engineers to accelerate development, solve common challenges, and follow best practices. + +## Table of Contents +1. [Component Development](#component-development) +2. [State Management](#state-management) +3. [Next.js Specific Features](#nextjs-specific-features) +4. [Performance Optimization](#performance-optimization) +5. [Testing & Quality Assurance](#testing--quality-assurance) +6. [UI/UX Implementation](#uiux-implementation) +7. [API Integration](#api-integration) +8. [Debugging & Troubleshooting](#debugging--troubleshooting) + +--- + +## Component Development + +### 1. React Component Creation Template + +**Prompt Template:** +``` +You are an expert React developer. Create a [component type] component called [ComponentName] with these requirements: +- [Requirement 1] +- [Requirement 2] +- [Requirement 3] +Use TypeScript, follow React best practices, implement proper prop validation, and include JSDoc comments. +``` + +**Example:** +``` +You are an expert React developer. Create a reusable Card component with these requirements: +- Accept title, description, and optional image props +- Support different card variants (default, outlined, elevated) +- Include hover animations and accessibility features +- Be responsive and work with Tailwind CSS +Use TypeScript, follow React best practices, implement proper prop validation, and include JSDoc comments. +``` + +### 2. Custom Hook Development + +**Prompt Template:** +``` +Create a custom React hook called use[HookName] that: +- [Functionality 1] +- [Functionality 2] +- [Functionality 3] +Include TypeScript types, error handling, and cleanup logic where needed. +``` + +**Example:** +``` +Create a custom React hook called useLocalStorage that: +- Stores and retrieves values from localStorage +- Handles JSON serialization/deserialization automatically +- Provides loading and error states +- Syncs across multiple components using the same key +Include TypeScript types, error handling, and cleanup logic where needed. +``` + +--- + +## State Management + +### 3. Context API Implementation + +**Prompt:** +``` +Create a React Context for [feature] management that includes: +- State interface with TypeScript +- Provider component with initial state +- Custom hook for consuming the context +- Actions for [list specific actions] +Follow the reducer pattern and include error boundaries. +``` + +### 4. Zustand Store Setup + +**Prompt:** +``` +Create a Zustand store for [feature] with these requirements: +- TypeScript interfaces for state shape +- Actions for [list actions] +- Persist middleware for localStorage +- DevTools integration for debugging +Include selectors and proper state immutability. +``` + +--- + +## Next.js Specific Features + +### 5. Page with Data Fetching + +**Prompt Template:** +``` +Create a Next.js page at [route] that: +- Fetches data using [getStaticProps/getServerSideProps/App Router] +- Implements [specific functionality] +- Handles loading and error states +- Includes proper SEO meta tags +- Is fully responsive with [CSS framework] +``` + +**Example:** +``` +Create a Next.js page at /products/[category] that: +- Fetches products using getStaticProps with ISR +- Implements filtering and sorting functionality +- Handles loading and error states gracefully +- Includes proper SEO meta tags and Open Graph data +- Is fully responsive with Tailwind CSS +``` + +### 6. API Route Implementation + +**Prompt:** +``` +Create a Next.js API route at /api/[endpoint] that: +- Handles [HTTP methods] +- Validates request data using [validation library] +- Connects to [database/external API] +- Implements proper error handling and status codes +- Includes rate limiting and authentication if needed +``` + +### 7. Middleware Setup + +**Prompt:** +``` +Create Next.js middleware that: +- [Functionality 1] +- [Functionality 2] +- Runs on specific routes: [route patterns] +- Handles redirects and rewrites appropriately +Include proper TypeScript types and error handling. +``` + +--- + +## Performance Optimization + +### 8. Component Optimization + +**Prompt:** +``` +Optimize this React component for performance: +[paste component code] + +Focus on: +- Memoization with React.memo, useMemo, useCallback +- Lazy loading and code splitting +- Bundle size optimization +- Render optimization techniques +``` + +### 9. Image Optimization + +**Prompt:** +``` +Implement an optimized image component using Next.js Image that: +- Supports responsive images with multiple breakpoints +- Includes lazy loading and blur placeholder +- Handles different image formats (WebP, AVIF) +- Provides fallback for unsupported formats +- Includes proper alt text and accessibility features +``` + +--- + +## Testing & Quality Assurance + +### 10. Component Testing + +**Prompt Template:** +``` +Write comprehensive tests for this [component type] using React Testing Library and Jest: +[paste component code] + +Include tests for: +- Rendering with different props +- User interactions and event handling +- Accessibility compliance +- Error states and edge cases +``` + +### 11. E2E Testing with Playwright + +**Prompt:** +``` +Create Playwright E2E tests for the [feature] workflow: +- [Step 1 of user journey] +- [Step 2 of user journey] +- [Step 3 of user journey] +Include proper page object models and test data setup. +``` + +### 12. Performance Testing + +**Prompt:** +``` +Create performance tests for [component/page] that measure: +- Core Web Vitals (LCP, FID, CLS) +- Bundle size impact +- Runtime performance metrics +- Memory usage patterns +Use appropriate testing tools and provide optimization recommendations. +``` + +--- + +## UI/UX Implementation + +### 13. Advanced Layout and Responsive Design + +**Prompt (Mockup to Responsive Component):** +``` +Convert this design mockup to a responsive React component: +[describe design or paste image] + +Requirements: +- Mobile-first approach +- Breakpoints: mobile (320px), tablet (768px), desktop (1024px) +- Use [CSS framework] for styling +- Ensure accessibility compliance (WCAG 2.1 AA) +- Include smooth animations and transitions +``` + +**Prompt Template (Complex Layout Implementation):** +``` +You are a master of CSS and React. Create a Next.js component that implements a [specific complex layout, e.g., 'responsive masonry grid', 'sidebar layout with collapsible sections', 'dashboard with draggable and resizable widgets']. +Requirements: +- Use [CSS Grid / Flexbox / combination] for the primary layout structure. +- Implement advanced alignment techniques for [specific alignment challenge, e.g., 'vertically centering dynamic height content', 'justifying items in a complex grid']. +- Ensure the layout is fully responsive across [list breakpoints]. +- [Optional: Add a specific feature like 'support for container queries for child elements' or 'integration with a state management solution for layout preferences']. +- Write clean, maintainable TypeScript and [CSS Modules / Tailwind CSS / Styled Components] for styling. +- Explain the rationale behind your layout choices and any trade-offs made. +``` + +**Example (Complex Layout Implementation):** +``` +You are a master of CSS and React. Create a Next.js page component that implements a responsive dashboard layout. +Requirements: +- A fixed sidebar (250px width on desktop, collapsible on tablet/mobile). +- A main content area next to the sidebar. +- The main content area should use CSS Grid to display multiple info cards that automatically adjust their column span based on available width (e.g., 1 column on mobile, 2 on tablet, 3-4 on desktop). +- Cards should have consistent spacing and alignment. +- Implement this using Next.js, TypeScript, and Tailwind CSS. +- Ensure the sidebar collapse mechanism is accessible and clearly indicated. +``` + +**Prompt Template (Container Queries):** +``` +You are a cutting-edge CSS and React developer. Create a Next.js component that demonstrates the use of CSS Container Queries to achieve a truly modular and responsive design. +Requirements: +- The component should adapt its internal layout or styling based on its allocated width, independent of the viewport. +- Provide at least two distinct visual states triggered by different container widths. +- Example scenario: A card component that switches from a vertical layout to a horizontal layout when its container is wide enough. +- Use modern CSS practices and TypeScript. +- Explain the setup for container queries (e.g., `container-type`, `container-name`) and how they are applied. +- Discuss current browser support and any necessary considerations for fallbacks or polyfills. +``` + +**Prompt Template (CSS Subgrid):** +``` +You are a CSS Grid expert. Design a Next.js component that effectively utilizes CSS Subgrid to manage alignment and structure within a nested grid layout. +Requirements: +- The component should feature a parent grid and at least one child element that itself becomes a grid and uses `subgrid` for its rows and/or columns. +- Clearly demonstrate how subgrid helps align items in the nested grid with the main parent grid tracks. +- Provide a comparative explanation or example of how this layout might be more complex or less precise without subgrid. +- Use Next.js, TypeScript, and [CSS Modules / Tailwind CSS / Styled Components]. +- Discuss browser support for subgrid and suggest fallback strategies for older browsers. +``` + +### 14. Form Implementation + +**Prompt:** +``` +Create a complex form component for [purpose] with: +- Form validation using [validation library] +- Multi-step wizard if applicable +- File upload capabilities +- Real-time validation feedback +- Accessibility features (ARIA labels, keyboard navigation) +- Loading states and error handling +Use React Hook Form and TypeScript. +``` + +### 15. Advanced Animation and Micro-interactions + +**Prompt Template:** +``` +You are a UI animation specialist. Implement [specific advanced animation, e.g., 'a choreographed entrance animation for a list of items', 'a complex SVG path animation', 'physics-based micro-interactions on a button/card', 'a shared layout transition between routes'] in a React/Next.js component using [Framer Motion / GSAP / React Spring / Lottie]. +Requirements: +- The animation should be [describe desired effect, e.g., 'smooth and performant (60fps)', 'triggered on scroll/hover/click/mount/route change', 'sequenced with precise timing and easing']. +- Address accessibility: ensure it respects `prefers-reduced-motion`. +- Optimize for performance, considering bundle size of the animation library and repaint/reflow costs. +- Provide clean, well-structured code with TypeScript, isolating animation logic where possible. +- Explain how to customize parameters (e.g., duration, delay, easing functions) or extend the animation. +``` + +**Example:** +``` +You are a UI animation specialist using Framer Motion. Implement a 'staggered list item entrance' animation for a dynamically loaded list of items in a Next.js component. +Requirements: +- When the list items appear (e.g., on page load or after data fetching), they should animate in one by one with a slight delay between each. +- The entrance animation for each item should combine opacity (from 0 to 1) and a vertical slide (e.g., from 20px below to its final position). +- The animation should be smooth, engaging, and use appropriate easing functions. +- Ensure it respects the `prefers-reduced-motion` media query (e.g., by disabling or simplifying animations). +- The component should accept the list items as props and render them. +- Provide clean, well-structured code with TypeScript and Framer Motion. +- Include comments explaining the key parts of the animation setup (e.g., `staggerChildren`, `variants`). +``` + +**Prompt Template (Advanced Scroll-Triggered Animations):** +``` +You are a web animation specialist. Implement sophisticated scroll-triggered animations for a section in a Next.js page using [Framer Motion / GSAP / Intersection Observer API with custom logic]. +Choose one or combine the following effects: +- Parallax scrolling for background or foreground elements. +- Staggered reveal animations for a list of items as they enter the viewport. +- An element that animates along a path or changes properties (e.g., opacity, scale, rotation) based on scroll progress within its parent container. +Requirements: +- Animations must be smooth, performant (prioritizing `transform` and `opacity`), and avoid jank. +- Implement `prefers-reduced-motion` detection to disable or simplify animations. +- Ensure that the scroll listeners or observers are efficiently managed and cleaned up to prevent memory leaks. +- Provide well-structured TypeScript code, clearly separating animation logic. +- Explain any calculations or concepts used (e.g., normalizing scroll progress, setting up Intersection Observer thresholds). +``` + +### 16. Design System Development and Theming + +**Prompt Template (Design Tokens):** +``` +You are an expert React/Next.js developer specializing in scalable frontend architectures. Outline a strategy for establishing and managing design tokens for a new, large-scale Next.js project using [chosen technology, e.g., CSS Custom Properties, Tailwind CSS theme configuration, Styled System, Vanilla Extract]. +Address the following: +- Token categories (e.g., colors, typography, spacing, radii, shadows, motion). +- Naming conventions and structure (e.g., global, alias, component-specific tokens). +- How to define and consume these tokens within React components. +- Strategy for theming (e.g., light/dark mode, brand themes) using these tokens. +- Tooling recommendations for managing and documenting tokens (e.g., Style Dictionary, Zeroheight). +- How TypeScript can be used to ensure type safety for tokens. +Provide a small code example of defining a few tokens and using them in a simple component. +``` + +**Example (Dynamic Theming):** +``` +You are an expert React/Next.js developer. Implement a dynamic theming system (light and dark modes) for a Next.js application using [Context API and CSS Custom Properties / Styled Components' ThemeProvider / Tailwind CSS dark mode variant]. +Requirements: +- Define a basic set of theme variables for colors (background, text, primary, secondary) for both light and dark themes. +- Create a mechanism to toggle between themes (e.g., a button or a hook `useTheme`). +- The selected theme should persist across page loads (e.g., using localStorage). +- Demonstrate the theming with a sample React component whose appearance changes based on the active theme. +- Ensure the solution is type-safe using TypeScript. +- Explain how new components can subscribe to theme changes. +``` + +**Prompt Template (Accessibility in Dynamic Theming):** +``` +You are an accessibility (a11y) and UI design expert. For a Next.js application that supports dynamic theming (e.g., light, dark, high-contrast modes), provide comprehensive guidelines and a checklist to ensure the theming system is fully accessible. +Address the following critical areas: +- **Color Contrast:** Minimum WCAG AA/AAA contrast ratios for text, interactive elements, icons, and graphics across all themes. How to test and enforce this (e.g., tools, automated checks). +- **Focus Indicators:** Ensuring focus indicators are highly visible and adapt correctly to different themes. +- **Semantic HTML & ARIA:** How theming might impact ARIA attributes or semantic meaning, and how to ensure consistency. +- **User Preferences:** Respecting operating system level theme preferences (e.g., via `prefers-color-scheme`). +- **Testing Strategy:** Specific testing steps for theme-related accessibility, including keyboard navigation and screen reader checks across themes. +- Provide an example of a problematic CSS/style snippet in a multi-theme setup and how to fix it for accessibility. +``` + +--- + +## API Integration + +### 17. Data Fetching with React Query + +**Prompt:** +``` +Set up React Query (TanStack Query) for [API endpoint] with: +- Query and mutation hooks +- Caching strategies +- Error handling and retry logic +- Optimistic updates +- Background refetching +Include TypeScript types for API responses. +``` + +### 18. Real-time Data with WebSockets + +**Prompt:** +``` +Implement WebSocket connection for [real-time feature] that: +- Establishes connection on component mount +- Handles connection states (connecting, connected, disconnected) +- Processes incoming messages and updates UI +- Includes reconnection logic +- Properly cleans up on unmount +``` + +--- + +## Debugging & Troubleshooting + +### 19. Performance Debugging + +**Prompt:** +``` +Help me debug performance issues in this React component: +[paste component code] + +Analyze: +- Unnecessary re-renders +- Memory leaks +- Bundle size impact +- Runtime performance bottlenecks +Provide specific optimization recommendations. +``` + +### 20. Build Error Resolution + +**Prompt:** +``` +I'm getting this build error in my Next.js project: +[paste error message] + +Help me: +- Understand the root cause +- Provide step-by-step solution +- Suggest preventive measures +- Update configuration if needed +``` + +### 21. Runtime Error Debugging + +**Prompt:** +``` +Debug this runtime error in my React application: +Error: [error message] +Component: [component name] +Context: [describe when error occurs] + +Provide: +- Root cause analysis +- Step-by-step debugging approach +- Code fix with explanation +- Error boundary implementation if needed +``` + +--- + +## Advanced Patterns + +### 22. Compound Component Pattern + +**Prompt:** +``` +Create a compound component for [UI element] that: +- Uses the compound component pattern +- Provides flexible composition +- Shares state between child components +- Includes proper TypeScript support +- Follows accessibility best practices +``` + +### 23. Render Props Pattern + +**Prompt:** +``` +Implement a render props component for [functionality] that: +- Encapsulates [specific logic] +- Provides flexible rendering options +- Includes proper TypeScript generics +- Handles loading and error states +- Is reusable across different UI implementations +``` + +### 24. Higher-Order Component (HOC) + +**Prompt:** +``` +Create a HOC called with[FeatureName] that: +- Adds [specific functionality] to wrapped components +- Preserves original component props and ref +- Includes proper TypeScript support +- Handles edge cases and error scenarios +- Provides debugging information in development +``` + +--- + +## Best Practices Reminders + +When using these prompts, remember to: + +1. **Always specify TypeScript** - Include type safety requirements +2. **Mention accessibility** - Ensure WCAG compliance +3. **Include error handling** - Handle edge cases and error states +4. **Request tests** - Ask for comprehensive test coverage +5. **Specify styling approach** - Mention CSS framework or styling method +6. **Consider performance** - Ask for optimization recommendations +7. **Include documentation** - Request JSDoc comments and README updates + +## Example Workflow + +``` +1. Use Component Development prompts to create base components +2. Apply State Management prompts for complex state logic +3. Implement Next.js features using specific prompts +4. Optimize with Performance prompts +5. Ensure quality with Testing prompts +6. Debug issues using Troubleshooting prompts +``` + +--- + +*This guide is designed to help Frontend React/Next.js engineers work more efficiently with AI assistants. Customize the prompts based on your specific project requirements and tech stack.* \ No newline at end of file diff --git a/hr-manager-hiring-prompts.md b/hr-manager-hiring-prompts.md new file mode 100644 index 0000000..27b6ceb --- /dev/null +++ b/hr-manager-hiring-prompts.md @@ -0,0 +1,793 @@ +# HR Manager Hiring Prompts Guide + +A comprehensive collection of AI prompts specifically designed for HR Managers to streamline hiring processes, create compelling job descriptions, and implement effective talent acquisition strategies. + +## Table of Contents +1. [Job Description Creation](#job-description-creation) +2. [Talent Sourcing & Recruitment](#talent-sourcing--recruitment) +3. [Interview Process Design](#interview-process-design) +4. [Candidate Assessment & Evaluation](#candidate-assessment--evaluation) +5. [Employer Branding & Attraction](#employer-branding--attraction) +6. [Diversity, Equity & Inclusion](#diversity-equity--inclusion) +7. [Compensation & Benefits Strategy](#compensation--benefits-strategy) +8. [Onboarding & Integration](#onboarding--integration) +9. [Recruitment Analytics & Metrics](#recruitment-analytics--metrics) +10. [Legal Compliance & Documentation](#legal-compliance--documentation) + +--- + +## Job Description Creation + +### 1. Comprehensive Job Description Writing + +**Prompt Template:** +``` +You are an expert HR professional. Create a comprehensive job description for [position title] with these requirements: +- Company: [company name and industry] +- Department: [specific department/team] +- Reporting structure: [manager/team lead] +- Experience level: [entry/mid/senior level] +- Work arrangement: [remote/hybrid/on-site] + +Include: +- Compelling job title and summary +- Key responsibilities and duties +- Required and preferred qualifications +- Skills and competencies needed +- Compensation range and benefits +- Company culture and values alignment +- Growth and development opportunities +``` + +**Example:** +``` +You are an expert HR professional. Create a comprehensive job description for Senior Software Engineer with these requirements: +- Company: TechFlow Solutions, a fast-growing fintech startup +- Department: Engineering team (backend focus) +- Reporting structure: Reports to Engineering Manager +- Experience level: Senior level (5+ years) +- Work arrangement: Hybrid (3 days in office, 2 remote) + +Include: +- Compelling job title that attracts top talent +- Key responsibilities including system design and mentoring +- Required qualifications (languages, frameworks, experience) +- Preferred skills (cloud platforms, DevOps, leadership) +- Competitive salary range ($120k-$160k) and equity package +- Company culture emphasizing innovation and work-life balance +- Career advancement opportunities and learning budget +``` + +### 2. Role-Specific Requirements Analysis + +**Prompt:** +``` +Analyze and define specific requirements for [job role] in [industry/company type] that includes: +- Core technical/functional competencies +- Soft skills and behavioral traits +- Industry-specific knowledge requirements +- Certification or educational prerequisites +- Experience level expectations and progression paths + +Create: +- Detailed competency framework +- Skills assessment criteria +- Performance indicators and success metrics +- Career development pathway +- Training and development needs +``` + +### 3. Job Description Optimization + +**Prompt:** +``` +Optimize this job description for [specific goals] by: +- Improving candidate attraction and engagement +- Enhancing SEO and job board visibility +- Ensuring inclusive and bias-free language +- Aligning with current market standards +- Incorporating employer branding elements + +Current job description: [paste existing description] + +Provide: +- Revised job description with improvements +- Explanation of changes made +- Keywords for better searchability +- Suggestions for posting platforms +- A/B testing recommendations +``` + +--- + +## Talent Sourcing & Recruitment + +### 4. Sourcing Strategy Development + +**Prompt Template:** +``` +Develop a comprehensive talent sourcing strategy for [position/department] with these parameters: +- Target candidate profile: [demographics, experience, skills] +- Hiring timeline: [urgency and timeline constraints] +- Budget considerations: [recruitment budget and resources] +- Market conditions: [competitive landscape, talent availability] +- Company constraints: [location, remote work, industry reputation] + +Include: +- Multi-channel sourcing approach +- Passive candidate engagement strategies +- Talent pipeline development +- Competitive intelligence and market analysis +- Success metrics and KPIs +``` + +**Example:** +``` +Develop a comprehensive talent sourcing strategy for Data Scientists with these parameters: +- Target candidate profile: PhD/Masters in data science, 3-7 years experience, Python/R expertise +- Hiring timeline: Need to fill 5 positions within 3 months +- Budget considerations: $15k recruitment budget, internal recruiter + agency support +- Market conditions: High competition, limited talent pool, remote work expectations +- Company constraints: Series B startup, hybrid work model, healthcare industry + +Include: +- LinkedIn, GitHub, Kaggle, and academic conference sourcing +- Passive candidate engagement through thought leadership content +- University partnerships and internship-to-hire programs +- Competitive analysis of compensation and benefits packages +- Metrics: time-to-fill, cost-per-hire, source effectiveness, candidate quality scores +``` + +### 5. Candidate Persona Development + +**Prompt:** +``` +Create detailed candidate personas for [role/department] that include: +- Demographic and professional characteristics +- Career motivations and aspirations +- Preferred communication channels and timing +- Decision-making factors and priorities +- Pain points and challenges in job searching +- Values and cultural fit indicators + +For each persona, provide: +- Sourcing channel recommendations +- Messaging and outreach strategies +- Interview and assessment approaches +- Offer negotiation considerations +- Retention and engagement tactics +``` + +### 6. Recruitment Marketing Strategy + +**Prompt:** +``` +Design a recruitment marketing strategy for [company/role] that: +- Builds employer brand awareness +- Attracts passive candidates +- Showcases company culture and values +- Highlights career growth opportunities +- Differentiates from competitors + +Include: +- Content marketing calendar and themes +- Social media strategy and platforms +- Employee advocacy programs +- Recruitment events and networking +- Measurement and optimization approaches +``` + +--- + +## Interview Process Design + +### 7. Structured Interview Framework + +**Prompt:** +``` +Design a structured interview process for [position] that includes: +- Interview stages and progression criteria +- Interviewer roles and responsibilities +- Question banks for different competencies +- Assessment rubrics and scoring methods +- Candidate experience optimization + +Create: +- Interview guide templates for each stage +- Behavioral and situational question sets +- Technical assessment criteria (if applicable) +- Reference check procedures +- Decision-making framework and documentation +``` + +### 8. Behavioral Interview Questions + +**Prompt Template:** +``` +Create behavioral interview questions for [role/competency] that assess: +- Core competencies: [list specific competencies] +- Leadership and teamwork abilities +- Problem-solving and decision-making skills +- Adaptability and learning agility +- Cultural fit and values alignment + +For each question, provide: +- The specific competency being assessed +- Follow-up probing questions +- Evaluation criteria and red flags +- Example strong and weak responses +- Scoring guidelines and benchmarks +``` + +**Example:** +``` +Create behavioral interview questions for Product Manager role that assess: +- Core competencies: Strategic thinking, stakeholder management, data-driven decision making +- Leadership abilities in cross-functional teams +- Problem-solving in ambiguous situations +- Customer-centric mindset and market awareness +- Cultural fit with innovation and collaboration values + +For each question, provide: +- Clear competency mapping (e.g., "Tell me about a time you had to pivot a product strategy" → Strategic thinking) +- Follow-up questions to dig deeper into decision-making process +- Red flags like blame-shifting or lack of data usage +- Examples of strong responses showing impact and learning +- 1-5 scoring scale with specific behavioral indicators +``` + +### 9. Technical Assessment Design + +**Prompt:** +``` +Design technical assessments for [technical role] that: +- Evaluate job-relevant skills and knowledge +- Provide fair and unbiased evaluation +- Respect candidate time and experience +- Simulate real work scenarios +- Allow for different solution approaches + +Include: +- Assessment format and duration +- Evaluation criteria and rubrics +- Sample problems or case studies +- Interviewer training materials +- Feedback and communication protocols +``` + +--- + +## Candidate Assessment & Evaluation + +### 10. Competency-Based Evaluation + +**Prompt:** +``` +Create a competency-based evaluation framework for [role] that: +- Maps to job requirements and success factors +- Provides objective assessment criteria +- Reduces bias and increases consistency +- Supports data-driven hiring decisions +- Enables candidate comparison and ranking + +Include: +- Competency definitions and behavioral indicators +- Assessment methods for each competency +- Scoring scales and interpretation guidelines +- Interviewer calibration procedures +- Documentation and reporting templates +``` + +### 11. Reference Check Strategy + +**Prompt:** +``` +Develop a comprehensive reference check strategy for [position level] that: +- Verifies candidate claims and experience +- Assesses cultural fit and work style +- Identifies potential performance issues +- Gathers insights for onboarding success +- Maintains legal compliance and confidentiality + +Include: +- Reference selection criteria and requirements +- Structured question sets for different reference types +- Documentation and record-keeping procedures +- Red flag identification and follow-up protocols +- Integration with final hiring decision process +``` + +### 12. Candidate Scoring and Ranking + +**Prompt:** +``` +Create a candidate scoring and ranking system for [hiring process] that: +- Weights different assessment components appropriately +- Provides transparent and defensible decisions +- Enables comparison across different interview panels +- Supports diversity and inclusion goals +- Facilitates hiring committee discussions + +Include: +- Scoring methodology and calculations +- Weighting rationale for different criteria +- Calibration and consistency checks +- Reporting and visualization tools +- Decision-making guidelines and thresholds +``` + +--- + +## Employer Branding & Attraction + +### 13. Employer Value Proposition + +**Prompt Template:** +``` +Develop an employer value proposition (EVP) for [company/department] that: +- Differentiates from competitors in [industry] +- Appeals to [target candidate demographics] +- Aligns with company mission and values +- Addresses candidate motivations and needs +- Supports recruitment and retention goals + +Include: +- Core EVP messaging and themes +- Proof points and supporting evidence +- Channel-specific adaptations +- Employee testimonials and stories +- Measurement and feedback mechanisms +``` + +**Example:** +``` +Develop an employer value proposition (EVP) for a renewable energy startup that: +- Differentiates from traditional energy companies and tech startups +- Appeals to environmentally conscious engineers and business professionals +- Aligns with mission to accelerate clean energy adoption +- Addresses desires for meaningful work and career growth +- Supports recruitment of top talent in competitive market + +Include: +- Core messaging around impact, innovation, and growth opportunities +- Proof points like sustainability metrics, patent portfolio, funding milestones +- LinkedIn, job board, and career page adaptations +- Employee stories about project impact and career development +- Surveys and feedback loops to validate and refine messaging +``` + +### 14. Recruitment Content Strategy + +**Prompt:** +``` +Create a recruitment content strategy for [company/role] that: +- Showcases company culture and work environment +- Highlights employee experiences and career journeys +- Demonstrates thought leadership and expertise +- Builds trust and credibility with candidates +- Drives engagement and applications + +Include: +- Content themes and messaging pillars +- Content formats and distribution channels +- Employee advocacy and participation plans +- Content calendar and production workflow +- Performance metrics and optimization strategies +``` + +### 15. Candidate Experience Optimization + +**Prompt:** +``` +Design an optimal candidate experience for [hiring process] that: +- Creates positive impressions at every touchpoint +- Provides transparency and clear communication +- Respects candidate time and effort +- Gathers feedback for continuous improvement +- Supports employer brand regardless of hiring outcome + +Include: +- Candidate journey mapping and touchpoint analysis +- Communication templates and timing +- Feedback collection and response protocols +- Technology and process improvements +- Training for hiring team members +``` + +--- + +## Diversity, Equity & Inclusion + +### 16. Inclusive Hiring Practices + +**Prompt:** +``` +Develop inclusive hiring practices for [organization] that: +- Remove bias from job descriptions and requirements +- Expand sourcing to underrepresented communities +- Ensure fair and equitable assessment processes +- Create welcoming interview experiences +- Support diverse candidate success + +Include: +- Bias audit and mitigation strategies +- Diverse sourcing channels and partnerships +- Structured interview training and calibration +- Accommodation and accessibility considerations +- Metrics and accountability measures +``` + +### 17. Diversity Sourcing Strategy + +**Prompt:** +``` +Create a diversity sourcing strategy for [role/department] that: +- Identifies and engages underrepresented talent pools +- Partners with diversity-focused organizations +- Leverages employee networks and referrals +- Addresses systemic barriers to application +- Measures and tracks diversity outcomes + +Include: +- Target diversity goals and metrics +- Sourcing channel identification and activation +- Partnership development and management +- Bias interruption and inclusive messaging +- Progress tracking and reporting mechanisms +``` + +### 18. Bias Mitigation Framework + +**Prompt:** +``` +Implement a bias mitigation framework for [hiring process] that: +- Identifies potential bias points in the process +- Implements evidence-based interventions +- Trains hiring team on unconscious bias +- Monitors outcomes for bias indicators +- Continuously improves based on data + +Include: +- Bias assessment and mapping +- Intervention design and implementation +- Training curriculum and delivery methods +- Monitoring dashboard and alerts +- Feedback loops and process improvements +``` + +--- + +## Compensation & Benefits Strategy + +### 19. Compensation Benchmarking + +**Prompt Template:** +``` +Conduct compensation benchmarking for [role/level] in [location/market] that: +- Analyzes market rates and trends +- Considers company size, industry, and stage +- Evaluates total compensation packages +- Identifies competitive positioning strategy +- Supports offer negotiation and decisions + +Include: +- Data sources and methodology +- Peer company identification and analysis +- Base salary, bonus, and equity comparisons +- Benefits and perquisites evaluation +- Recommendations for competitive positioning +``` + +**Example:** +``` +Conduct compensation benchmarking for Senior Data Engineer in San Francisco Bay Area that: +- Analyzes market rates from Glassdoor, Levels.fyi, and salary surveys +- Considers Series B startup vs. FAANG and established tech companies +- Evaluates base salary, annual bonus, equity grants, and benefits +- Identifies 75th percentile positioning strategy to attract top talent +- Supports offer negotiations within budget constraints + +Include: +- Multiple data sources with sample sizes and recency +- Peer companies: similar stage startups, established tech, consulting firms +- Total compensation ranges: $140k-$200k base, 10-20% bonus, 0.1-0.3% equity +- Benefits comparison: health insurance, 401k, PTO, learning budgets +- Recommendation: Target 75th percentile with competitive equity upside +``` + +### 20. Benefits Package Design + +**Prompt:** +``` +Design a competitive benefits package for [company type/size] that: +- Meets diverse employee needs and preferences +- Aligns with company values and culture +- Fits within budget and administrative constraints +- Differentiates from competitors +- Supports recruitment and retention goals + +Include: +- Core benefits requirements and options +- Voluntary and supplemental benefits +- Work-life balance and wellness programs +- Professional development and learning benefits +- Communication and enrollment strategies +``` + +### 21. Offer Strategy and Negotiation + +**Prompt:** +``` +Develop offer strategy and negotiation guidelines for [role/level] that: +- Balances candidate expectations with budget constraints +- Maintains internal equity and fairness +- Provides flexibility for different candidate priorities +- Supports quick decision-making and closure +- Protects company interests and relationships + +Include: +- Offer structure and component flexibility +- Negotiation parameters and approval processes +- Alternative value propositions and creative solutions +- Timeline management and urgency tactics +- Documentation and communication protocols +``` + +--- + +## Onboarding & Integration + +### 22. Pre-boarding Strategy + +**Prompt:** +``` +Create a pre-boarding strategy for [role/company] that: +- Maintains candidate engagement between offer and start date +- Prepares new hires for successful integration +- Reduces anxiety and buyer's remorse +- Builds excitement and commitment +- Ensures smooth first-day experience + +Include: +- Communication timeline and touchpoints +- Information sharing and preparation materials +- Technology setup and access provisioning +- Team introductions and relationship building +- First-day and first-week planning +``` + +### 23. Role-Specific Onboarding Plan + +**Prompt:** +``` +Design a role-specific onboarding plan for [position] that: +- Accelerates time to productivity +- Builds necessary relationships and networks +- Provides role-specific training and resources +- Sets clear expectations and success metrics +- Integrates with company culture and values + +Include: +- 30-60-90 day milestone and goal setting +- Training curriculum and learning resources +- Mentorship and buddy system assignment +- Performance check-ins and feedback loops +- Success metrics and evaluation criteria +``` + +### 24. New Hire Integration Support + +**Prompt:** +``` +Develop new hire integration support for [department/team] that: +- Facilitates social and professional connections +- Provides ongoing guidance and resources +- Addresses common challenges and obstacles +- Measures integration success and satisfaction +- Supports long-term retention and engagement + +Include: +- Integration milestone tracking +- Support resource identification and access +- Feedback collection and response mechanisms +- Manager and team training on integration +- Continuous improvement based on outcomes +``` + +--- + +## Recruitment Analytics & Metrics + +### 25. Hiring Metrics Dashboard + +**Prompt Template:** +``` +Create a comprehensive hiring metrics dashboard for [organization/department] that tracks: +- Recruitment funnel performance and conversion rates +- Time-to-fill and time-to-hire metrics +- Cost-per-hire and budget utilization +- Source effectiveness and ROI +- Quality of hire and retention rates + +Include: +- Key performance indicators and benchmarks +- Data visualization and reporting formats +- Automated data collection and updates +- Stakeholder-specific views and insights +- Action triggers and improvement recommendations +``` + +**Example:** +``` +Create a comprehensive hiring metrics dashboard for Engineering department that tracks: +- Recruitment funnel: applications → phone screens → technical interviews → offers → acceptances +- Time-to-fill: average 45 days target, tracking by role level and urgency +- Cost-per-hire: $8k target including agency fees, job boards, and internal costs +- Source effectiveness: LinkedIn, referrals, agencies, job boards with quality scores +- Quality metrics: 90-day retention, performance ratings, hiring manager satisfaction + +Include: +- Weekly/monthly KPI summaries with red/yellow/green status indicators +- Interactive charts showing trends and drill-down capabilities +- Automated data feeds from ATS, HRIS, and performance management systems +- Executive summary for leadership, detailed views for recruiters and hiring managers +- Alert system for metrics falling below thresholds with improvement action plans +``` + +### 26. Recruitment ROI Analysis + +**Prompt:** +``` +Conduct recruitment ROI analysis for [hiring initiative/program] that: +- Calculates total investment and associated costs +- Measures hiring outcomes and business impact +- Compares different sourcing channels and methods +- Identifies optimization opportunities +- Supports budget allocation and strategy decisions + +Include: +- Cost calculation methodology and components +- Benefit quantification and measurement approaches +- ROI calculation and interpretation guidelines +- Comparative analysis across channels and programs +- Recommendations for investment optimization +``` + +### 27. Predictive Hiring Analytics + +**Prompt:** +``` +Develop predictive hiring analytics for [organization] that: +- Forecasts hiring needs based on business growth +- Predicts candidate success and retention likelihood +- Identifies optimal sourcing strategies and timing +- Anticipates market conditions and competition +- Supports proactive talent planning + +Include: +- Data requirements and collection strategies +- Predictive modeling approaches and algorithms +- Validation and accuracy measurement methods +- Implementation and integration considerations +- Actionable insights and decision support tools +``` + +--- + +## Legal Compliance & Documentation + +### 28. Hiring Compliance Framework + +**Prompt:** +``` +Establish a hiring compliance framework for [organization/jurisdiction] that: +- Ensures adherence to employment laws and regulations +- Protects against discrimination and bias claims +- Maintains proper documentation and records +- Supports audit and investigation requirements +- Provides training and guidance for hiring teams + +Include: +- Legal requirement identification and mapping +- Policy and procedure documentation +- Training curriculum and delivery methods +- Documentation templates and retention policies +- Monitoring and audit procedures +``` + +### 29. Interview Documentation Standards + +**Prompt:** +``` +Create interview documentation standards for [organization] that: +- Capture objective assessment information +- Support hiring decisions and rationale +- Protect against legal challenges +- Enable performance tracking and improvement +- Maintain candidate privacy and confidentiality + +Include: +- Documentation templates and formats +- Required information and assessment criteria +- Storage and retention procedures +- Access controls and privacy protections +- Training on proper documentation practices +``` + +### 30. Background Check and Verification + +**Prompt:** +``` +Implement background check and verification procedures for [role/organization] that: +- Verify candidate credentials and experience +- Assess potential risks and red flags +- Comply with legal requirements and restrictions +- Maintain fairness and consistency +- Protect candidate rights and privacy + +Include: +- Background check scope and requirements +- Vendor selection and management procedures +- Candidate consent and communication protocols +- Decision-making criteria and appeal processes +- Documentation and record-keeping requirements +``` + +--- + +## Best Practices Reminders + +When using these prompts, remember to: + +1. **Ensure legal compliance** - Always consider employment laws and regulations +2. **Focus on candidate experience** - Create positive interactions at every touchpoint +3. **Promote diversity and inclusion** - Actively work to reduce bias and increase representation +4. **Use data-driven decisions** - Leverage metrics and analytics for continuous improvement +5. **Maintain confidentiality** - Protect candidate and employee information appropriately +6. **Document thoroughly** - Keep detailed records for legal protection and process improvement +7. **Stay current with trends** - Adapt to changing market conditions and best practices + +## Example Workflow for HR Managers + +``` +1. Start with Job Description Creation for clear role definition +2. Develop Sourcing Strategy for targeted candidate attraction +3. Design Interview Process for consistent evaluation +4. Implement Assessment Framework for objective decisions +5. Create Employer Branding for competitive positioning +6. Ensure DEI Practices for inclusive hiring +7. Establish Compensation Strategy for competitive offers +8. Plan Onboarding Process for successful integration +9. Monitor Analytics and Metrics for continuous improvement +10. Maintain Compliance Framework for legal protection +``` + +## HR Technology Integration + +- **Applicant Tracking Systems (ATS)** - Leverage technology for process automation and tracking +- **HRIS Integration** - Connect hiring data with employee lifecycle management +- **Assessment Platforms** - Use validated tools for skills and personality assessment +- **Video Interviewing** - Implement remote interview capabilities and recording +- **Analytics Dashboards** - Create real-time visibility into hiring performance +- **AI and Automation** - Use technology to reduce bias and improve efficiency + +## Integration with Business Teams + +### Collaboration with Hiring Managers +- Use interview design prompts for structured evaluation processes +- Implement assessment frameworks for consistent candidate evaluation +- Provide training on bias mitigation and inclusive practices + +### Working with Leadership +- Use analytics prompts for strategic workforce planning +- Implement ROI analysis for budget justification and optimization +- Create executive dashboards for visibility into hiring performance + +### Partnership with Legal/Compliance +- Use compliance framework prompts for legal protection +- Implement documentation standards for audit readiness +- Ensure background check procedures meet regulatory requirements + +--- + +*This guide is designed to help HR Managers build effective, compliant, and inclusive hiring processes. Customize the prompts based on your specific organizational needs, industry requirements, and legal jurisdiction.* \ No newline at end of file diff --git a/job-specific-prompts-index.md b/job-specific-prompts-index.md new file mode 100644 index 0000000..08500cb --- /dev/null +++ b/job-specific-prompts-index.md @@ -0,0 +1,434 @@ +# Job-Specific AI Prompts Guide + +A comprehensive collection of AI prompts tailored for different software engineering roles and specializations. Each guide contains role-specific scenarios, best practices, and optimized prompts to accelerate development and solve common challenges. + +## Foundational Communication Guide + +### Essential for All Developers +- **[LLM Communication Techniques for Developers](llm-communication-techniques-for-developers.md)** - Master effective communication with AI assistants + - CLEAR framework and STAR method for structured prompts + - Context management and progressive disclosure techniques + - Debugging and troubleshooting communication patterns + - Architecture discussions and collaborative problem solving + - Advanced techniques like Socratic method and rubber duck debugging + +## Available Guides + +### Frontend Development +- **[Frontend React/Next.js Engineer](frontend-react-nextjs-prompts.md)** - Complete guide for React and Next.js developers + - Component development and custom hooks + - State management (Context API, Zustand) + - Next.js specific features (SSR, SSG, API routes) + - Performance optimization and testing + - UI/UX implementation and accessibility + +### Backend Development +- **[Rust Backend Engineer (RIG + Actix-web)](rust-backend-engineer-prompts.md)** - Specialized guide for Rust backend developers + - Actix-web server development + - RIG integration for AI capabilities + - Database integration with SQLx + - Authentication, authorization, and security + - Performance optimization and deployment + +- **[Node.js Sails.js Backend Engineer](nodejs-sailsjs-backend-prompts.md)** - Comprehensive guide for Node.js Sails.js developers + - Sails.js MVC architecture and conventions + - Waterline ORM and database integration + - Real-time features with Socket.io + - RESTful API development and GraphQL + - Authentication, middleware, and deployment + +### Blockchain & Web3 +- **[Blockchain Architect](blockchain-architect-prompts.md)** - Complete guide for Blockchain Architects and Web3 developers + - Blockchain architecture design and technology stack selection + - Smart contract architecture and DeFi protocol design + - Consensus mechanisms and scalability solutions + - Security, cryptography, and interoperability + - Infrastructure, governance, and tokenomics + +### Design & User Experience +- **[UI Designer (Figma)](ui-designer-figma-prompts.md)** - Complete guide for UI Designers using Figma + - Interactive prototype creation and design systems + - Component design and responsive layouts + - Accessibility and usability testing + - Design handoff and developer collaboration + - Performance optimization and conversion rate optimization + +### Quality Assurance & Testing +- **[Test Engineer (Pytest)](test-engineer-pytest-prompts.md)** - Comprehensive guide for Test Engineers using pytest + - Test framework setup and organization + - Unit, integration, and API testing + - UI/E2E testing with Selenium and Playwright + - Test data management and fixtures + - Performance testing and CI/CD integration + +### Product Management +- **[Product Manager](product-manager-prompts.md)** - Complete guide for Product Managers + - Interactive prototype creation and MVP definition + - User research, personas, and journey mapping + - Feature planning and prioritization frameworks + - Market research and competitive analysis + - Product strategy, roadmapping, and go-to-market + - Data analysis, metrics, and stakeholder communication + +### Human Resources & Talent +- **[HR Manager (Hiring & Recruitment)](hr-manager-hiring-prompts.md)** - Comprehensive guide for HR Managers + - Job description creation and optimization + - Talent sourcing and recruitment strategies + - Interview process design and candidate assessment + - Employer branding and diversity initiatives + - Compensation strategy and onboarding processes + - Recruitment analytics and legal compliance + +### Coming Soon +- **Python Backend Engineer** (Django/FastAPI) +- **DevOps Engineer** (Docker, Kubernetes, CI/CD) +- **Mobile Developer** (React Native/Flutter) +- **Data Engineer** (Python, SQL, ETL pipelines) +- **Machine Learning Engineer** (Python, TensorFlow, PyTorch) +- **UX Researcher** (User research, usability testing, analytics) + +## How to Choose the Right Guide + +### Start with Communication Fundamentals +**All developers should begin with**: [LLM Communication Techniques](llm-communication-techniques-for-developers.md) +- Learn to structure thoughts clearly and concisely +- Master prompt engineering for technical scenarios +- Understand context management strategies +- Practice effective debugging communication +- Develop collaborative problem-solving skills + +### By Technology Stack +- **React/Next.js Frontend** → [Frontend React/Next.js Guide](frontend-react-nextjs-prompts.md) +- **Rust + Actix-web Backend** → [Rust Backend Guide](rust-backend-engineer-prompts.md) +- **Node.js + Sails.js Backend** → [Node.js Sails.js Guide](nodejs-sailsjs-backend-prompts.md) +- **Blockchain/Web3 Development** → [Blockchain Architect Guide](blockchain-architect-prompts.md) +- **Figma Design** → [UI Designer Figma Guide](ui-designer-figma-prompts.md) +- **Pytest Testing** → [Test Engineer Pytest Guide](test-engineer-pytest-prompts.md) +- **Product Management** → [Product Manager Guide](product-manager-prompts.md) +- **HR & Recruitment** → [HR Manager Guide](hr-manager-hiring-prompts.md) +- **Python Backend** → Coming soon + +### By Role Responsibilities +- **Frontend Focus**: UI/UX, component development, state management +- **Backend Focus**: APIs, databases, authentication, performance +- **Blockchain Focus**: Smart contracts, DeFi protocols, consensus mechanisms +- **Design Focus**: Prototyping, design systems, user experience +- **Testing Focus**: Test automation, quality assurance, CI/CD +- **Product Management**: Strategy, research, prototyping, stakeholder communication +- **HR & Talent**: Hiring, recruitment, job descriptions, candidate assessment +- **Full-Stack**: Use both frontend and backend guides +- **DevOps Focus**: Infrastructure, deployment, monitoring + +### By Experience Level +- **Junior Developers**: Start with basic setup and component/API development prompts +- **Mid-Level Developers**: Focus on architecture, testing, and optimization prompts +- **Senior Developers**: Use advanced patterns, performance, and system design prompts +- **Architects**: Use blockchain architecture and system design prompts +- **Designers**: Begin with prototype and component prompts, advance to design systems +- **Test Engineers**: Start with framework setup, progress to advanced testing patterns +- **Product Managers**: Begin with user research and prototype prompts, advance to strategy +- **HR Managers**: Start with job description creation, advance to analytics and compliance + +## Universal Prompts for All Roles + +### 1. Effective Communication Check +``` +Using the CLEAR framework, help me structure this request: +Context: [Current situation and environment] +Language: [Technical terms and scope] +Expectations: [What I want as output] +Actions: [Specific things to do] +Results: [How I'll validate success] + +My current request: [Your original question/need] +``` + +### 2. Progressive Problem Solving +``` +Let's use progressive disclosure to solve this step by step: + +High-level question: [Your main challenge] + +Based on your response, I'll ask follow-up questions to drill down into: +- Implementation details +- Edge cases and error handling +- Testing and validation approaches +- Performance and optimization considerations +``` + +### 3. Context-Rich Code Review +``` +CODE REVIEW REQUEST using structured communication: + +PURPOSE: [What this code accomplishes] +CONTEXT: [Technology stack and constraints] +CHANGES: [Summary of modifications] +CONCERNS: [Specific areas of uncertainty] +FOCUS: [What to pay attention to] + +[CODE BLOCK] + +Specific questions: +1. [Technical concern #1] +2. [Performance/security question] +3. [Maintainability consideration] +``` + +### 4. Collaborative Architecture Discussion +``` +COLLABORATIVE ARCHITECTURE SESSION: +Let's work together on: [System/component design challenge] + +My current thinking: +- Approach: [How I'm considering solving it] +- Constraints: [Technical and business limitations] +- Concerns: [What worries me about this approach] +- Unknowns: [Areas where I need guidance] + +Please: +- Challenge my assumptions +- Suggest alternative approaches +- Point out potential issues I haven't considered +- Help me think through edge cases and failure scenarios +``` + +### 5. Structured Debugging Session +``` +DEBUGGING SESSION using systematic approach: + +PROBLEM: [Clear problem statement] +ENVIRONMENT: [Technical context and setup] +SYMPTOMS: [What's actually happening] +EXPECTED: [What should happen instead] +INVESTIGATION: [What I've already tried] +HYPOTHESIS: [What I think might be wrong] + +CODE CONTEXT: +[Relevant code sections] + +ASSISTANCE NEEDED: +- Logic review and reasoning validation +- Alternative debugging strategies +- Tool recommendations +- Pattern recognition from similar issues +``` + +## Cross-Role Collaboration Prompts + +### Frontend-Backend Integration +``` +Design API contract between frontend and backend for [feature]: +Frontend needs: [list requirements] +Backend capabilities: [list what backend provides] + +Include: +- API endpoint specifications +- Request/response schemas +- Error handling strategies +- Authentication requirements +``` + +### Design-Development Collaboration +``` +Create design-to-development handoff documentation for [feature/component]: +Design specifications: [Figma designs and requirements] +Technical constraints: [development limitations] +Implementation timeline: [development schedule] + +Include: +- Component specifications and measurements +- Asset export requirements +- Interaction and animation details +- Responsive behavior documentation +- Accessibility requirements +``` + +### Testing-Development Integration +``` +Create testing strategy for [feature/component] that covers: +Development requirements: [functionality to test] +Quality standards: [coverage and performance targets] +Testing timeline: [when tests should be implemented] + +Include: +- Unit test requirements and coverage targets +- Integration test scenarios +- UI/E2E test workflows +- Performance testing criteria +- CI/CD integration requirements +``` + +### Product-Engineering Collaboration +``` +Create technical requirements document for [product feature] that bridges product and engineering: +Product requirements: [list product needs] +Technical constraints: [list technical limitations] +User experience goals: [list UX objectives] + +Include: +- Feature specifications and acceptance criteria +- Technical implementation approach +- Timeline and resource estimates +- Risk assessment and mitigation strategies +``` + +### HR-Engineering Collaboration +``` +Create technical hiring strategy for [engineering role] that aligns HR and engineering needs: +Role requirements: [technical skills and experience needed] +Team dynamics: [cultural fit and collaboration needs] +Growth trajectory: [career development and advancement] + +Include: +- Technical assessment design and evaluation criteria +- Interview process with engineering team involvement +- Onboarding plan with technical mentorship +- Performance evaluation and career development framework +``` + +### Blockchain-Traditional Development Integration +``` +Create integration strategy between blockchain and traditional systems for [use case]: +Blockchain requirements: [decentralization, security, transparency needs] +Traditional system constraints: [existing infrastructure, compliance, performance] +User experience goals: [seamless interaction, familiar interfaces] + +Include: +- Hybrid architecture design with on-chain and off-chain components +- API design for blockchain integration +- User authentication and wallet management +- Data synchronization and consistency strategies +``` + +### DevOps-Development Integration +``` +Create deployment strategy for [application] with: +Development requirements: [list dev needs] +Infrastructure constraints: [list limitations] +Performance targets: [specify metrics] + +Include: +- CI/CD pipeline design +- Environment configuration +- Monitoring and alerting setup +- Rollback procedures +``` + +## Best Practices Across All Roles + +### 1. Always Specify Context +- Mention your tech stack and versions +- Include project constraints and requirements +- Specify target environment (development, staging, production) + +### 2. Include Quality Requirements +- Request error handling and edge case coverage +- Ask for security considerations +- Include performance requirements +- Specify testing needs + +### 3. Ask for Documentation +- Request code comments and documentation +- Ask for README updates +- Include API documentation for backend work +- Request component documentation for frontend work + +### 4. Consider Maintainability +- Ask for clean, readable code +- Request modular, reusable components +- Include refactoring suggestions +- Ask for code organization best practices + +## Example Multi-Role Workflow + +### Building a Full-Stack Feature +1. **Product Planning**: Use Product Manager prompts for user research and requirements +2. **Design Phase**: Use UI Designer prompts for prototypes and design systems +3. **Architecture Design**: Use universal architecture prompts +4. **Backend Development**: Use Rust/Node.js backend prompts for API development +5. **Frontend Development**: Use React/Next.js prompts for UI implementation +6. **Testing**: Use Test Engineer prompts for comprehensive testing +7. **Integration**: Use cross-role collaboration prompts +8. **Deployment**: Use DevOps prompts for deployment strategy + +### Blockchain Product Development +1. **Research Phase**: Use Product Manager user research prompts +2. **Architecture Phase**: Use Blockchain Architect system design prompts +3. **Smart Contract Development**: Use Blockchain Architect smart contract prompts +4. **Frontend Integration**: Use Frontend development with Web3 integration +5. **Testing Phase**: Use Test Engineer prompts adapted for blockchain testing +6. **Security Audit**: Use Blockchain Architect security framework prompts +7. **Launch Phase**: Use Product Manager go-to-market prompts + +### Hiring and Team Building +1. **Role Definition**: Use HR Manager job description prompts +2. **Technical Assessment**: Use role-specific technical prompts for evaluation +3. **Interview Process**: Use HR Manager interview design prompts +4. **Onboarding**: Use HR Manager onboarding prompts with technical mentorship +5. **Performance Management**: Use role-specific performance evaluation prompts + +### Product Development Cycle +1. **Research Phase**: Use Product Manager user research prompts +2. **Strategy Phase**: Use Product Manager strategy and roadmap prompts +3. **Design Phase**: Use UI Designer prototype and design system prompts +4. **Development Phase**: Use appropriate engineering guides +5. **Testing Phase**: Use Test Engineer prompts for quality assurance +6. **Launch Phase**: Use Product Manager go-to-market prompts +7. **Optimization Phase**: Use data analysis and performance prompts + +### Design-to-Development Workflow +1. **User Research**: Use Product Manager research prompts +2. **Prototype Creation**: Use UI Designer prototype prompts +3. **Design System**: Use UI Designer design system prompts +4. **Component Development**: Use Frontend development prompts +5. **Testing**: Use Test Engineer UI testing prompts +6. **Handoff**: Use design-development collaboration prompts + +### Quality Assurance Process +1. **Test Planning**: Use Test Engineer framework setup prompts +2. **Unit Testing**: Use Test Engineer unit testing prompts +3. **Integration Testing**: Use Test Engineer integration prompts +4. **UI Testing**: Use Test Engineer UI/E2E testing prompts +5. **Performance Testing**: Use Test Engineer performance prompts +6. **Reporting**: Use Test Engineer reporting prompts + +## Contributing New Role-Specific Guides + +To contribute a new job-specific guide: + +1. **Follow the established format**: + - Clear table of contents + - Categorized prompt sections + - Template and example prompts + - Best practices section + +2. **Include role-specific scenarios**: + - Common daily tasks + - Technology-specific challenges + - Industry best practices + - Performance considerations + +3. **Provide practical examples**: + - Real-world use cases + - Complete prompt templates + - Expected outcomes + - Integration guidelines + +4. **Consider experience levels**: + - Basic prompts for beginners + - Advanced patterns for experienced professionals + - Leadership prompts for senior roles + +## Feedback and Updates + +These guides are living documents that should evolve with: +- New technology releases +- Changing best practices +- Community feedback +- Real-world usage patterns + +Please contribute improvements, new prompts, and additional role-specific guides to help the entire development community work more efficiently with AI assistants. + +--- + +*Choose the guide that best matches your role and technology stack. For full-stack development or cross-functional teams, use multiple guides as needed. Remember to customize prompts based on your specific project requirements and constraints.* \ No newline at end of file diff --git a/learning-to-code-guide.md b/learning-to-code-guide.md new file mode 100644 index 0000000..9110df6 --- /dev/null +++ b/learning-to-code-guide.md @@ -0,0 +1,78 @@ + # AI Coding 101: Learning To Code + + The following tips match what was covered in the AI Coding 101 episode, but the [LearnToCode.md](LearnToCode.md) page contains more detailed prompts and a technology glossary. + + #### 31. Tell AI to keep it simple + that you are a new dev + + **Example:** + ``` + I am learning how to code. Can you simply explain how the frontend connects to the backend? + ``` +--- + + #### 32. Ask AI to explain code "line by line" + + **Prompt:** + ``` + Please add comments explaining [function] line by line + ``` + + **Example:** + ``` + I am learning how to code. Can you explain the getContactDetails function line by line? + ``` +--- + + #### 33. Ask AI to explain specific technologies & concepts + + **Prompt:** + ``` + Can you explain how [concept] works? What does [technology] do? + ``` + + **Example:** + ``` + I'm a new dev. Can you explain what databases are for, when I should use them, and what Postgres is specifically? + ``` +--- + + #### 34. Ask AI how to build something + + **Prompt:** + ``` + I want to build a [app/feature]. How would you approach this problem from a technical perspective? + ``` + + **Example:** + ``` + I want to build a chat app. How would you architect this and what considerations do we need to take into account? + ``` +--- + + #### 35. Ask AI to show you examples + + **Prompt:** + ``` + Can you show me a working example of a [concept] and explain it? + ``` + + **Example:** + ``` + I am learning to code and want to understand how objects work. Can you create some examples and explain them? + ``` +--- + + #### 36. Tell the AI what you already know vs what is unclear + + **Prompt:** + ``` + I know how [concept] works but can you explain how it relates to [concept 2]? + ``` + + **Example:** + ``` + I have an API and understand how requests come in but can you explain how I could add authentication to my endpoints? + ``` +--- + + ### 37. Focus on learning and understanding core concepts \ No newline at end of file diff --git a/llm-communication-techniques-for-developers.md b/llm-communication-techniques-for-developers.md new file mode 100644 index 0000000..2d40ef4 --- /dev/null +++ b/llm-communication-techniques-for-developers.md @@ -0,0 +1,1073 @@ +# LLM Communication Techniques for Developers + +A comprehensive guide to effective communication strategies with Large Language Models (LLMs) for robust software development. Learn how to structure thoughts, craft precise prompts, and maintain productive conversations with AI assistants. + +## Table of Contents +1. [Fundamental Communication Principles](#fundamental-communication-principles) +2. [Prompt Engineering for Developers](#prompt-engineering-for-developers) +3. [Context Management Strategies](#context-management-strategies) +4. [Structured Problem-Solving Frameworks](#structured-problem-solving-frameworks) +5. [Code-Specific Communication Patterns](#code-specific-communication-patterns) +6. [Debugging and Troubleshooting Communication](#debugging-and-troubleshooting-communication) +7. [Architecture and Design Discussions](#architecture-and-design-discussions) +8. [Iterative Development Communication](#iterative-development-communication) +9. [Documentation and Knowledge Transfer](#documentation-and-knowledge-transfer) +10. [Advanced Communication Techniques](#advanced-communication-techniques) + +--- + +## Fundamental Communication Principles + +### 1. The CLEAR Framework + +**C**ontext - **L**anguage - **E**xpectations - **A**ctions - **R**esults + +**Context Setting:** +``` +I'm working on a [project type] using [technology stack]. +Current situation: [brief description] +My role: [your position/responsibility] +Team context: [team size, experience level, constraints] +``` + +**Language Precision:** +``` +Technical terms: Use specific terminology +Scope boundaries: Define what's included/excluded +Assumptions: State what you're assuming +Constraints: Mention limitations upfront +``` + +**Clear Expectations:** +``` +Expected output: [code, explanation, analysis, recommendations] +Format preference: [structured list, code blocks, diagrams] +Detail level: [high-level overview, detailed implementation, step-by-step] +Timeline: [immediate, planning phase, long-term consideration] +``` + +**Actionable Requests:** +``` +Specific actions: "Generate", "Review", "Optimize", "Explain" +Measurable outcomes: "Reduce latency by X", "Improve coverage to Y%" +Concrete deliverables: "Working code", "Test cases", "Documentation" +``` + +**Results Validation:** +``` +Success criteria: How will you know it worked? +Testing approach: How will you validate the solution? +Feedback loop: What will you do with the output? +``` + +### 2. The Inverted Pyramid Structure + +Start with the most critical information first, then provide supporting details. + +**Template:** +``` +IMMEDIATE NEED: [What you need right now] +CONTEXT: [Why you need it] +CONSTRAINTS: [What limitations exist] +DETAILS: [Additional specifications] +BACKGROUND: [Nice-to-have context] +``` + +**Example:** +``` +IMMEDIATE NEED: Fix memory leak in Node.js application causing crashes +CONTEXT: Production service handling 10k+ requests/minute, crashes every 2 hours +CONSTRAINTS: Cannot restart service during business hours (9 AM - 6 PM EST) +DETAILS: Using Express.js 4.18, MongoDB with Mongoose, Redis for caching +BACKGROUND: Legacy codebase inherited from previous team, limited documentation +``` + +### 3. The PREP Framework + +**P**oint - **R**eason - **E**xample - **P**oint + +The PREP framework is excellent for structuring technical explanations and requests clearly and persuasively. + +**Point (Main Message):** +``` +Primary statement: [What you want or what the issue is] +Key takeaway: [The most important thing to understand] +``` + +**Reason (Why/Justification):** +``` +Technical rationale: [Why this approach/solution makes sense] +Business justification: [Impact on project/users/performance] +Evidence: [Data, metrics, or technical facts supporting your point] +``` + +**Example (Concrete Illustration):** +``` +Code example: [Specific implementation or demonstration] +Use case: [Real-world scenario where this applies] +Comparison: [How this differs from alternatives] +``` + +**Point (Reinforcement):** +``` +Restatement: [Reiterate the main message with new insight] +Next steps: [What should happen next] +Call to action: [Specific request or decision needed] +``` + +**PREP Template for Technical Requests:** +``` +POINT: I need to implement caching to improve API response times +REASON: Current response times are 800ms average, causing user frustration and potential churn. Caching could reduce this to under 200ms based on our data access patterns. +EXAMPLE: Similar to how we implemented Redis caching for user sessions, we could cache frequently accessed product data. For instance, product catalog queries that currently hit the database every time could be cached for 5 minutes. +POINT: Implementing this caching strategy would significantly improve user experience and reduce database load, making it a high-impact optimization for our current performance issues. +``` + +**PREP for Bug Reports:** +``` +POINT: Authentication middleware is failing in production environment +REASON: Valid JWT tokens are being rejected with 401 errors, but only in production. This suggests an environment-specific configuration issue affecting token validation. +EXAMPLE: User logs in successfully, receives JWT token, but subsequent API calls to /api/user/profile return 401. Same flow works perfectly in development and staging environments. +POINT: This is blocking all authenticated users from accessing the application, making it a critical production issue requiring immediate investigation of environment-specific JWT configuration. +``` + +**PREP for Architecture Proposals:** +``` +POINT: We should adopt microservices architecture for our user management system +REASON: Current monolithic approach is creating deployment bottlenecks and scaling issues. Team velocity is decreasing as the codebase grows, and we need independent scaling of user-facing features. +EXAMPLE: Companies like Netflix and Amazon use microservices to handle similar scale. We could split into UserAuth, UserProfile, and UserPreferences services, each with independent databases and deployment pipelines. +POINT: This architectural change would enable faster development cycles, better fault isolation, and more efficient resource utilization, directly addressing our current scalability challenges. +``` + +### 4. Precision in Technical Language + +**Instead of vague terms:** +- "It's slow" → "Response time increased from 200ms to 2.5s" +- "It's broken" → "Function returns undefined instead of expected array" +- "Make it better" → "Reduce memory usage by 30% while maintaining current throughput" + +**Use specific technical vocabulary:** +- "Optimize" → "Reduce time complexity", "Minimize memory allocation", "Improve cache hit rate" +- "Fix" → "Resolve race condition", "Handle null pointer exception", "Correct algorithm logic" +- "Improve" → "Refactor for readability", "Enhance error handling", "Increase test coverage" + +--- + +## Prompt Engineering for Developers + +### 5. The STAR Method for Technical Prompts + +**S**ituation - **T**ask - **A**ction - **R**esult + +**Template:** +``` +SITUATION: [Current technical context and environment] +TASK: [Specific technical challenge or requirement] +ACTION: [What you want the LLM to do] +RESULT: [Expected outcome and success criteria] +``` + +**Example:** +``` +SITUATION: Building a microservices architecture with Docker containers, using Node.js and PostgreSQL +TASK: Implement distributed tracing to monitor request flows across 5 services +ACTION: Design a tracing solution using OpenTelemetry with Jaeger backend +RESULT: Complete implementation with code examples, configuration files, and monitoring dashboard setup +``` + +### 6. Multi-Layered Prompt Structure + +**Layer 1: Core Request** +``` +Primary objective: [Main thing you want] +``` + +**Layer 2: Technical Context** +``` +Technology stack: [Languages, frameworks, tools] +Current architecture: [System design overview] +Performance requirements: [Specific metrics] +``` + +**Layer 3: Constraints and Preferences** +``` +Must have: [Non-negotiable requirements] +Should have: [Preferred features] +Could have: [Nice-to-have additions] +Won't have: [Explicit exclusions] +``` + +**Layer 4: Output Specifications** +``` +Format: [Code blocks, explanations, diagrams] +Detail level: [Implementation-ready, conceptual, reference] +Examples: [Include working examples, test cases] +``` + +### 7. Progressive Disclosure Technique + +Start with a high-level request, then drill down based on the response. + +**Initial Prompt:** +``` +I need to implement user authentication for a React application. +What are the main approaches and their trade-offs? +``` + +**Follow-up Prompts:** +``` +Based on your JWT recommendation, show me the implementation for: +1. Login component with form validation +2. Protected route wrapper +3. Token refresh mechanism +4. Logout functionality +``` + +**Deep Dive Prompts:** +``` +For the token refresh mechanism you showed: +- How do I handle race conditions when multiple requests trigger refresh? +- What's the best way to queue pending requests during token refresh? +- How should I handle refresh token expiration? +``` + +--- + +## Context Management Strategies + +### 8. Context Anchoring + +Establish and maintain context throughout the conversation. + +**Context Anchor Template:** +``` +PROJECT CONTEXT: +- Application: [Type and purpose] +- Tech Stack: [Primary technologies] +- Team: [Size and experience] +- Timeline: [Development phase and deadlines] +- Constraints: [Technical and business limitations] + +CURRENT FOCUS: +- Feature: [What you're working on] +- Goal: [Specific objective] +- Blockers: [Current challenges] +``` + +**Maintaining Context:** +``` +Continuing with our [project name] discussion... +Building on the [previous solution/approach]... +Given our [constraint/requirement] from earlier... +``` + +### 9. Context Compression + +When conversations get long, compress previous context into concise summaries. + +**Compression Template:** +``` +SUMMARY OF PREVIOUS DISCUSSION: +- Problem: [Core issue identified] +- Solution approach: [Chosen strategy] +- Implementation status: [What's been done] +- Current challenge: [New issue or next step] + +NEW REQUEST: +[Current specific need] +``` + +### 10. Context Switching Signals + +Clearly indicate when changing topics or focus areas. + +**Switching Signals:** +``` +"Shifting focus to..." +"Moving to a different aspect..." +"New topic: ..." +"Changing context from X to Y..." +"Pivoting to discuss..." +``` + +--- + +## Structured Problem-Solving Frameworks + +### 11. The 5W1H Technical Framework + +**Who:** Stakeholders and users affected +**What:** Specific technical problem or requirement +**When:** Timeline and deadlines +**Where:** Environment and platform constraints +**Why:** Business justification and goals +**How:** Technical approach and implementation + +**Template:** +``` +WHO: [Users, team members, systems affected] +WHAT: [Precise technical problem statement] +WHEN: [Deadlines, milestones, time constraints] +WHERE: [Environment, platform, infrastructure] +WHY: [Business value, technical necessity] +HOW: [Preferred approach, constraints, alternatives] +``` + +### 12. Root Cause Analysis Communication + +**Problem Statement Framework:** +``` +SYMPTOM: [What users/systems experience] +IMPACT: [Business and technical consequences] +FREQUENCY: [How often it occurs] +ENVIRONMENT: [Where it happens] +REPRODUCTION: [Steps to recreate] +HYPOTHESIS: [Initial theory about cause] +``` + +**Investigation Request:** +``` +Help me analyze this issue using: +1. Timeline analysis: [When did it start?] +2. Change correlation: [What changed recently?] +3. Pattern identification: [Are there commonalities?] +4. Dependency mapping: [What systems are involved?] +5. Data analysis: [What logs/metrics show?] +``` + +### 13. Solution Evaluation Framework + +**Criteria-Based Evaluation:** +``` +SOLUTION OPTIONS: [List alternatives] + +EVALUATION CRITERIA: +- Technical feasibility: [Implementation complexity] +- Performance impact: [Speed, memory, scalability] +- Maintenance burden: [Long-term support needs] +- Risk assessment: [Potential failure points] +- Resource requirements: [Time, people, infrastructure] +- Integration complexity: [How it fits with existing systems] + +RECOMMENDATION: [Preferred option with justification] +``` + +--- + +## Code-Specific Communication Patterns + +### 14. Code Review Communication + +**Review Request Template:** +``` +CODE REVIEW REQUEST: +Purpose: [What this code accomplishes] +Changes: [Summary of modifications] +Testing: [How it was tested] +Concerns: [Areas you're unsure about] +Focus areas: [What to pay attention to] + +[CODE BLOCK] + +Specific questions: +1. [Specific concern #1] +2. [Specific concern #2] +3. [Performance/security/maintainability question] +``` + +### 15. Implementation Guidance Requests + +**Feature Implementation Template:** +``` +FEATURE REQUEST: +Functionality: [What it should do] +User story: [As a X, I want Y, so that Z] +Acceptance criteria: [Specific requirements] +Technical constraints: [Limitations to consider] + +IMPLEMENTATION GUIDANCE NEEDED: +- Architecture approach: [How to structure the solution] +- Technology choices: [Which tools/libraries to use] +- Integration points: [How it connects to existing code] +- Testing strategy: [How to ensure quality] +- Performance considerations: [Scalability requirements] +``` + +### 16. Code Optimization Requests + +**Optimization Template:** +``` +OPTIMIZATION TARGET: +Current performance: [Specific metrics] +Target performance: [Desired improvements] +Constraints: [What cannot be changed] + +CURRENT CODE: +[Code block with performance issues] + +ANALYSIS REQUEST: +1. Bottleneck identification: [Where are the slow parts?] +2. Algorithmic improvements: [Better approaches?] +3. Data structure optimization: [More efficient structures?] +4. Caching opportunities: [What can be cached?] +5. Parallel processing: [What can run concurrently?] +``` + +--- + +## Debugging and Troubleshooting Communication + +### 17. Bug Report Structure + +**Comprehensive Bug Report:** +``` +BUG REPORT: +Summary: [One-line description] +Environment: [OS, browser, versions] +Steps to reproduce: +1. [Step 1] +2. [Step 2] +3. [Step 3] + +Expected behavior: [What should happen] +Actual behavior: [What actually happens] +Error messages: [Exact error text] +Logs: [Relevant log entries] +Screenshots: [If applicable] + +Additional context: +- Frequency: [Always, sometimes, rarely] +- Impact: [Critical, major, minor] +- Workaround: [Temporary solution if any] +``` + +### 18. Debugging Session Communication + +**Debugging Request Template:** +``` +DEBUGGING SESSION: +Problem: [Clear problem statement] +Hypothesis: [What you think might be wrong] +Investigation done: [What you've already tried] +Current state: [Where you're stuck] + +CODE CONTEXT: +[Relevant code sections] + +DEBUGGING ASSISTANCE NEEDED: +1. Logic review: [Check my reasoning] +2. Alternative approaches: [Different debugging strategies] +3. Tool recommendations: [Better debugging tools] +4. Pattern recognition: [Similar issues you've seen] +``` + +### 19. Performance Investigation + +**Performance Analysis Request:** +``` +PERFORMANCE INVESTIGATION: +Baseline metrics: [Current performance numbers] +Performance goals: [Target metrics] +User impact: [How performance affects users] + +PROFILING DATA: +[Performance measurements, bottlenecks identified] + +ANALYSIS REQUEST: +- Hotspot identification: [Where is time spent?] +- Memory analysis: [Memory usage patterns] +- I/O bottlenecks: [Database, file, network issues] +- Algorithmic complexity: [Big O analysis] +- Optimization priorities: [What to fix first] +``` + +--- + +## Architecture and Design Discussions + +### 20. Architecture Decision Records (ADR) Communication + +**ADR Template for LLM Discussion:** +``` +ARCHITECTURE DECISION: +Title: [Brief decision description] +Status: [Proposed, Accepted, Deprecated] +Context: [Forces at play, constraints] +Decision: [What we decided] +Consequences: [Positive and negative outcomes] + +DISCUSSION NEEDED: +- Alternative evaluation: [Other options considered] +- Risk assessment: [Potential problems] +- Implementation strategy: [How to execute] +- Success metrics: [How to measure success] +``` + +### 21. System Design Communication + +**System Design Template:** +``` +SYSTEM DESIGN REQUEST: +Requirements: +- Functional: [What the system must do] +- Non-functional: [Performance, scalability, reliability] +- Constraints: [Technical and business limitations] + +DESIGN AREAS: +1. High-level architecture: [Overall system structure] +2. Data model: [How data is organized] +3. API design: [Interface specifications] +4. Scalability strategy: [How to handle growth] +5. Security considerations: [Protection mechanisms] +6. Monitoring and observability: [How to track health] + +SPECIFIC GUIDANCE NEEDED: +[Areas where you want detailed advice] +``` + +### 22. Technology Selection Framework + +**Technology Evaluation Template:** +``` +TECHNOLOGY SELECTION: +Use case: [What you're trying to accomplish] +Requirements: +- Performance: [Speed, throughput, latency needs] +- Scalability: [Growth expectations] +- Team expertise: [Current skills and learning capacity] +- Ecosystem: [Integration requirements] +- Budget: [Cost constraints] + +OPTIONS UNDER CONSIDERATION: +[List of technologies being evaluated] + +EVALUATION CRITERIA: +1. Technical fit: [How well it solves the problem] +2. Learning curve: [Time to productivity] +3. Community support: [Documentation, help available] +4. Long-term viability: [Sustainability, roadmap] +5. Integration complexity: [How it fits with existing stack] + +DECISION SUPPORT NEEDED: +[Specific areas where you want analysis] +``` + +--- + +## Iterative Development Communication + +### 23. Sprint Planning Communication + +**Sprint Planning Template:** +``` +SPRINT PLANNING: +Sprint goal: [What we want to achieve] +Duration: [Sprint length] +Team capacity: [Available development time] + +BACKLOG ITEMS: +[List of features/tasks to consider] + +PLANNING ASSISTANCE NEEDED: +- Story estimation: [Help sizing tasks] +- Dependency identification: [What blocks what] +- Risk assessment: [What could go wrong] +- Task breakdown: [How to split large items] +- Capacity planning: [Realistic sprint scope] +``` + +### 24. Progress Review Communication + +**Progress Review Template:** +``` +PROGRESS REVIEW: +Sprint/milestone: [Current period] +Completed: [What was finished] +In progress: [Current work] +Blocked: [Items that can't proceed] +Risks: [Potential issues ahead] + +REVIEW ASSISTANCE NEEDED: +- Velocity analysis: [Are we on track?] +- Blocker resolution: [How to unblock items] +- Scope adjustment: [What to add/remove] +- Quality assessment: [Technical debt concerns] +- Next steps: [Priorities for next period] +``` + +### 25. Retrospective Communication + +**Retrospective Template:** +``` +RETROSPECTIVE: +Period: [Time frame being reviewed] +Goals: [What we aimed to achieve] +Outcomes: [What actually happened] + +ANALYSIS AREAS: +- What went well: [Successes to continue] +- What didn't work: [Problems to address] +- What we learned: [New insights gained] +- What to try: [Experiments for next period] + +IMPROVEMENT PLANNING: +- Process changes: [How to work differently] +- Tool improvements: [Better technology/tools] +- Skill development: [Learning priorities] +- Communication enhancements: [Better collaboration] +``` + +--- + +## Documentation and Knowledge Transfer + +### 26. Documentation Generation + +**Documentation Request Template:** +``` +DOCUMENTATION REQUEST: +Audience: [Who will read this] +Purpose: [Why they need it] +Scope: [What to cover] +Format: [README, API docs, tutorial, etc.] + +CONTENT TO DOCUMENT: +[Code, system, process to explain] + +DOCUMENTATION REQUIREMENTS: +- Getting started: [How to begin using it] +- Core concepts: [Key ideas to understand] +- Examples: [Practical usage scenarios] +- Troubleshooting: [Common problems and solutions] +- Reference: [Complete API/configuration details] +``` + +### 27. Knowledge Transfer Communication + +**Knowledge Transfer Template:** +``` +KNOWLEDGE TRANSFER: +From: [Current knowledge holder] +To: [Knowledge recipient] +Subject: [What knowledge is being transferred] +Timeline: [When transfer needs to complete] + +KNOWLEDGE AREAS: +- System architecture: [How things are structured] +- Business logic: [Why things work this way] +- Operational procedures: [How to maintain/deploy] +- Troubleshooting: [Common issues and solutions] +- Development workflow: [How to make changes] + +TRANSFER FORMAT: +- Documentation: [Written explanations] +- Code walkthrough: [Guided code review] +- Hands-on training: [Practical exercises] +- Q&A sessions: [Interactive discussion] +``` + +### 28. Technical Writing Assistance + +**Technical Writing Template:** +``` +TECHNICAL WRITING REQUEST: +Document type: [Tutorial, reference, explanation] +Target audience: [Experience level, role] +Technical complexity: [Beginner, intermediate, advanced] + +CONTENT OUTLINE: +[Structure of what needs to be written] + +WRITING ASSISTANCE NEEDED: +- Structure optimization: [Better organization] +- Clarity improvement: [Clearer explanations] +- Example generation: [Practical demonstrations] +- Completeness check: [Missing information] +- Audience appropriateness: [Right level of detail] +``` + +--- + +## Advanced Communication Techniques + +### 29. Socratic Method for Problem Solving + +Use guided questioning to explore problems deeply. + +**Question Frameworks:** +``` +PROBLEM EXPLORATION: +- What exactly is the problem we're trying to solve? +- What assumptions are we making? +- What would happen if we didn't solve this? +- What are the constraints we must work within? + +SOLUTION EXPLORATION: +- What are all the possible approaches? +- What are the trade-offs of each approach? +- What would success look like? +- How would we measure success? + +IMPLEMENTATION EXPLORATION: +- What could go wrong with this approach? +- What dependencies do we need to consider? +- How would we test this solution? +- What would we do if this doesn't work? +``` + +### 30. Rubber Duck Debugging with LLMs + +Structure your thoughts by explaining the problem step-by-step. + +**Rubber Duck Template:** +``` +RUBBER DUCK SESSION: +I'm going to walk through this problem step by step: + +1. What I'm trying to do: [Goal] +2. What I expect to happen: [Expected behavior] +3. What actually happens: [Actual behavior] +4. Here's my code: [Code walkthrough] +5. Here's my logic: [Step-by-step reasoning] +6. Here's where I think it might be wrong: [Hypothesis] + +Please help me identify flaws in my reasoning or suggest what I might be missing. +``` + +### 31. Collaborative Problem Solving + +Frame the LLM as a collaborative partner rather than just a tool. + +**Collaboration Template:** +``` +COLLABORATIVE SESSION: +Let's work together on: [Problem statement] + +My current thinking: +- Approach: [How I'm thinking about it] +- Concerns: [What worries me] +- Unknowns: [What I'm not sure about] + +I'd like you to: +- Challenge my assumptions +- Suggest alternative approaches +- Point out potential issues I haven't considered +- Help me think through edge cases + +Let's iterate on this solution together. +``` + +### 32. First Principles Thinking + +Break down complex problems to their fundamental truths, then build up solutions from scratch. This approach, famously used by Elon Musk, is powerful for technical innovation and problem-solving. + +**First Principles Framework:** +``` +DECONSTRUCTION: +- What do we know to be absolutely true about this problem? +- What assumptions are we making that might not be necessary? +- What are the fundamental physical/logical constraints? +- What are the core requirements that cannot be compromised? + +RECONSTRUCTION: +- Starting from these fundamentals, what's the simplest solution? +- What would we build if we had no existing constraints? +- How can we combine these basic truths in new ways? +- What innovative approaches become possible? +``` + +**First Principles Template for Technical Problems:** +``` +FIRST PRINCIPLES ANALYSIS: + +Problem: [Complex technical challenge] + +STEP 1 - DECONSTRUCTION: +Fundamental truths: +- [Core constraint #1: e.g., "Data must be consistent across distributed systems"] +- [Core constraint #2: e.g., "Network calls have latency"] +- [Core constraint #3: e.g., "Memory is finite"] + +Assumptions to challenge: +- [Assumption #1: e.g., "We must use a relational database"] +- [Assumption #2: e.g., "All data must be immediately consistent"] +- [Assumption #3: e.g., "We need to support all legacy APIs"] + +STEP 2 - RECONSTRUCTION: +From first principles, the solution would: +- [Fundamental approach based on core truths] +- [Novel combination of basic elements] +- [Innovative solution unconstrained by current implementation] + +STEP 3 - PRACTICAL APPLICATION: +How to bridge from ideal to practical: +- [What constraints are actually necessary] +- [Incremental steps toward first principles solution] +- [Hybrid approaches that capture key benefits] +``` + +**Example - Database Performance Problem:** +``` +FIRST PRINCIPLES ANALYSIS: + +Problem: Database queries are too slow, affecting user experience + +STEP 1 - DECONSTRUCTION: +Fundamental truths: +- Data access speed is limited by storage medium (disk vs memory vs network) +- Frequently accessed data should be closer to the processor +- Query complexity directly affects execution time +- Users only need specific data subsets, not entire datasets + +Assumptions to challenge: +- "We must query the database for every request" +- "All data must be stored in a single normalized database" +- "We need to support complex joins for all queries" +- "Data must always be perfectly up-to-date" + +STEP 2 - RECONSTRUCTION: +From first principles, the solution would: +- Keep frequently accessed data in memory (Redis/in-memory cache) +- Pre-compute common query results (materialized views/denormalization) +- Separate read and write operations (CQRS pattern) +- Accept eventual consistency for non-critical data + +STEP 3 - PRACTICAL APPLICATION: +Incremental implementation: +- Add Redis caching for user sessions and product catalogs +- Create read replicas for query-heavy operations +- Implement background jobs to pre-compute dashboard data +- Use CDN for static content and API responses where appropriate +``` + +**First Principles for Architecture Decisions:** +``` +ARCHITECTURE FIRST PRINCIPLES: + +Challenge: [System design problem] + +FUNDAMENTAL REQUIREMENTS: +- [Core business need #1] +- [Core technical constraint #1] +- [Core user requirement #1] + +ASSUMPTIONS TO QUESTION: +- "We need a microservices architecture" +- "We must use the same technology stack as other teams" +- "We need real-time updates for all features" +- "We must support every possible use case from day one" + +FIRST PRINCIPLES SOLUTION: +- Start with the simplest architecture that meets core requirements +- Add complexity only when fundamental constraints demand it +- Choose technologies based on problem requirements, not popularity +- Build for current needs with clear extension points for future growth + +IMPLEMENTATION STRATEGY: +- [Minimal viable architecture] +- [Clear criteria for when to add complexity] +- [Specific extension points for anticipated growth] +``` + +**First Principles for Code Optimization:** +``` +OPTIMIZATION FIRST PRINCIPLES: + +Performance Problem: [Specific performance issue] + +FUNDAMENTAL CONSTRAINTS: +- [Physical limits: CPU, memory, network, storage] +- [Algorithmic complexity bounds] +- [Business requirements that cannot change] + +ASSUMPTIONS TO CHALLENGE: +- "We need to optimize the existing algorithm" +- "We must maintain backward compatibility" +- "We need to process all data in real-time" +- "We must use the current data structure" + +FIRST PRINCIPLES APPROACH: +- What's the theoretical minimum time/space complexity for this problem? +- What would the solution look like if we could redesign from scratch? +- Which operations are actually necessary vs. convenient? +- How can we eliminate work rather than just doing it faster? + +PRACTICAL OPTIMIZATION: +- [Algorithmic improvements based on first principles] +- [Data structure changes that eliminate unnecessary work] +- [Caching strategies that prevent redundant computation] +- [Architectural changes that avoid the problem entirely] +``` + +**Using First Principles with LLMs:** +``` +FIRST PRINCIPLES LLM PROMPT: + +Help me apply first principles thinking to: [Problem statement] + +Please guide me through: +1. DECONSTRUCTION: What are the fundamental truths and constraints? +2. ASSUMPTION CHALLENGE: What am I assuming that might not be necessary? +3. RECONSTRUCTION: What would an ideal solution look like from scratch? +4. PRACTICAL BRIDGE: How can we move toward the first principles solution? + +Current approach: [Describe current solution/thinking] +Constraints I think are fixed: [List assumptions] +Desired outcome: [What success looks like] +``` + +**Benefits of First Principles Thinking for Developers:** + +1. **Innovation**: Breaks free from conventional solutions and industry assumptions +2. **Clarity**: Forces clear understanding of what's actually required vs. what's traditional +3. **Efficiency**: Often reveals simpler solutions by eliminating unnecessary complexity +4. **Problem-Solving**: Helps tackle novel problems where existing patterns don't apply +5. **Communication**: Provides clear reasoning for technical decisions and trade-offs + +**When to Use First Principles:** +- Facing novel technical challenges with no clear precedent +- Existing solutions are too complex or inefficient +- Need to innovate beyond current industry standards +- Debugging complex systems where assumptions may be wrong +- Making major architectural decisions +- Optimizing performance beyond incremental improvements + +--- + +## Communication Anti-Patterns to Avoid + +### Common Mistakes + +**❌ Vague Requests:** +- "Make this code better" +- "Fix this bug" +- "Optimize this" + +**✅ Specific Requests:** +- "Reduce the time complexity of this sorting algorithm from O(n²) to O(n log n)" +- "Fix the null pointer exception on line 42 when user input is empty" +- "Optimize this database query to reduce execution time from 2s to under 500ms" + +**❌ Missing Context:** +- "This doesn't work" +- "I need help with React" +- "How do I deploy this?" + +**✅ Rich Context:** +- "This authentication middleware returns 401 for valid JWT tokens in production but works in development" +- "I need help implementing infinite scroll in React using hooks with a REST API that returns paginated data" +- "How do I deploy this Node.js app with PostgreSQL to AWS using Docker containers?" + +**❌ Overwhelming Information:** +- Dumping entire codebases without focus +- Providing irrelevant background information +- Mixing multiple unrelated questions + +**✅ Focused Communication:** +- Provide only relevant code sections +- Give necessary context without overwhelming detail +- Ask one clear question at a time + +--- + +## Quick Reference Templates + +### Emergency Debugging Template +``` +🚨 URGENT ISSUE: +Impact: [Production down, users affected, etc.] +Timeline: [When it started, deadline to fix] +Symptoms: [What's happening] +Quick context: [Minimal necessary background] +Immediate need: [What you need right now] +``` + +### Code Review Template +``` +📝 CODE REVIEW: +Purpose: [What this code does] +Key changes: [Main modifications] +Review focus: [What to pay attention to] +Specific concerns: [Your questions] +[CODE BLOCK] +``` + +### Architecture Discussion Template +``` +🏗️ ARCHITECTURE: +Problem: [What we're solving] +Constraints: [Limitations] +Options: [Alternatives considered] +Recommendation: [Preferred approach] +Trade-offs: [Pros and cons] +``` + +### Learning Template +``` +📚 LEARNING REQUEST: +Topic: [What you want to learn] +Current level: [Your experience] +Goal: [What you want to achieve] +Context: [How you'll use this knowledge] +Format: [How you learn best] +``` + +### PREP Framework Template +``` +🎯 PREP STRUCTURE: +POINT: [Main message/request/issue] +REASON: [Technical and business justification with evidence] +EXAMPLE: [Concrete code example, use case, or comparison] +POINT: [Reinforcement with next steps and call to action] +``` + +### First Principles Template +``` +🔬 FIRST PRINCIPLES: +DECONSTRUCTION: [Fundamental truths and core constraints] +ASSUMPTIONS: [What we're assuming that might not be necessary] +RECONSTRUCTION: [Ideal solution built from fundamentals] +PRACTICAL: [Bridge from ideal to implementable solution] +``` + +--- + +## Measuring Communication Effectiveness + +### Success Metrics + +**Quality Indicators:** +- First response addresses your actual need +- Minimal back-and-forth clarification needed +- Solutions are implementable without major modifications +- Explanations match your technical level + +**Efficiency Indicators:** +- Faster problem resolution +- Reduced debugging time +- Fewer implementation iterations +- Better code quality outcomes + +**Learning Indicators:** +- Improved understanding of concepts +- Ability to apply solutions to similar problems +- Enhanced problem-solving skills +- Better technical decision-making + +### Continuous Improvement + +**Reflection Questions:** +- Did I provide enough context? +- Was my request specific enough? +- Did I get the level of detail I needed? +- How could I have communicated more effectively? + +**Iteration Strategies:** +- Refine prompts based on response quality +- Build a personal library of effective templates +- Adapt communication style to different types of problems +- Practice structured thinking before engaging with LLMs + +--- + +*This guide provides a foundation for effective LLM communication in software development. Adapt these techniques to your specific needs, technology stack, and communication style. The key is consistent practice and continuous refinement of your communication approach.* \ No newline at end of file diff --git a/modifying-existing-code.md b/modifying-existing-code.md new file mode 100644 index 0000000..b2ca369 --- /dev/null +++ b/modifying-existing-code.md @@ -0,0 +1,83 @@ + # AI Coding 101: Modifying Existing Code + + #### 14. Keep code organized by asking AI to refactor & simplify + + **Prompt:** + ``` + Please refactor the code in [file / function] to split it up into [list of files / functions] + ``` + + **Example:** + ``` + Please split up dataParser.ts into dedicated files including csvParser.ts, xmlParser.ts, and pdfParser.ts + ``` +--- + + ## 15. Manage and balance the CONTEXT you give to the AI + +--- + + #### 16. Tag specific relevant files as context + + **Prompt:** + ``` + Please implement [feature]. You’ll need to modify [list of files]. Here are additional files for context: [list of files] + ``` +--- + + #### 17. Keep your files at 300 lines of code or less + +--- + + #### 18. Keep in mind that the full conversation is used as context + +--- + + #### 19. Start a new conversation for each new feature + +--- + + #### 20. Tell the AI what works well and what needs to be changed + + **Prompt:** + ``` + This was a good start. [list of features] are working well but [list of problems] still needs to be fixed. Can you fix that? + ``` + + **Example:** + ``` + The new search feature is properly calling the API and showing results but it is not properly searching by product description. Can you please fix that? + ``` +--- + + #### 21. Ask AI to find edge cases or bugs + + **Prompt:** + ``` + Are there any edge cases we should consider or handle? + ``` +--- + + #### 22. Ask AI to review the code + + **Prompt:** + ``` + Now that we have finished building [feature], can you do a full review of the implementation and the new code? + ``` +--- + + #### 23. Ask AI about what the current code does + + **Prompt:** + ``` + How does the code in [@file] work? Give a high level overview + ``` + + ``` + How does the [function] work? Give a detailed description + ``` + + **Example:** + ``` + What does the code in @serverComm.ts do? How does it handle authentication? + ``` \ No newline at end of file diff --git a/nodejs-sailsjs-backend-prompts.md b/nodejs-sailsjs-backend-prompts.md new file mode 100644 index 0000000..77de7f0 --- /dev/null +++ b/nodejs-sailsjs-backend-prompts.md @@ -0,0 +1,820 @@ +# Node.js Sails.js Backend Engineer Prompts Guide + +A comprehensive collection of AI prompts specifically designed for Node.js backend engineers working with Sails.js framework to build scalable, maintainable, and robust web applications and APIs. + +## Table of Contents +1. [Project Setup & Architecture](#project-setup--architecture) +2. [Sails.js Application Development](#sailsjs-application-development) +3. [Model & Database Integration](#model--database-integration) +4. [API Development & Controllers](#api-development--controllers) +5. [Authentication & Authorization](#authentication--authorization) +6. [Real-time Features with Sockets](#real-time-features-with-sockets) +7. [Middleware & Policies](#middleware--policies) +8. [Testing & Quality Assurance](#testing--quality-assurance) +9. [Performance & Optimization](#performance--optimization) +10. [Deployment & DevOps](#deployment--devops) + +--- + +## Project Setup & Architecture + +### 1. New Sails.js Project Setup + +**Prompt Template:** +``` +You are an expert Node.js backend developer. Set up a new Sails.js project with these requirements: +- Sails.js version: [specify version] +- Database: [MongoDB/PostgreSQL/MySQL] +- Authentication: [JWT/Passport/custom] +- Real-time features: [WebSocket requirements] +- API type: [REST/GraphQL/both] +- Environment setup: [development/staging/production] + +Include: +- Project structure and configuration +- Database connection setup +- Environment variable management +- Package.json with necessary dependencies +- Basic security configurations +``` + +**Example:** +``` +You are an expert Node.js backend developer. Set up a new Sails.js project with these requirements: +- Sails.js version: 1.5.x (latest stable) +- Database: PostgreSQL with Waterline ORM +- Authentication: JWT-based with Passport.js integration +- Real-time features: Socket.io for live notifications and chat +- API type: RESTful APIs with GraphQL endpoint +- Environment setup: Docker-ready for development and production + +Include: +- Project structure with organized controllers, models, and services +- PostgreSQL connection with connection pooling +- Environment variables for different deployment stages +- Package.json with security, testing, and development dependencies +- CORS, helmet, and rate limiting configurations +``` + +### 2. Sails.js Architecture Design + +**Prompt:** +``` +Design a scalable Sails.js architecture for [application type] with: +- Modular controller organization +- Service layer for business logic +- Helper functions for utilities +- Policy-based authorization +- Hook system for custom functionality +- Configuration management strategy + +Include: +- Directory structure and naming conventions +- Separation of concerns principles +- Dependency injection patterns +- Error handling strategy +- Logging and monitoring setup +``` + +### 3. Environment Configuration + +**Prompt:** +``` +Set up comprehensive environment configuration for Sails.js application with: +- Development, staging, and production environments +- Database configurations for each environment +- Security settings and secrets management +- Third-party service integrations +- Feature flags and environment-specific settings + +Include: +- config/ directory structure +- Environment variable validation +- Configuration inheritance and overrides +- Secure credential management +- Docker and deployment configurations +``` + +--- + +## Sails.js Application Development + +### 4. Controller Development + +**Prompt Template:** +``` +Create a Sails.js controller for [resource/feature] with these requirements: +- CRUD operations: [specify which operations] +- Input validation and sanitization +- Error handling and response formatting +- Pagination and filtering support +- Authentication and authorization checks +- [Additional specific requirements] + +Include: +- RESTful action methods +- Request/response handling +- Waterline query optimization +- Proper HTTP status codes +- API documentation comments +``` + +**Example:** +``` +Create a Sails.js controller for user management with these requirements: +- CRUD operations: Create, read, update, delete, and list users +- Input validation using joi or express-validator +- Password hashing and secure user creation +- Pagination with limit/offset and search functionality +- Role-based access control for admin operations +- Profile picture upload with file validation + +Include: +- RESTful action methods (GET, POST, PUT, DELETE) +- Async/await error handling with try-catch blocks +- Waterline queries with population and associations +- Standardized JSON response format +- JSDoc comments for API documentation +``` + +### 5. Service Layer Implementation + +**Prompt:** +``` +Implement Sails.js services for [business domain] that: +- Encapsulate business logic separate from controllers +- Handle complex data operations and transformations +- Integrate with external APIs and services +- Provide reusable functionality across controllers +- Include proper error handling and logging + +Create services for: +- [Service 1]: [specific functionality] +- [Service 2]: [specific functionality] +- [Service 3]: [specific functionality] + +Include dependency injection and testing strategies. +``` + +### 6. Helper Functions Development + +**Prompt:** +``` +Create Sails.js helper functions for [utility purpose] that: +- Provide reusable utility functions +- Handle common operations like [specific operations] +- Include input validation and error handling +- Support both synchronous and asynchronous operations +- Are well-documented and testable + +Include: +- Helper function definitions with proper inputs/outputs +- Error handling and validation +- Usage examples and documentation +- Unit tests for each helper +- Performance considerations +``` + +--- + +## Model & Database Integration + +### 7. Waterline Model Definition + +**Prompt Template:** +``` +Create Waterline models for [domain/entity] with these requirements: +- Attributes: [list specific attributes and types] +- Associations: [relationships with other models] +- Validations: [validation rules and constraints] +- Lifecycle callbacks: [beforeCreate, afterUpdate, etc.] +- Custom methods: [model-specific functionality] + +Include: +- Proper attribute types and validations +- Association definitions (one-to-one, one-to-many, many-to-many) +- Index definitions for performance +- Custom instance and class methods +- Migration considerations +``` + +**Example:** +``` +Create Waterline models for an e-commerce system with these requirements: +- User model: email, password, profile info, roles +- Product model: name, description, price, inventory, categories +- Order model: user reference, products, status, payment info +- Associations: User has many Orders, Order has many Products (through OrderItems) +- Validations: Email format, price ranges, required fields + +Include: +- Proper attribute types (string, number, boolean, json) +- Association definitions with foreign keys +- Unique indexes on email, SKU fields +- Password hashing in beforeCreate callback +- Custom methods for order calculations and user authentication +``` + +### 8. Database Migration Strategy + +**Prompt:** +``` +Design database migration strategy for Sails.js application with: +- Schema versioning and migration files +- Data migration for existing records +- Rollback procedures and safety measures +- Environment-specific migration handling +- Performance considerations for large datasets + +Include: +- Migration file structure and naming +- Safe migration practices +- Data backup and recovery procedures +- Testing migration scripts +- Production deployment strategy +``` + +### 9. Advanced Waterline Queries + +**Prompt:** +``` +Implement advanced Waterline queries for [specific use case] that: +- Use complex filtering and sorting +- Include population of associations +- Implement aggregation and grouping +- Handle pagination efficiently +- Optimize for performance + +Include: +- Query optimization techniques +- Index usage and performance monitoring +- Error handling for database operations +- Caching strategies for frequently accessed data +- Raw query integration when needed +``` + +--- + +## API Development & Controllers + +### 10. RESTful API Design + +**Prompt Template:** +``` +Design and implement RESTful APIs for [resource] using Sails.js with: +- Standard HTTP methods and status codes +- Consistent request/response formats +- Input validation and sanitization +- Error handling and meaningful error messages +- API versioning strategy +- Documentation and examples + +Include: +- Route definitions and controller actions +- Request/response schemas +- Validation middleware +- Error response standardization +- API documentation with examples +``` + +**Example:** +``` +Design and implement RESTful APIs for blog management using Sails.js with: +- Posts: CRUD operations with author association +- Comments: Nested under posts with moderation +- Categories: Hierarchical structure with parent/child relationships +- Tags: Many-to-many relationship with posts +- Search and filtering capabilities across all resources + +Include: +- Route definitions in config/routes.js +- Controller actions with proper HTTP methods +- JSON schema validation for request bodies +- Standardized error responses with error codes +- OpenAPI/Swagger documentation with examples +``` + +### 11. GraphQL Integration + +**Prompt:** +``` +Integrate GraphQL with Sails.js application for [use case] that: +- Defines GraphQL schema for existing models +- Implements resolvers with Waterline integration +- Handles authentication and authorization +- Supports real-time subscriptions +- Includes query optimization and N+1 prevention + +Include: +- Schema definition and type resolvers +- Authentication middleware for GraphQL +- Subscription setup with Socket.io +- Query complexity analysis and rate limiting +- Integration with existing REST endpoints +``` + +### 12. API Versioning Strategy + +**Prompt:** +``` +Implement API versioning strategy for Sails.js application with: +- Version management approach: [URL path/header/query parameter] +- Backward compatibility maintenance +- Deprecation and sunset policies +- Documentation for multiple versions +- Migration guides for API consumers + +Include: +- Routing configuration for versions +- Controller organization by version +- Shared code and DRY principles +- Version-specific middleware +- Client communication strategy +``` + +--- + +## Authentication & Authorization + +### 13. JWT Authentication System + +**Prompt:** +``` +Implement JWT authentication system for Sails.js with: +- User registration and login endpoints +- JWT token generation and validation +- Refresh token mechanism +- Password reset functionality +- Account verification and activation +- Security best practices + +Include: +- Passport.js integration with JWT strategy +- Secure password hashing with bcrypt +- Token expiration and refresh logic +- Email verification workflow +- Rate limiting for auth endpoints +- Security headers and CORS configuration +``` + +### 14. Role-Based Access Control (RBAC) + +**Prompt:** +``` +Implement RBAC system for Sails.js application with: +- User roles and permissions model +- Policy-based authorization +- Resource-level access control +- Dynamic permission checking +- Admin interface for role management + +Include: +- Role and permission models with associations +- Policy functions for different access levels +- Middleware for route protection +- Helper functions for permission checking +- Admin dashboard for user and role management +``` + +### 15. OAuth2 and Social Authentication + +**Prompt:** +``` +Integrate OAuth2 and social authentication with [providers] using: +- Passport.js strategies for social providers +- Account linking and profile merging +- Secure token storage and management +- User profile synchronization +- Error handling for OAuth failures + +Include: +- Provider configuration and setup +- Callback handling and user creation +- Profile data mapping and validation +- Account conflict resolution +- Security considerations and best practices +``` + +--- + +## Real-time Features with Sockets + +### 16. Socket.io Integration + +**Prompt Template:** +``` +Implement real-time features using Sails.js sockets for [use case] with: +- Socket connection management +- Room-based messaging and broadcasting +- Authentication for socket connections +- Event handling and message routing +- Error handling and reconnection logic + +Include: +- Socket event definitions and handlers +- Room management and user presence +- Message validation and sanitization +- Performance optimization for high concurrency +- Client-side integration examples +``` + +**Example:** +``` +Implement real-time chat system using Sails.js sockets with: +- Multi-room chat with private and public rooms +- User presence indicators and typing notifications +- Message history and persistence +- File sharing and media upload +- Moderation tools and user management + +Include: +- Socket event handlers for join/leave/message +- Room-based broadcasting with user lists +- Message validation and content filtering +- Database integration for message persistence +- React/Vue.js client integration examples +``` + +### 17. Real-time Notifications + +**Prompt:** +``` +Create real-time notification system with: +- Push notifications to connected clients +- Notification persistence and history +- User preference management +- Different notification types and priorities +- Integration with external push services + +Include: +- Notification model and delivery system +- Socket broadcasting to specific users +- Preference-based filtering +- Mobile push notification integration +- Email fallback for offline users +``` + +### 18. Live Data Synchronization + +**Prompt:** +``` +Implement live data synchronization for [data type] that: +- Broadcasts model changes to connected clients +- Handles concurrent updates and conflicts +- Maintains data consistency across clients +- Supports offline/online synchronization +- Includes conflict resolution strategies + +Include: +- Model lifecycle hooks for broadcasting +- Client-side state management +- Optimistic updates and rollback +- Conflict detection and resolution +- Performance optimization for large datasets +``` + +--- + +## Middleware & Policies + +### 19. Custom Middleware Development + +**Prompt:** +``` +Create custom middleware for Sails.js that: +- [Specific middleware functionality] +- Integrates with Sails.js request/response cycle +- Handles errors gracefully +- Is configurable and reusable +- Includes proper logging and monitoring + +Include: +- Middleware function implementation +- Configuration options and defaults +- Error handling and next() calls +- Integration with Sails.js hooks +- Testing and documentation +``` + +### 20. Policy Implementation + +**Prompt:** +``` +Implement Sails.js policies for [authorization scenario] that: +- Check user authentication and authorization +- Validate request parameters and headers +- Implement rate limiting and throttling +- Handle CORS and security headers +- Provide detailed error responses + +Include: +- Policy function definitions +- Integration with controller actions +- Configuration in config/policies.js +- Error handling and response formatting +- Testing strategies for policies +``` + +### 21. Request Validation Middleware + +**Prompt:** +``` +Create request validation middleware using [validation library] that: +- Validates request body, query, and parameters +- Provides detailed validation error messages +- Supports custom validation rules +- Integrates with Sails.js error handling +- Includes sanitization and transformation + +Include: +- Validation schema definitions +- Custom validator functions +- Error message formatting +- Integration with controllers +- Performance optimization +``` + +--- + +## Testing & Quality Assurance + +### 22. Unit Testing Strategy + +**Prompt:** +``` +Create comprehensive unit testing strategy for Sails.js application using [testing framework] with: +- Controller action testing +- Model method and validation testing +- Service function testing +- Helper function testing +- Mock and stub strategies for external dependencies + +Include: +- Test setup and teardown procedures +- Database testing with test fixtures +- Mocking external services and APIs +- Code coverage requirements and reporting +- Continuous integration setup +``` + +### 23. Integration Testing + +**Prompt:** +``` +Implement integration tests for [API endpoints/features] that: +- Test complete request/response cycles +- Validate database interactions +- Test authentication and authorization flows +- Include error scenario testing +- Test real-time socket functionality + +Include: +- Test database setup and cleanup +- API endpoint testing with supertest +- Socket.io testing strategies +- Test data management and fixtures +- Performance and load testing basics +``` + +### 24. API Testing and Documentation + +**Prompt:** +``` +Create API testing suite and documentation for [API endpoints] that: +- Tests all CRUD operations and edge cases +- Validates request/response schemas +- Includes authentication testing +- Generates API documentation +- Supports automated testing in CI/CD + +Include: +- Postman/Insomnia collection setup +- OpenAPI/Swagger documentation +- Automated schema validation +- Test data generation and management +- Documentation hosting and maintenance +``` + +--- + +## Performance & Optimization + +### 25. Database Query Optimization + +**Prompt:** +``` +Optimize database queries for [specific use case] in Sails.js by: +- Analyzing slow queries and bottlenecks +- Implementing proper indexing strategies +- Using query optimization techniques +- Implementing caching layers +- Monitoring query performance + +Include: +- Query analysis and profiling tools +- Index creation and maintenance +- Waterline query optimization +- Redis caching implementation +- Performance monitoring and alerting +``` + +### 26. Caching Implementation + +**Prompt:** +``` +Implement comprehensive caching strategy using [Redis/Memcached] with: +- API response caching +- Database query result caching +- Session and user data caching +- Cache invalidation strategies +- Performance monitoring and metrics + +Include: +- Cache configuration and setup +- Cache key design and naming conventions +- TTL strategies for different data types +- Cache warming and preloading +- Fallback mechanisms for cache failures +``` + +### 27. Application Performance Monitoring + +**Prompt:** +``` +Set up application performance monitoring for Sails.js with: +- Request/response time tracking +- Database query performance monitoring +- Memory and CPU usage tracking +- Error rate and exception monitoring +- Custom business metrics tracking + +Include: +- APM tool integration (New Relic, DataDog, etc.) +- Custom middleware for performance tracking +- Alerting and notification setup +- Performance dashboard creation +- Optimization recommendations based on metrics +``` + +--- + +## Deployment & DevOps + +### 28. Docker Configuration + +**Prompt:** +``` +Create Docker configuration for Sails.js application with: +- Multi-stage build for optimization +- Development and production environments +- Database and Redis service integration +- Environment variable management +- Health checks and monitoring + +Include: +- Dockerfile with best practices +- Docker Compose for local development +- Production-ready container configuration +- Security considerations and non-root user +- Volume management for persistent data +``` + +### 29. CI/CD Pipeline + +**Prompt:** +``` +Set up CI/CD pipeline for Sails.js application using [GitHub Actions/GitLab CI/Jenkins] with: +- Automated testing on multiple Node.js versions +- Code quality checks and linting +- Security vulnerability scanning +- Automated deployment to [cloud provider] +- Database migration handling + +Include: +- Pipeline configuration files +- Test automation and reporting +- Deployment strategies (blue-green, rolling) +- Environment-specific configurations +- Rollback procedures and monitoring +``` + +### 30. Cloud Deployment + +**Prompt:** +``` +Deploy Sails.js application to [AWS/GCP/Azure/Heroku] with: +- Container orchestration or serverless deployment +- Database setup and connection management +- Load balancing and auto-scaling +- Environment variable and secrets management +- Monitoring and logging setup + +Include: +- Infrastructure as code (Terraform/CloudFormation) +- Database migration and backup strategies +- SSL/TLS certificate management +- CDN setup for static assets +- Cost optimization strategies +``` + +--- + +## Advanced Patterns + +### 31. Microservices Architecture + +**Prompt:** +``` +Design microservices architecture using Sails.js with: +- Service decomposition strategy +- Inter-service communication patterns +- Data consistency and transaction management +- Service discovery and load balancing +- Monitoring and observability + +Include: +- Service boundary definitions +- API gateway configuration +- Event-driven communication +- Distributed tracing setup +- Fault tolerance and circuit breakers +``` + +### 32. Event-Driven Architecture + +**Prompt:** +``` +Implement event-driven architecture with: +- Event sourcing and CQRS patterns +- Message queue integration (RabbitMQ/Apache Kafka) +- Event handlers and processors +- Saga pattern for distributed transactions +- Event replay and recovery mechanisms + +Include: +- Event schema design +- Message broker configuration +- Event handler implementation +- Error handling and dead letter queues +- Monitoring and alerting for events +``` + +### 33. API Gateway Integration + +**Prompt:** +``` +Integrate Sails.js application with API Gateway for: +- Request routing and load balancing +- Authentication and authorization +- Rate limiting and throttling +- Request/response transformation +- Monitoring and analytics + +Include: +- Gateway configuration and setup +- Service registration and discovery +- Security policy implementation +- Performance optimization +- Monitoring and logging integration +``` + +--- + +## Best Practices Reminders + +When using these prompts, remember to: + +1. **Follow Node.js best practices** - Use async/await, proper error handling, and security measures +2. **Leverage Sails.js conventions** - Follow MVC patterns and use built-in features +3. **Include comprehensive testing** - Unit, integration, and API testing +4. **Implement proper security** - Authentication, authorization, input validation, and HTTPS +5. **Optimize for performance** - Database queries, caching, and monitoring +6. **Document thoroughly** - API documentation, code comments, and deployment guides +7. **Plan for scalability** - Database design, caching strategies, and load balancing + +## Example Workflow + +``` +1. Start with Project Setup prompts for architecture +2. Use Model & Database prompts for data layer +3. Implement APIs using Controller Development prompts +4. Add Authentication & Authorization +5. Implement real-time features with Socket prompts +6. Add middleware and policies for security +7. Ensure quality with Testing prompts +8. Optimize with Performance prompts +9. Deploy using DevOps prompts +``` + +## Sails.js-Specific Tips + +- **Use Waterline ORM effectively** - Leverage associations and lifecycle callbacks +- **Implement proper policies** - Use Sails.js policy system for authorization +- **Leverage built-in features** - Use Sails.js blueprints, hooks, and helpers +- **Follow conventions** - Use Sails.js naming conventions and directory structure +- **Optimize for real-time** - Use Socket.io integration for live features +- **Monitor performance** - Use Sails.js built-in logging and monitoring capabilities + +--- + +*This guide is designed to help Node.js backend engineers build robust, scalable applications using Sails.js framework. Customize the prompts based on your specific project requirements and infrastructure needs.* \ No newline at end of file diff --git a/pdf_to_markdown.py b/pdf_to_markdown.py new file mode 100644 index 0000000..de53d12 --- /dev/null +++ b/pdf_to_markdown.py @@ -0,0 +1,64 @@ +import io +from pdfminer.high_level import extract_text_to_fp +from pdfminer.layout import LAParams +import os + +def convert_pdf_to_markdown(pdf_path, markdown_path): + """ + Extracts text from a PDF file and saves it as a Markdown file. + + Args: + pdf_path (str): The path to the input PDF file. + markdown_path (str): The path to save the output Markdown file. + + Returns: + bool: True if conversion was successful, False otherwise. + """ + if not os.path.exists(pdf_path): + print(f"Error: PDF file not found at {pdf_path}") + return False + + try: + output_string = io.StringIO() + # Extract text from PDF + with open(pdf_path, 'rb') as fin: + extract_text_to_fp(fin, output_string, laparams=LAParams(), output_type='text', codec='') + + markdown_content = output_string.getvalue() + output_string.close() + + # Write to Markdown file + with open(markdown_path, 'w', encoding='utf-8') as fout: + fout.write(markdown_content) + + print(f"Successfully converted '{pdf_path}' to '{markdown_path}'") + return True + except Exception as e: + print(f"An error occurred during PDF to Markdown conversion: {e}") + return False + +if __name__ == "__main__": + # --- Configuration --- + # The PDF file is located in the 'Google-Prompts-Engineering' subdirectory + pdf_subdirectory = "Google-Prompts-Engineering" + pdf_filename = "gemini-for-google-workspace-prompting-guide-101.pdf" + + # The Markdown file will be saved in the same subdirectory + markdown_filename = os.path.splitext(pdf_filename)[0] + ".md" + + # Construct full paths + # Assumes the script is run from the workspace root '/Users/tonycai/workspace/prompts-remote' + workspace_root = os.getcwd() # Get current working directory, should be workspace root + + pdf_full_path = os.path.join(workspace_root, pdf_subdirectory, pdf_filename) + markdown_full_path = os.path.join(workspace_root, pdf_subdirectory, markdown_filename) + # --- End Configuration --- + + print(f"Attempting to convert: {pdf_full_path}") + print(f"Output Markdown will be: {markdown_full_path}") + + if os.path.exists(pdf_full_path): + convert_pdf_to_markdown(pdf_full_path, markdown_full_path) + else: + print(f"Error: Could not find '{pdf_full_path}'.") + print("Please ensure the PDF file exists at the specified location and the script is run from the workspace root.") \ No newline at end of file diff --git a/product-manager-prompts.md b/product-manager-prompts.md new file mode 100644 index 0000000..d4f386b --- /dev/null +++ b/product-manager-prompts.md @@ -0,0 +1,737 @@ +# Product Manager Prompts Guide + +A comprehensive collection of AI prompts specifically designed for Product Managers to accelerate product development, create prototypes, conduct research, and make data-driven decisions. + +## Table of Contents +1. [Prototype Development](#prototype-development) +2. [User Research & Analysis](#user-research--analysis) +3. [Feature Planning & Prioritization](#feature-planning--prioritization) +4. [Market Research & Competitive Analysis](#market-research--competitive-analysis) +5. [Product Strategy & Roadmapping](#product-strategy--roadmapping) +6. [Stakeholder Communication](#stakeholder-communication) +7. [Data Analysis & Metrics](#data-analysis--metrics) +8. [User Experience & Design](#user-experience--design) +9. [Go-to-Market Strategy](#go-to-market-strategy) +10. [Product Documentation](#product-documentation) + +--- + +## Prototype Development + +### 1. Interactive Prototype Creation + +**Prompt Template:** +``` +You are an expert product designer. Create a detailed interactive prototype for [product/feature] with these requirements: +- Target users: [user personas] +- Core functionality: [list key features] +- Platform: [web/mobile/desktop] +- Design constraints: [technical or business limitations] + +Include: +- User flow diagrams +- Wireframes for key screens +- Interactive elements and transitions +- Technical implementation notes +- User testing scenarios +``` + +**Example:** +``` +You are an expert product designer. Create a detailed interactive prototype for a task management mobile app with these requirements: +- Target users: Remote workers and small team leads +- Core functionality: Task creation, assignment, progress tracking, team collaboration +- Platform: Mobile-first (iOS/Android) with web companion +- Design constraints: Must work offline, simple onboarding process + +Include: +- User flow diagrams for task creation and team collaboration +- Wireframes for dashboard, task detail, and team views +- Interactive elements like swipe gestures and notifications +- Technical implementation notes for offline sync +- User testing scenarios for different user types +``` + +### 2. MVP Prototype Definition + +**Prompt:** +``` +Define an MVP prototype for [product concept] that: +- Validates core hypothesis: [main assumption to test] +- Serves target market: [specific user segment] +- Delivers essential value: [primary benefit] +- Can be built in [timeframe] with [resource constraints] + +Create: +- Feature prioritization matrix +- User story mapping +- Technical architecture overview +- Success metrics and KPIs +- Risk assessment and mitigation strategies +``` + +### 3. Rapid Prototyping Framework + +**Prompt:** +``` +Create a rapid prototyping framework for [product category] that includes: +- Design system components +- Reusable UI patterns +- User interaction templates +- Data flow structures +- Testing methodologies + +Focus on speed and iteration while maintaining quality standards. +``` + +--- + +## User Research & Analysis + +### 4. User Persona Development + +**Prompt Template:** +``` +Create detailed user personas for [product/service] based on: +- Market research data: [available data sources] +- User interviews: [key insights] +- Behavioral patterns: [observed behaviors] +- Pain points: [identified problems] + +For each persona, include: +- Demographics and psychographics +- Goals and motivations +- Frustrations and pain points +- Technology usage patterns +- Preferred communication channels +- Decision-making process +``` + +**Example:** +``` +Create detailed user personas for a financial planning app based on: +- Market research data: Millennials struggle with retirement planning +- User interviews: 50 interviews with ages 25-40 +- Behavioral patterns: Mobile-first, prefer visual data representation +- Pain points: Complex financial jargon, lack of personalized advice + +For each persona, include: +- Demographics (age, income, education, location) +- Financial goals and current challenges +- Technology comfort level and app usage +- Preferred learning styles and communication +- Decision-making triggers for financial products +``` + +### 5. User Journey Mapping + +**Prompt:** +``` +Create a comprehensive user journey map for [specific user goal] including: +- Pre-awareness stage +- Discovery and research phase +- Evaluation and decision-making +- Onboarding and first use +- Regular usage patterns +- Advanced feature adoption +- Potential churn points + +For each stage, identify: +- User emotions and motivations +- Touchpoints and interactions +- Pain points and friction +- Opportunities for improvement +- Success metrics +``` + +### 6. User Interview Guide Creation + +**Prompt:** +``` +Create a user interview guide for [research objective] that: +- Uncovers [specific insights needed] +- Avoids leading questions +- Encourages storytelling +- Explores emotional responses +- Validates or challenges assumptions: [list assumptions] + +Include: +- Opening questions to build rapport +- Core questions organized by theme +- Follow-up probes for deeper insights +- Scenario-based questions +- Closing questions for additional feedback +``` + +--- + +## Feature Planning & Prioritization + +### 7. Feature Prioritization Framework + +**Prompt:** +``` +Create a feature prioritization framework for [product] considering: +- Business impact: [revenue, growth, retention metrics] +- User value: [user satisfaction, engagement, adoption] +- Technical complexity: [development effort, dependencies] +- Strategic alignment: [company goals, market positioning] + +Include: +- Scoring methodology +- Weighting criteria +- Decision matrix template +- Stakeholder input process +- Regular review schedule +``` + +### 8. User Story Creation + +**Prompt Template:** +``` +Write comprehensive user stories for [feature/epic] that include: +- User persona: [specific user type] +- Goal: [what they want to accomplish] +- Motivation: [why it's important] +- Acceptance criteria: [definition of done] +- Edge cases and error scenarios +- Dependencies and assumptions + +Format: As a [user type], I want [goal] so that [benefit/motivation]. +``` + +**Example:** +``` +Write comprehensive user stories for a social sharing feature that include: +- User persona: Content creators and casual users +- Goal: Share achievements and progress with friends +- Motivation: Social validation and community building +- Acceptance criteria: Share to multiple platforms, privacy controls +- Edge cases: Network failures, privacy violations, spam prevention +- Dependencies: Social platform APIs, user authentication + +Format: As a [user type], I want [goal] so that [benefit/motivation]. +``` + +### 9. Feature Impact Assessment + +**Prompt:** +``` +Assess the impact of implementing [feature] by analyzing: +- User adoption potential +- Revenue impact (direct and indirect) +- Development and maintenance costs +- Competitive advantage +- Risk factors and mitigation strategies +- Success metrics and measurement plan + +Provide recommendation with supporting rationale. +``` + +--- + +## Market Research & Competitive Analysis + +### 10. Competitive Analysis Framework + +**Prompt:** +``` +Conduct comprehensive competitive analysis for [product category] including: +- Direct competitors: [list known competitors] +- Indirect competitors: [alternative solutions] +- Emerging threats: [new market entrants] + +For each competitor, analyze: +- Product features and capabilities +- Pricing strategy and business model +- Target market and positioning +- Strengths and weaknesses +- Market share and growth trends +- User reviews and feedback patterns + +Identify opportunities for differentiation. +``` + +### 11. Market Opportunity Assessment + +**Prompt:** +``` +Assess market opportunity for [product/feature] by analyzing: +- Total Addressable Market (TAM) +- Serviceable Addressable Market (SAM) +- Serviceable Obtainable Market (SOM) +- Market trends and growth drivers +- Regulatory environment +- Technology enablers and barriers + +Include market sizing methodology and assumptions. +``` + +### 12. SWOT Analysis + +**Prompt:** +``` +Perform SWOT analysis for [product/company] in context of [specific market/opportunity]: + +Strengths: +- Internal capabilities and advantages +- Unique value propositions +- Resource advantages + +Weaknesses: +- Internal limitations and gaps +- Areas for improvement +- Resource constraints + +Opportunities: +- Market trends and openings +- Unmet customer needs +- Technology developments + +Threats: +- Competitive pressures +- Market risks +- External challenges + +Provide strategic recommendations based on analysis. +``` + +--- + +## Product Strategy & Roadmapping + +### 13. Product Vision Creation + +**Prompt:** +``` +Create a compelling product vision for [product] that: +- Articulates long-term aspirations +- Aligns with company mission and values +- Resonates with target users +- Differentiates from competitors +- Inspires the development team + +Include: +- Vision statement (1-2 sentences) +- Supporting narrative +- Success visualization +- Key principles and values +- Stakeholder alignment strategy +``` + +### 14. Product Roadmap Development + +**Prompt Template:** +``` +Develop a [timeframe] product roadmap for [product] that includes: +- Strategic themes and initiatives +- Major feature releases +- Technical infrastructure improvements +- Market expansion opportunities +- Resource allocation and dependencies + +Organize by: +- Now (current quarter): [immediate priorities] +- Next (following quarter): [planned features] +- Later (future quarters): [strategic initiatives] + +Include success metrics and review checkpoints. +``` + +**Example:** +``` +Develop a 12-month product roadmap for an e-commerce platform that includes: +- Strategic themes: Mobile optimization, AI personalization, international expansion +- Major feature releases: Advanced search, social commerce, subscription services +- Technical infrastructure: Performance improvements, security enhancements +- Market expansion: European market entry, B2B marketplace + +Organize by: +- Now (Q1): Mobile app redesign, payment system upgrade +- Next (Q2): AI recommendation engine, social sharing features +- Later (Q3-Q4): International localization, B2B portal launch + +Include conversion rate, user engagement, and revenue growth metrics. +``` + +### 15. OKR (Objectives and Key Results) Setting + +**Prompt:** +``` +Create OKRs for [product/team] for [time period] that: +- Align with company strategic goals +- Are ambitious yet achievable +- Include measurable key results +- Focus on outcomes over outputs + +Structure: +Objective: [Qualitative goal statement] +Key Results: +- KR1: [Specific, measurable outcome] +- KR2: [Specific, measurable outcome] +- KR3: [Specific, measurable outcome] + +Include tracking methodology and review schedule. +``` + +--- + +## Stakeholder Communication + +### 16. Executive Summary Creation + +**Prompt:** +``` +Create an executive summary for [project/initiative] that: +- Communicates key points in 1-2 pages +- Addresses executive concerns and priorities +- Includes clear recommendations +- Supports decision-making + +Structure: +- Problem statement and opportunity +- Proposed solution and approach +- Expected outcomes and benefits +- Resource requirements and timeline +- Risks and mitigation strategies +- Next steps and decision points +``` + +### 17. Stakeholder Alignment Strategy + +**Prompt:** +``` +Develop stakeholder alignment strategy for [initiative] considering: +- Key stakeholders: [list stakeholders and their interests] +- Potential conflicts and concerns +- Communication preferences and channels +- Decision-making authority and influence +- Success criteria from each perspective + +Create: +- Stakeholder mapping and analysis +- Communication plan and timeline +- Influence and engagement strategies +- Conflict resolution approaches +``` + +### 18. Product Update Communication + +**Prompt:** +``` +Create product update communication for [audience] covering: +- Recent achievements and milestones +- Key metrics and performance indicators +- Upcoming features and improvements +- User feedback and testimonials +- Market developments and competitive updates + +Tailor message for: +- Internal teams (detailed, tactical) +- Executive leadership (strategic, high-level) +- External customers (benefit-focused, engaging) +- Investors (growth-focused, data-driven) +``` + +--- + +## Data Analysis & Metrics + +### 19. Metrics Framework Development + +**Prompt:** +``` +Develop comprehensive metrics framework for [product/feature] including: + +Primary Metrics (North Star): +- [Key business metric that drives growth] + +Secondary Metrics: +- User engagement indicators +- Business performance measures +- Product quality metrics + +Counter Metrics: +- Metrics to prevent gaming or negative outcomes + +Include: +- Measurement methodology +- Data collection requirements +- Reporting frequency and format +- Action triggers and thresholds +``` + +### 20. A/B Test Design + +**Prompt:** +``` +Design A/B test for [hypothesis] with: +- Null and alternative hypotheses +- Target audience and segmentation +- Test variations and control group +- Primary and secondary metrics +- Sample size and duration calculations +- Success criteria and statistical significance + +Include: +- Test implementation plan +- Data collection methodology +- Analysis framework +- Decision-making criteria +``` + +### 21. Data-Driven Decision Framework + +**Prompt:** +``` +Create framework for data-driven decision making that: +- Defines types of decisions requiring data +- Establishes data quality standards +- Outlines analysis methodologies +- Includes bias recognition and mitigation +- Balances quantitative and qualitative insights + +Include templates for: +- Decision documentation +- Data analysis reports +- Recommendation presentations +- Post-decision reviews +``` + +--- + +## User Experience & Design + +### 22. UX Research Planning + +**Prompt:** +``` +Plan UX research study for [research question] that: +- Defines research objectives and hypotheses +- Selects appropriate research methods +- Identifies target participants and recruitment strategy +- Outlines data collection and analysis approach +- Establishes timeline and resource requirements + +Include: +- Research protocol and scripts +- Participant screening criteria +- Data analysis framework +- Reporting and presentation plan +``` + +### 23. Design System Requirements + +**Prompt:** +``` +Define requirements for design system that: +- Ensures consistency across [product/platform] +- Supports [team size] designers and developers +- Accommodates [accessibility/internationalization] needs +- Scales with product growth + +Include: +- Component library specifications +- Design token definitions +- Documentation requirements +- Governance and maintenance processes +- Implementation guidelines +``` + +### 24. Accessibility Assessment + +**Prompt:** +``` +Assess accessibility of [product/feature] against: +- WCAG 2.1 guidelines (AA level) +- Platform-specific accessibility standards +- User needs for different disabilities +- Assistive technology compatibility + +Provide: +- Current state assessment +- Gap analysis and prioritization +- Implementation recommendations +- Testing and validation approach +- Ongoing compliance strategy +``` + +--- + +## Go-to-Market Strategy + +### 25. Launch Strategy Development + +**Prompt:** +``` +Develop go-to-market strategy for [product/feature] including: +- Target market segmentation and positioning +- Value proposition and messaging +- Pricing strategy and business model +- Distribution channels and partnerships +- Marketing and promotion tactics +- Sales enablement and support + +Create: +- Launch timeline and milestones +- Success metrics and KPIs +- Risk assessment and contingency plans +- Post-launch optimization strategy +``` + +### 26. Pricing Strategy Framework + +**Prompt:** +``` +Develop pricing strategy for [product] considering: +- Cost structure and margin requirements +- Competitive pricing landscape +- Customer willingness to pay +- Value-based pricing opportunities +- Market penetration vs. skimming strategies + +Include: +- Pricing model recommendations +- Tier structure and feature differentiation +- Promotional pricing strategies +- Price testing and optimization plan +- Revenue impact projections +``` + +### 27. Customer Acquisition Strategy + +**Prompt:** +``` +Create customer acquisition strategy for [product] that: +- Identifies high-value customer segments +- Maps customer acquisition channels +- Defines acquisition cost targets +- Outlines conversion optimization approach +- Includes retention and expansion strategies + +Analyze: +- Channel effectiveness and ROI +- Customer lifetime value (CLV) +- Acquisition cost (CAC) by channel +- Conversion funnel optimization +- Referral and viral growth opportunities +``` + +--- + +## Product Documentation + +### 28. Product Requirements Document (PRD) + +**Prompt Template:** +``` +Create comprehensive PRD for [feature/product] including: + +1. Overview and Objectives + - Problem statement and user needs + - Success criteria and metrics + - Assumptions and constraints + +2. User Experience + - User flows and scenarios + - Functional requirements + - Non-functional requirements + +3. Technical Specifications + - Architecture and dependencies + - Integration requirements + - Performance and scalability needs + +4. Implementation Plan + - Development phases and timeline + - Resource requirements + - Risk assessment and mitigation + +5. Success Measurement + - Key metrics and KPIs + - Testing and validation approach + - Launch and rollout strategy +``` + +### 29. Release Notes Creation + +**Prompt:** +``` +Create user-friendly release notes for [version/update] that: +- Highlight new features and improvements +- Explain benefits in user terms +- Address known issues and fixes +- Provide migration or setup guidance +- Include visual aids and examples + +Structure for different audiences: +- End users: Benefit-focused, simple language +- Technical users: Detailed specifications +- Internal teams: Implementation details and dependencies +``` + +### 30. Product Knowledge Base + +**Prompt:** +``` +Develop product knowledge base structure for [product] that: +- Organizes information by user journey +- Includes searchable content categories +- Provides multiple content formats +- Supports self-service and support teams + +Include: +- Information architecture +- Content creation guidelines +- Maintenance and update processes +- User feedback integration +- Performance measurement approach +``` + +--- + +## Best Practices Reminders + +When using these prompts, remember to: + +1. **Always include user context** - Specify target users and their needs +2. **Define success metrics** - Include measurable outcomes and KPIs +3. **Consider constraints** - Mention technical, business, and resource limitations +4. **Include stakeholder perspectives** - Address different viewpoints and concerns +5. **Plan for iteration** - Build in feedback loops and optimization opportunities +6. **Document assumptions** - Make underlying assumptions explicit +7. **Think strategically** - Connect tactical decisions to broader business goals + +## Example Workflow for Product Managers + +``` +1. Start with User Research prompts to understand needs +2. Use Market Research prompts to assess opportunities +3. Apply Feature Planning prompts to prioritize development +4. Create prototypes using Prototype Development prompts +5. Develop strategy using Product Strategy prompts +6. Plan launch using Go-to-Market prompts +7. Measure success using Data Analysis prompts +8. Communicate results using Stakeholder Communication prompts +``` + +## Integration with Development Teams + +### Collaboration with Engineers +- Use technical requirement prompts when working with backend/frontend teams +- Include implementation feasibility in feature planning +- Align on technical architecture and constraints + +### Working with Designers +- Collaborate on UX research and design system requirements +- Ensure accessibility and usability standards +- Balance user needs with technical constraints + +### Stakeholder Management +- Use executive communication prompts for leadership updates +- Apply data analysis prompts for evidence-based decisions +- Leverage competitive analysis for strategic positioning + +--- + +*This guide is designed to help Product Managers work more efficiently with AI assistants across all aspects of product development. Customize the prompts based on your specific product, market, and organizational context.* \ No newline at end of file diff --git a/rust-backend-engineer-prompts.md b/rust-backend-engineer-prompts.md new file mode 100644 index 0000000..8b69c81 --- /dev/null +++ b/rust-backend-engineer-prompts.md @@ -0,0 +1,638 @@ +# Rust Backend Engineer Prompts Guide (RIG + Actix-web) + +A comprehensive collection of AI prompts specifically designed for Rust backend engineers working with RIG (Rust Intelligence Gateway) and Actix-web to build robust, performant, and secure backend systems. + +## Table of Contents +1. [Project Setup & Architecture](#project-setup--architecture) +2. [Actix-web Server Development](#actix-web-server-development) +3. [RIG Integration & AI Features](#rig-integration--ai-features) +4. [Database Integration](#database-integration) +5. [Authentication & Authorization](#authentication--authorization) +6. [API Development](#api-development) +7. [Error Handling & Logging](#error-handling--logging) +8. [Testing & Quality Assurance](#testing--quality-assurance) +9. [Performance & Optimization](#performance--optimization) +10. [Deployment & DevOps](#deployment--devops) + +--- + +## Project Setup & Architecture + +### 1. New Rust Backend Project Setup + +**Prompt Template:** +``` +You are an expert Rust backend developer. Set up a new Rust project with these requirements: +- Use Actix-web as the web framework +- Integrate RIG for AI capabilities +- Include [database type] for data persistence +- Set up [authentication method] +- Configure logging and error handling +- Include Docker configuration +- Set up proper project structure with modules + +Create the Cargo.toml, main.rs, and necessary module files with proper dependencies and versions. +``` + +**Example:** +``` +You are an expert Rust backend developer. Set up a new Rust project with these requirements: +- Use Actix-web 4.x as the web framework +- Integrate RIG for LLM integration capabilities +- Include PostgreSQL with SQLx for data persistence +- Set up JWT-based authentication +- Configure structured logging with tracing +- Include Docker configuration for containerization +- Set up proper project structure with modules for handlers, models, services + +Create the Cargo.toml, main.rs, and necessary module files with proper dependencies and versions. +``` + +### 2. Modular Architecture Setup + +**Prompt:** +``` +Design a modular Rust backend architecture for [application type] with: +- Clean separation of concerns (handlers, services, repositories) +- Dependency injection pattern +- Configuration management +- Error handling strategy +- Middleware organization +- Module structure for scalability + +Include file structure and module declarations. +``` + +--- + +## Actix-web Server Development + +### 3. Basic Actix-web Server + +**Prompt Template:** +``` +Create an Actix-web server with these features: +- [Feature 1] +- [Feature 2] +- [Feature 3] +- CORS configuration +- Request/response logging middleware +- Health check endpoint +- Graceful shutdown handling + +Include proper error handling and configuration management. +``` + +**Example:** +``` +Create an Actix-web server with these features: +- RESTful API endpoints for user management +- File upload capabilities with size limits +- Rate limiting middleware +- CORS configuration for frontend integration +- Request/response logging middleware +- Health check endpoint at /health +- Graceful shutdown handling + +Include proper error handling and configuration management. +``` + +### 4. Custom Middleware Development + +**Prompt:** +``` +Create custom Actix-web middleware for [purpose] that: +- [Functionality 1] +- [Functionality 2] +- [Functionality 3] +- Handles errors gracefully +- Includes proper logging +- Is configurable and reusable + +Include unit tests and documentation. +``` + +### 5. Request/Response Handling + +**Prompt:** +``` +Implement Actix-web handlers for [endpoint purpose] with: +- Input validation using serde and validator +- Proper HTTP status codes +- Error response formatting +- Request/response DTOs +- Async processing where appropriate +- Documentation with examples + +Include both success and error scenarios. +``` + +--- + +## RIG Integration & AI Features + +### 6. RIG Setup and Configuration + +**Prompt:** +``` +Set up RIG (Rust Intelligence Gateway) in an Actix-web application with: +- [LLM provider] integration (OpenAI/Anthropic/local models) +- Configuration for API keys and endpoints +- Error handling for AI service failures +- Rate limiting for AI requests +- Caching for repeated queries +- Proper async handling + +Include environment configuration and fallback strategies. +``` + +### 7. AI-Powered API Endpoints + +**Prompt Template:** +``` +Create an AI-powered endpoint using RIG that: +- Accepts [input type] from users +- Processes data through [AI model/provider] +- Returns [output format] +- Handles streaming responses if applicable +- Includes proper error handling +- Implements request validation and sanitization + +Use RIG's built-in features for [specific functionality]. +``` + +**Example:** +``` +Create an AI-powered endpoint using RIG that: +- Accepts text documents from users via POST /api/analyze +- Processes content through OpenAI GPT-4 for sentiment analysis +- Returns structured JSON with sentiment scores and key insights +- Handles streaming responses for real-time feedback +- Includes proper error handling for API failures +- Implements request validation and content sanitization + +Use RIG's built-in features for prompt templating and response parsing. +``` + +### 8. RAG (Retrieval-Augmented Generation) Implementation + +**Prompt:** +``` +Implement a RAG system using RIG with: +- Vector database integration ([Qdrant/Pinecone/Weaviate]) +- Document embedding and indexing +- Similarity search functionality +- Context retrieval and augmentation +- LLM integration for generation +- Caching strategies for performance + +Include endpoints for document upload, indexing, and querying. +``` + +--- + +## Database Integration + +### 9. SQLx Database Setup + +**Prompt:** +``` +Set up SQLx with [database type] for a Rust backend with: +- Connection pool configuration +- Migration system setup +- Model definitions with proper types +- Repository pattern implementation +- Transaction handling +- Error handling for database operations + +Include CRUD operations for [entity type]. +``` + +### 10. Database Models and Migrations + +**Prompt:** +``` +Create SQLx models and migrations for [domain] with: +- Proper table relationships (foreign keys, indexes) +- Data validation constraints +- Timestamp fields (created_at, updated_at) +- Soft delete functionality if needed +- Migration files for schema changes + +Include both up and down migrations. +``` + +### 11. Repository Pattern Implementation + +**Prompt:** +``` +Implement the repository pattern for [entity] with: +- Trait definition for repository interface +- SQLx implementation with connection pool +- CRUD operations with proper error handling +- Query optimization and indexing +- Pagination support +- Transaction support for complex operations + +Include unit tests with mock implementations. +``` + +--- + +## Authentication & Authorization + +### 12. JWT Authentication System + +**Prompt:** +``` +Implement JWT authentication for Actix-web with: +- User registration and login endpoints +- JWT token generation and validation +- Refresh token mechanism +- Password hashing with bcrypt/argon2 +- Middleware for protected routes +- Role-based access control (RBAC) + +Include proper error handling and security best practices. +``` + +### 13. OAuth2 Integration + +**Prompt:** +``` +Integrate OAuth2 authentication with [provider] using: +- OAuth2 flow implementation +- State parameter for CSRF protection +- Token exchange and validation +- User profile retrieval +- Account linking functionality +- Session management + +Include error handling for OAuth failures. +``` + +### 14. Authorization Middleware + +**Prompt:** +``` +Create authorization middleware that: +- Validates JWT tokens +- Extracts user claims and roles +- Implements permission checking +- Handles token expiration gracefully +- Supports role-based and resource-based permissions +- Includes audit logging + +Integrate with Actix-web's middleware system. +``` + +--- + +## API Development + +### 15. RESTful API Design + +**Prompt Template:** +``` +Design and implement RESTful APIs for [resource] with: +- Standard HTTP methods (GET, POST, PUT, DELETE) +- Proper status codes and error responses +- Input validation and sanitization +- Pagination for list endpoints +- Filtering and sorting capabilities +- API versioning strategy + +Include OpenAPI/Swagger documentation. +``` + +**Example:** +``` +Design and implement RESTful APIs for blog posts with: +- Standard HTTP methods (GET, POST, PUT, DELETE) +- Proper status codes and error responses +- Input validation using serde and validator +- Pagination for list endpoints with cursor-based pagination +- Filtering by author, tags, and date ranges +- API versioning strategy using URL prefixes + +Include OpenAPI/Swagger documentation with examples. +``` + +### 16. GraphQL API Implementation + +**Prompt:** +``` +Implement a GraphQL API using async-graphql with: +- Schema definition for [domain models] +- Query and mutation resolvers +- Subscription support for real-time updates +- Authentication and authorization integration +- Error handling and validation +- Performance optimization (N+1 problem prevention) + +Include integration with Actix-web. +``` + +### 17. WebSocket Implementation + +**Prompt:** +``` +Implement WebSocket functionality for [real-time feature] with: +- Connection management and authentication +- Message broadcasting and routing +- Room/channel management +- Heartbeat and reconnection handling +- Rate limiting and abuse prevention +- Integration with existing REST API + +Use Actix-web's WebSocket support. +``` + +--- + +## Error Handling & Logging + +### 18. Comprehensive Error Handling + +**Prompt:** +``` +Implement a comprehensive error handling system with: +- Custom error types for different error categories +- Error conversion and propagation +- User-friendly error responses +- Internal error logging with context +- Error codes for client identification +- Recovery strategies where possible + +Include integration with Actix-web's error handling. +``` + +### 19. Structured Logging Setup + +**Prompt:** +``` +Set up structured logging using tracing with: +- Different log levels for various components +- Request tracing and correlation IDs +- Performance metrics logging +- Error tracking and alerting +- Log formatting for different environments +- Integration with external logging services + +Include configuration for development and production. +``` + +### 20. Monitoring and Observability + +**Prompt:** +``` +Implement monitoring and observability with: +- Prometheus metrics collection +- Health check endpoints with detailed status +- Performance monitoring and profiling +- Distributed tracing setup +- Custom metrics for business logic +- Alerting configuration + +Include dashboard configuration examples. +``` + +--- + +## Testing & Quality Assurance + +### 21. Unit Testing Strategy + +**Prompt:** +``` +Create comprehensive unit tests for [component] with: +- Test fixtures and mock data +- Database testing with test containers +- HTTP client testing with mock servers +- Error scenario testing +- Performance benchmarks +- Property-based testing where applicable + +Use tokio-test and mockall for async testing. +``` + +### 22. Integration Testing + +**Prompt:** +``` +Implement integration tests for [API endpoints] with: +- Test database setup and cleanup +- Full request/response cycle testing +- Authentication flow testing +- Error handling verification +- Performance testing under load +- Test data management + +Include CI/CD pipeline integration. +``` + +### 23. Load Testing + +**Prompt:** +``` +Create load testing scenarios for [application] using: +- Realistic user behavior simulation +- Gradual load increase patterns +- Database connection pool testing +- Memory and CPU usage monitoring +- Bottleneck identification +- Performance regression detection + +Include test scripts and result analysis. +``` + +--- + +## Performance & Optimization + +### 24. Database Query Optimization + +**Prompt:** +``` +Optimize database queries for [specific use case] by: +- Analyzing query execution plans +- Adding appropriate indexes +- Implementing query result caching +- Using connection pooling effectively +- Optimizing N+1 query problems +- Implementing read replicas if needed + +Include before/after performance metrics. +``` + +### 25. Caching Implementation + +**Prompt:** +``` +Implement caching strategy using [Redis/in-memory] with: +- Cache key design and naming conventions +- TTL strategies for different data types +- Cache invalidation patterns +- Cache warming strategies +- Fallback mechanisms for cache failures +- Performance monitoring and metrics + +Include integration with existing API endpoints. +``` + +### 26. Async Processing and Queues + +**Prompt:** +``` +Implement background job processing with: +- Job queue system ([Redis/RabbitMQ/database]) +- Worker process management +- Job retry and failure handling +- Priority queue implementation +- Job status tracking and monitoring +- Graceful shutdown handling + +Include examples for common background tasks. +``` + +--- + +## Deployment & DevOps + +### 27. Docker Configuration + +**Prompt:** +``` +Create Docker configuration for Rust backend with: +- Multi-stage build for optimization +- Security best practices (non-root user) +- Health check configuration +- Environment variable management +- Volume mounting for persistent data +- Docker Compose for local development + +Include both development and production configurations. +``` + +### 28. CI/CD Pipeline + +**Prompt:** +``` +Set up CI/CD pipeline for Rust backend using [GitHub Actions/GitLab CI] with: +- Automated testing on multiple Rust versions +- Code quality checks (clippy, fmt) +- Security vulnerability scanning +- Docker image building and pushing +- Automated deployment to [cloud provider] +- Rollback strategies + +Include environment-specific configurations. +``` + +### 29. Cloud Deployment + +**Prompt:** +``` +Deploy Rust backend to [AWS/GCP/Azure] with: +- Container orchestration ([Kubernetes/ECS]) +- Load balancer configuration +- Database setup and connection +- Environment variable management +- Logging and monitoring setup +- Auto-scaling configuration + +Include infrastructure as code (Terraform/CloudFormation). +``` + +--- + +## Advanced Patterns + +### 30. Event-Driven Architecture + +**Prompt:** +``` +Implement event-driven architecture with: +- Event sourcing pattern +- CQRS (Command Query Responsibility Segregation) +- Event store implementation +- Event handlers and processors +- Saga pattern for distributed transactions +- Event replay and recovery mechanisms + +Include integration with message brokers. +``` + +### 31. Microservices Communication + +**Prompt:** +``` +Implement microservices communication with: +- Service discovery mechanism +- Circuit breaker pattern +- Retry policies with exponential backoff +- Request/response correlation +- Distributed tracing +- API gateway integration + +Include error handling and fallback strategies. +``` + +### 32. Security Hardening + +**Prompt:** +``` +Implement security hardening measures with: +- Input validation and sanitization +- SQL injection prevention +- XSS protection +- CSRF protection +- Rate limiting and DDoS protection +- Security headers configuration +- Dependency vulnerability scanning + +Include security testing and audit procedures. +``` + +--- + +## Best Practices Reminders + +When using these prompts, remember to: + +1. **Specify Rust edition** - Use latest stable Rust features +2. **Include error handling** - Rust's Result type and proper error propagation +3. **Memory safety** - Leverage Rust's ownership system +4. **Async/await** - Use tokio for async operations +5. **Testing** - Include unit and integration tests +6. **Documentation** - Add rustdoc comments +7. **Performance** - Consider zero-cost abstractions +8. **Security** - Follow Rust security best practices + +## Example Workflow + +``` +1. Start with Project Setup prompts for architecture +2. Use Actix-web prompts for server implementation +3. Integrate RIG for AI capabilities +4. Add Database Integration for persistence +5. Implement Authentication & Authorization +6. Build APIs using API Development prompts +7. Add comprehensive Error Handling & Logging +8. Ensure quality with Testing prompts +9. Optimize with Performance prompts +10. Deploy using DevOps prompts +``` + +## RIG-Specific Tips + +- **Model Selection**: Choose appropriate LLM providers based on use case +- **Prompt Engineering**: Use RIG's prompt templating for consistency +- **Error Handling**: Implement fallbacks for AI service failures +- **Caching**: Cache AI responses to reduce costs and latency +- **Monitoring**: Track AI usage and performance metrics +- **Security**: Sanitize inputs before sending to AI models + +--- + +*This guide is designed to help Rust backend engineers build robust, scalable, and AI-powered applications using RIG and Actix-web. Customize the prompts based on your specific project requirements and infrastructure.* \ No newline at end of file diff --git a/test-engineer-pytest-prompts.md b/test-engineer-pytest-prompts.md new file mode 100644 index 0000000..9124b44 --- /dev/null +++ b/test-engineer-pytest-prompts.md @@ -0,0 +1,849 @@ +# Test Engineer Pytest Prompts Guide + +A comprehensive collection of AI prompts specifically designed for Test Engineers using pytest framework to build robust test automation suites, ensure software quality, and implement effective testing strategies. + +## Table of Contents +1. [Test Framework Setup](#test-framework-setup) +2. [Unit Testing](#unit-testing) +3. [Integration Testing](#integration-testing) +4. [API Testing](#api-testing) +5. [Database Testing](#database-testing) +6. [UI/E2E Testing](#uie2e-testing) +7. [Test Data Management](#test-data-management) +8. [Test Fixtures & Configuration](#test-fixtures--configuration) +9. [Performance Testing](#performance-testing) +10. [Test Reporting & CI/CD](#test-reporting--cicd) + +--- + +## Test Framework Setup + +### 1. Pytest Project Setup + +**Prompt Template:** +``` +You are an expert test engineer. Set up a comprehensive pytest testing framework for [project type] with these requirements: +- Testing scope: [unit/integration/e2e/all] +- Application stack: [technology stack] +- Test environment: [local/CI/cloud] +- Reporting needs: [HTML/XML/dashboard/coverage] +- Integration requirements: [CI/CD tools, databases, APIs] + +Include: +- Project structure and organization +- pytest.ini configuration +- conftest.py setup with fixtures +- Requirements and dependencies +- Test discovery and execution setup +``` + +**Example:** +``` +You are an expert test engineer. Set up a comprehensive pytest testing framework for a Python web application with these requirements: +- Testing scope: Unit, integration, and API testing +- Application stack: Flask/Django, PostgreSQL, Redis, REST APIs +- Test environment: Local development and GitHub Actions CI +- Reporting needs: HTML reports, coverage reports, JUnit XML +- Integration requirements: Database fixtures, API mocking, Docker containers + +Include: +- Organized test directory structure (tests/unit, tests/integration, tests/api) +- pytest.ini with markers, test paths, and coverage configuration +- conftest.py with database fixtures, API clients, and test data +- requirements-test.txt with pytest plugins and testing dependencies +- Makefile or scripts for running different test suites +``` + +### 2. Test Configuration Management + +**Prompt:** +``` +Create a test configuration management system for pytest that handles: +- Multiple test environments (dev, staging, prod) +- Environment-specific test data and settings +- Secure credential management for testing +- Feature flags and test toggles +- Database and service connection configurations + +Include: +- Configuration file structure +- Environment variable management +- Fixture-based configuration injection +- Test environment isolation +- Configuration validation and error handling +``` + +### 3. Test Organization Strategy + +**Prompt:** +``` +Design a test organization strategy for [application type] using pytest that: +- Separates different types of tests logically +- Enables selective test execution +- Supports parallel test execution +- Facilitates test maintenance and updates +- Provides clear test categorization + +Include: +- Directory structure and naming conventions +- Pytest markers for test categorization +- Test collection and filtering strategies +- Documentation and team guidelines +- Scalability considerations for large test suites +``` + +--- + +## Unit Testing + +### 4. Unit Test Creation + +**Prompt Template:** +``` +Create comprehensive unit tests using pytest for [function/class/module] with these requirements: +- Code under test: [describe the functionality] +- Test scenarios: [happy path, edge cases, error conditions] +- Dependencies: [external services, databases, file systems] +- Coverage target: [percentage or specific areas] +- Testing approach: [TDD/BDD/traditional] + +Include: +- Test class organization and naming +- Parametrized tests for multiple scenarios +- Mock and patch strategies for dependencies +- Assertion patterns and custom assertions +- Test documentation and comments +``` + +**Example:** +``` +Create comprehensive unit tests using pytest for a user authentication service with these requirements: +- Code under test: User login, registration, password reset functionality +- Test scenarios: Valid credentials, invalid passwords, expired tokens, rate limiting +- Dependencies: Database ORM, email service, Redis cache, JWT tokens +- Coverage target: 95% line coverage with focus on security-critical paths +- Testing approach: TDD with security-focused test cases + +Include: +- TestUserAuth class with logical test grouping +- Parametrized tests for different credential combinations +- Mock strategies for database, email, and cache dependencies +- Custom assertions for security validations +- Clear test documentation explaining security test rationale +``` + +### 5. Test-Driven Development (TDD) + +**Prompt:** +``` +Implement TDD approach using pytest for [feature/functionality] that: +- Starts with failing tests that define requirements +- Implements minimal code to pass tests +- Refactors code while maintaining test coverage +- Follows red-green-refactor cycle +- Ensures comprehensive test coverage + +Include: +- Initial failing test cases +- Incremental implementation steps +- Refactoring opportunities and improvements +- Test evolution and maintenance +- Documentation of TDD process and decisions +``` + +### 6. Mock and Patch Strategies + +**Prompt:** +``` +Create effective mocking strategies using pytest for [system/component] that: +- Isolates units under test from dependencies +- Provides realistic mock behaviors +- Handles complex dependency chains +- Supports different testing scenarios +- Maintains test reliability and speed + +Include: +- Mock object creation and configuration +- Patch decorators and context managers +- Side effects and return value management +- Mock assertion and verification patterns +- Best practices for mock maintenance +``` + +--- + +## Integration Testing + +### 7. Integration Test Design + +**Prompt Template:** +``` +Design integration tests using pytest for [system integration] with these requirements: +- Integration scope: [components/services/systems involved] +- Test environment: [local/containerized/cloud] +- Data requirements: [test data setup and cleanup] +- External dependencies: [APIs, databases, message queues] +- Performance considerations: [execution time, resource usage] + +Include: +- Test setup and teardown procedures +- Integration test scenarios and workflows +- Error handling and failure recovery +- Test data management strategies +- Environment configuration and isolation +``` + +**Example:** +``` +Design integration tests using pytest for an e-commerce order processing system with these requirements: +- Integration scope: Order service, payment gateway, inventory system, notification service +- Test environment: Docker containers with test databases and mock services +- Data requirements: Customer data, product catalog, payment methods +- External dependencies: Stripe API, email service, inventory database +- Performance considerations: Tests should complete within 30 seconds + +Include: +- Docker-compose setup for test environment +- End-to-end order processing test scenarios +- Payment gateway mock and real API testing +- Test data factories for orders, customers, and products +- Cleanup procedures for test data and external service calls +``` + +### 8. Service Integration Testing + +**Prompt:** +``` +Create service integration tests for [microservices/APIs] that: +- Test service-to-service communication +- Validate data flow and transformations +- Handle service failures and timeouts +- Test authentication and authorization +- Verify contract compliance + +Include: +- Service mock and stub implementations +- Contract testing with schema validation +- Error scenario and resilience testing +- Authentication token management +- Service discovery and configuration testing +``` + +### 9. Database Integration Testing + +**Prompt:** +``` +Implement database integration tests using pytest that: +- Test database operations and transactions +- Validate data integrity and constraints +- Test migration and schema changes +- Handle concurrent access scenarios +- Verify performance characteristics + +Include: +- Database fixture setup and cleanup +- Transaction isolation and rollback strategies +- Data validation and constraint testing +- Migration testing procedures +- Performance benchmarking and monitoring +``` + +--- + +## API Testing + +### 10. REST API Testing + +**Prompt Template:** +``` +Create comprehensive REST API tests using pytest for [API/endpoint] with these requirements: +- API endpoints: [list specific endpoints to test] +- Authentication: [API keys, JWT, OAuth, etc.] +- Test scenarios: [CRUD operations, error cases, edge cases] +- Data validation: [request/response schema validation] +- Performance requirements: [response time, throughput] + +Include: +- API client setup and configuration +- Request/response validation +- Authentication and authorization testing +- Error handling and status code verification +- Performance and load testing basics +``` + +**Example:** +``` +Create comprehensive REST API tests using pytest for a blog management API with these requirements: +- API endpoints: /posts, /comments, /users, /auth endpoints +- Authentication: JWT tokens with role-based access control +- Test scenarios: CRUD for posts/comments, user registration/login, permission checks +- Data validation: JSON schema validation for all requests/responses +- Performance requirements: 95% of requests under 200ms response time + +Include: +- API client with automatic JWT token management +- JSON schema validation for all endpoints +- Role-based permission testing (admin, author, reader) +- Comprehensive error response testing (400, 401, 403, 404, 500) +- Basic load testing with concurrent requests +``` + +### 11. GraphQL API Testing + +**Prompt:** +``` +Implement GraphQL API testing using pytest that covers: +- Query and mutation testing +- Schema validation and introspection +- Error handling and validation +- Authentication and authorization +- Performance and complexity analysis + +Include: +- GraphQL client setup and query execution +- Schema introspection and validation +- Query complexity and depth limiting tests +- Authentication context and permission testing +- Error response format validation +``` + +### 12. API Contract Testing + +**Prompt:** +``` +Create API contract tests using pytest that: +- Validate API specification compliance +- Test backward compatibility +- Verify schema evolution +- Check breaking changes +- Ensure consumer-provider compatibility + +Include: +- OpenAPI/Swagger specification validation +- Contract testing with Pact or similar tools +- Schema versioning and migration testing +- Consumer-driven contract testing +- Breaking change detection and reporting +``` + +--- + +## Database Testing + +### 13. Database Test Fixtures + +**Prompt:** +``` +Create database test fixtures using pytest that: +- Provide clean test data for each test +- Handle database setup and teardown +- Support multiple database engines +- Enable test isolation and parallelization +- Manage test data relationships and constraints + +Include: +- Database connection and session management +- Test data factory patterns +- Transaction isolation strategies +- Fixture scoping and lifecycle management +- Database migration and schema testing +``` + +### 14. ORM Testing + +**Prompt:** +``` +Implement ORM testing strategies using pytest for [ORM framework] that: +- Test model definitions and relationships +- Validate query generation and optimization +- Test data validation and constraints +- Handle migration and schema changes +- Verify performance characteristics + +Include: +- Model factory and fixture creation +- Relationship and association testing +- Query optimization and N+1 problem testing +- Migration testing procedures +- Performance profiling and optimization +``` + +### 15. Data Migration Testing + +**Prompt:** +``` +Create data migration tests using pytest that: +- Validate migration scripts and procedures +- Test data transformation and integrity +- Handle large dataset migrations +- Verify rollback procedures +- Test migration performance + +Include: +- Migration test data setup +- Before/after data validation +- Performance benchmarking +- Rollback and recovery testing +- Data integrity verification procedures +``` + +--- + +## UI/E2E Testing + +### 16. Selenium Integration + +**Prompt Template:** +``` +Set up Selenium-based UI testing with pytest for [web application] with these requirements: +- Browser support: [Chrome, Firefox, Safari, Edge] +- Test scenarios: [user workflows to test] +- Page object model: [implementation approach] +- Test data: [user accounts, test data requirements] +- CI/CD integration: [headless execution, reporting] + +Include: +- WebDriver setup and configuration +- Page Object Model implementation +- Test data management and cleanup +- Screenshot and video capture on failures +- Cross-browser testing strategies +``` + +**Example:** +``` +Set up Selenium-based UI testing with pytest for an e-commerce web application with these requirements: +- Browser support: Chrome and Firefox with headless options for CI +- Test scenarios: User registration, product search, cart management, checkout process +- Page object model: Separate page classes with element locators and actions +- Test data: Test user accounts, product catalog, payment methods +- CI/CD integration: Headless execution with screenshot capture on failures + +Include: +- WebDriver factory with browser selection and configuration +- Page Object classes for home, product, cart, and checkout pages +- Test user factory with different user types and permissions +- Automatic screenshot capture and HTML source saving on test failures +- Docker-based browser execution for CI environments +``` + +### 17. Playwright Integration + +**Prompt:** +``` +Implement Playwright-based testing with pytest that: +- Supports multiple browsers and devices +- Handles modern web application features +- Provides fast and reliable test execution +- Includes visual regression testing +- Supports API and UI testing combination + +Include: +- Playwright setup and browser management +- Modern web feature testing (SPA, PWA) +- Visual comparison and screenshot testing +- API interception and mocking +- Mobile and responsive testing +``` + +### 18. Visual Regression Testing + +**Prompt:** +``` +Create visual regression testing suite using pytest that: +- Captures and compares screenshots +- Handles responsive design testing +- Manages baseline image updates +- Provides detailed diff reporting +- Integrates with CI/CD pipelines + +Include: +- Screenshot capture and comparison logic +- Baseline image management +- Responsive breakpoint testing +- Visual diff reporting and analysis +- CI integration with artifact storage +``` + +--- + +## Test Data Management + +### 19. Test Data Factories + +**Prompt:** +``` +Create test data factories using pytest that: +- Generate realistic test data +- Handle complex object relationships +- Support different data scenarios +- Provide data cleanup and isolation +- Enable parameterized testing + +Include: +- Factory pattern implementation +- Relationship and dependency management +- Data variation and randomization +- Cleanup and teardown procedures +- Integration with test fixtures +``` + +### 20. Database Seeding + +**Prompt:** +``` +Implement database seeding strategies for pytest that: +- Provide consistent test data across environments +- Handle data dependencies and relationships +- Support incremental and full data refresh +- Manage sensitive and anonymized data +- Enable selective data loading + +Include: +- Seed data definition and management +- Data loading and refresh procedures +- Dependency resolution and ordering +- Data anonymization and privacy protection +- Performance optimization for large datasets +``` + +### 21. Mock Data Generation + +**Prompt:** +``` +Create mock data generation system using pytest that: +- Generates realistic fake data +- Supports different data types and formats +- Handles localization and internationalization +- Provides consistent data across test runs +- Enables custom data patterns + +Include: +- Faker integration and customization +- Custom data providers and generators +- Localization and cultural data variations +- Seed management for reproducible data +- Performance optimization for large datasets +``` + +--- + +## Test Fixtures & Configuration + +### 22. Advanced Fixture Design + +**Prompt:** +``` +Design advanced pytest fixtures for [testing scenario] that: +- Provide efficient resource management +- Support different fixture scopes +- Handle complex setup and teardown +- Enable fixture composition and reuse +- Manage fixture dependencies + +Include: +- Fixture hierarchy and dependency management +- Resource pooling and sharing strategies +- Error handling and cleanup procedures +- Fixture parameterization and customization +- Performance optimization techniques +``` + +### 23. Configuration Management + +**Prompt:** +``` +Implement test configuration management using pytest that: +- Handles multiple test environments +- Manages sensitive configuration data +- Supports configuration inheritance +- Enables runtime configuration changes +- Provides configuration validation + +Include: +- Configuration file structure and formats +- Environment-specific overrides +- Secure credential management +- Configuration injection into tests +- Validation and error handling +``` + +### 24. Plugin Development + +**Prompt:** +``` +Create custom pytest plugins for [specific functionality] that: +- Extend pytest capabilities +- Provide reusable testing utilities +- Integrate with external tools +- Support team-specific workflows +- Maintain compatibility with pytest ecosystem + +Include: +- Plugin architecture and hooks +- Custom markers and decorators +- Command-line option integration +- Configuration and setup procedures +- Documentation and usage examples +``` + +--- + +## Performance Testing + +### 25. Load Testing Integration + +**Prompt:** +``` +Integrate load testing with pytest using [tool/framework] that: +- Tests application performance under load +- Validates response times and throughput +- Identifies performance bottlenecks +- Supports different load patterns +- Provides detailed performance reporting + +Include: +- Load test scenario definition +- Performance metric collection +- Baseline and threshold management +- Result analysis and reporting +- CI/CD integration for performance gates +``` + +### 26. Stress Testing + +**Prompt:** +``` +Implement stress testing using pytest that: +- Tests system behavior under extreme conditions +- Identifies breaking points and limits +- Validates error handling and recovery +- Tests resource exhaustion scenarios +- Provides stability and reliability metrics + +Include: +- Stress test scenario design +- Resource monitoring and measurement +- Failure detection and analysis +- Recovery testing procedures +- Performance degradation analysis +``` + +### 27. Performance Benchmarking + +**Prompt:** +``` +Create performance benchmarking suite using pytest that: +- Measures and tracks performance metrics +- Compares performance across versions +- Identifies performance regressions +- Provides statistical analysis +- Integrates with monitoring systems + +Include: +- Benchmark test implementation +- Statistical analysis and reporting +- Performance trend tracking +- Regression detection algorithms +- Integration with monitoring and alerting +``` + +--- + +## Test Reporting & CI/CD + +### 28. Test Reporting + +**Prompt Template:** +``` +Create comprehensive test reporting for pytest that includes: +- Test execution results and metrics +- Coverage reports and analysis +- Performance and timing data +- Error analysis and debugging information +- Historical trend analysis + +Generate reports for: +- Development teams: [detailed technical reports] +- Management: [executive summaries and dashboards] +- CI/CD: [machine-readable formats] +- Quality assurance: [detailed test analysis] + +Include multiple output formats and integration options. +``` + +**Example:** +``` +Create comprehensive test reporting for pytest that includes: +- Test execution results with pass/fail rates and execution times +- Code coverage reports with line, branch, and function coverage +- Performance metrics with response times and resource usage +- Detailed error logs with stack traces and debugging information +- Historical trend analysis with regression detection + +Generate reports for: +- Development teams: HTML reports with detailed coverage and error analysis +- Management: Executive dashboards with quality metrics and trends +- CI/CD: JUnit XML and JSON formats for pipeline integration +- Quality assurance: Detailed test case analysis with risk assessment + +Include Allure reporting, coverage.py integration, and custom dashboard creation. +``` + +### 29. CI/CD Integration + +**Prompt:** +``` +Integrate pytest with CI/CD pipeline for [platform] that: +- Runs tests automatically on code changes +- Provides fast feedback to developers +- Manages test environments and dependencies +- Handles test result reporting and notifications +- Supports parallel test execution + +Include: +- Pipeline configuration and setup +- Test environment provisioning +- Artifact management and storage +- Notification and alerting setup +- Performance optimization strategies +``` + +### 30. Quality Gates + +**Prompt:** +``` +Implement quality gates using pytest that: +- Define quality criteria and thresholds +- Block deployments on quality failures +- Provide clear feedback on quality issues +- Support different quality metrics +- Enable quality trend monitoring + +Include: +- Quality metric definition and measurement +- Threshold configuration and management +- Gate evaluation and decision logic +- Reporting and notification systems +- Quality improvement recommendations +``` + +--- + +## Advanced Testing Patterns + +### 31. Behavior-Driven Development (BDD) + +**Prompt:** +``` +Implement BDD testing using pytest with [pytest-bdd/behave] that: +- Translates business requirements into tests +- Enables collaboration between technical and non-technical stakeholders +- Provides living documentation +- Supports scenario-based testing +- Maintains traceability between requirements and tests + +Include: +- Feature file creation and management +- Step definition implementation +- Scenario outline and data tables +- Background and hook management +- Reporting and documentation generation +``` + +### 32. Property-Based Testing + +**Prompt:** +``` +Implement property-based testing using pytest with Hypothesis that: +- Generates test cases automatically +- Finds edge cases and boundary conditions +- Validates system properties and invariants +- Provides shrinking and minimization +- Integrates with existing test suites + +Include: +- Property definition and specification +- Custom data generation strategies +- Invariant testing and validation +- Integration with traditional unit tests +- Performance and execution optimization +``` + +### 33. Mutation Testing + +**Prompt:** +``` +Implement mutation testing using pytest that: +- Evaluates test suite effectiveness +- Identifies weak spots in test coverage +- Validates test quality and reliability +- Provides mutation score metrics +- Guides test improvement efforts + +Include: +- Mutation testing setup and configuration +- Mutant generation and execution +- Survival analysis and reporting +- Test improvement recommendations +- Integration with quality metrics +``` + +--- + +## Best Practices Reminders + +When using these prompts, remember to: + +1. **Follow pytest conventions** - Use proper naming, fixtures, and markers +2. **Write maintainable tests** - Clear, readable, and well-documented test code +3. **Ensure test isolation** - Tests should not depend on each other +4. **Use appropriate test types** - Unit, integration, and E2E tests for different purposes +5. **Manage test data effectively** - Clean setup and teardown procedures +6. **Optimize test execution** - Parallel execution and efficient resource usage +7. **Integrate with CI/CD** - Automated testing and quality gates + +## Example Workflow for Test Engineers + +``` +1. Start with Test Framework Setup for project foundation +2. Implement Unit Tests for individual components +3. Add Integration Tests for component interactions +4. Create API Tests for service interfaces +5. Implement Database Tests for data layer validation +6. Add UI/E2E Tests for user workflow validation +7. Set up Test Data Management for reliable test execution +8. Configure Test Reporting for visibility and tracking +9. Integrate with CI/CD for automated quality assurance +10. Implement Advanced Testing Patterns for comprehensive coverage +``` + +## Pytest-Specific Tips + +- **Use fixtures effectively** - Leverage pytest's powerful fixture system for setup and teardown +- **Implement proper markers** - Organize tests with custom markers for selective execution +- **Utilize parametrization** - Test multiple scenarios with parametrized tests +- **Handle test discovery** - Follow pytest naming conventions for automatic test discovery +- **Optimize test execution** - Use pytest-xdist for parallel execution +- **Integrate plugins** - Leverage pytest ecosystem for extended functionality + +## Integration with Development Teams + +### Collaboration with Developers +- Use TDD prompts for collaborative test-first development +- Implement code review processes that include test quality +- Provide clear test documentation and examples + +### Working with DevOps +- Integrate testing with CI/CD pipelines +- Implement infrastructure testing and monitoring +- Collaborate on test environment management + +### Quality Assurance +- Implement comprehensive test coverage strategies +- Use reporting prompts for quality metrics and tracking +- Establish quality gates and standards + +--- + +*This guide is designed to help Test Engineers build comprehensive, maintainable, and effective test suites using pytest. Customize the prompts based on your specific application requirements, testing strategy, and team needs.* \ No newline at end of file diff --git a/the-alignment-prompts-of-the-frontend.md b/the-alignment-prompts-of-the-frontend.md new file mode 100644 index 0000000..45196a0 --- /dev/null +++ b/the-alignment-prompts-of-the-frontend.md @@ -0,0 +1,234 @@ +# Frontend Alignment Prompts: Mastering Precision in UI Design + +A comprehensive guide with AI prompts for frontend developers to tackle various alignment challenges, ensuring pixel-perfect and responsive user interfaces. + +## Table of Contents +1. [Core CSS Alignment (Flexbox & Grid)](#core-css-alignment) +2. [Text & Typography Alignment](#text--typography-alignment) +3. [Icon & Media Alignment](#icon--media-alignment) +4. [Form Element Alignment](#form-element-alignment) +5. [Responsive Alignment Strategies](#responsive-alignment-strategies) +6. [Alignment in Complex Components](#alignment-in-complex-components) +7. [Debugging Alignment Issues](#debugging-alignment-issues) + +--- + +## 1. Core CSS Alignment (Flexbox & Grid) + +### 1.1 Flexbox Alignment + +**Prompt Template:** +``` +You are a CSS Flexbox expert. I need to align items within a container. +Container selector: `[containerSelector]` +Item selector(s): `[itemSelector]` +Desired alignment: +- Main-axis (justify-content): [e.g., space-between, center, flex-end] +- Cross-axis (align-items): [e.g., center, stretch, flex-start] +- Individual item alignment (align-self on specific items, if any): [e.g., item `.special-item` should be `flex-end`] +- Wrapping behavior: [e.g., wrap, nowrap] +Provide the necessary CSS for the container and any specific items. Explain the key Flexbox properties used. +Using [React/Vue/Angular/Vanilla JS] context if relevant for dynamic classes. +``` + +**Example:** +``` +You are a CSS Flexbox expert. I need to align three `div` elements (`.item`) horizontally within a `nav` element (`.navbar`). +Desired alignment: +- Main-axis (justify-content): `space-around` +- Cross-axis (align-items): `center` +The navbar should have a fixed height of 60px. +Provide the CSS for `.navbar` and `.item`. Explain `display: flex`, `justify-content`, and `align-items`. +``` + +### 1.2 CSS Grid Alignment + +**Prompt Template:** +``` +You are a CSS Grid layout master. I need to align child elements within a grid container. +Container selector: `[containerSelector]` +Child element selector(s): `[childSelector]` +Grid structure: +- Columns: [e.g., `repeat(3, 1fr)`, `100px auto 1fr`] +- Rows: [e.g., `auto 1fr auto`, `minmax(100px, auto)`] +- Gaps: [e.g., `1rem`, `10px 20px`] +Alignment: +- Justify items (inline/row axis for all items): [e.g., start, end, center, stretch] +- Align items (block/column axis for all items): [e.g., start, end, center, stretch] +- Justify self (specific item, inline axis): `[itemSelector]` should be `[value]` +- Align self (specific item, block axis): `[itemSelector]` should be `[value]` +Provide the CSS for the container and any specific child elements. Explain the key Grid properties used. +``` + +**Example:** +``` +You are a CSS Grid layout master. I have a `div` with class `.grid-container` and several `article` elements inside. +Grid structure: +- Columns: `repeat(auto-fit, minmax(250px, 1fr))` +- Rows: `auto` +- Gaps: `1.5rem` +Alignment: +- Align items (block/column axis for all items): `stretch` +I want one specific article with class `.featured-article` to span two columns and be centered within its grid area using `align-self` and `justify-self`. +Provide the CSS. Explain `grid-template-columns`, `gap`, `align-items`, `grid-column`, `justify-self`, `align-self`. +``` + +--- + +## 2. Text & Typography Alignment + +### 2.1 Vertical Rhythm & Baseline Alignment + +**Prompt Template:** +``` +You are a typography and CSS expert. I want to establish consistent vertical rhythm and baseline alignment for text elements in my [React/Vue/Next.js/HTML] project. +Key text elements involved: +- Headers (e.g., `h1`, `h2`, `h3`) +- Paragraphs (`p`) +- Lists (`ul`, `ol`, `li`) +Base font size: `[e.g., 16px]` +Line height multiple: `[e.g., 1.5]` +Desired approach: [e.g., using margins, SASS mixins, CSS custom properties] +Generate the necessary CSS or SASS to ensure all text elements align to a common baseline grid. Explain how to apply this and verify the alignment. +``` + +**Example:** +``` +You are a typography and CSS expert. I want to establish consistent vertical rhythm for my blog content area. +Base font size: `18px` +Line height multiple: `1.6` +Key text elements: `h2`, `h3`, `p`, `blockquote`. +Use CSS custom properties for defining font sizes and line heights based on the rhythm. +Show how to calculate and apply margins (top/bottom) to maintain the rhythm. +Explain how to debug baseline alignment issues using browser developer tools. +``` + +### 2.2 Text Alignment within Constrained Elements + +**Prompt Template:** +``` +You are a CSS expert. I have a text element `[textElementSelector]` inside a container `[containerSelector]` with specific dimensions or constraints (e.g., fixed width, max-lines with ellipsis). +Desired text alignment: +- Horizontal: [e.g., left, right, center, justify] +- Vertical (if applicable, e.g., within a fixed height button): [e.g., top, middle, bottom using flexbox/line-height] +- Handling overflow: [e.g., ellipsis, clip] +Provide the CSS to achieve this alignment. If using Flexbox or Grid for vertical alignment, explain why. +``` + +--- + +## 3. Icon & Media Alignment + +### 3.1 Aligning Icons with Text + +**Prompt Template:** +``` +You are a UI and CSS expert. I need to align an icon (`[iconElementTagOrClass]`, e.g., `svg`, `.icon-font`) with adjacent text (`[textElementTagOrClass]`). +Desired vertical alignment: [e.g., middle of text, baseline of text, top of text cap height] +Icon library/type: [e.g., Font Awesome, SVG inline, Material Icons] +Provide CSS solutions (e.g., using Flexbox, `vertical-align`, adjusting line-height/padding) to achieve precise alignment. Include any necessary HTML structure. Explain trade-offs if multiple solutions exist. +``` + +### 3.2 Aligning Media (Images/Videos) with Captions or Other Elements + +**Prompt Template:** +``` +You are a CSS layout expert. I have an image/video element `[mediaElementSelector]` and a caption/text element `[captionElementSelector]` that need to be aligned. +Desired layout: +- Caption position: [e.g., below the media, overlaying bottom of media, to the side of media] +- Alignment of media and caption relative to each other: [e.g., caption text centered under media, media and caption block left-aligned] +Provide HTML structure and CSS (using Flexbox, Grid, or other techniques) to achieve this. Consider responsive behavior. +``` + +--- + +## 4. Form Element Alignment + +### 4.1 Aligning Labels and Inputs + +**Prompt Template:** +``` +You are a CSS and Forms expert. I need to style a form and align its labels (`label`) with their corresponding input fields (`input`, `textarea`, `select`). +Alignment preference: +- Label position relative to input: [e.g., above, to the left, inline] +- Alignment of labels if they are in a column (e.g., all labels right-aligned for a consistent starting point for inputs). +- Alignment of inputs if they are in a column. +Provide clean CSS to achieve this. Consider using Flexbox or Grid for robust form layouts. Show how to handle different input types and potential for error messages. +``` + +### 4.2 Button Alignment in Forms or UI Groups + +**Prompt Template:** +``` +You are a CSS UI expert. I need to align multiple buttons (`button`, `.btn`) within a form, a modal footer, or a button group. +Desired alignment: [e.g., all buttons right-aligned, buttons spaced evenly, primary button on right and secondary on left] +Container element: `[containerSelector]` +Provide CSS using Flexbox or Grid to achieve the button alignment. Explain how to adjust spacing and order. +``` + +--- + +## 5. Responsive Alignment Strategies + +**Prompt Template:** +``` +You are a responsive design and CSS expert. I have a component `[componentSelector]` with several child elements `[childSelectors]` that need different alignment based on viewport size. +Alignment requirements: +- Mobile (`< [breakpoint1]px`): [Describe mobile alignment, e.g., items stacked vertically, centered] +- Tablet (`[breakpoint1]px` to `[breakpoint2]px`): [Describe tablet alignment, e.g., 2-column layout, items space-between] +- Desktop (`> [breakpoint2]px`): [Describe desktop alignment, e.g., horizontal layout, items aligned to start] +Provide CSS using media queries and appropriate layout techniques (Flexbox/Grid) to implement these responsive alignment changes. +``` + +--- + +## 6. Alignment in Complex Components + +### 6.1 Navigation Bar Item Alignment + +**Prompt Template:** +``` +You are a CSS expert. I'm building a navigation bar `[navSelector]` with a logo `[logoSelector]`, a list of links `[linksListSelector]`, and a user profile section `[userProfileSelector]`. +Desired alignment: +- Logo: [e.g., aligned to the far left] +- Links list: [e.g., centered in the available space, or left-aligned next to logo] +- User profile section: [e.g., aligned to the far right] +- Vertical alignment for all items: [e.g., centered within the navbar height] +Provide HTML structure and CSS (likely Flexbox) to achieve this complex alignment. Ensure it's responsive. +``` + +### 6.2 Card Component Content Alignment + +**Prompt Template:** +``` +You are a CSS component design expert. I'm creating a card component `[cardSelector]` which contains an image `[imageSelector]`, a title `[titleSelector]`, a description `[descriptionSelector]`, and a footer with actions `[footerSelector]`. +Desired internal alignment: +- Image: [e.g., full-width at the top] +- Title and Description: [e.g., left-aligned, with specific spacing] +- Footer: [e.g., always at the bottom of the card, with action buttons right-aligned within it] +The card has a fixed or variable height. Provide robust CSS (Flexbox/Grid) to manage the internal alignment of these elements, especially ensuring the footer stays at the bottom if content is short. +``` + +--- + +## 7. Debugging Alignment Issues + +**Prompt Template:** +``` +You are a CSS debugging expert. I'm having trouble aligning `[problematicElementSelector]` within its parent `[parentElementSelector]`. +Current behavior: [Describe what's happening, e.g., "the element is pushed to the right", "it's not vertically centered"] +Desired behavior: [Describe what you want] +Relevant HTML structure: +\`\`\`html +[Paste relevant HTML snippet] +\`\`\` +Relevant CSS: +\`\`\`css +[Paste relevant CSS snippet for parent and child] +\`\`\` +What are common causes for this type of alignment issue? Suggest debugging steps using browser developer tools (e.g., inspecting box model, computed styles, Flexbox/Grid inspectors). Provide potential CSS fixes or properties to investigate. +``` + +--- + +*This guide provides prompts to generate solutions for common frontend alignment tasks. Customize them with your specific selectors, desired behaviors, and project context.* \ No newline at end of file diff --git a/troubleshooting.md b/troubleshooting.md new file mode 100644 index 0000000..5b2ea3d --- /dev/null +++ b/troubleshooting.md @@ -0,0 +1,67 @@ + # AI Coding 101: Troubleshooting + + #### 24. Be specific about what is not working (and what is) + + **Prompt:** + ``` + When I do [X], I see [Y], but when I do [Z], it seems to work. + ``` + + ``` + Right now the [feature 1] is working correctly but [feature 2] is failing [failure description]. Can you fix that? + ``` + + **Example:** + ``` + The buttons are visible now but when I click them nothing seems to happen. Can you fix that? + ``` +--- + + #### 25. Share screenshots to show what is wrong + + **Example:** + ``` + The layout is still incorrect. Please see [@screenshot] and note how the sidebar is not properly expanding. + ``` +--- + + #### 26. Share the exact errors + + **Prompt:** + ``` + It’s still failing - here are the errors: [full error logs] + ``` +--- + + ## 27. The Beaver Method + The Beaver Method is a troubleshooting approach that works by asking AI to add logs throughout the code, running the software, and feeding the logs back to AI for context. + + **Step 1 Prompt:** + ``` + Please add logs at every step of the process to make it easier to troubleshoot and figure out where the problem is. + ``` + + **Step 2 Prompt:** + ``` + I ran the process and here is the result: [full logs generated from step 1] + ``` +--- + + #### 28. Ask AI to explain the code + Similar to #23 but in the context of troubleshooting to bridge the disconnect between expectations and reality. + + **Example:** + ``` + This code doesn’t convert dates correctly. Can you explain how it works? + ``` +--- + + #### 29. Ask AI to use a "radically different approach" + + **Prompt:** + ``` + This still isn’t working. Let’s try a radically different approach. + ``` +--- + + ## 30. Know when to stop asking AI and read the code yourself \ No newline at end of file diff --git a/ui-designer-figma-prompts.md b/ui-designer-figma-prompts.md new file mode 100644 index 0000000..cd75a29 --- /dev/null +++ b/ui-designer-figma-prompts.md @@ -0,0 +1,768 @@ +# UI Designer Figma Prompts Guide + +A comprehensive collection of AI prompts specifically designed for UI Designers working with Figma to create stunning prototypes, design systems, and user interfaces efficiently. + +## Table of Contents +1. [Prototype Development](#prototype-development) +2. [Design System Creation](#design-system-creation) +3. [Component Design](#component-design) +4. [User Interface Layout](#user-interface-layout) +5. [Interactive Design & Animation](#interactive-design--animation) +6. [Responsive Design](#responsive-design) +7. [Accessibility & Usability](#accessibility--usability) +8. [Design Handoff & Documentation](#design-handoff--documentation) +9. [User Research & Testing](#user-research--testing) +10. [Design Optimization](#design-optimization) + +--- + +## Prototype Development + +### 1. Interactive Prototype Creation + +**Prompt Template:** +``` +You are an expert UI designer. Create a detailed Figma prototype for [product/feature] with these requirements: +- User flow: [specific user journey] +- Platform: [web/mobile/tablet/desktop] +- Design style: [modern/minimalist/corporate/playful] +- Key interactions: [list specific interactions] +- Target audience: [user demographics] + +Include: +- Frame structure and organization +- Interactive hotspots and transitions +- Micro-interactions and animations +- Navigation patterns and flow +- Prototype testing scenarios +``` + +**Example:** +``` +You are an expert UI designer. Create a detailed Figma prototype for a food delivery mobile app with these requirements: +- User flow: Browse restaurants → Select items → Checkout → Track order +- Platform: Mobile-first (iOS/Android) +- Design style: Modern, clean with vibrant food imagery +- Key interactions: Swipe gestures, pull-to-refresh, animated cart updates +- Target audience: Urban millennials and Gen Z users + +Include: +- Frame structure with proper mobile dimensions +- Interactive hotspots for navigation and actions +- Smooth transitions between screens +- Bottom navigation with active states +- Order tracking with real-time updates simulation +``` + +### 2. High-Fidelity Prototype Framework + +**Prompt:** +``` +Design a high-fidelity prototype framework in Figma for [application type] that includes: +- Consistent navigation patterns +- Reusable interaction components +- State management for UI elements +- Error handling and feedback states +- Loading and transition animations + +Focus on: +- User experience flow optimization +- Visual hierarchy and information architecture +- Accessibility considerations +- Performance and usability testing preparation +``` + +### 3. Rapid Prototyping System + +**Prompt:** +``` +Create a rapid prototyping system in Figma for [design team/project] that: +- Enables quick iteration and testing +- Uses modular design components +- Supports multiple device breakpoints +- Includes pre-built interaction patterns +- Facilitates stakeholder feedback collection + +Include: +- Template library organization +- Component naming conventions +- Prototype sharing and collaboration workflows +- Version control and iteration tracking +``` + +--- + +## Design System Creation + +### 4. Comprehensive Design System + +**Prompt Template:** +``` +Create a comprehensive design system in Figma for [brand/product] with these specifications: +- Brand identity: [colors, typography, tone] +- Platform requirements: [web/mobile/both] +- Component scope: [basic/advanced/enterprise] +- Team size: [number of designers/developers] +- Accessibility level: [WCAG compliance level] + +Include: +- Color palette with semantic tokens +- Typography scale and hierarchy +- Spacing and layout grids +- Component library with variants +- Documentation and usage guidelines +``` + +**Example:** +``` +Create a comprehensive design system in Figma for a fintech startup with these specifications: +- Brand identity: Professional blue/green palette, clean typography, trustworthy tone +- Platform requirements: Web dashboard and mobile app +- Component scope: Advanced with complex data visualization components +- Team size: 5 designers, 8 developers +- Accessibility level: WCAG 2.1 AA compliance + +Include: +- Primary/secondary color palette with semantic tokens +- Typography scale optimized for financial data +- 8px grid system with responsive breakpoints +- Component library with form elements, charts, and data tables +- Comprehensive documentation with do's and don'ts +``` + +### 5. Component Library Architecture + +**Prompt:** +``` +Design a scalable component library architecture in Figma for [organization] that: +- Supports atomic design methodology +- Enables consistent cross-platform design +- Facilitates easy maintenance and updates +- Includes proper component documentation +- Supports design token integration + +Structure: +- Atoms: [basic elements] +- Molecules: [simple combinations] +- Organisms: [complex components] +- Templates: [page layouts] +- Pages: [specific instances] +``` + +### 6. Design Token System + +**Prompt:** +``` +Create a design token system in Figma for [product/brand] that includes: +- Color tokens (primitive, semantic, component-specific) +- Typography tokens (font families, sizes, weights, line heights) +- Spacing tokens (margins, padding, gaps) +- Border radius and shadow tokens +- Animation and timing tokens + +Include: +- Token naming conventions +- Hierarchical organization structure +- Documentation for developers +- Implementation guidelines +- Maintenance and update procedures +``` + +--- + +## Component Design + +### 7. UI Component Creation + +**Prompt Template:** +``` +Design a [component type] component in Figma with these requirements: +- Functionality: [specific features and behaviors] +- States: [default, hover, active, disabled, loading, error] +- Variants: [size, style, or type variations] +- Accessibility: [ARIA labels, keyboard navigation, screen reader support] +- Platform: [web/mobile/both] + +Include: +- Component structure and auto-layout +- Property panels and variant organization +- Interaction states and transitions +- Documentation and usage examples +- Developer handoff specifications +``` + +**Example:** +``` +Design a button component in Figma with these requirements: +- Functionality: Primary actions, secondary actions, icon support +- States: Default, hover, active, disabled, loading +- Variants: Small, medium, large sizes; filled, outlined, text styles +- Accessibility: Proper contrast ratios, focus indicators, touch targets +- Platform: Web and mobile responsive + +Include: +- Auto-layout with proper padding and spacing +- Organized variant properties panel +- Smooth hover and press state transitions +- Clear documentation with usage guidelines +- CSS specifications for developer implementation +``` + +### 8. Form Component System + +**Prompt:** +``` +Create a comprehensive form component system in Figma that includes: +- Input fields (text, email, password, number, search) +- Selection components (dropdown, radio, checkbox, toggle) +- Date and time pickers +- File upload components +- Form validation and error states + +For each component, include: +- Multiple size variants +- Validation states (success, warning, error) +- Accessibility features +- Responsive behavior +- Clear labeling and helper text patterns +``` + +### 9. Navigation Component Library + +**Prompt:** +``` +Design a navigation component library for [application type] that includes: +- Primary navigation (header, sidebar, bottom nav) +- Secondary navigation (tabs, breadcrumbs, pagination) +- Menu systems (dropdown, mega menu, context menu) +- Search and filtering components +- Mobile navigation patterns + +Include: +- Responsive behavior across breakpoints +- Active and inactive states +- Accessibility considerations +- Animation and transition specifications +- Integration with overall design system +``` + +--- + +## User Interface Layout + +### 10. Dashboard Design + +**Prompt Template:** +``` +Design a dashboard interface in Figma for [domain/industry] with these requirements: +- Primary metrics: [key performance indicators] +- User roles: [different user types and permissions] +- Data visualization: [charts, graphs, tables needed] +- Layout structure: [grid system, sidebar, header configuration] +- Responsive behavior: [desktop, tablet, mobile considerations] + +Include: +- Information hierarchy and visual organization +- Interactive data visualization components +- Filtering and search functionality +- Customization and personalization options +- Export and sharing capabilities +``` + +**Example:** +``` +Design a dashboard interface in Figma for e-commerce analytics with these requirements: +- Primary metrics: Sales revenue, conversion rates, traffic sources, top products +- User roles: Store owners, marketing managers, analysts +- Data visualization: Line charts, bar graphs, pie charts, data tables +- Layout structure: Left sidebar navigation, top header, main content grid +- Responsive behavior: Desktop-first with tablet and mobile adaptations + +Include: +- Clear metric hierarchy with prominent KPIs +- Interactive charts with hover states and drill-down capabilities +- Advanced filtering with date ranges and category selection +- Customizable widget arrangement and dashboard personalization +- Export functionality for reports and data sharing +``` + +### 11. Landing Page Design + +**Prompt:** +``` +Create a high-converting landing page design in Figma for [product/service] that: +- Communicates value proposition clearly +- Includes compelling call-to-action elements +- Optimizes for conversion and user engagement +- Supports A/B testing variations +- Works across all device types + +Include: +- Hero section with strong visual hierarchy +- Feature highlights and benefits +- Social proof and testimonials +- Clear conversion funnel design +- Mobile-first responsive layout +``` + +### 12. E-commerce Interface Design + +**Prompt:** +``` +Design an e-commerce interface in Figma for [product category] that includes: +- Product listing and grid layouts +- Product detail pages with image galleries +- Shopping cart and checkout flow +- User account and order management +- Search and filtering functionality + +Focus on: +- Conversion optimization +- Trust and security indicators +- Mobile commerce best practices +- Accessibility and usability +- Performance considerations +``` + +--- + +## Interactive Design & Animation + +### 13. Micro-interaction Design + +**Prompt:** +``` +Design micro-interactions in Figma for [specific UI elements] that: +- Provide clear user feedback +- Enhance usability and delight +- Support accessibility requirements +- Maintain performance standards +- Align with brand personality + +Create interactions for: +- Button hover and click states +- Form field focus and validation +- Loading and progress indicators +- Navigation transitions +- Data visualization animations + +Include timing, easing, and implementation notes. +``` + +### 14. Prototype Animation System + +**Prompt:** +``` +Create an animation system in Figma for [application] that includes: +- Transition types and timing functions +- Loading and progress animations +- Feedback and confirmation animations +- Navigation and page transitions +- Data visualization animations + +Define: +- Animation principles and guidelines +- Duration and easing standards +- Performance considerations +- Accessibility and reduced motion support +- Implementation specifications for developers +``` + +### 15. Interactive Component States + +**Prompt:** +``` +Design comprehensive interactive states for [component type] in Figma that cover: +- Default and resting states +- Hover and focus interactions +- Active and pressed states +- Loading and processing states +- Success and error feedback states +- Disabled and unavailable states + +Include: +- Smooth transition specifications +- Accessibility considerations +- Touch and mouse interaction differences +- Animation timing and easing +- Developer implementation guidelines +``` + +--- + +## Responsive Design + +### 16. Multi-Device Design System + +**Prompt Template:** +``` +Create a responsive design system in Figma for [application] that works across: +- Desktop: [specific breakpoints and layouts] +- Tablet: [orientation and size considerations] +- Mobile: [iOS and Android specifications] +- Wearable: [if applicable] + +Include: +- Flexible grid systems +- Responsive typography scales +- Adaptive component behaviors +- Touch target optimizations +- Platform-specific design patterns +``` + +**Example:** +``` +Create a responsive design system in Figma for a news application that works across: +- Desktop: 1440px, 1920px with sidebar navigation and multi-column layouts +- Tablet: 768px, 1024px with collapsible navigation and two-column grids +- Mobile: 375px, 414px with bottom navigation and single-column layouts +- Apple Watch: Article summaries and breaking news notifications + +Include: +- 12-column grid system with flexible gutters +- Responsive typography scale from 14px to 48px +- Adaptive card components that stack and resize +- 44px minimum touch targets for mobile +- Platform-specific navigation patterns and interactions +``` + +### 17. Breakpoint Strategy + +**Prompt:** +``` +Define a comprehensive breakpoint strategy in Figma for [project] that: +- Covers all target devices and screen sizes +- Ensures optimal content layout at each breakpoint +- Maintains design consistency across devices +- Supports both portrait and landscape orientations +- Considers emerging device categories + +Include: +- Breakpoint definitions and rationale +- Layout behavior at each breakpoint +- Component adaptation strategies +- Typography and spacing adjustments +- Testing and validation approaches +``` + +### 18. Mobile-First Design Approach + +**Prompt:** +``` +Implement a mobile-first design approach in Figma for [application] that: +- Prioritizes mobile user experience +- Progressively enhances for larger screens +- Optimizes for touch interactions +- Considers mobile-specific constraints +- Ensures fast loading and performance + +Focus on: +- Essential content and feature prioritization +- Thumb-friendly navigation patterns +- Efficient use of screen real estate +- Mobile-specific interaction patterns +- Performance optimization considerations +``` + +--- + +## Accessibility & Usability + +### 19. Accessibility-First Design + +**Prompt:** +``` +Create an accessibility-first design in Figma for [application] that meets: +- WCAG 2.1 AA compliance standards +- Color contrast requirements (4.5:1 for normal text) +- Keyboard navigation support +- Screen reader compatibility +- Motor accessibility considerations + +Include: +- High contrast color schemes +- Clear focus indicators +- Proper heading hierarchy +- Alternative text specifications +- Touch target size requirements (44px minimum) +- Error handling and feedback systems +``` + +### 20. Inclusive Design Patterns + +**Prompt:** +``` +Design inclusive UI patterns in Figma that accommodate: +- Visual impairments (low vision, color blindness) +- Motor disabilities (limited dexterity, tremors) +- Cognitive differences (memory, attention, processing) +- Hearing impairments (deaf, hard of hearing) +- Temporary disabilities (broken arm, bright sunlight) + +Create: +- Multiple ways to access information +- Clear and simple language patterns +- Consistent navigation and interaction patterns +- Error prevention and recovery mechanisms +- Customizable interface options +``` + +### 21. Usability Testing Preparation + +**Prompt:** +``` +Prepare Figma prototypes for usability testing of [feature/application] that: +- Support realistic user task scenarios +- Include error states and edge cases +- Enable natural user interactions +- Collect meaningful feedback data +- Test across different user groups + +Include: +- Task flow documentation +- Prototype interaction specifications +- Testing scenario scripts +- Data collection points +- Iteration and improvement plans +``` + +--- + +## Design Handoff & Documentation + +### 22. Developer Handoff Specifications + +**Prompt:** +``` +Create comprehensive developer handoff documentation in Figma for [project] that includes: +- Detailed design specifications +- Component implementation guidelines +- Asset export requirements +- Interaction and animation specifications +- Responsive behavior documentation + +Provide: +- CSS specifications and measurements +- Color codes and typography details +- Spacing and layout specifications +- Asset naming conventions +- Implementation priority and phasing +``` + +### 23. Design System Documentation + +**Prompt:** +``` +Create thorough design system documentation in Figma that covers: +- Component usage guidelines +- Design principles and philosophy +- Brand guidelines and voice +- Accessibility standards +- Implementation best practices + +Include: +- Do's and don'ts for each component +- Code snippets and implementation examples +- Accessibility considerations +- Maintenance and update procedures +- Team collaboration guidelines +``` + +### 24. Asset Organization System + +**Prompt:** +``` +Develop an asset organization system in Figma for [team/project] that: +- Enables efficient file management +- Supports team collaboration +- Maintains version control +- Facilitates asset reuse +- Ensures consistency across projects + +Include: +- File naming conventions +- Folder structure and organization +- Component library management +- Version control workflows +- Team access and permissions +``` + +--- + +## User Research & Testing + +### 25. User Research Integration + +**Prompt:** +``` +Integrate user research findings into Figma designs for [product] by: +- Translating user insights into design decisions +- Creating user-centered design solutions +- Validating design concepts with user data +- Iterating based on user feedback +- Documenting research-driven design rationale + +Include: +- User persona integration in design decisions +- Journey mapping visualization +- Pain point identification and solutions +- User testing scenario preparation +- Research findings documentation +``` + +### 26. A/B Testing Design Variants + +**Prompt:** +``` +Create A/B testing design variants in Figma for [specific feature/page] that test: +- Different layout approaches +- Alternative interaction patterns +- Various visual treatments +- Content presentation methods +- Call-to-action variations + +Include: +- Clear variant documentation +- Hypothesis and success metrics +- Implementation specifications +- Testing timeline and methodology +- Results analysis framework +``` + +### 27. User Feedback Integration + +**Prompt:** +``` +Design a system in Figma for collecting and integrating user feedback that: +- Captures user sentiment and preferences +- Identifies usability issues and pain points +- Tracks user behavior patterns +- Enables rapid iteration and improvement +- Maintains user-centered design focus + +Include: +- Feedback collection mechanisms +- User testing result integration +- Design iteration workflows +- Stakeholder communication methods +- Continuous improvement processes +``` + +--- + +## Design Optimization + +### 28. Performance-Optimized Design + +**Prompt:** +``` +Create performance-optimized designs in Figma for [application] that: +- Minimize loading times and resource usage +- Optimize images and assets for web/mobile +- Consider bandwidth and device limitations +- Prioritize critical content and features +- Support progressive loading strategies + +Include: +- Asset optimization guidelines +- Image compression and format recommendations +- Critical path design prioritization +- Loading state and skeleton screen designs +- Performance budget considerations +``` + +### 29. Conversion Rate Optimization + +**Prompt:** +``` +Design for conversion rate optimization in Figma by: +- Optimizing user flow and reducing friction +- Improving call-to-action visibility and effectiveness +- Enhancing trust signals and social proof +- Streamlining form and checkout processes +- Testing and iterating on key conversion points + +Focus on: +- Clear value proposition communication +- Reduced cognitive load and decision fatigue +- Trust and credibility indicators +- Mobile conversion optimization +- A/B testing preparation +``` + +### 30. Design System Scalability + +**Prompt:** +``` +Design a scalable design system in Figma that: +- Supports future product growth and expansion +- Enables efficient team collaboration +- Maintains consistency across multiple products +- Facilitates easy updates and maintenance +- Supports international and accessibility requirements + +Include: +- Modular component architecture +- Scalable naming and organization systems +- Documentation and governance processes +- Integration with development workflows +- Long-term maintenance strategies +``` + +--- + +## Best Practices Reminders + +When using these prompts, remember to: + +1. **Follow Figma best practices** - Use auto-layout, components, and proper layer organization +2. **Design for accessibility** - Ensure WCAG compliance and inclusive design principles +3. **Consider all device types** - Design responsive layouts for multiple screen sizes +4. **Document thoroughly** - Provide clear specifications for developers and stakeholders +5. **Test early and often** - Create prototypes for user testing and validation +6. **Maintain consistency** - Use design systems and component libraries effectively +7. **Optimize for performance** - Consider loading times and resource constraints + +## Example Workflow for UI Designers + +``` +1. Start with User Research prompts to understand user needs +2. Use Design System prompts to establish visual foundation +3. Create layouts using Interface Layout prompts +4. Build components with Component Design prompts +5. Add interactions using Interactive Design prompts +6. Ensure accessibility with Accessibility prompts +7. Create prototypes using Prototype Development prompts +8. Prepare handoff using Documentation prompts +9. Optimize designs using Design Optimization prompts +``` + +## Figma-Specific Tips + +- **Use Auto Layout effectively** - Create responsive components that adapt to content +- **Organize with proper naming** - Use consistent naming conventions for layers and components +- **Leverage component variants** - Create flexible components with multiple states and options +- **Utilize design tokens** - Implement consistent colors, typography, and spacing +- **Create interactive prototypes** - Use Figma's prototyping features for realistic user testing +- **Collaborate efficiently** - Use comments, sharing, and version history for team collaboration + +## Integration with Development Teams + +### Collaboration with Engineers +- Use developer handoff prompts for clear implementation specifications +- Include technical constraints in design decisions +- Provide detailed interaction and animation specifications + +### Working with Product Managers +- Align designs with product requirements and user stories +- Create prototypes that validate product concepts +- Document design decisions and rationale + +### Stakeholder Communication +- Use visual presentations and interactive prototypes +- Provide clear design rationale and user research backing +- Create design variations for stakeholder feedback + +--- + +*This guide is designed to help UI Designers work more efficiently with AI assistants while creating exceptional user interfaces in Figma. Customize the prompts based on your specific project requirements, brand guidelines, and user needs.* \ No newline at end of file diff --git a/ultimate-coding-prompt-guide.md b/ultimate-coding-prompt-guide.md index 6ec9677..3d514c2 100644 --- a/ultimate-coding-prompt-guide.md +++ b/ultimate-coding-prompt-guide.md @@ -1,4 +1,5 @@ # AI Coding 101: Ultimate Prompt Guide + This is a companion document to go along with my AI Coding 101 video. This document contains all the prompts discussed in the video - though I suggest you watch the video for all of the additional context and explanation that relates to these prompts and tips. You can watch the full video here: @@ -6,344 +7,9 @@ You can watch the full video here: [![AI Coding 101: Ultimate Prompt Guide](https://img.youtube.com/vi/uwA3MMYBfAQ/0.jpg)](https://youtu.be/uwA3MMYBfAQ) > 🎥 AI Coding 101: Ultimate Prompt Guide (37 tips) +This guide is split into the following scenario-specific files: -# Writing New Code -#### 1. Specify technologies and frameworks - -**Prompt**: -``` -Please create [app/feature description] using [technology list] -``` - -**Example:** -``` -Create a weather tracking app using React (vite), TypeScript, ShadCN, and Tailwind -``` ---- -#### 2. Choose Popular Technologies - -**Recommendations:** -``` -Frontend: TypeScript, React, Tailwind, ShadCN -Backend: TypeScript, Python, Express.js, FastAPI, Django -Databases: Postgres, MongoDB, Redis -Cloud: Cloud Storage (S3), Supabase Auth, Cloud/Edge Functions -``` ---- -#### 3. Design the solution, then implement with AI - -**Prompt:** -``` -I am building a [feature]. It should work like this: [list of requirements] -We should [implementation tips]. It should also handle these edge cases: [list] -``` - -**Example:** -``` -We’re building a search feature. It should perform the search based on the product title and description. - -Create a new component, SearchBar, and add it to the existing NavBar component. Also, create a new search endpoint in the @server.ts file. - -When no results are found, we should display 'No Results' in place of the product list. -``` ---- -#### 4. Break things down, give the AI a list of tasks - -**Prompt:** -``` -Please implement the following: -1. [Requirement #1] -2. [Requirement #2] -3. [Requirement #3] -``` ---- -## 5. Find the right balance of task scope (not too big or small) - ---- -#### 6. Use examples in your prompts - -**Prompt:** -``` -Please create a [feature] that follows this example: [example]” -``` - -**Example:** -``` -Create a date formatting function. It should work like this: -1.Input: '2024-02-07' → Output: 'Feb 7, 2024' -2.Input: '2024-02-07T15:30:00' → Output: 'Feb 7, 2024 3:30 PM' -``` ---- -#### 7. Provide sample code for the AI to follow - -**Prompt:** -``` -Please create a [feature]. Here is working sample code: [code] -``` ---- -#### 8. Use @Docs and @Web context utilities - -**Prompt:** -``` -Please build a [feature]. Reference the [@Docs / link] docs -``` - -``` -Please build a [feature]. Find the best practices and examples for building this on the [@Web]” -``` ---- -#### 9. Make sure the code is secure and performs well - -**Prompt:** -``` -Please implement [feature]. Make sure to account for any potential security issues. -``` - -``` -We just implemented [feature]. Can you check to make sure that it use the most efficient approach? -``` ---- -#### 10. Proactively check for additional considerations - -**Prompt:** -``` -Are there any additional considerations for building [feature]? -``` ---- -#### 11. Ask the AI to write tests & try Test-Driven Development - -**Prompt:** -``` -Please write the tests for the new feature we just implemented -``` - -**Test-Driven Development:** -``` -We are building [feature]. Please write the tests to cover the following cases: [list]. Once complete, build the actual feature. -``` ---- -#### 12. Have AI generate your documentation - -**Example:** -``` -Please add an explanation of this code to our README -``` ---- -#### 13. Use precise naming - -**Example:** -``` -Please create a new csvParser method and add it to the dataParsers.ts file -``` - ---- -# Modifying Existing Code -#### 14. Keep code organized by asking AI to refactor & simplify - -**Prompt:** -``` -Please refactor the code in [file / function] to split it up into [list of files / functions] -``` - -**Example:** -``` -Please split up dataParser.ts into dedicated files including csvParser.ts, xmlParser.ts, and pdfParser.ts -``` ---- -## 15. Manage and balance the CONTEXT you give to the AI - ---- -#### 16. Tag specific relevant files as context - -**Prompt:** -``` -Please implement [feature]. You’ll need to modify [list of files]. Here are additional files for context: [list of files] -``` ---- -#### 17. Keep your files at 300 lines of code or less - ---- -#### 18. Keep in mind that the full conversation is used as context - ---- -#### 19. Start a new conversation for each new feature - ---- -#### 20. Tell the AI what works well and what needs to be changed - -**Prompt:** -``` -This was a good start. [list of features] are working well but [list of problems] still needs to be fixed. Can you fix that? -``` - -**Example:** -``` -The new search feature is properly calling the API and showing results but it is not properly searching by product description. Can you please fix that? -``` ---- -#### 21. Ask AI to find edge cases or bugs - -**Prompt:** -``` -Are there any edge cases we should consider or handle? -``` ---- -#### 22. Ask AI to review the code - -**Prompt:** -``` -Now that we have finished building [feature], can you do a full review of the implementation and the new code? -``` ---- -#### 23. Ask AI about what the current code does - -**Prompt:** -``` -How does the code in [@file] work? Give a high level overview -``` - -``` -How does the [function] work? Give a detailed description” -``` - -**Example:** -``` -What does the code in @serverComm.ts do? How does it handle authentication? -``` ---- -# Troubleshooting -#### 24. Be specific about what is not working (and what is) - -**Prompt:** -``` -When I do [X], I see [Y], but when I do [Z], it seems to work. -``` - -``` -Right now the [feature 1] is working correctly but [feature 2] is failing [failure description]. Can you fix that? -``` - -**Example:** -``` -The buttons are visible now but when I click them nothing seems to happen. Can you fix that? -``` ---- -#### 25. Share screenshots to show what is wrong - -**Example:** -``` -The layout is still incorrect. Please see [@screenshot] and note how the sidebar is not properly expanding. -``` ---- -#### 26. Share the exact errors - -**Prompt:** -``` -It’s still failing - here are the errors: [full error logs] -``` ---- -## 27. The Beaver Method -The beaver method is a troubleshooting approach that works by asking AI to add logs throughout the code that you are troubleshooting, running the software, and feeding the logs back into the AI so that it can troubleshoot with all the relevant runtime context. - -**Step 1 Prompt:** -``` -Please add logs at every step of the process to make it easier to troubleshoot and figure out where the problem is. -``` - -**Step 2 Prompt:** -``` -I ran the process and here is the result: [full logs generated from step 1] -``` ---- -#### 28. Ask AI to explain the code -Similar to #23 but in the context of troubleshooting to help bridge the disconnect between developer expectations and the way the code actually works (which the developer currently perceives as incorrect). - -**Example:** -``` -This code doesn’t convert dates correctly. Can you explain how it works? -``` ---- -#### 29. Ask AI to use a "radically different approach" - -**Prompt:** -``` -This still isn’t working. Let’s try a radically different approach. -``` ---- -## 30. Know when to stop asking AI and read the code yourself - ---- -# Learning To Code - -The following tips match what was covered in the AI Coding 101 episode, but the [Learn To Code](https://github.com/VoloBuilds/prompts/blob/main/LearnToCode.md) page contains more detailed tips for learning to code specifically including a **technology glossary** that can help guide your exploration. - -#### 31. Tell AI to keep it simple + that you are a new dev - -**Example:** -``` -I am learning how to code. Can you simply explain how the frontend connects to the backend? -``` ---- -#### 32. Ask AI to explain code "line by line" - -**Prompt:** -``` -Please add comments explaining [function] line by line -``` - -**Example:** -``` -I am learning how to code. Can you explain the getContactDetails function line by line? -``` ---- -#### 33. Ask AI to explain specific technologies & concepts - -**Prompt:** -``` -Can you explain how [concept] works? What does [technology] do? -``` - -**Example:** -``` -I'm a new dev. Can you explain what databases are for, when I should use them, and what Postgres is specifically? -``` ---- -#### 34. Ask AI how to build something - -**Prompt:** -``` -I want to build a [app/feature]. How would you approach this problem from a technical perspective? -``` - -**Example:** -``` -I want to build a chat app. How would you architect this and what considerations do we need to take into account? -``` ---- -#### 35. Ask AI to show you examples - -**Prompt:** -``` -Can you show me a working example of a [concept] and explain it? -``` - -**Example:** -``` -I am learning to code and want to understand how objects work. Can you create some examples and explain them? -``` ---- -#### 36. Tell the AI what you already know vs what is unclear - -**Prompt:** -``` -I know how [concept] works but can you explain how it relates to [concept 2]? -``` - -**Example:** -``` -I have an API and understand how requests come in but can you explain how I could add authentication to my endpoints? -``` ---- -### 37. Focus on learning and understanding core concepts - ---- +- [Writing New Code](writing-new-code.md) +- [Modifying Existing Code](modifying-existing-code.md) +- [Troubleshooting](troubleshooting.md) +- [Learning To Code](learning-to-code-guide.md) diff --git a/user-story.md b/user-story.md new file mode 100644 index 0000000..1b35827 --- /dev/null +++ b/user-story.md @@ -0,0 +1,27 @@ +# User Stories for AI Coding Prompt Guides + +This document outlines the key user personas and their primary goals for using the AI Coding Prompt Guides repository. + +## 1. New Developer / Learner +- As a beginner learning to code, I want a curated set of AI prompts that explain fundamental programming concepts, so that I can build confidence and foundational knowledge. +- As a learner, I want line-by-line explanations and simple examples, so that complex ideas become accessible and memorable. + +## 2. Feature Developer +- As a developer building new functionality, I want robust feature prompt templates, so that I can generate production-ready code with error handling and unit tests quickly. +- As a Next.js developer, I want dedicated Next.js templates (SSG, SSR, routing, styling), so that I can scaffold pages and data fetching efficiently without manually writing boilerplate. + +## 3. Code Maintainer / Refactorer +- As a code maintainer, I want prompts that suggest refactoring and modularization strategies, so that I can keep the codebase organized, DRY, and maintainable. + +## 4. Troubleshooter +- As a developer encountering errors, I want targeted AI prompts for diagnosing and fixing issues, so that I can resolve bugs and performance problems faster. +- As a troubleshooter, I want guidance on adding logs and interpreting outputs (The Beaver Method), so that I can systematically debug complex flows. + +## 5. Continuous Learner +- As a continuous learner, I want deep-dive prompts into specific technologies and best practices, so that I can expand my skill set and adopt industry-standard approaches. + +## 6. Contributor / Collaborator +- As a contributor, I want clear contribution guidelines and scenario-based templates, so that I can easily propose changes or add new prompts aligned with the project structure. + +## 7. Project Owner / Maintainer +- As a project owner, I want an index and concise README that guide users to scenario-specific guides, so that they can find relevant prompts without wading through a monolithic document. \ No newline at end of file diff --git a/utility-tools/pdf_to_markdown.py b/utility-tools/pdf_to_markdown.py new file mode 100644 index 0000000..5221a47 --- /dev/null +++ b/utility-tools/pdf_to_markdown.py @@ -0,0 +1,66 @@ +import io +from pdfminer.high_level import extract_text_to_fp +from pdfminer.layout import LAParams +import os + +def convert_pdf_to_markdown(pdf_path, markdown_path): + """ + Extracts text from a PDF file and saves it as a Markdown file. + + Args: + pdf_path (str): The path to the input PDF file. + markdown_path (str): The path to save the output Markdown file. + + Returns: + bool: True if conversion was successful, False otherwise. + """ + if not os.path.exists(pdf_path): + print(f"Error: PDF file not found at {pdf_path}") + return False + + try: + output_string = io.StringIO() + with open(pdf_path, 'rb') as fin: + extract_text_to_fp(fin, output_string, laparams=LAParams(), output_type='text', codec='') + + markdown_content = output_string.getvalue() + output_string.close() + + with open(markdown_path, 'w', encoding='utf-8') as fout: + fout.write(markdown_content) + + print(f"Successfully converted '{pdf_path}' to '{markdown_path}'") + return True + except Exception as e: + print(f"An error occurred during PDF to Markdown conversion: {e}") + return False + +if __name__ == "__main__": + # --- Configuration --- + pdf_subdirectory = "Google-Prompts-Engineering" # Directory containing the PDF + actual_pdf_filename = "gemini-for-google-workspace-prompting-guide-101.pdf" # Name of the PDF file + actual_markdown_filename = os.path.splitext(actual_pdf_filename)[0] + ".md" + + # Determine workspace root based on the script's location + # Assumes the script is in a subdirectory of the workspace root (e.g., utility-tools) + script_path = os.path.abspath(__file__) # Full path to this script + script_dir = os.path.dirname(script_path) # Directory containing this script (e.g., utility-tools) + workspace_root = os.path.dirname(script_dir) # Assumed workspace root (one level up from script_dir) + + # Construct full paths for the PDF and output Markdown file + pdf_full_path = os.path.join(workspace_root, pdf_subdirectory, actual_pdf_filename) + markdown_full_path = os.path.join(workspace_root, pdf_subdirectory, actual_markdown_filename) + # --- End Configuration --- + + print(f"Attempting to convert: {pdf_full_path}") + + if os.path.exists(pdf_full_path): + convert_pdf_to_markdown(pdf_full_path, markdown_full_path) + else: + print(f"Error: Could not find '{pdf_full_path}'.") + print("Please ensure the PDF file exists at the specified location and the script is run from the workspace root.") + + # Example usage if you want to specify paths directly: + # pdf_input = "path/to/your/document.pdf" + # md_output = "path/to/your/document.md" + # convert_pdf_to_markdown(pdf_input, md_output) \ No newline at end of file diff --git a/writing-new-code.md b/writing-new-code.md new file mode 100644 index 0000000..ec741dd --- /dev/null +++ b/writing-new-code.md @@ -0,0 +1,171 @@ + # AI Coding 101: Writing New Code + + #### 1. Robust feature prompt template + + **Prompt Template:** + ``` + You are an expert [technology] developer. Implement [app/feature description] with these requirements: + - [Requirement 1] + - [Requirement 2] + - [Requirement 3] + Use [technology list], follow best practices, include error handling, and provide unit tests. + ``` + + **Example:** + ``` + You are an expert full-stack developer. Implement a weather tracking app using React (Vite) and TypeScript with these requirements: + - Fetch real-time data from the OpenWeather API. + - Display temperature, humidity, and conditions. + - Handle loading and error states gracefully. + - Include unit tests for data-fetching functions. + ``` +--- + + #### Next.js frontend prompt template + + **Prompt Template:** + ``` + You are an expert Next.js developer. Implement [app/feature description] in a Next.js project with these requirements: + - [Requirement 1] + - [Requirement 2] + - [Requirement 3] + Fetch data using getStaticProps or getServerSideProps, set up dynamic routes with getStaticPaths, and style with [CSS framework]. Include error handling and unit tests. + ``` + + **Example:** + ``` + You are an expert Next.js developer. Build a blog homepage in Next.js with these requirements: + - Create a page at /blog. + - Fetch posts from Contentful using getStaticProps. + - Implement dynamic routes under /blog/[slug] with getStaticPaths. + - Style with Tailwind CSS. + - Handle loading, error, and fallback states. + - Write unit tests for data fetching and page rendering. + ``` +--- + + #### 2. Choose Popular Technologies + + **Recommendations:** + ``` + Frontend: TypeScript, React, Tailwind, ShadCN + Backend: TypeScript, Python, Express.js, FastAPI, Django + Databases: Postgres, MongoDB, Redis + Cloud: Cloud Storage (S3), Supabase Auth, Cloud/Edge Functions + ``` +--- + + #### 3. Design the solution, then implement with AI + + **Prompt:** + ``` + I am building a [feature]. It should work like this: [list of requirements] + We should [implementation tips]. It should also handle these edge cases: [list] + ``` + + **Example:** + ``` + We’re building a search feature. It should perform the search based on the product title and description. + + Create a new component, SearchBar, and add it to the existing NavBar component. Also, create a new search endpoint in the @server.ts file. + + When no results are found, we should display 'No Results' in place of the product list. + ``` +--- + + #### 4. Break things down, give the AI a list of tasks + + **Prompt:** + ``` + Please implement the following: + 1. [Requirement #1] + 2. [Requirement #2] + 3. [Requirement #3] + ``` +--- + + ## 5. Find the right balance of task scope (not too big or small) +--- + + #### 6. Use examples in your prompts + + **Prompt:** + ``` + Please create a [feature] that follows this example: [example] + ``` + + **Example:** + ``` + Create a date formatting function. It should work like this: + 1. Input: '2024-02-07' → Output: 'Feb 7, 2024' + 2. Input: '2024-02-07T15:30:00' → Output: 'Feb 7, 2024 3:30 PM' + ``` +--- + + #### 7. Provide sample code for the AI to follow + + **Prompt:** + ``` + Please create a [feature]. Here is working sample code: [code] + ``` +--- + + #### 8. Use @Docs and @Web context utilities + + **Prompt:** + ``` + Please build a [feature]. Reference the [@Docs / link] docs + ``` + + ``` + Please build a [feature]. Find the best practices and examples for building this on the [@Web] + ``` +--- + + #### 9. Make sure the code is secure and performs well + + **Prompt:** + ``` + Please implement [feature]. Make sure to account for any potential security issues. + ``` + + ``` + We just implemented [feature]. Can you check to make sure that it use the most efficient approach? + ``` +--- + + #### 10. Proactively check for additional considerations + + **Prompt:** + ``` + Are there any additional considerations for building [feature]? + ``` +--- + + #### 11. Ask the AI to write tests & try Test-Driven Development + + **Prompt:** + ``` + Please write the tests for the new feature we just implemented + ``` + + **Test-Driven Development:** + ``` + We are building [feature]. Please write the tests to cover the following cases: [list]. Once complete, build the actual feature. + ``` +--- + + #### 12. Have AI generate your documentation + + **Example:** + ``` + Please add an explanation of this code to our README + ``` +--- + + #### 13. Use precise naming + + **Example:** + ``` + Please create a new csvParser method and add it to the dataParsers.ts file + ``` \ No newline at end of file