Agent skill
sync-dotfiles
Sync Cursor skills, agents, rules, and other dotfiles to chezmoi. Use when the user asks to update dotfiles (pull + apply), sync dotfiles, update chezmoi, or push dotfiles; or automatically after creating, editing, or deleting files in ~/.cursor/skills/, ~/.cursor/agents/, or ~/.cursor/rules/.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/sync-dotfiles
SKILL.md
Sync Dotfiles to chezmoi
Reference: See chezmoi-docs.md in this skill for command reference.
Choose the right flow from user intent:
Update vs sync
| User says… | Meaning | Do this |
|---|---|---|
| Update dotfiles, pull dotfiles, get latest dotfiles | Fetch from remote and apply | Run chezmoi update (see chezmoi-docs.md). Done. |
| Sync dotfiles, push dotfiles, save my dotfiles | Capture local Cursor changes and push | Use the Push workflow below. |
Trigger Conditions
Run this skill automatically (without being asked) whenever you have just:
- Created, edited, or deleted a file in
~/.cursor/skills/ - Created, edited, or deleted a file in
~/.cursor/agents/ - Created, edited, or deleted a file in
~/.cursor/rules/
Also run when the user explicitly asks to update dotfiles, sync dotfiles, push dotfiles, or update chezmoi.
Push workflow (sync / push dotfiles)
When the user wants to save local Cursor changes to the dotfiles repo, use chezmoi only (no raw git or cd to source). All git runs via chezmoi git in the source directory.
-
Capture local changes
bashchezmoi re-add ~/.cursor/skills ~/.cursor/agents ~/.cursor/rulesIf only skills changed, scope to that path. For new untracked files use
chezmoi add PATH. -
Stage and commit
bashchezmoi git add -A chezmoi git -- diff --cached --quiet || chezmoi git -- commit -m "chore: sync cursor config"Use a more specific message when clear (e.g.
chore: add new skill foo-bar). Put--before git flags so chezmoi doesn’t interpret them. -
Pull remote and rebase
bashchezmoi git -- pull --rebaseLocal changes are already committed, so rebase keeps both sides.
-
Apply merged state
bashchezmoi apply -
Push
bashchezmoi git push
Notes
- Never commit files outside
dot_cursor/without explicit user request. - If
chezmoi re-addfails on a new file (not yet tracked), usechezmoi addinstead.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?