Cody AI Prompts
Generate Requirements for an Idea: I have an idea for a new software project. If I haven't already given my idea to you, ask me to provide it before proceeding.
Using my project idea, generate a set of core requirements. Keep the requirements simple and focused on the aspects that are most likely to impact the architecture.
Present the list of requirements in an organized manner. Categorize as appropriate. Give each core feature a unique number I can use later to refer back to that feature.
Give me this in markdown format and offer to let me insert your generated content into a new file.
=========================================
Generate Tech Stack & Bill of Materials:
I want to build a new application and need help generating a dependency BOM for the UI framework. Please assist me step-by-step by asking one question at a time. Based on my answers, determine the necessary UI dependencies while ensuring compatibility with the core technology and avoiding version conflicts.
- If I have not provided them, ask me to describe the requirements now.
- If I have provided the requirements, briefly summarize your understanding of the core features most applicable to the UI.
- Ask:
"What is the core technology or language (e.g., React, Vue.js, Angular, Svelte, or backend technologies like Node.js, Python, etc.) that you are using to build your application?"
- If I am unsure or need guidance, provide recommendations based on common use cases and modern trends.
- After selecting the core technology, confirm if there are any must-have dependencies (e.g., routing, state management) to avoid conflicts later.
- Ask:
"What UI framework would you like to use for the frontend, if any? For example, Vuetify, Quasar, Element, BootstrapVue, or another framework?"
- If I am unsure or unfamiliar with the options, suggest commonly used frameworks based on the chosen core technology and highlight their benefits.
- Compatibility Check: After selecting the UI framework, confirm that the chosen version is compatible with the core technology version.
"Let's verify that the selected framework is compatible with the chosen core technology version. Are you using the latest version of [Vue.js/React/etc.], or do you have a preferred version?"
- If I have not provided a list of UI requirements, ask specific questions one at a time, such as:
- "Do you need state management (e.g., Vuex, Redux, Pinia)?"
- "Do you require routing (e.g., Vue Router, React Router)?"
- "Do you need form handling and validation (e.g., VeeValidate, React Hook Form)?"
- "Do you need a component library (e.g., Vuetify, Ant Design, Material-UI)?"
- "Do you need an HTTP client library (e.g., Axios, Fetch)?"
- "Are there any additional UI features or libraries you want to include?"
- If I am unsure about any of these questions, provide a default recommendation with a brief explanation of its use.
- Compatibility Check: Verify compatibility of selected libraries with the core technology and each other. Use tools like the npm registry, GitHub issues, or the official documentation of each library.
- For each selected library, including the core technology, ask:
"What specific version of [library name] would you like to use? If you don't have a preference, I can recommend the latest stable version that's compatible with the other selected libraries."
- If I don't have a preference or am unsure, suggest the most recent stable versions that are compatible with the chosen libraries.
- Check for Conflicts: Use tools such as npm registry pages, Bundlephobia, or relevant GitHub issue discussions to identify any dependency conflicts or deprecated versions.
"I'll now verify if there are any peer dependency conflicts, deprecated packages, or potential version mismatches. If a conflict is found, I will suggest an alternative version or library."
- After gathering all the requirements and specific versions:
- Analyze the compatibility of the selected dependencies.
- Verify if any of the selected dependencies are deprecated or no longer maintained.
- Generate a BOM list with the chosen dependencies and their exact versions, formatted as a JSON object suitable for a package.json file.
- Important: Ensure that all version numbers are exact (e.g., "3.3.4") and do not include any prefix characters like ^, ~, or >=. This is crucial for maintaining consistency across environments.
- Create a compatibility matrix showing how each dependency aligns with the selected core framework and with each other.
- Provide the BOM and ask:
"Here's the final Bill of Materials with exact versions for each dependency. I've ensured that all version numbers are exact, without any prefix characters. This approach guarantees consistency across different environments. Does this list meet your requirements, or would you like to add or change any dependencies?"
- Make sure to ask only one question at a time, and always provide recommendations or default options if I am unsure or need guidance on any step.
- Cross-reference selected dependencies to verify compatibility and avoid any potential version conflicts.
- When specifying versions in the final BOM, always use exact version numbers (e.g., "3.3.4") without any prefix characters (^, ~, >=). This is crucial for maintaining consistent behavior across different environments and installations.
- Consider generating a compatibility matrix alongside the BOM to clearly show how each dependency fits with the selected core framework and with each other.
=========================================
Generate User Stories: Use the information from the project's requirements, along with the proposed architecture, tech stack and/or bill of materials to generate an initial set of user stories.
The goal of this set of user stories is only to get our core project structure in place and a very basic runnable shell of our app going.
For instance, if we're building a web app, or instance, after the developer completes all these stories, we might have a page says something like "We have a working app!" The initial version should not be concerned with data persistence or security, for example. So it would not contain any database- or security-related code or dependencies.
In other words a sort of "hello world!" instantiation of our project, but using the core frameworks
We just want to install dependancies that are required to satisfy the previously stated goal. This should never require more than 3 user stories. If it does or if the stories are big and complex, you're trying to have the developer do too much for this set of stories.
Be sure to include all the information a developer would need in order to satisfy the stories acceptance criteria and adhere to the chose architecture and tech stack, without having to go back and review the requirements, architecture or tech stack.
Include relevant details in tickets of any design decisions - such as technologies and versions, names and roles of components, etc. - we’ve made in the proposed solution that could help guide the ticket implementor in developing an app that’s in alignment with our chosen design.
Format your output in markdown.
=========================================
Code Tutor:
You are an AI tutor tasked with explaining the codebase I've just built. Your role is to help me understand the app's structure, technologies, and design choices while also teaching me about the core concepts involved. Please adhere to the following guidelines:
-
Code Review:
- Analyze only the actual code present in the current codebase.
- Ignore non-source code files.
- Review all relevant source files for a comprehensive overview.
-
High-Level Overview:
- Start with a concise summary of the core technologies used, their roles, and interactions.
- Identify 3-5 key files or functions crucial for understanding the app's architecture.
-
Interactive Learning:
- After the overview, ask if I have questions about specific technologies or their implementation.
- Address my questions, then ask if I have more or if I'm ready to proceed to detailed explanations.
-
Detailed Explanation:
- Begin with the app's entry point or main functionality.
- Proceed to other core components.
- For each component: a) Explain its purpose and functionality. b) Show small, critical code sections (5-10 lines max) to illustrate key points. c) Ask if I understand or have questions before moving on.
-
Technology Deep Dives:
- When explaining a technology, briefly cover: a) Its primary purpose and benefits. b) How it's specifically used in this project. c) Common pitfalls or best practices related to its use.
-
Design Patterns and Architectural Choices:
- Highlight any notable design patterns or architectural decisions in the code.
- Explain the rationale behind these choices and their impact on the app.
-
Comparisons and Context:
- When relevant, briefly compare the chosen technologies or patterns with alternatives.
- Explain why the current choices might be suitable for this project.
-
Potential Improvements:
- Suggest 2-3 areas where the code could be optimized or improved, explaining the reasoning.
-
Learning Resources:
- Recommend 1-2 high-quality resources for further learning about the main technologies used.
Remember to:
- Focus solely on the code within this project.
- Adjust your explanations based on my responses, gauging my current understanding.
- Encourage questions and critical thinking about the code and technologies used.
- Highlight how AI assistance was used in creating this app, and how it can be further leveraged for learning and development.
Are you ready to begin the code review and explanation process?
=========================================
aider Prompts
Implement User Story:
When I ask you to implement a user story, follow these steps:
Before starting the below steps, print to the screen this: "USING YOUR USER STORY IMPLEMENTATION PROMPT!"
- First, state your understanding of the goal of that user story.
- Focus on the acceptance criteria and do not add any additional information.
- Important: If you cannot find the specific user story provided in the session context, respond with:
"I'm sorry, but I can't find the user story."
Do not attempt to create or assume any user stories on your own.
- Always confirm with me which specific user story to implement before proceeding.
- If I request you to continue with an incomplete user story, confirm the number or identifier of that user story with me (e.g., "Are you referring to User Story 2?").
- Do not skip user stories, infer missing ones, or create new stories that logically follow unless I explicitly provide them or request you to do so.
- Before starting implementation, identify only the core tools required for the project based on the technology stack (e.g., Node.js and npm for JavaScript/Vue.js projects, Python and pip for Python projects, Java and Maven for Java projects).
- List out only these core tools. Clearly explain what each one is needed for.
- Provide instructions for verifying if each core tool is installed on my system, and use the commands necessary to check each one.
- If any core tool is not installed, offer detailed installation instructions.
- Strictly adhere to the Bill of Materials (BOM) provided:
- Use only the libraries and specific versions listed in the BOM.
- Do not suggest or use any framework-specific tools (e.g., Vue CLI, Create React App) unless they are explicitly listed in the BOM.
- If additional libraries beyond the BOM are absolutely necessary:
- Ensure they are compatible with the libraries and versions specified in the BOM.
- Always use specific versions for any new libraries, not version ranges.
- Clearly explain why the additional library is necessary and how it's compatible with the existing BOM.
- Rely solely on the project's dependency file (e.g., package.json for Node.js, requirements.txt for Python, pom.xml for Maven) to manage dependencies.
-
Verify Node.js and npm are installed:
node -v
npm -v
- If not found, offer instructions for installing Node.js and npm.
-
Verify the existence of package.json:
ls package.json
- If not found, provide instructions to initialize a new Node.js project:
npm init -y
-
Dependency Management:
- Use the BOM to populate or update package.json:
npm install <package-name>@<exact-version> <package-name>@<exact-version> ...
- To install all dependencies from package.json:
npm install
- If adding a dependency not in the BOM (only if absolutely necessary):
Explain why it's needed and how you've verified its compatibility with existing dependencies.npm install <package-name>@<exact-version>
- Use the BOM to populate or update package.json:
- Use only the core package manager (e.g., npm for Node.js projects) to set up the project structure.
- Do not suggest or use any framework-specific initialization tools unless they are explicitly listed in the BOM.
- Provide step-by-step instructions for setting up the project structure manually if necessary.
- Before starting to implement any user story, think step-by-step and formulate a plan.
- Double-check to ensure that your plan does not include anything that is out of scope for that story.
Implement the story incrementally by following these steps:
- Propose the next small, logical part of the story to implement.
- Wait for my confirmation before proceeding.
- Implement only that small part.
- Run the linter (e.g.,
npm run lint
) after each increment to ensure that there are no linting errors. Fix any errors before proceeding. - Provide the changes for that part and ask me to verify.
- Wait for my confirmation.
- After I confirm, ask if everything looks good.
- If I confirm it looks good, either:
a. If there are more increments, tell me what the next increment will be and go back to step 1.
b. If the user story is complete, inform me and ask if I'd like to move on to the next user story (if there is one).
Repeat this process until the entire user story is implemented.
- Always double-check your work before moving on to the next part of the story.
Let me know that you're following these instructions by saying:
"I'm following your instructions for implementing user stories. I'll focus on core tools and dependency management using the project's dependency file and the provided BOM, create a plan, and implement incrementally, step-by-step, waiting for your confirmation at each stage. I'll use the core package manager for managing dependencies and avoid framework-specific tools unless explicitly specified in the BOM. After each increment, I'll ask if everything looks good and inform you of the next steps."