mcpField
S
sync-dotfiles

sync-dotfiles

github.com/camachoAgent workflows39 installs
Repository

About sync-dotfiles

A skill for syncing dotfiles between the ai-env repository and a home directory. It maps requests such as checking drift, capturing local changes, deploying repository configs, and installing skills to `sync.sh` subcommands, with an explicit safe path for ambiguous sync requests.

Key features

  1. 01Compare repository and home files
  2. 02Show the tracked file registry
  3. 03Pull local changes into the repo
  4. 04Push repository configs to home
  5. 05Install skills from the lock file

Use cases

  1. 01Check for configuration drift
  2. 02Save local config edits to the repo
  3. 03Deploy repository configs on a machine
  4. 04Install global skills from the lock file

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/camacho/ai-skills --skill sync-dotfiles

After installing, type/sync-dotfilesin Claude Code to confirm it loaded.

Bundled filessync.sh

Details

From the project README

When to invoke

  • User says "sync dotfiles", "pull configs", "push configs", "check drift"
  • After a session where permissions or hooks were modified
  • On a new machine after cloning ai-env

Subcommands

Map user intent to sync.sh subcommand:

IntentCommandWhat it does
"check what's different"sync.sh diffShow drift between repo and home
"what's tracked"sync.sh statusShow file registry
"capture my local changes"sync.sh pullHome → repo (home wins)
"deploy repo configs"sync.sh pushRepo → home (repo wins)
"install skills"sync.sh skills-pushInstall global skills from dotfiles/skills-lock.json
"sync" (ambiguous)Show diff first, then ask directionSafe default

Running sync.sh

The sync script is bundled with this skill at sync.sh (same directory as this SKILL.md). Run it directly — the script discovers the ai-env repo automatically:

/path/to/skill/sync.sh <subcommand>

The script sets AI_ENV_ROOT automatically via the discovery chain below. To override:

AI_ENV_ROOT=/custom/path/to/ai-env /path/to/skill/sync.sh push

AI_ENV_ROOT discovery

The script discovers the ai-env repo (where dotfiles/ lives) automatically:

  1. If $AI_ENV_ROOT is set and $AI_ENV_ROOT/dotfiles exists: use that
  2. If the script is inside an ai-env git repo (e.g., running from a symlink): use that repo root
  3. If ~/projects/camacho/ai-env exists: use that
  4. Clone camacho/ai-env to a temp dir via GitHub
  5. If clone fails: error with instructions to set AI_ENV_ROOT

After pull

Show git diff dotfiles/ and offer to commit: chore: sync dotfiles

After push

Run sync.sh status to confirm, warn about any missing files.

Comments

Markdown supported