todowrite.txt 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
  2. It also helps the user understand the progress of the task and overall progress of their requests.
  3. ## When to Use This Tool
  4. Use this tool proactively in these scenarios:
  5. 1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions
  6. 2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations
  7. 3. User explicitly requests todo list - When the user directly asks you to use the todo list
  8. 4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)
  9. 5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.
  10. 6. After completing a task - Mark it complete and add any new follow-up tasks
  11. 7. When you start working on a new task, mark the todo as in_progress. Ideally you should only have one todo as in_progress at a time. Complete existing tasks before starting new ones.
  12. ## When NOT to Use This Tool
  13. Skip using this tool when:
  14. 1. There is only a single, straightforward task
  15. 2. The task is trivial and tracking it provides no organizational benefit
  16. 3. The task can be completed in less than 3 trivial steps
  17. 4. The task is purely conversational or informational
  18. NOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.
  19. ## Examples of When to Use the Todo List
  20. <example>
  21. User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!
  22. Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.
  23. *Creates todo list with the following items:*
  24. 1. Create dark mode toggle component in Settings page
  25. 2. Add dark mode state management (context/store)
  26. 3. Implement CSS-in-JS styles for dark theme
  27. 4. Update existing components to support theme switching
  28. 5. Run tests and build process, addressing any failures or errors that occur
  29. *Begins working on the first task*
  30. <reasoning>
  31. The assistant used the todo list because:
  32. 1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes
  33. 2. The user explicitly requested tests and build be run afterward
  34. 3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task
  35. </reasoning>
  36. </example>
  37. <example>
  38. User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project
  39. Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.
  40. *Uses grep or search tools to locate all instances of getCwd in the codebase*
  41. Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.
  42. *Creates todo list with specific items for each file that needs updating*
  43. <reasoning>
  44. The assistant used the todo list because:
  45. 1. First, the assistant searched to understand the scope of the task
  46. 2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps
  47. 3. The todo list helps ensure every instance is tracked and updated systematically
  48. 4. This approach prevents missing any occurrences and maintains code consistency
  49. </reasoning>
  50. </example>
  51. <example>
  52. User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.
  53. Assistant: I'll help implement these features. First, let's add all the features to the todo list.
  54. *Creates a todo list breaking down each feature into specific tasks based on the project architecture*
  55. Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.
  56. <reasoning>
  57. The assistant used the todo list because:
  58. 1. The user provided multiple complex features to implement in a comma separated list
  59. 2. The todo list helps organize these large features into manageable tasks
  60. 3. This approach allows for tracking progress across the entire implementation
  61. </reasoning>
  62. </example>
  63. <example>
  64. User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>
  65. Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.
  66. *Reviews component structure, render patterns, state management, and data fetching*
  67. Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.
  68. *Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*
  69. Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>
  70. <reasoning>
  71. The assistant used the todo list because:
  72. 1. First, the assistant examined the codebase to identify specific performance issues
  73. 2. Based on this analysis, it identified multiple optimization opportunities
  74. 3. Performance optimization is a non-trivial task requiring multiple steps
  75. 4. The todo list helps methodically track improvements across different components
  76. 5. This systematic approach ensures all performance bottlenecks are addressed
  77. </reasoning>
  78. </example>
  79. ## Examples of When NOT to Use the Todo List
  80. <example>
  81. User: How do I print 'Hello World' in Python?
  82. Assistant: In Python, you can print "Hello World" with this simple code:
  83. python
  84. print("Hello World")
  85. This will output the text "Hello World" to the console when executed.</assistant>
  86. <reasoning>
  87. The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.
  88. </reasoning>
  89. </example>
  90. <example>
  91. User: What does the git status command do?
  92. Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.
  93. <reasoning>
  94. The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.
  95. </reasoning>
  96. </example>
  97. <example>
  98. User: Can you add a comment to the calculateTotal function to explain what it does?
  99. Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.
  100. * Uses the Edit tool to add a comment to the calculateTotal function *
  101. <reasoning>
  102. The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.
  103. </reasoning>
  104. </example>
  105. <example>
  106. User: Run npm install for me and tell me what happens.
  107. Assistant: I'll run the npm install command for you.
  108. *Executes: npm install*
  109. The command completed successfully. Here's the output:
  110. [Output of npm install command]
  111. All dependencies have been installed according to your package.json file.
  112. <reasoning>
  113. The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.
  114. </reasoning>
  115. </example>
  116. ## Task States and Management
  117. 1. **Task States**: Use these states to track progress:
  118. - pending: Task not yet started
  119. - in_progress: Currently working on (limit to ONE task at a time)
  120. - completed: Task finished successfully
  121. - cancelled: Task no longer needed
  122. 2. **Task Management**:
  123. - Update task status in real-time as you work
  124. - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
  125. - Only have ONE task in_progress at any time
  126. - Complete current tasks before starting new ones
  127. - Cancel tasks that become irrelevant
  128. 3. **Task Breakdown**:
  129. - Create specific, actionable items
  130. - Break complex tasks into smaller, manageable steps
  131. - Use clear, descriptive task names
  132. When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.