[
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# AI Dev Tasks\n\nWelcome to **AI Dev Tasks**! This repository provides a collection of markdown files designed to supercharge your feature development workflow with AI-powered IDEs and CLIs. These tools work with any AI coding assistant including [Amp](https://ampcode.com), Claude Code, Windsurf, and others. By leveraging these structured prompts, you can systematically approach building features, from ideation to implementation, with built-in checkpoints for verification.\n\nStop wrestling with monolithic AI requests and start guiding your AI collaborator step-by-step!\n\n## The Core Idea\n\nBuilding complex features with AI can sometimes feel like a black box. This workflow aims to bring structure, clarity, and control to the process by:\n\n1. **Defining Scope:** Clearly outlining what needs to be built with a Product Requirement Document (PRD).\n2. **Detailed Planning:** Breaking down the PRD into a granular, actionable task list.\n3. **Iterative Implementation:** Guiding the AI to tackle one task at a time, allowing you to review and approve each change.\n\nThis structured approach helps ensure the AI stays on track, makes it easier to debug issues, and gives you confidence in the generated code.\n\n## Workflow: From Idea to Implemented Feature\n\nHere's the step-by-step process using the `.md` files in this repository:\n\n### 1. Create a Product Requirement Document (PRD)\n\nFirst, lay out the blueprint for your feature. A PRD clarifies what you're building, for whom, and why.\n\nYou can create a lightweight PRD directly within your AI tool of choice:\n\n1. Ensure you have the `create-prd.md` file from this repository accessible.\n2. In your AI tool, initiate PRD creation:\n\n    ```text\n    Use @create-prd.md\n    Here's the feature I want to build: [Describe your feature in detail]\n    Reference these files to help you: [Optional: @file1.py @file2.ts]\n    ```\n\n\n    ![Example of initiating PRD creation](https://pbs.twimg.com/media/Go6DDlyX0AAS7JE?format=jpg&name=large)\n\n### 2. Generate Your Task List from the PRD\n\nWith your PRD drafted (e.g., `MyFeature-PRD.md`), the next step is to generate a detailed, step-by-step implementation plan for your AI Developer.\n\n1. Ensure you have `generate-tasks.md` accessible.\n2. In your AI tool, use the PRD to create tasks:\n\n    ```text\n    Now take @MyFeature-PRD.md and create tasks using @generate-tasks.md\n    ```\n    *(Note: Replace `@MyFeature-PRD.md` with the actual filename of the PRD you generated in step 1.)*\n\n    ![Example of generating tasks from PRD](https://pbs.twimg.com/media/Go6FITbWkAA-RCT?format=jpg&name=medium)\n\n### 3. Examine Your Task List\n\nYou'll now have a well-structured task list, often with tasks and sub-tasks, ready for the AI to start working on. This provides a clear roadmap for implementation.\n\n![Example of a generated task list](https://pbs.twimg.com/media/Go6GNuOWsAEcSDm?format=jpg&name=medium)\n\n### 4. Instruct the AI to Work Through Tasks (and Mark Completion)\n\nTo ensure methodical progress and allow for verification, instruct the AI to work through the task list one sub-task at a time.\n\n1. In your AI tool, tell the AI to start with the first task (e.g., `1.1`):\n\n    ```text\n    Please start on task 1.1 from the generated task list.\n    ```\n\n    The AI will attempt the task and then prompt you to review.\n\n    ![Example of starting on a task](https://pbs.twimg.com/media/Go6I41KWcAAAlHc?format=jpg&name=medium)\n\n### 5. Progress\n\nThe AI will continue working through the remaining tasks in the list.\n\n![Example of a progressing task list with completed items](https://pbs.twimg.com/media/Go6KrXZWkAA_UuX?format=jpg&name=medium)\n\nWhile it's not always perfect, this method has proven to be a very reliable way to build out larger features with AI assistance.\n\n### Video Demonstration\n\nIf you'd like to see this in action, I demonstrated it on [Claire Vo's \"How I AI\" podcast](https://www.youtube.com/watch?v=fD4ktSkNCw4).\n\n[![Demonstration of AI Dev Tasks on How I AI Podcast](https://img.youtube.com/vi/fD4ktSkNCw4/maxresdefault.jpg)](https://www.youtube.com/watch?v=fD4ktSkNCw4).\n\n## Files in this Repository\n\n* **`create-prd.md`**: Guides the AI in generating a Product Requirement Document for your feature.\n* **`generate-tasks.md`**: Takes a PRD markdown file as input and helps the AI break it down into a detailed, step-by-step implementation task list.\n\n## Benefits\n\n* **Structured Development:** Enforces a clear process from idea to code.\n* **Step-by-Step Verification:** Allows you to review and approve AI-generated code at each small step, ensuring quality and control.\n* **Manages Complexity:** Breaks down large features into smaller, digestible tasks for the AI, reducing the chance of it getting lost or generating overly complex, incorrect code.\n* **Improved Reliability:** Offers a more dependable approach to leveraging AI for significant development work compared to single, large prompts.\n* **Clear Progress Tracking:** Provides a visual representation of completed tasks, making it easy to see how much has been done and what's next.\n\n## How to Use\n\n1. **Clone or Download:** Get these `.md` files into your project or a central location where your AI tool can access them.\n   ```bash\n   git clone https://github.com/snarktank/ai-dev-tasks.git\n   ```\n2. **Follow the Workflow:** Systematically use the `.md` files in your AI assistant as described in the workflow above.\n3. **Adapt and Iterate:**\n    * Feel free to modify the prompts within the `.md` files to better suit your specific needs or coding style.\n    * If the AI struggles with a task, try rephrasing your initial feature description or breaking down tasks even further.\n\n\n\n## Tips for Success\n\n* **Be Specific:** The more context and clear instructions you provide (both in your initial feature description and any clarifications), the better the AI's output will be.\n* **Correct File Tagging:** Always ensure you're accurately tagging the PRD filename (e.g., `@MyFeature-PRD.md`) when generating tasks.\n* **Patience and Iteration:** AI is a powerful tool, but it's not magic. Be prepared to guide, correct, and iterate. This workflow is designed to make that iteration process smoother.\n\n## Contributing\n\nGot ideas to improve these `.md` files or have new ones that fit this workflow? Contributions are welcome!\n\nPlease feel free to:\n\n* Open an issue to discuss changes or suggest new features.\n* Submit a pull request with your enhancements.\n\n---\n\nHappy AI-assisted developing!\n"
  },
  {
    "path": "create-prd.md",
    "content": "# Rule: Generating a Product Requirements Document (PRD)\n\n## Goal\n\nTo guide an AI assistant in creating a detailed Product Requirements Document (PRD) in Markdown format, based on an initial user prompt. The PRD should be clear, actionable, and suitable for a junior developer to understand and implement the feature.\n\n## Process\n\n1.  **Receive Initial Prompt:** The user provides a brief description or request for a new feature or functionality.\n2.  **Ask Clarifying Questions:** Before writing the PRD, the AI *must* ask only the most essential clarifying questions needed to write a clear PRD. Limit questions to 3-5 critical gaps in understanding. The goal is to understand the \"what\" and \"why\" of the feature, not necessarily the \"how\" (which the developer will figure out). Make sure to provide options in letter/number lists so I can respond easily with my selections.\n3.  **Generate PRD:** Based on the initial prompt and the user's answers to the clarifying questions, generate a PRD using the structure outlined below.\n4.  **Save PRD:** Save the generated document as `prd-[feature-name].md` inside the `/tasks` directory.\n\n## Clarifying Questions (Guidelines)\n\nAsk only the most critical questions needed to write a clear PRD. Focus on areas where the initial prompt is ambiguous or missing essential context. Common areas that may need clarification:\n\n*   **Problem/Goal:** If unclear - \"What problem does this feature solve for the user?\"\n*   **Core Functionality:** If vague - \"What are the key actions a user should be able to perform?\"\n*   **Scope/Boundaries:** If broad - \"Are there any specific things this feature *should not* do?\"\n*   **Success Criteria:** If unstated - \"How will we know when this feature is successfully implemented?\"\n\n**Important:** Only ask questions when the answer isn't reasonably inferable from the initial prompt. Prioritize questions that would significantly impact the PRD's clarity.\n\n### Formatting Requirements\n\n- **Number all questions** (1, 2, 3, etc.)\n- **List options for each question as A, B, C, D, etc.** for easy reference\n- Make it simple for the user to respond with selections like \"1A, 2C, 3B\"\n\n### Example Format\n\n```\n1. What is the primary goal of this feature?\n   A. Improve user onboarding experience\n   B. Increase user retention\n   C. Reduce support burden\n   D. Generate additional revenue\n\n2. Who is the target user for this feature?\n   A. New users only\n   B. Existing users only\n   C. All users\n   D. Admin users only\n\n3. What is the expected timeline for this feature?\n   A. Urgent (1-2 weeks)\n   B. High priority (3-4 weeks)\n   C. Standard (1-2 months)\n   D. Future consideration (3+ months)\n```\n\n## PRD Structure\n\nThe generated PRD should include the following sections:\n\n1.  **Introduction/Overview:** Briefly describe the feature and the problem it solves. State the goal.\n2.  **Goals:** List the specific, measurable objectives for this feature.\n3.  **User Stories:** Detail the user narratives describing feature usage and benefits.\n4.  **Functional Requirements:** List the specific functionalities the feature must have. Use clear, concise language (e.g., \"The system must allow users to upload a profile picture.\"). Number these requirements.\n5.  **Non-Goals (Out of Scope):** Clearly state what this feature will *not* include to manage scope.\n6.  **Design Considerations (Optional):** Link to mockups, describe UI/UX requirements, or mention relevant components/styles if applicable.\n7.  **Technical Considerations (Optional):** Mention any known technical constraints, dependencies, or suggestions (e.g., \"Should integrate with the existing Auth module\").\n8.  **Success Metrics:** How will the success of this feature be measured? (e.g., \"Increase user engagement by 10%\", \"Reduce support tickets related to X\").\n9.  **Open Questions:** List any remaining questions or areas needing further clarification.\n\n## Target Audience\n\nAssume the primary reader of the PRD is a **junior developer**. Therefore, requirements should be explicit, unambiguous, and avoid jargon where possible. Provide enough detail for them to understand the feature's purpose and core logic.\n\n## Output\n\n*   **Format:** Markdown (`.md`)\n*   **Location:** `/tasks/`\n*   **Filename:** `prd-[feature-name].md`\n\n## Final instructions\n\n1. Do NOT start implementing the PRD\n2. Make sure to ask the user clarifying questions\n3. Take the user's answers to the clarifying questions and improve the PRD\n"
  },
  {
    "path": "generate-tasks.md",
    "content": "# Rule: Generating a Task List from User Requirements\n\n## Goal\n\nTo guide an AI assistant in creating a detailed, step-by-step task list in Markdown format based on user requirements, feature requests, or existing documentation. The task list should guide a developer through implementation.\n\n## Output\n\n- **Format:** Markdown (`.md`)\n- **Location:** `/tasks/`\n- **Filename:** `tasks-[feature-name].md` (e.g., `tasks-user-profile-editing.md`)\n\n## Process\n\n1.  **Receive Requirements:** The user provides a feature request, task description, or points to existing documentation\n2.  **Analyze Requirements:** The AI analyzes the functional requirements, user needs, and implementation scope from the provided information\n3.  **Phase 1: Generate Parent Tasks:** Based on the requirements analysis, create the file and generate the main, high-level tasks required to implement the feature. **IMPORTANT: Always include task 0.0 \"Create feature branch\" as the first task, unless the user specifically requests not to create a branch.** Use your judgement on how many additional high-level tasks to use. It's likely to be about 5. Present these tasks to the user in the specified format (without sub-tasks yet). Inform the user: \"I have generated the high-level tasks based on your requirements. Ready to generate the sub-tasks? Respond with 'Go' to proceed.\"\n4.  **Wait for Confirmation:** Pause and wait for the user to respond with \"Go\".\n5.  **Phase 2: Generate Sub-Tasks:** Once the user confirms, break down each parent task into smaller, actionable sub-tasks necessary to complete the parent task. Ensure sub-tasks logically follow from the parent task and cover the implementation details implied by the requirements.\n6.  **Identify Relevant Files:** Based on the tasks and requirements, identify potential files that will need to be created or modified. List these under the `Relevant Files` section, including corresponding test files if applicable.\n7.  **Generate Final Output:** Combine the parent tasks, sub-tasks, relevant files, and notes into the final Markdown structure.\n8.  **Save Task List:** Save the generated document in the `/tasks/` directory with the filename `tasks-[feature-name].md`, where `[feature-name]` describes the main feature or task being implemented (e.g., if the request was about user profile editing, the output is `tasks-user-profile-editing.md`).\n\n## Output Format\n\nThe generated task list _must_ follow this structure:\n\n```markdown\n## Relevant Files\n\n- `path/to/potential/file1.ts` - Brief description of why this file is relevant (e.g., Contains the main component for this feature).\n- `path/to/file1.test.ts` - Unit tests for `file1.ts`.\n- `path/to/another/file.tsx` - Brief description (e.g., API route handler for data submission).\n- `path/to/another/file.test.tsx` - Unit tests for `another/file.tsx`.\n- `lib/utils/helpers.ts` - Brief description (e.g., Utility functions needed for calculations).\n- `lib/utils/helpers.test.ts` - Unit tests for `helpers.ts`.\n\n### Notes\n\n- Unit tests should typically be placed alongside the code files they are testing (e.g., `MyComponent.tsx` and `MyComponent.test.tsx` in the same directory).\n- Use `npx jest [optional/path/to/test/file]` to run tests. Running without a path executes all tests found by the Jest configuration.\n\n## Instructions for Completing Tasks\n\n**IMPORTANT:** As you complete each task, you must check it off in this markdown file by changing `- [ ]` to `- [x]`. This helps track progress and ensures you don't skip any steps.\n\nExample:\n- `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing)\n\nUpdate the file after completing each sub-task, not just after completing an entire parent task.\n\n## Tasks\n\n- [ ] 0.0 Create feature branch\n  - [ ] 0.1 Create and checkout a new branch for this feature (e.g., `git checkout -b feature/[feature-name]`)\n- [ ] 1.0 Parent Task Title\n  - [ ] 1.1 [Sub-task description 1.1]\n  - [ ] 1.2 [Sub-task description 1.2]\n- [ ] 2.0 Parent Task Title\n  - [ ] 2.1 [Sub-task description 2.1]\n- [ ] 3.0 Parent Task Title (may not require sub-tasks if purely structural or configuration)\n```\n\n## Interaction Model\n\nThe process explicitly requires a pause after generating parent tasks to get user confirmation (\"Go\") before proceeding to generate the detailed sub-tasks. This ensures the high-level plan aligns with user expectations before diving into details.\n\n## Target Audience\n\nAssume the primary reader of the task list is a **junior developer** who will implement the feature.\n"
  }
]