Summary
Add a "Sync Variants" feature that allows users to copy configuration (skills, MCP servers, permissions, CLAUDE.md) from one source variant to multiple target variants.
Problem
Skills, MCP servers, and CLAUDE.md configured in one variant aren't available in other variants. Users who set up multiple variants need to manually copy configuration between them.
Proposed Solution
Sync Direction
- One source variant -> multiple target variants (one-to-many)
- Overwrite target with source (no merge)
What to Sync
- Skills (entire
config/skills/ directory)
- MCP servers (from
.claude.json)
- Permissions (allow/deny rules from
settings.json)
- CLAUDE.md (if present)
What NOT to Sync
- Provider-specific settings (API keys, base URLs, model overrides)
- Theme preferences
- Team mode configuration
- Provider env vars (CC_MIRROR_, ANTHROPIC_, etc.)
Backup Strategy
- Create single backup at
~/.cc-mirror/<variant>/config.backup/ before sync
- Overwrite previous backup on new sync (only keep one version)
Implementation Plan
Core Module (src/core/sync.ts)
export type SyncItem = 'skills' | 'mcp-servers' | 'permissions' | 'claude-md';
export interface SyncOptions {
items: SyncItem[];
createBackup: boolean;
}
export interface SyncResult {
target: string;
success: boolean;
backupPath?: string;
itemResults: Record<SyncItem, { copied: number; skipped: number; errors: string[] }>;
}
export function syncVariants(sourceDir: string, targetDirs: string[], options: SyncOptions): SyncResult[];
export function createConfigBackup(variantDir: string): string;
export function restoreConfigBackup(variantDir: string): boolean;
TUI Flow
Home -> "Sync Variants" -> sync-source (pick one) -> sync-targets (pick many) -> sync-running -> sync-done
Files to Create/Modify
- NEW:
src/core/sync.ts (~200 lines)
- NEW:
src/tui/hooks/useSync.ts (~100 lines)
- NEW:
src/tui/screens/SyncSourceScreen.tsx
- NEW:
src/tui/screens/SyncTargetsScreen.tsx (multi-select)
- NEW:
src/tui/screens/SyncRunningScreen.tsx
- NEW:
src/tui/screens/SyncDoneScreen.tsx
- MODIFY:
src/tui/screens/HomeScreen.tsx (add menu item)
- MODIFY:
src/tui/app.tsx (add screen handlers)
- MODIFY:
src/core/index.ts (export sync functions)
- MODIFY:
src/tui/hooks/index.ts (export useSync)
Acceptance Criteria
Summary
Add a "Sync Variants" feature that allows users to copy configuration (skills, MCP servers, permissions, CLAUDE.md) from one source variant to multiple target variants.
Problem
Skills, MCP servers, and CLAUDE.md configured in one variant aren't available in other variants. Users who set up multiple variants need to manually copy configuration between them.
Proposed Solution
Sync Direction
What to Sync
config/skills/directory).claude.json)settings.json)What NOT to Sync
Backup Strategy
~/.cc-mirror/<variant>/config.backup/before syncImplementation Plan
Core Module (
src/core/sync.ts)TUI Flow
Files to Create/Modify
src/core/sync.ts(~200 lines)src/tui/hooks/useSync.ts(~100 lines)src/tui/screens/SyncSourceScreen.tsxsrc/tui/screens/SyncTargetsScreen.tsx(multi-select)src/tui/screens/SyncRunningScreen.tsxsrc/tui/screens/SyncDoneScreen.tsxsrc/tui/screens/HomeScreen.tsx(add menu item)src/tui/app.tsx(add screen handlers)src/core/index.ts(export sync functions)src/tui/hooks/index.ts(export useSync)Acceptance Criteria
.claude.jsonsettings.json