Skip to content
Development
Command

/sync

Orchestrate multi-editor configuration synchronization with intelligent conflict resolution and rollback capabilities

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/sync

Context preview

What this command does when you run it.

Orchestrate multi-editor configuration synchronization with intelligent conflict resolution and rollback capabilities

Command definition

sync.md
allowed-tools: Task, Read, Write, Edit, MultiEdit, Bash(fd:*), Bash(rg:*), Bash(jq:*), Bash(eza:*), Bash(bat:*), Bash(gdate:*), Bash(deno:*)
name: "Sync"
description: "Orchestrate multi-editor configuration synchronization with intelligent conflict resolution and rollback capabilities"
author: "wcygan"
tags: ["workflow","manage"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N 2>/dev/null || date +%s%N 2>/dev/null || echo "$(date +%s)$(jot -r 1 100000 999999 2>/dev/null || shuf -i 100000-999999 -n 1 2>/dev/null || echo $RANDOM$RANDOM)"`
  • Target editors: $ARGUMENTS
  • Editor config files detected: !`fd "(keybindings\.json|keymap\.json|settings\.json)" . -d 3 | head -10 || echo "No editor config files found"`
  • Cursor config: !`fd "keybindings\.json" cursor/ -d 2 | head -1 || echo "cursor/keybindings.json not found"`
  • VSCode config: !`fd "keybindings\.json" vscode/ -d 2 | head -1 || echo "vscode/keybindings.json not found"`
  • Zed config: !`fd "keymap\.json" zed/ -d 2 | head -1 || echo "zed/keymap.json not found"`
  • Backup directory: !`fd backup . -t d -d 2 | head -1 || echo "No backup directory found"`
  • Deno task status: !`test -f deno.json && jq -r '.tasks."sync:editors" // "Not configured"' deno.json || echo "No deno.json found"`

Your Task

STEP 1: Initialize synchronization session and backup existing configurations

  • CREATE session state file: `/tmp/sync-session-$SESSION_ID.json`
  • ANALYZE existing editor configurations from Context section
  • CREATE timestamped backup of all editor configs
  • VALIDATE sync tools availability (jq, deno required)
# Initialize sync session state
echo '{
  "sessionId": "'$SESSION_ID'",
  "targetEditors": "'$ARGUMENTS'",
  "backupTimestamp": "'$(gdate -Iseconds 2>/dev/null || date -Iseconds)'",
  "conflictsDetected": [],
  "syncStrategy": "intelligent-merge"
}' > /tmp/sync-session-$SESSION_ID.json

# Create configuration backup
mkdir -p /tmp/editor-config-backup-$SESSION_ID

STEP 2: Comprehensive configuration analysis with parallel sub-agent coordination

TRY:

IF multiple_editors_detected AND complex_keybinding_conflicts:

LAUNCH parallel sub-agents for comprehensive configuration analysis:

  • **Agent 1: Cursor Configuration Analysis**: Analyze Cursor editor keybindings and settings
  • Focus: Keybinding patterns, custom shortcuts, editor-specific features
  • Tools: jq for JSON parsing, rg for pattern search
  • Output: Cursor configuration profile with feature mapping
  • **Agent 2: VSCode Configuration Analysis**: Analyze VSCode keybindings and settings
  • Focus: Extension-dependent keybindings, workspace settings, global preferences
  • Tools: jq for JSON parsing, configuration validation
  • Output: VSCode configuration profile with extension dependencies
  • **Agent 3: Zed Configuration Analysis**: Analyze Zed keymap and settings
  • Focus: Modal editing patterns, vim integration, custom key sequences
  • Tools: jq for JSON parsing, keymap validation
  • Output: Zed configuration profile with modal editing considerations
  • **Agent 4: Conflict Detection & Resolution**: Identify conflicts and propose resolutions
  • Focus: Conflicting keybindings, platform differences, feature gaps
  • Tools: Configuration diffing, intelligent conflict resolution
  • Output: Conflict report with resolution strategies

**Sub-Agent Coordination:**

# Each agent reports findings to session state
echo "Parallel configuration analysis agents launched..."
echo "Results will be aggregated for intelligent synchronization"

ELSE:

EXECUTE streamlined single-editor or simple synchronization:

# Simple synchronization workflow
echo "๐Ÿ”„ Executing streamlined configuration sync..."

STEP 3: Configuration file discovery and validation

**Systematic Configuration Discovery:**

# Discover all editor configuration files
echo "๐Ÿ“ Editor Configuration Discovery:"
echo "Cursor configs:"
fd "(keybindings|settings)\.json" cursor/ -d 3 | head -5

echo "VSCode configs:"
fd "(keybindings|settings)\.json" vscode/ -d 3 | head -5

echo "Zed configs:"
fd "(keymap|settings)\.json" zed/ -d 3 | head -5

# Validate JSON syntax
echo "๐Ÿ” Configuration Validation:"
for config in $(fd "\.(json|jsonc)$" . -d 3); do
  jq . "$config" >/dev/null 2>&1 && echo "โœ… $config" || echo "โŒ $config (invalid JSON)"
done

**Configuration Backup Strategy:**

# Create timestamped backups
BACKUP_DIR="/tmp/editor-config-backup-$SESSION_ID"
mkdir -p "$BACKUP_DIR"/{cursor,vscode,zed}

# Backup with verification
FOR EACH editor_config IN cursor/ vscode/ zed/:
  cp -r "$editor_config" "$BACKUP_DIR/"
  echo "๐Ÿ“ฆ Backed up $editor_config"
done

STEP 4: Intelligent keybinding analysis and conflict resolution

**Pattern Recognition and Normalization:**

# Extract and normalize keybinding patterns
echo "๐Ÿ” Keybinding Pattern Analysis:"

# Common keybinding extraction
rg '"key":\s*"([^"]+)".*"command":\s*"([^"]+)"' cursor/ vscode/ zed/ --only-matching --no-filename | sort | uniq -c | sort -nr

# Platform-specific pattern detection
rg '(cmd|ctrl|alt|shift)\+' cursor/ vscode/ zed/ --only-matching | sort | uniq -c

# Command frequency analysis
rg '"command":\s*"([^"]+)"' cursor/ vscode/ zed/ -o --no-filename | sort | uniq -c | sort -nr | head -20

**Conflict Detection Algorithm:**

# Generate conflict detection report
echo "โš ๏ธ Conflict Detection Report:"

# Same key, different commands across editors
echo "Conflicting keybindings (same key, different commands):"
# Implementation would compare keybinding mappings across editors

# Missing keybindings in specific editors
echo "Missing keybindings by editor:"
# Implementation would identify gaps in coverage

STEP 5: Automated synchronization script generation

**Deno Synchronization Script Creation:**

// scripts/sync-editor-configs.ts
import { parse, stringify } from "@std/json";
import { walk } from
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin