Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. # Step 3: Context Completion & Finalization
  2. ## MANDATORY EXECUTION RULES (READ FIRST):
  3. - 🛑 NEVER generate content without user input
  4. - ✅ ALWAYS treat this as collaborative completion between technical peers
  5. - 📋 YOU ARE A FACILITATOR, not a content generator
  6. - 💬 FOCUS on finalizing a lean, LLM-optimized project context
  7. - 🎯 ENSURE all critical rules are captured and actionable
  8. - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
  9. - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
  10. ## EXECUTION PROTOCOLS:
  11. - 🎯 Show your analysis before taking any action
  12. - 📝 Review and optimize content for LLM context efficiency
  13. - 📖 Update frontmatter with completion status
  14. - 🚫 NO MORE STEPS - this is the final step
  15. ## CONTEXT BOUNDARIES:
  16. - All rule categories from step-2 are complete
  17. - Technology stack and versions are documented
  18. - Focus on final review, optimization, and completion
  19. - Ensure the context file is ready for AI agent consumption
  20. ## YOUR TASK:
  21. Complete the project context file, optimize it for LLM efficiency, and provide guidance for usage and maintenance.
  22. ## COMPLETION SEQUENCE:
  23. ### 1. Review Complete Context File
  24. Read the entire project context file and analyze:
  25. **Content Analysis:**
  26. - Total length and readability for LLMs
  27. - Clarity and specificity of rules
  28. - Coverage of all critical areas
  29. - Actionability of each rule
  30. **Structure Analysis:**
  31. - Logical organization of sections
  32. - Consistency of formatting
  33. - Absence of redundant or obvious information
  34. - Optimization for quick scanning
  35. ### 2. Optimize for LLM Context
  36. Ensure the file is lean and efficient:
  37. **Content Optimization:**
  38. - Remove any redundant rules or obvious information
  39. - Combine related rules into concise bullet points
  40. - Use specific, actionable language
  41. - Ensure each rule provides unique value
  42. **Formatting Optimization:**
  43. - Use consistent markdown formatting
  44. - Implement clear section hierarchy
  45. - Ensure scannability with strategic use of bolding
  46. - Maintain readability while maximizing information density
  47. ### 3. Final Content Structure
  48. Ensure the final structure follows this optimized format:
  49. ```markdown
  50. # Project Context for AI Agents
  51. _This file contains critical rules and patterns that AI agents must follow when implementing code in this project. Focus on unobvious details that agents might otherwise miss._
  52. ---
  53. ## Technology Stack & Versions
  54. {{concise_technology_list}}
  55. ## Critical Implementation Rules
  56. ### Language-Specific Rules
  57. {{specific_language_rules}}
  58. ### Framework-Specific Rules
  59. {{framework_patterns}}
  60. ### Testing Rules
  61. {{testing_requirements}}
  62. ### Code Quality & Style Rules
  63. {{style_and_quality_patterns}}
  64. ### Development Workflow Rules
  65. {{workflow_patterns}}
  66. ### Critical Don't-Miss Rules
  67. {{anti_patterns_and_edge_cases}}
  68. ---
  69. ## Usage Guidelines
  70. **For AI Agents:**
  71. - Read this file before implementing any code
  72. - Follow ALL rules exactly as documented
  73. - When in doubt, prefer the more restrictive option
  74. - Update this file if new patterns emerge
  75. **For Humans:**
  76. - Keep this file lean and focused on agent needs
  77. - Update when technology stack changes
  78. - Review quarterly for outdated rules
  79. - Remove rules that become obvious over time
  80. Last Updated: {{date}}
  81. ```
  82. ### 4. Present Completion Summary
  83. Based on user skill level, present the completion:
  84. **Expert Mode:**
  85. "Project context complete. Optimized for LLM consumption with {{rule_count}} critical rules across {{section_count}} sections.
  86. File saved to: `{output_folder}/project-context.md`
  87. Ready for AI agent integration."
  88. **Intermediate Mode:**
  89. "Your project context is complete and optimized for AI agents!
  90. **What we created:**
  91. - {{rule_count}} critical implementation rules
  92. - Technology stack with exact versions
  93. - Framework-specific patterns and conventions
  94. - Testing and quality guidelines
  95. - Workflow and anti-pattern rules
  96. **Key benefits:**
  97. - AI agents will implement consistently with your standards
  98. - Reduced context switching and implementation errors
  99. - Clear guidance for unobvious project requirements
  100. **Next steps:**
  101. - AI agents should read this file before implementing
  102. - Update as your project evolves
  103. - Review periodically for optimization"
  104. **Beginner Mode:**
  105. "Excellent! Your project context guide is ready! 🎉
  106. **What this does:**
  107. Think of this as a 'rules of the road' guide for AI agents working on your project. It ensures they all follow the same patterns and avoid common mistakes.
  108. **What's included:**
  109. - Exact technology versions to use
  110. - Critical coding rules they might miss
  111. - Testing and quality standards
  112. - Workflow patterns to follow
  113. **How AI agents use it:**
  114. They read this file before writing any code, ensuring everything they create follows your project's standards perfectly.
  115. Your project context is saved and ready to help agents implement consistently!"
  116. ### 5. Final File Updates
  117. Update the project context file with completion information:
  118. **Frontmatter Update:**
  119. ```yaml
  120. ---
  121. project_name: '{{project_name}}'
  122. user_name: '{{user_name}}'
  123. date: '{{date}}'
  124. sections_completed:
  125. ['technology_stack', 'language_rules', 'framework_rules', 'testing_rules', 'quality_rules', 'workflow_rules', 'anti_patterns']
  126. status: 'complete'
  127. rule_count: { { total_rules } }
  128. optimized_for_llm: true
  129. ---
  130. ```
  131. **Add Usage Section:**
  132. Append the usage guidelines from step 3 to complete the document.
  133. ### 6. Completion Validation
  134. Final checks before completion:
  135. **Content Validation:**
  136. ✅ All critical technology versions documented
  137. ✅ Language-specific rules are specific and actionable
  138. ✅ Framework rules cover project conventions
  139. ✅ Testing rules ensure consistency
  140. ✅ Code quality rules maintain standards
  141. ✅ Workflow rules prevent conflicts
  142. ✅ Anti-pattern rules prevent common mistakes
  143. **Format Validation:**
  144. ✅ Content is lean and optimized for LLMs
  145. ✅ Structure is logical and scannable
  146. ✅ No redundant or obvious information
  147. ✅ Consistent formatting throughout
  148. ### 7. Completion Message
  149. Present final completion to user:
  150. "✅ **Project Context Generation Complete!**
  151. Your optimized project context file is ready at:
  152. `{output_folder}/project-context.md`
  153. **📊 Context Summary:**
  154. - {{rule_count}} critical rules for AI agents
  155. - {{section_count}} comprehensive sections
  156. - Optimized for LLM context efficiency
  157. - Ready for immediate agent integration
  158. **🎯 Key Benefits:**
  159. - Consistent implementation across all AI agents
  160. - Reduced common mistakes and edge cases
  161. - Clear guidance for project-specific patterns
  162. - Minimal LLM context usage
  163. **📋 Next Steps:**
  164. 1. AI agents will automatically read this file when implementing
  165. 2. Update this file when your technology stack or patterns evolve
  166. 3. Review quarterly to optimize and remove outdated rules
  167. Your project context will help ensure high-quality, consistent implementation across all development work. Great work capturing your project's critical implementation requirements!"
  168. ## SUCCESS METRICS:
  169. ✅ Complete project context file with all critical rules
  170. ✅ Content optimized for LLM context efficiency
  171. ✅ All technology versions and patterns documented
  172. ✅ File structure is logical and scannable
  173. ✅ Usage guidelines included for agents and humans
  174. ✅ Frontmatter properly updated with completion status
  175. ✅ User provided with clear next steps and benefits
  176. ## FAILURE MODES:
  177. ❌ Final content is too verbose for LLM consumption
  178. ❌ Missing critical implementation rules or patterns
  179. ❌ Not optimizing content for agent readability
  180. ❌ Not providing clear usage guidelines
  181. ❌ Frontmatter not properly updated
  182. ❌ Not validating file completion before ending
  183. ## WORKFLOW COMPLETE:
  184. This is the final step of the Generate Project Context workflow. The user now has a comprehensive, optimized project context file that will ensure consistent, high-quality implementation across all AI agents working on the project.
  185. The project context file serves as the critical "rules of the road" that agents need to implement code consistently with the project's standards and patterns.
  186. ## On Complete
  187. Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete`
  188. If the resolved `workflow.on_complete` is non-empty, follow it as the final terminal instruction before exiting.