Prompts in
Software Development
The following experts will collaborate to design an efficient algorithm for [specific problem]:
- **Algorithm Designer**: Proposes an initial algorithmic approach.
- **Performance Analyst**: Evaluates the proposed algorithm's time and space complexity.
- **Security Auditor**: Identifies potential security risks in the algorithm.
**Process**:
1. **Algorithm Designer**: Propose an initial algorithm for [specific problem].
2. **Performance Analyst**: Assess the algorithm's efficiency and suggest improvements.
3. **Security Auditor**: Review the algorithm for security vulnerabilities and recommend mitigations.
4. **Collaborative Refinement**: The experts discuss and refine the algorithm based on the analyses.
5. **Final Algorithm**: Present the optimized and secure algorithm, including pseudocode and explanations.
Generate a [programming language] function that [performs specific task].
1. **Initial Code Generation**: Create the function based on the provided specifications.
2. **Self-Critique**: Review the generated code, identifying potential security vulnerabilities, inefficiencies, or areas for improvement.
3. **Refinement**: Revise the code to address the identified issues, enhancing security and performance.
4. **Explanation**: Provide a summary of the improvements made and the rationale behind them.
Can you provide a few test cases, including edge cases, that might break the following function or logic? [insert code or logic description] Please explain why each test case is important.
Act as a code reviewer. Here is a snippet that isn't working as expected:
[insert code]
Please review it and point out any mistakes, bad practices, or potential issues that could be causing problems. Provide suggestions for improvement and explain your reasoning.
Generate three different solutions to the following problem: [insert problem]. Then, analyze these solutions and provide the most efficient and readable one. Explain your reasoning for choosing this solution.
Solve the following problem step by step:
Problem: [Insert your problem statement here]
Please provide your solution, explaining each step of your thought process and implementation.
I will explain what this function is doing: [your explanation]. Given that, is my reasoning correct and does it reveal where the bug is? Please critique my explanation and point out any logical flaws or mistakes you notice.
Write a [language] code example that accomplishes the following task: [describe the task or algorithm]. Ensure the code is well-commented and follows best practices.
Summarize the following codebase, including the directory structure and the main purpose of each file. Highlight key dependencies, entry points, and any unique architectural decisions. Here is the codebase:
[Paste code snippets and directory tree here]
You are a senior software engineer. Refactor and optimize the following code for better performance, readability, and maintainability. Do not change its functionality. Explain the changes you make and why they improve the code. Here is the code:
[Paste your code here]
You are a debugging assistant. Analyze the following code and identify any errors, bugs, or unexpected behaviors. Explain each issue step by step, and provide corrected code with explanations for each fix. Here is the code:
[Paste your code here]
You are an expert software engineer. Review the following code for correctness, efficiency, readability, and maintainability. Identify any bugs, suggest improvements, and explain your reasoning. If relevant, recommend best practices or alternative approaches. Here is the code:
[Paste your code here]
Help me to solve the issue and write updated code. Also explain what the issue was and what you did to fix it.
Issue (optional): [explain issue]
Code: [paste your code]
First, identify the key variables in the following scenario. Next, analyze how these variables interact. Finally, predict the likely outcome and explain your reasoning at each stage. Scenario:
[describe your scenario or code]
Generate three different solutions to the following problem. Then, compare and analyze these solutions for efficiency, readability, and correctness. Select the best one and explain your reasoning for choosing it. Problem:
[describe your problem]
Solve the following problem step by step. For each step, explain your reasoning and how it contributes to the solution. Do not skip any intermediate steps. Problem:
[describe your problem]
You are a systematic debugger. Given the following code and a description of the issue, analyze the logic step by step. Identify possible logical errors, edge cases, and suggest corrections. For each step, explain your reasoning and how it leads to the next. Code:
[paste your code]
Issue:
[describe the observed issue]
Share three best practices for crafting prompts to use with GitHub Copilot that improve the quality and relevance of code suggestions.
I want you to act as a prompt generator for programming tasks. Given a title like 'Debugging Helper' or 'Code Documentation Assistant', generate a clear and actionable prompt that can be used to instruct an AI model to perform that task effectively.
Provide examples of operations in PowerShell where .NET classes are more efficient than built-in cmdlets. Explain why using .NET classes improves performance or functionality in these cases.
I want you to act as a code review helper. I will provide you with code snippets, and you will analyze them for potential bugs, style issues, and improvements. Provide clear, constructive feedback and suggest best practices for writing clean and efficient code. Do not write explanations beyond the review comments. My first code snippet is: [insert code here].