# 🔄 Version Comparison Tool
**Compare different versions of system prompts to understand evolution**
## 📋 Overview
This tool helps you:
- **Compare prompt versions** (e.g., Cursor v1.0 vs v1.2 vs Agent)
- **Track changes** over time
- **Understand evolution** of AI coding tools
- **Identify patterns** in updates
## 🚀 Usage
### Command Line (PowerShell)
```powershell
# Compare two versions
python scripts/compare-versions.py --tool "Cursor Prompts" --v1 "Agent Prompt v1.0.txt" --v2 "Agent Prompt v1.2.txt"
# Compare all versions
python scripts/compare-versions.py --tool "Cursor Prompts" --all
# Generate HTML diff
python scripts/compare-versions.py --tool "Cursor Prompts" --v1 v1.0 --v2 v1.2 --html > diff.html
```
### Web Interface
```bash
# Start comparison server
python scripts/comparison-server.py
# Open in browser
# http://localhost:8000
```
## 📊 Comparison Methods
### 1. Side-by-Side Comparison
View files side by side with synchronized scrolling:
```
Version 1.0 | Version 1.2
-----------------------|------------------------
Line 1: Old text | Line 1: New text
Line 2: Same | Line 2: Same
Line 3: Removed |
| Line 3: Added
```
### 2. Unified Diff
Traditional diff format with +/- markers:
```diff
Line 1: Same text
- Line 2: Old version
+ Line 2: New version
Line 3: Same text
```
### 3. Word-Level Diff
Highlights changed words within lines:
```
Line 1: The quick brownred fox
```
### 4. Statistics Summary
Quantitative analysis of changes:
```
Changes Summary:
- Lines added: 45
- Lines removed: 23
- Lines modified: 12
- Total changes: 80
- Similarity: 92.5%
```
## 🔍 Example Comparisons
### Cursor Prompt Evolution
**v1.0 → v1.2:**
- ✅ Added conciseness instructions
- ✅ Improved tool usage guidelines
- ✅ Added AGENTS.md context
- ❌ Removed verbose explanations
**v1.2 → Agent:**
- ✅ Added parallel execution support
- ✅ Added sub-agent delegation
- ✅ Added TODO tracking
- ✅ Enhanced memory system
### GitHub Copilot Evolution
**GPT-4 → GPT-4o:**
- ✅ Faster response times
- ✅ Better context understanding
- ✅ Improved code generation
**GPT-4o → GPT-5:**
- ✅ Multi-modal capabilities
- ✅ Better reasoning
- ✅ Longer context window
## 📈 Tracking Changes
### Key Metrics
- **Conciseness Score:** How brief instructions became
- **Security Rules:** Number of security guidelines
- **Tool Count:** Available tools/functions
- **Context Size:** Maximum context window
- **Response Length:** Average response size
### Evolution Patterns
1. **Trend toward conciseness** (2023-2025)
2. **More security rules** (increasing)
3. **Parallel execution** (emerging 2024)
4. **Sub-agents** (emerging late 2024)
5. **TODO tracking** (2024-2025)
## 🛠️ Tools & Scripts
### compare-versions.py
Main comparison script:
```python
import difflib
from pathlib import Path
def compare_files(file1, file2):
with open(file1) as f1, open(file2) as f2:
diff = difflib.unified_diff(
f1.readlines(),
f2.readlines(),
fromfile=file1,
tofile=file2
)
return ''.join(diff)
```
### comparison-server.py
Web interface for comparisons:
```python
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
class ComparisonHandler(BaseHTTPRequestHandler):
def do_GET(self):
# Serve comparison UI
pass
def do_POST(self):
# Handle comparison requests
pass
```
## 📊 HTML Diff Viewer
Generated HTML includes:
- Syntax highlighting
- Line numbers
- Change markers (+/-)
- Statistics panel
- Navigation between changes
- Copy buttons
### Example Output:
```html