plan-and-act.mdx 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. ---
  2. title: "Plan & Act"
  3. sidebarTitle: "Plan & Act"
  4. ---
  5. Plan & Act modes represent Cline's approach to structured AI development, emphasizing thoughtful planning before implementation. This dual-mode system helps developers create more maintainable, accurate code while reducing iteration time.
  6. <Frame>
  7. <iframe
  8. style={{ width: "100%", aspectRatio: "16/9" }}
  9. src="https://www.youtube.com/embed/b7o6URFPp64"
  10. title="YouTube video player"
  11. frameBorder="0"
  12. allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
  13. allowFullScreen></iframe>
  14. </Frame>
  15. #### Plan Mode: Think First
  16. Plan mode is where you and Cline figure out what you're trying to build and how you'll build it. In this mode, Cline:
  17. - Can read your entire codebase to understand the context
  18. - Won't make any changes to your files
  19. - Focuses on understanding requirements and creating a strategy
  20. - Helps identify potential issues before you write a single line of code
  21. <Tip>
  22. Try [Dictation](/features/dictation) in Plan mode - instead of typing out complex requirements, you can speak naturally and share your complete thought process. It's perfect for rapid back-and-forth planning discussions.
  23. </Tip>
  24. #### Act Mode: Build It
  25. Once you've got a plan, you switch to Act mode. Now Cline:
  26. - Has all the building capabilities at its disposal
  27. - Can make changes to your codebase
  28. - Still remembers everything from your planning session
  29. - Executes the strategy you worked out together
  30. <Frame>
  31. <img src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(5).png" alt="Act mode capabilities" />
  32. </Frame>
  33. ### Workflow Guide
  34. When I'm working on a new feature or fixing a complex bug, here's what works for me:
  35. 1. I start in Plan mode and tell Cline what I want to build
  36. 2. Cline helps me explore the codebase, looking at relevant files
  37. 3. Together we figure out the best approach, considering edge cases and potential issues
  38. 4. When I'm confident in our plan, I switch to Act mode
  39. 5. Cline implements the solution based on our planning
  40. #### 1. Start with Plan Mode
  41. Begin every significant development task in Plan mode:
  42. In this mode:
  43. <Frame>
  44. <img src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(5)%20(1).png" alt="Plan mode workflow" />
  45. </Frame>
  46. - Share your requirements
  47. - Let Cline analyze relevant files
  48. - Engage in dialogue to clarify objectives
  49. - Develop implementation strategy
  50. <Frame>
  51. <img
  52. src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(2)%20(1)%20(1)%20(1).png"
  53. alt="Planning phase"
  54. />
  55. </Frame>
  56. #### 2. Switch to Act Mode
  57. Once you have a clear plan, switch to Act mode:
  58. <Frame>
  59. <img src="https://storage.googleapis.com/cline_public_images/docs/assets/switching-to-act.gif" alt="Switching to Act mode" />
  60. </Frame>
  61. Act mode allows Cline to:
  62. - Execute against the agreed plan
  63. - Make changes to your codebase
  64. - Maintain context from planning phase
  65. #### 3. Iterate as Needed
  66. Complex projects often require multiple plan-act cycles:
  67. - Return to Plan mode when encountering unexpected complexity
  68. - Use Act mode for implementing solutions
  69. - Maintain development momentum while ensuring quality
  70. ### Best Practices
  71. #### Planning Phase
  72. 1. Be comprehensive with requirements
  73. 2. Share relevant context upfront
  74. 3. Point Cline to relevant files if he hasn't read them
  75. 4. Validate approach before implementation
  76. #### Implementation Phase
  77. 1. Follow the established plan
  78. 2. Monitor progress against objectives
  79. 3. Track changes and their impact
  80. 4. Document significant decisions
  81. <Frame>
  82. <img
  83. src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(3)%20(1).png"
  84. alt="Implementation best practices"
  85. />
  86. </Frame>
  87. ### Power User Tips
  88. #### Enhancing Planning
  89. - Use Plan mode to explore edge cases before implementation
  90. - Switch back to Plan when encountering unexpected complexity
  91. - Leverage [file reading](/features/at-mentions/file-mentions) to validate assumptions early
  92. - Have Cline write markdown files of the plan for future reference
  93. ### Common Patterns
  94. #### When to Use Each Mode
  95. I've found Plan mode works best when:
  96. - Starting something new where the approach isn't obvious
  97. - Debugging a tricky issue where I'm not sure what's wrong
  98. - Making architectural decisions that will affect multiple parts of the codebase
  99. - Trying to understand a complex workflow or feature
  100. And Act mode is perfect for:
  101. - Implementing a solution we've already planned out
  102. - Making routine changes where the approach is clear
  103. - Following established patterns in the codebase
  104. - Running tests and making minor adjustments
  105. <Frame>
  106. <img src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(6).png" alt="Mode usage patterns" />
  107. </Frame>
  108. ### Contributing
  109. Share your experiences and improvements:
  110. - Join our [Discord community](https://discord.gg/cline)
  111. - Participate in discussions
  112. - Submit feature requests
  113. - Report issues
  114. ---
  115. Remember: The time invested in planning pays dividends in implementation quality and maintenance efficiency.