Comparing Prototypes
Systematically compares two branch implementations of the same specification to determine which better meets requirements and follows best practices.
Workflow Overview
This is a multi-phase workflow with context management:
- •Spec Understanding - Locate and analyze the specification
- •Branch 1 Analysis - Checkout, analyze, and document first implementation
- •Context Compaction - Reduce context before analyzing second branch
- •Branch 2 Analysis - Checkout, analyze, and document second implementation
- •Context Compaction - Reduce context before comparison
- •Comparison & Report - Compare implementations and generate final report
Phase 1: Spec Understanding
- •
Locate Specification:
- •Search for spec files using Glob:
specs/**/*.md,docs/specs/**/*.md,**/*spec*.md - •If multiple found, present list to user with AskUserQuestion
- •If none found, ask user to provide spec file path
- •Search for spec files using Glob:
- •
Read and Analyze Spec:
- •Read the spec file completely
- •Identify key requirements, features, acceptance criteria
- •Note technical constraints and implementation guidelines
- •Create mental model of what "success" looks like
Phase 2: Branch 1 Analysis
- •
Get Branch Information:
- •If user hasn't provided branch names, use AskUserQuestion to ask for:
- •Branch 1 name
- •Branch 2 name
- •Store these for the workflow
- •If user hasn't provided branch names, use AskUserQuestion to ask for:
- •
Checkout Branch 1:
bashgit checkout <branch-1-name>
- •
Analyze Implementation:
- •Use Glob/Grep to locate relevant implementation files
- •Read key implementation files
- •Apply analysis criteria from guidelines/analysis-criteria.md:
- •Spec compliance
- •Code quality
- •Testing coverage
- •Performance considerations
- •
Document Findings:
- •Create
spec_matching_tree1.mdusing templates/spec-matching-template.md - •Create
implementation_approach_tree1.mdusing templates/implementation-approach-template.md - •Save both files to project root
- •Create
Phase 3: Context Compaction (After Branch 1)
Run the compact command to reduce context window:
/compact summarize under 200 words
Wait for compaction to complete before proceeding.
Phase 4: Branch 2 Analysis
- •
Checkout Branch 2:
bashgit checkout <branch-2-name>
- •
Analyze Implementation:
- •Repeat the same analysis process as Branch 1
- •Use same criteria from guidelines/analysis-criteria.md
- •Focus on same files/areas for fair comparison
- •
Document Findings:
- •Create
spec_matching_tree2.mdusing templates/spec-matching-template.md - •Create
implementation_approach_tree2.mdusing templates/implementation-approach-template.md - •Save both files to project root
- •Create
Phase 5: Context Compaction (After Branch 2)
Run the compact command again:
/compact summarize under 200 words
Wait for compaction to complete before proceeding.
Phase 6: Comparison & Final Report
- •
Read All Documentation:
- •Read
spec_matching_tree1.mdandspec_matching_tree2.md - •Read
implementation_approach_tree1.mdandimplementation_approach_tree2.md
- •Read
- •
Compare Implementations:
- •Spec Compliance: Which implementation better fulfills spec requirements?
- •Code Quality: Which has better organization, readability, maintainability?
- •Testing Coverage: Which has more comprehensive and effective tests?
- •Performance: Which has better performance characteristics?
- •Overall Recommendation: Which implementation should be preferred and why?
- •
Generate Final Report:
- •Create
prototype_comparison_report.mdusing templates/comparison-report-template.md - •Include:
- •Executive summary with clear recommendation
- •Detailed comparison across all criteria
- •Strengths and weaknesses of each approach
- •Specific examples and code references (file:line format)
- •Action items or next steps
- •Create
- •
Present Summary to User:
- •Provide a concise verbal summary (3-5 key points)
- •Highlight the recommended implementation
- •Note any critical differences or concerns
- •Reference the full report for details
Best Practices
- •Fair Comparison: Analyze the same aspects of both implementations
- •Objective Analysis: Focus on measurable criteria, not subjective preferences
- •Specific Examples: Reference actual code with file:line format
- •Context Management: Don't skip the /compact commands - they're essential for managing token budget
- •Clear Recommendation: Always provide a definitive recommendation with reasoning
Notes
- •All output files are saved to the project root directory
- •The skill automatically searches for spec files in common locations
- •Context compaction is critical - don't skip those phases
- •If a branch doesn't exist, ask the user to verify the branch name