Handle synchronization conflicts between local Life OS data and remote Todoist data when both have been modified.
// User's recent edits take priority
// Overwrite remote with local version
// Use when: User explicitly modified locally and wants to keep it// Remote Todoist data takes priority
// Overwrite local with remote version
// Use when: Remote is more authoritative or user prefers Todoist version// Intelligently combine both versions
// Use when: Changes are complementary, not contradictory
// Example: Merge title additions, combine tags// Let user manually resolve
// Present both versions side-by-side
// User creates final merged version
// Use when: Automatic merge would lose data// Don't resolve now, ask later
// Log conflict for future resolution
// Use when: User wants to decide laterinterface ConflictDetectionFlow {
step1: "Compare local and remote timestamps"
step2: "Check if both modified since last sync"
step3: "Compare field values (title, date, status, etc.)"
step4: "Identify conflict type and severity"
step5: "Generate conflict report"
}graph TD
A[Detect Conflict] --> B[Analyze Conflict Type]
B --> C{Severity?}
C -->|Low| D[Auto-Merge]
C -->|Medium| E[Suggest Resolution]
C -->|High| F[User Decision Required]
D --> G[Apply Resolution]
E --> H{User Accepts?}
H -->|Yes| G
H -->|No| F
F --> I[Interactive UI]
I --> J[User Chooses Strategy]
J --> G
G --> K[Re-Sync]
K --> L[Verify Success]╔════════════════════════════════════════════════════════════╗
║ SYNC CONFLICT DETECTED ║
╠════════════════════════════════════════════════════════════╣
║ Task: "Buy groceries" ║
║ Conflict Type: TITLE + DUE_DATE ║
║ Last Synced: 2025-10-19 14:30 ║
╠════════════════════════════════════════════════════════════╣
║ LOCAL (Your Changes) REMOTE (Todoist) ║
║ ────────────────────────────────────────────────────── ║
║ Title: "Buy groceries for Title: "Buy groceries" ║
║ dinner party" ║
║ Due: 2025-10-25 Due: 2025-10-27 ║
║ Modified: 2 hours ago Modified: 1 hour ago ║
╠════════════════════════════════════════════════════════════╣
║ Resolution Options: ║
║ [1] Keep Local (your changes win) ║
║ [2] Keep Remote (Todoist wins) ║
║ [3] Merge Both (combine changes) ║
║ [4] Manual Edit (edit directly) ║
║ [5] Skip (decide later) ║
╚════════════════════════════════════════════════════════════╝╔════════════════════════════════════════════════════════════╗
║ RESOLUTION PREVIEW ║
╠════════════════════════════════════════════════════════════╣
║ Selected Strategy: Merge Both ║
║ ║
║ Final Version: ║
║ ────────────────────────────────────────────────────── ║
║ Title: "Buy groceries for dinner party" ║
║ Due: 2025-10-25 ║
║ Priority: 2 ║
║ Project: Personal ║
╠════════════════════════════════════════════════════════════╣
║ This will: ║
║ ✓ Update Todoist with merged version ║
║ ✓ Update local database ║
║ ✓ Mark conflict as resolved ║
║ ║
║ Continue? [Y/n] ║
╚════════════════════════════════════════════════════════════╝# During bi-directional sync
1. Load local tasks from database
2. Fetch remote tasks from Todoist
3. Compare timestamps and content
4. Generate conflict list# Show user what conflicts exist
1. Format conflict details
2. Display side-by-side comparison
3. Highlight differences
4. Explain conflict severity# Interactive prompt
1. Show resolution options
2. Get user selection
3. Validate choice
4. Confirm before applying# Execute chosen strategy
1. Create merged version
2. Update local database
3. Push to Todoist
4. Mark conflict as resolved
5. Log resolution decision# Ensure clean state
1. Verify sync successful
2. Update sync timestamps
3. Continue with remaining tasks
4. Generate conflict reportStrategy: Auto-merge with notification
Strategy: Suggest best resolution, allow override
Strategy: Require explicit user choice
interface ConflictSettings {
autoMergeLowSeverity: boolean; // Auto-merge safe conflicts
promptBeforeOverwrite: boolean; // Always confirm
keepConflictLog: boolean; // Log all conflicts
defaultStrategy: 'local' | 'remote' | 'prompt'; // Fallback
}interface ConflictLog {
timestamp: Date;
taskId: string;
taskTitle: string;
conflictType: ConflictType[];
localValue: any;
remoteValue: any;
chosenStrategy: ResolutionStrategy;
finalValue: any;
autoResolved: boolean;
userNotes?: string;
}async function syncWithConflictResolution() {
// 1. Attempt bi-directional sync
const syncResult = await bidirectionalSync();
// 2. Check for conflicts
if (syncResult.conflicts.length > 0) {
console.log(`⚠️ ${syncResult.conflicts.length} conflicts detected`);
// 3. Resolve each conflict
for (const conflict of syncResult.conflicts) {
const resolution = await resolveConflict(conflict);
await applyResolution(conflict, resolution);
}
// 4. Re-sync after resolutions
await bidirectionalSync();
}
console.log('✅ Sync complete with all conflicts resolved');
}✅ All conflict types detected accurately ✅ User can choose resolution strategy ✅ Resolution applies correctly to both local and remote ✅ No data loss during conflict resolution ✅ Sync continues successfully after resolution ✅ Conflict log maintained for audit ✅ Clear UI shows what conflicts exist ✅ Safe defaults prevent accidental overwrites
# Sync and handle conflicts
npm run sync -- --resolve-conflicts
# View conflict log
npm run sync:conflicts -- --log
# Configure conflict resolution
npm run sync:configure -- --conflict-strategy=prompt
# Test conflict resolution
npm run test:conflicts/src/utils/conflict-detector.ts/src/utils/conflict-ui.ts/src/services/conflict-resolver.ts/tests/conflicts/scenarios.test.tskmondlane/ExoMind
8794d26
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.