From 7cf4c68c8dc92f39788ecb03cbfbb7b71ab67f0b Mon Sep 17 00:00:00 2001 From: bhandari-piyush Date: Fri, 4 Jul 2025 15:04:09 +0530 Subject: [PATCH] feat: Create context templates to complete Phase 2.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 2.3: Context Templates Creation ✅ COMPLETE ✨ context-handoff-tmpl.md (109 lines) - Comprehensive handoff structure with BMad markup - Placeholder system for context transfer - LLM instruction markup for dynamic content - Validation checkpoints and error handling - Quality assurance and fallback procedures ✨ context-summary-tmpl.md (122 lines) - Summary template for context compression - Information hierarchy and compression instructions - Quality validation and freshness assessment - Context recovery procedures and metadata 🎉 PHASE 2 FOUNDATION COMPLETE 🎉 All planning agents enhanced + context templates created --- bmad-core/templates/context-handoff-tmpl.md | 137 ++++++++++++++++++ bmad-core/templates/context-summary-tmpl.md | 150 ++++++++++++++++++++ 2 files changed, 287 insertions(+) create mode 100644 bmad-core/templates/context-handoff-tmpl.md create mode 100644 bmad-core/templates/context-summary-tmpl.md diff --git a/bmad-core/templates/context-handoff-tmpl.md b/bmad-core/templates/context-handoff-tmpl.md new file mode 100644 index 00000000..07818bc6 --- /dev/null +++ b/bmad-core/templates/context-handoff-tmpl.md @@ -0,0 +1,137 @@ +# Context Handoff Template + +## Context Transfer Overview + +**From Agent**: {{source_agent}} +**To Agent**: {{target_agent}} +**Transfer Purpose**: {{context_transfer_purpose}} +**Transfer Date**: {{transfer_date}} +**Priority Level**: {{priority_level}} + +--- + +## Core Context Summary + +### Project Context +**Project Name**: {{project_name}} +**Current Phase**: {{current_phase}} +**Key Objectives**: {{key_objectives}} + +### Technical Context +**Architecture**: {{technical_architecture}} +**Technology Stack**: {{technology_stack}} +**Dependencies**: {{key_dependencies}} + +### Business Context +**Problem Statement**: {{problem_statement}} +**Success Criteria**: {{success_criteria}} +**Constraints**: {{known_constraints}} + +--- + +## Detailed Context Package + +### 1. Work Completed +{{completed_work_summary}} + +[[LLM: Provide concise summary of completed work, focusing on deliverables and key decisions made]] + +### 2. Current State +**Status**: {{current_status}} +**Active Tasks**: {{active_tasks}} +**Blocked Items**: {{blocked_items}} + +[[LLM: Describe current project state with specific focus on what the receiving agent needs to understand]] + +### 3. Next Actions Required +{{next_actions}} + +[[LLM: List specific, actionable next steps that the receiving agent should prioritize]] + +### 4. Key Decisions & Rationale +{{key_decisions}} + +[[LLM: Document important decisions made and reasoning behind them to prevent re-work]] + +### 5. Context Dependencies +**Files Referenced**: {{referenced_files}} +**Templates Used**: {{templates_used}} +**Checklists Applied**: {{checklists_applied}} + +--- + +## Transfer Validation + +### Pre-Transfer Checklist +- [ ] All critical context information captured +- [ ] Dependencies clearly documented +- [ ] Next actions are specific and actionable +- [ ] Technical details are accurate +- [ ] Business context is complete + +### Receiving Agent Confirmation +**Agent**: {{receiving_agent_name}} +**Confirmation**: {{agent_confirmation}} +**Questions**: {{clarification_questions}} + +[[LLM: Generate specific questions for the receiving agent to confirm understanding]] + +--- + +## Quality Assurance + +### Context Completeness Score +**Technical Context**: {{technical_score}}/10 +**Business Context**: {{business_score}}/10 +**Process Context**: {{process_score}}/10 +**Overall Score**: {{overall_score}}/10 + +### Risk Assessment +**Low Risk**: {{low_risk_items}} +**Medium Risk**: {{medium_risk_items}} +**High Risk**: {{high_risk_items}} + +[[LLM: Identify potential risks in context transfer and suggest mitigation strategies]] + +--- + +## Error Handling + +### Common Transfer Issues +1. **Incomplete Technical Context** + - Missing architecture details + - Unclear dependencies + - Solution: {{technical_mitigation}} + +2. **Business Context Gaps** + - Unclear requirements + - Missing stakeholder input + - Solution: {{business_mitigation}} + +3. **Process Continuity Breaks** + - Lost workflow state + - Missing checklist progress + - Solution: {{process_mitigation}} + +### Fallback Procedures +If context transfer fails: +1. {{fallback_step_1}} +2. {{fallback_step_2}} +3. {{fallback_step_3}} + +[[LLM: Generate specific fallback steps based on the transfer context and receiving agent capabilities]] + +--- + +## Transfer Completion + +**Handoff Status**: {{handoff_status}} +**Completion Time**: {{completion_timestamp}} +**Follow-up Required**: {{followup_needed}} + +**Source Agent Sign-off**: {{source_agent_signoff}} +**Receiving Agent Sign-off**: {{receiving_agent_signoff}} + +--- + +*This context handoff template ensures comprehensive knowledge transfer between BMAD agents while maintaining continuity and reducing context loss.* \ No newline at end of file diff --git a/bmad-core/templates/context-summary-tmpl.md b/bmad-core/templates/context-summary-tmpl.md new file mode 100644 index 00000000..4942cfd1 --- /dev/null +++ b/bmad-core/templates/context-summary-tmpl.md @@ -0,0 +1,150 @@ +# Context Summary Template + +## Summary Overview + +**Context Type**: {{context_type}} +**Summary Date**: {{summary_date}} +**Compression Ratio**: {{compression_ratio}} +**Agent**: {{summarizing_agent}} +**Priority Level**: {{summary_priority}} + +--- + +## Executive Summary + +### Key Outcomes +{{key_outcomes}} + +[[LLM: Provide 2-3 sentence summary of the most important outcomes and achievements]] + +### Critical Decisions +{{critical_decisions}} + +[[LLM: List top 3 decisions that will impact future work, with brief rationale]] + +### Next Priorities +{{next_priorities}} + +[[LLM: Identify top 3 priorities for immediate attention]] + +--- + +## Technical Summary + +### Architecture Decisions +**Key Patterns**: {{architecture_patterns}} +**Technology Choices**: {{technology_decisions}} +**Integration Points**: {{integration_summary}} + +[[LLM: Compress technical context to essential architectural decisions and patterns that must be preserved]] + +### Implementation Status +**Completed**: {{completed_features}} +**In Progress**: {{active_development}} +**Planned**: {{planned_features}} + +--- + +## Business Summary + +### Requirements Evolution +**Original**: {{original_requirements}} +**Current**: {{current_requirements}} +**Changes**: {{requirement_changes}} + +[[LLM: Summarize how requirements have evolved and why changes were made]] + +### Stakeholder Feedback +**Key Insights**: {{stakeholder_insights}} +**Concerns**: {{stakeholder_concerns}} +**Approvals**: {{stakeholder_approvals}} + +--- + +## Process Summary + +### Methodology Adherence +**Process**: {{process_followed}} +**Deviations**: {{process_deviations}} +**Lessons**: {{process_lessons}} + +### Quality Metrics +**Code Quality**: {{code_quality_score}}/10 +**Documentation**: {{documentation_score}}/10 +**Test Coverage**: {{test_coverage_score}}/10 + +[[LLM: Assess quality metrics and highlight areas needing attention]] + +--- + +## Context Compression + +### Information Hierarchy +**Must Preserve**: {{must_preserve}} +**Should Preserve**: {{should_preserve}} +**Can Summarize**: {{can_summarize}} +**Can Discard**: {{can_discard}} + +[[LLM: Categorize information by preservation priority for future context optimization]] + +### Key References +**Critical Files**: {{critical_files}} +**Important Templates**: {{important_templates}} +**Essential Checklists**: {{essential_checklists}} + +--- + +## Quality Validation + +### Completeness Check +- [ ] Technical context preserved +- [ ] Business context captured +- [ ] Process context maintained +- [ ] Key decisions documented +- [ ] Next actions identified + +### Accuracy Verification +**Technical Accuracy**: {{technical_accuracy}}/10 +**Business Accuracy**: {{business_accuracy}}/10 +**Process Accuracy**: {{process_accuracy}}/10 + +[[LLM: Validate accuracy of summarized information against source context]] + +### Freshness Assessment +**Last Updated**: {{last_update}} +**Staleness Risk**: {{staleness_risk}} +**Refresh Needed**: {{refresh_timeline}} + +--- + +## Context Recovery Instructions + +### Expansion Triggers +When to expand this summary: +1. {{expansion_trigger_1}} +2. {{expansion_trigger_2}} +3. {{expansion_trigger_3}} + +### Recovery Procedures +**Full Context**: {{full_context_location}} +**Key Details**: {{detail_recovery_steps}} +**Validation**: {{recovery_validation}} + +[[LLM: Provide specific instructions for recovering full context when needed]] + +--- + +## Summary Metadata + +**Compression Method**: {{compression_method}} +**Original Size**: {{original_size}} tokens +**Compressed Size**: {{compressed_size}} tokens +**Compression Efficiency**: {{efficiency_percentage}}% + +**Quality Score**: {{overall_quality}}/10 +**Usability Score**: {{usability_score}}/10 +**Recovery Confidence**: {{recovery_confidence}}/10 + +--- + +*This context summary maintains essential information while optimizing for storage efficiency and quick retrieval.* \ No newline at end of file