commandby lancejames221b
Hv Sync
Synchronize hAIveMind commands, configurations, and agent state with collective
Installs: 0
Used in: 1 repos
Updated: 1d ago
$
npx ai-builder add command lancejames221b/hv-syncInstalls to .claude/commands/hv-sync.md
# hv-sync - Collective Synchronization ## Purpose Synchronize local hAIveMind installation with the collective, ensuring commands, configurations, and agent state are up-to-date across all nodes. ## When to Use - **Regular Updates**: Keep commands and configs current with collective - **After Network Issues**: Resync after connectivity problems - **New Agent Setup**: Initial sync for new agent registration - **Troubleshooting**: Clean sync to resolve configuration issues - **Manual Updates**: Force sync when automatic updates fail - **Status Checking**: Verify current sync state and version info ## Syntax ``` hv-sync [operation] [options] ``` ## Parameters - **operation** (optional): Sync operation type - `force`: Force full resync regardless of current state - `status`: Show sync status without making changes - `clean`: Remove local state and perform fresh sync - (no operation): Smart sync based on current state - **options** (optional): - `--verbose`: Show detailed progress during sync - `--commands`: Sync only command files - `--config`: Sync only configuration files - `--memory`: Sync only memory/agent state - `--hooks`: Enable automatic pre/post sync hooks for ticket-memory synchronization - `--dry-run`: Show what would be synced without making changes ## Real-World Examples ### Regular Update Check ``` hv-sync ``` **Result**: Smart sync that only updates changed components ### Force Complete Resync ``` hv-sync force --verbose ``` **Result**: Downloads all commands and configs regardless of current versions ### Check Sync Status Only ``` hv-sync status ``` **Result**: Shows version comparisons and sync timestamps without making changes ### Clean Slate Resync ``` hv-sync clean ``` **Result**: Removes local state and performs complete fresh installation ### Commands-Only Update ``` hv-sync --commands --verbose ``` **Result**: Updates only hv-* command files with detailed progress ### Sync with Automated Hooks ``` hv-sync --hooks --verbose ``` **Result**: Performs sync with automatic pre/post hooks for ticket-memory synchronization ## Expected Output ### Smart Sync (Default) ``` š hAIveMind Synchronization - 2025-01-24 15:45:00 š Checking collective for updates... ā Connected to collective (lance-dev orchestrator) ā Local version: 2025-01-20, Collective version: 2025-01-24 ā 3 updates available š¦ Syncing Commands: ā hv-broadcast.md - Updated (v1.2.3 ā v1.2.4) ā hv-query.md - Updated (v1.0.5 ā v1.0.6) āŖ hv-delegate.md - Current (v1.1.0) āŖ hv-status.md - Current (v1.1.2) ā recall.md - Updated (v2.0.1 ā v2.0.2) āŖ remember.md - Current (v2.0.1) āŖ hv-sync.md - Current (v1.0.8) š§ Agent Configuration: ā Agent registration refreshed ā Capabilities updated: +monitoring, +incident_response ā Network mesh updated (2 new nodes discovered) š CLAUDE.md Integration: āŖ No updates needed (current version) š Sync Complete! ā³ 3 commands updated ā³ Agent capabilities refreshed ā³ Network mesh updated ā³ Next automatic sync: 2025-01-24 21:45:00 ``` ### Status Check Output ``` š hAIveMind Sync Status - 2025-01-24 15:45:00 š·ļø VERSIONS: ā³ Local Version: 2025-01-20 14:30:00 ā³ Collective Version: 2025-01-24 12:15:00 ā³ Status: 3 updates available ā³ Last Sync: 2025-01-23 09:20:00 (1 day ago) š¦ COMMAND STATUS: āāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāā¬āāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāā ā Command ā Local ā Collective ā Status ā āāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāā¼āāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāā⤠ā hv-broadcast ā v1.2.3 ā v1.2.4 ā ā¬ļø Update Available ā ā hv-delegate ā v1.1.0 ā v1.1.0 ā ā Current ā ā hv-install ā v1.0.3 ā v1.0.3 ā ā Current ā ā hv-query ā v1.0.5 ā v1.0.6 ā ā¬ļø Update Available ā ā hv-status ā v1.1.2 ā v1.1.2 ā ā Current ā ā hv-sync ā v1.0.8 ā v1.0.8 ā ā Current ā ā recall ā v2.0.1 ā v2.0.2 ā ā¬ļø Update Available ā ā remember ā v2.0.1 ā v2.0.1 ā ā Current ā āāāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāā“āāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāāā š¤ AGENT STATUS: ā³ Registration: Active (lance-dev-development-agent) ā³ Capabilities: development, infrastructure_management, coordination ā³ Network Nodes: 12 connected, 2 offline ā³ Last Heartbeat: 45 seconds ago ā” SYNC SCHEDULE: ā³ Auto-sync: Enabled (every 6 hours) ā³ Next Check: 2025-01-24 21:45:00 ā³ Force Sync Available: Yes ``` ## Sync Operations Deep Dive ### Smart Sync (Default) - Compares local versions with collective versions - Only downloads changed files - Updates agent registration if needed - Preserves local customizations where possible - Fast and network-efficient ### Force Sync - Downloads all commands regardless of version - Completely refreshes agent registration - Overwrites local customizations - Use when experiencing unexplained issues - Longer operation but ensures consistency ### Clean Sync - Removes all local hAIveMind state - Performs fresh installation from scratch - Reregisters agent with new identity if needed - Use as last resort for corrupted installations - Equivalent to uninstall + install ## Performance Considerations - **Smart Sync**: ~5-15 seconds, minimal network usage - **Force Sync**: ~30-60 seconds, full download - **Clean Sync**: ~45-90 seconds, complete reinstall - **Status Check**: ~2-5 seconds, minimal data transfer - **Network Impact**: Syncs use efficient delta compression ## Error Scenarios and Solutions ### Network Connectivity Issues ``` ā Error: Cannot connect to collective orchestrator š” Troubleshooting: 1. Check Tailscale: tailscale status 2. Verify orchestrator: ping lance-dev 3. Check MCP server: curl http://lance-dev:8900/health 4. Retry with: hv-sync force ``` ### Version Conflicts ``` ā ļø Warning: Local modifications detected in hv-broadcast.md š” Options: 1. Backup and allow overwrite: hv-sync force 2. Skip this file: choose 'skip' when prompted 3. Manual merge: review differences before sync ``` ### Agent Registration Issues ``` ā Error: Agent registration failed (duplicate ID) š” Resolution: 1. Clean registration: hv-sync clean 2. Check for duplicate agents: hv-status --agents 3. Manual cleanup may be required ``` ## Best Practices - **Regular Sync**: Run weekly or after system changes - **Before Important Work**: Sync before major tasks - **After Network Issues**: Sync after connectivity problems - **Status Monitoring**: Check status before manual sync - **Backup Customizations**: Save custom changes before force sync - **Scheduled Sync**: Enable automatic sync for convenience ## Related Commands - **Before syncing**: Use `hv-status` to check collective health - **After syncing**: Use `hv-install status` to verify installation - **For issues**: Use `hv-query` to find sync-related solutions - **Share updates**: Use `hv-broadcast` to inform others of sync results - **Hook management**: Use `hv-sync-hooks` to manage automated synchronization hooks --- **Sync Operation**: $ARGUMENTS This will synchronize your local hAIveMind installation with the collective, ensuring you have the latest commands, configurations, and agent state for optimal collaborative intelligence.
Quick Install
$
npx ai-builder add command lancejames221b/hv-syncDetails
- Type
- command
- Author
- lancejames221b
- Slug
- lancejames221b/hv-sync
- Created
- 4d ago