Personal Cursor configuration in Git: rules, slash commands, and agent skills. Clone once, point your Cursor config directories at this repo (or copy the folders), then pull to stay up to date across machines.
| Folder | Cursor location | Purpose |
|---|---|---|
cursor-rules/ |
User rules (~/.cursor/rules/) |
Always-on or requestable guidance (.mdc files) |
cursor-skills/ |
User skills (~/.cursor/skills/) |
Agent skills (TDD, Playwright, git helpers, framework experts, etc.) |
cursor-commands/ |
Slash commands (~/.cursor/commands/) |
Short prompts (e.g. changelog helpers). Prefer skills for git workflows. |
agents/skills/ |
Agent skills (~/.agents/skills/) |
Cross-agent skills (diagnose, handoff, grill-me, …) |
scripts/ |
(not installed into Cursor) | csync, pull-on-start, and hierarchy-aware skills CLI wrappers |
Git workflows live as user skills under cursor-skills/ (linked to ~/.cursor/skills/). Invoke them by name in chat — start with the git router skill for the menu. Slash commands that still exist are thin prompts, not git entry points.
This repo does not include Cursor’s built-in ~/.cursor/skills-cursor/ skills.
git clone https://github.com/MarcoAntolini/cursor-sync.git
cd cursor-syncPick any directory you like (e.g. ~/cursor-sync or C:\Users\you\cursor-sync).
Linking keeps one source of truth: edits and git pull apply everywhere Cursor reads config.
macOS / Linux — create parent dirs if needed, then symlink:
mkdir -p ~/.cursor ~/.agents
ln -sfn "$(pwd)/cursor-rules" ~/.cursor/rules
ln -sfn "$(pwd)/cursor-skills" ~/.cursor/skills
ln -sfn "$(pwd)/cursor-commands" ~/.cursor/commands
ln -sfn "$(pwd)/agents/skills" ~/.agents/skillsWindows (PowerShell, run as your user) — use directory junctions or symlinks. Enable Developer Mode if mklink requires it.
$Repo = "C:\Users\you\cursor-sync" # your clone path
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.cursor" | Out-Null
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.agents" | Out-Null
cmd /c mklink /D "$env:USERPROFILE\.cursor\rules" "$Repo\cursor-rules"
cmd /c mklink /D "$env:USERPROFILE\.cursor\skills" "$Repo\cursor-skills"
cmd /c mklink /D "$env:USERPROFILE\.cursor\commands" "$Repo\cursor-commands"
cmd /c mklink /D "$env:USERPROFILE\.agents\skills" "$Repo\agents\skills"If a real folder already exists at the target (e.g. ~/.cursor/rules), rename or back it up before linking.
- Restart Cursor (or reload the window).
- Settings → Rules: you should see rules from
cursor-rules/. - In chat, invoke a skill by name (e.g.
git,git-commit, TDD, diagnose). - Optionally type
/for remaining slash commands (e.g. changelog helpers).
If you do not want symlinks:
cp -R cursor-rules ~/.cursor/rules
cp -R cursor-skills ~/.cursor/skills
cp -R cursor-commands ~/.cursor/commands
cp -R agents/skills ~/.agents/skillsYou must re-copy (or merge manually) when you pull updates from upstream.
After you change rules, skills, or commands (in Cursor or in this repo), sync to GitHub with one command instead of cd, add, commit, pull, and push by hand.
scripts/csync.ps1 and scripts/csync.sh stage everything, commit only if there are changes, then pull --rebase --autostash and push (quiet). Default commit message is a timestamp; pass a custom message as the first argument.
Scripts resolve the repo from their own location. If your clone lives elsewhere, set CURSOR_SYNC to its path (e.g. C:\Users\you\dev\cursor-sync or /opt/dotfiles/cursor-sync).
Add one line to your shell profile ($PROFILE on Windows, ~/.bashrc or ~/.zshrc on macOS/Linux). Adjust the path to match where you cloned:
Windows (PowerShell):
. "$env:USERPROFILE\cursor-sync\scripts\csync.ps1"macOS / Linux (bash/zsh):
source ~/cursor-sync/scripts/csync.shReload the shell, then:
csync # message: sync <timestamp>
csync "add TDD skill tweaks" # custom messageYou can also run a one-off sync without loading your profile:
pwsh -File "$env:USERPROFILE\cursor-sync\scripts\csync.ps1" "optional message"~/cursor-sync/scripts/csync.sh "optional message"With symlinks, Cursor writes directly into this repo, so csync is usually all you need on the machine where you edited.
On a second machine, you often only need the latest config from GitHub. scripts/pull-on-start.ps1 and scripts/pull-on-start.sh run a silent background git pull --rebase when you open a shell (no commit or push).
Windows (PowerShell) — add to $PROFILE (in addition to csync if you use it):
. "$env:USERPROFILE\cursor-sync\scripts\pull-on-start.ps1"macOS / Linux:
source ~/cursor-sync/scripts/pull-on-start.shRespects CURSOR_SYNC the same way as csync. Skip this if you prefer to pull manually or only use csync on that machine.
Global agent skills often live in nested folders under ~/.agents/skills/ (for example mattpocock/…). The official npx skills update flattens them. scripts/skills-cli/ is a hierarchy-aware wrapper (skills-tree) that updates skills in place and keeps nested paths.
Windows (PowerShell) — add to $PROFILE:
. "$env:USERPROFILE\cursor-sync\scripts\skills.ps1"macOS / Linux:
source ~/cursor-sync/scripts/skills.shReload the shell, then:
skills check # should print a skills-tree header first
skills update # update, preserving nested locations
skills locations # list root vs nested installs
Get-Command skills # PowerShell: confirm it points at skills-treeIf skills check hangs with only a GitHub rate-limit message and no skills-tree header, you are hitting the official CLI directly (wrapper not loaded) or unauthenticated API limits — run gh auth login / set GITHUB_TOKEN, then re-source the wrapper above.
Other commands are forwarded to npx skills. See scripts/skills-cli/README.md.
If you prefer not to install csync:
cd ~/cursor-sync # or your clone path
git add -A && git commit -m "sync" && git pull --rebase --autostash && git pushWith copies instead of symlinks, you still need to re-copy or merge after pulling on another machine.
- Fork the repository on GitHub (or clone and use your own remote).
- Edit rules, skills, and commands in this repo; Cursor reads them via the links above.
- Commit and push from
cursor-synclike any other dotfiles repo.
To override something for a single project only, use that project’s .cursor/rules/ or .cursor/skills/ — project rules can stack with user rules.
- Paths differ by OS (
~/.cursorvs%USERPROFILE%\.cursor), but the four mappings are the same. - Do not commit secrets (API keys,
.env, tokens). This repo is intended for prompts and tooling only. - Line endings are normalized to LF (see
.gitattributes).