{communication_language}Complete the project context file, optimize it for LLM efficiency, and provide guidance for usage and maintenance.
Read the entire project context file and analyze:
Content Analysis:
Structure Analysis:
Ensure the file is lean and efficient:
Content Optimization:
Formatting Optimization:
Ensure the final structure follows this optimized format:
# Project Context for AI Agents
_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._
---
## Technology Stack & Versions
{{concise_technology_list}}
## Critical Implementation Rules
### Language-Specific Rules
{{specific_language_rules}}
### Framework-Specific Rules
{{framework_patterns}}
### Testing Rules
{{testing_requirements}}
### Code Quality & Style Rules
{{style_and_quality_patterns}}
### Development Workflow Rules
{{workflow_patterns}}
### Critical Don't-Miss Rules
{{anti_patterns_and_edge_cases}}
---
## Usage Guidelines
**For AI Agents:**
- Read this file before implementing any code
- Follow ALL rules exactly as documented
- When in doubt, prefer the more restrictive option
- Update this file if new patterns emerge
**For Humans:**
- Keep this file lean and focused on agent needs
- Update when technology stack changes
- Review quarterly for outdated rules
- Remove rules that become obvious over time
Last Updated: {{date}}
Based on user skill level, present the completion:
Expert Mode: "Project context complete. Optimized for LLM consumption with {{rule_count}} critical rules across {{section_count}} sections.
File saved to: {output_folder}/project-context.md
Ready for AI agent integration."
Intermediate Mode: "Your project context is complete and optimized for AI agents!
What we created:
Key benefits:
Next steps:
Beginner Mode: "Excellent! Your project context guide is ready! 🎉
What this does: 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.
What's included:
How AI agents use it: They read this file before writing any code, ensuring everything they create follows your project's standards perfectly.
Your project context is saved and ready to help agents implement consistently!"
Update the project context file with completion information:
Frontmatter Update:
---
project_name: '{{project_name}}'
user_name: '{{user_name}}'
date: '{{date}}'
sections_completed:
['technology_stack', 'language_rules', 'framework_rules', 'testing_rules', 'quality_rules', 'workflow_rules', 'anti_patterns']
status: 'complete'
rule_count: { { total_rules } }
optimized_for_llm: true
---
Add Usage Section: Append the usage guidelines from step 3 to complete the document.
Final checks before completion:
Content Validation: ✅ All critical technology versions documented ✅ Language-specific rules are specific and actionable ✅ Framework rules cover project conventions ✅ Testing rules ensure consistency ✅ Code quality rules maintain standards ✅ Workflow rules prevent conflicts ✅ Anti-pattern rules prevent common mistakes
Format Validation: ✅ Content is lean and optimized for LLMs ✅ Structure is logical and scannable ✅ No redundant or obvious information ✅ Consistent formatting throughout
Present final completion to user:
"✅ Project Context Generation Complete!
Your optimized project context file is ready at:
{output_folder}/project-context.md
📊 Context Summary:
🎯 Key Benefits:
📋 Next Steps:
Your project context will help ensure high-quality, consistent implementation across all development work. Great work capturing your project's critical implementation requirements!"
✅ Complete project context file with all critical rules ✅ Content optimized for LLM context efficiency ✅ All technology versions and patterns documented ✅ File structure is logical and scannable ✅ Usage guidelines included for agents and humans ✅ Frontmatter properly updated with completion status ✅ User provided with clear next steps and benefits
❌ Final content is too verbose for LLM consumption ❌ Missing critical implementation rules or patterns ❌ Not optimizing content for agent readability ❌ Not providing clear usage guidelines ❌ Frontmatter not properly updated ❌ Not validating file completion before ending
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.
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.