Sync
Pull the latest changes from the remote repository and report status.
Process
Check current state:
- Run
git status to check for uncommitted changes.
- If there are uncommitted changes, stash them first (
git stash), pull, then pop the stash. Warn the user about the stash.
Pull from remote:
- Run
git pull --rebase origin <current-branch>.
- If rebase conflicts occur, abort the rebase (
git rebase --abort), try git pull --no-rebase instead, and report any merge conflicts for the user to resolve.
Check for outstanding work:
- Check if
tasks/roadmap.md exists for the full plan, and tasks/todo.md for the current phase.
- If
tasks/todo.md exists, read it and look for unchecked items (- [ ]).
- If there are incomplete items, summarise: which phase is current, what the next step is, and how many steps/phases remain.
- If
tasks/manual-todo.md exists, count unchecked manual tasks and include in the summary.
- If
tasks/record-todo.md or tasks/recurring-todo.md exists, count unchecked advisory items and include those counts separately. Do not treat them as active plan steps.
- If all items are checked, report that the plan is complete.
- If neither file exists, note that there is no active plan.
Check provisioning version:
- If
CLAUDE.md or AGENTS.md contains <!-- provision-agentic-config vX.Y -->, extract the version.
- Read
~/.claude/skills/provision-agentic-config/SKILL.md and extract the version: field from the YAML frontmatter.
- If the installed skill version is newer than the provisioned version in either file, warn:
⚠ CLAUDE.md provisioned with vX.Y but provision-agentic-config is at vX.Y — consider re-running /provision-agentic-config
- If the version comment is missing from
CLAUDE.md or AGENTS.md, note: ℹ No provision version found in CLAUDE.md/AGENTS.md — run /provision-agentic-config to add version tracking
- If
~/.claude/skills/provision-agentic-config/SKILL.md does not exist, skip this check silently.
Report status:
- Branch name
- Commits pulled (if any) — show short log of new commits
- Whether stashed changes were re-applied
- Any conflicts that need manual resolution
- Current
git status
- Outstanding work — summary from step 3 (next step, current phase, remaining work, pending manual tasks) or "No active plan"
- Advisory tasks — pending record/recurring counts, if those files exist
Post-sync actions:
a) Check if sync.md exists at the project root.
b) If sync.md exists — parse and execute it:
- Read
sync.md and identify sections by H2 headings.
- Dependencies (aliases: "Deps", "Dependency Management"):
Execute shell commands found in fenced code blocks (e.g.,
npm install). Report output briefly.
- Conflict Resolution (aliases: "Conflicts"):
If the pull introduced merge conflicts (from step 2), apply the guidance in this section. For example, if it says "accept theirs for lockfiles", run the appropriate
git checkout --theirs command. If no conflicts exist, skip silently.
- Custom (aliases: "Project-Specific", "Scripts", "Setup"):
Execute shell commands found in fenced code blocks in order. Report output briefly.
- Notifications (aliases: "Awareness", "Alerts", "Watch"):
For each bullet point, check if the mentioned file or directory was modified in the pulled commits (use
git diff --name-only against the pre-pull HEAD). If any match, print a prominent alert with the bullet's description.
- Sections with unrecognised headings: skip with a note ("Skipped unknown sync.md section: ").
- Report a summary of all post-sync actions taken.
c) If sync.md does not exist — suggest creating one:
- Analyse the project to detect:
- Package manager (look for
package-lock.json, yarn.lock, pnpm-lock.yaml, Pipfile.lock, requirements.txt, go.sum, Cargo.lock, Gemfile.lock, composer.lock)
- Common scripts (check
package.json scripts, Makefile, Justfile for build/codegen/migrate targets)
- Config templates (
.env.example, docker-compose.yml, config/)
- Present a suggested
sync.md to the user with detected actions pre-filled, following the format in the sync.md format section below.
- Ask: "Would you like me to create this
sync.md? You can customise it anytime."
- Only create the file if the user approves.
sync.md format
The sync.md file lives at the project root. It uses H2 sections as categories. Shell commands go in fenced code blocks; prose guidance goes in bullet points.
# Post-Sync Actions
## Dependencies
Commands to run after pulling to keep local dependencies up to date.
```sh
npm install
Conflict Resolution
Project-specific guidance for handling merge conflicts.
- Always accept theirs for
package-lock.json — regenerate via install command above
- For
generated/ files, regenerate with npm run codegen instead of resolving manually
Custom
Project-specific scripts or commands to run after sync.
npm run codegen
Notifications
Files and patterns to check for changes after a pull. Alert the user if any were modified.
.env.example — check for new environment variables you may need to add to .env
CLAUDE.md — review if project conventions were updated
config/ — warn about config schema changes
## Constraints
- Do not force-push or rewrite history.
- Do not auto-resolve merge conflicts — report them and let the user decide. However, if `sync.md` has a **Conflict Resolution** section, follow its guidance for the specific files/patterns it covers.
- If stash pop fails due to conflicts, leave the stash intact and report it.
- Post-sync commands from `sync.md` run in the project root directory.
- If any post-sync command fails, report the error and continue with remaining actions (do not abort).
- Never auto-create `sync.md` without explicit user approval.
- Do not execute commands from `sync.md` sections that are commented out with HTML comments (`<!-- ... -->`).
## Default Shipping Contract
Follow the shared shipping contract convention in CLAUDE.md.
1---2name: sync-63description: Pull latest changes from remote and report status4---5
6# Sync
7
8Pull the latest changes from the remote repository and report status.
9
10## Process
11
121. **Check current state:**
13 - Run `git status` to check for uncommitted changes.
14 - If there are uncommitted changes, stash them first (`git stash`), pull, then pop the stash. Warn the user about the stash.
15
162. **Pull from remote:**
17 - Run `git pull --rebase origin <current-branch>`.
18 - If rebase conflicts occur, abort the rebase (`git rebase --abort`), try `git pull --no-rebase` instead, and report any merge conflicts for the user to resolve.
19
203. **Check for outstanding work:**
21 - Check if `tasks/roadmap.md` exists for the full plan, and `tasks/todo.md` for the current phase.
22 - If `tasks/todo.md` exists, read it and look for unchecked items (`- [ ]`).
23 - If there are incomplete items, summarise: which phase is current, what the next step is, and how many steps/phases remain.
24 - If `tasks/manual-todo.md` exists, count unchecked manual tasks and include in the summary.
25 - If `tasks/record-todo.md` or `tasks/recurring-todo.md` exists, count unchecked advisory items and include those counts separately. Do not treat them as active plan steps.
26 - If all items are checked, report that the plan is complete.
27 - If neither file exists, note that there is no active plan.
28
294. **Check provisioning version:**
30 - If `CLAUDE.md` or `AGENTS.md` contains `<!-- provision-agentic-config vX.Y -->`, extract the version.
31 - Read `~/.claude/skills/provision-agentic-config/SKILL.md` and extract the `version:` field from the YAML frontmatter.
32 - If the installed skill version is newer than the provisioned version in either file, warn: `⚠ CLAUDE.md provisioned with vX.Y but provision-agentic-config is at vX.Y — consider re-running /provision-agentic-config`
33 - If the version comment is missing from `CLAUDE.md` or `AGENTS.md`, note: `ℹ No provision version found in CLAUDE.md/AGENTS.md — run /provision-agentic-config to add version tracking`
34 - If `~/.claude/skills/provision-agentic-config/SKILL.md` does not exist, skip this check silently.
35
365. **Report status:**
37 - Branch name
38 - Commits pulled (if any) — show short log of new commits
39 - Whether stashed changes were re-applied
40 - Any conflicts that need manual resolution
41 - Current `git status`
42 - **Outstanding work** — summary from step 3 (next step, current phase, remaining work, pending manual tasks) or "No active plan"
43 - **Advisory tasks** — pending record/recurring counts, if those files exist
44
456. **Post-sync actions:**
46
47 a) Check if `sync.md` exists at the project root.
48
49 b) **If `sync.md` exists** — parse and execute it:
50 - Read `sync.md` and identify sections by H2 headings.
51 - **Dependencies** (aliases: "Deps", "Dependency Management"):
52 Execute shell commands found in fenced code blocks (e.g., `npm install`). Report output briefly.
53 - **Conflict Resolution** (aliases: "Conflicts"):
54 If the pull introduced merge conflicts (from step 2), apply the guidance in this section. For example, if it says "accept theirs for lockfiles", run the appropriate `git checkout --theirs` command. If no conflicts exist, skip silently.
55 - **Custom** (aliases: "Project-Specific", "Scripts", "Setup"):
56 Execute shell commands found in fenced code blocks in order. Report output briefly.
57 - **Notifications** (aliases: "Awareness", "Alerts", "Watch"):
58 For each bullet point, check if the mentioned file or directory was modified in the pulled commits (use `git diff --name-only` against the pre-pull HEAD). If any match, print a prominent alert with the bullet's description.
59 - Sections with unrecognised headings: skip with a note ("Skipped unknown sync.md section: <heading>").
60 - Report a summary of all post-sync actions taken.
61
62 c) **If `sync.md` does not exist** — suggest creating one:
63 - Analyse the project to detect:
64 - Package manager (look for `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `Pipfile.lock`, `requirements.txt`, `go.sum`, `Cargo.lock`, `Gemfile.lock`, `composer.lock`)
65 - Common scripts (check `package.json` scripts, `Makefile`, `Justfile` for build/codegen/migrate targets)
66 - Config templates (`.env.example`, `docker-compose.yml`, `config/`)
67 - Present a suggested `sync.md` to the user with detected actions pre-filled, following the format in the **sync.md format** section below.
68 - Ask: "Would you like me to create this `sync.md`? You can customise it anytime."
69 - **Only create the file if the user approves.**
70
71## sync.md format
72
73The `sync.md` file lives at the project root. It uses H2 sections as categories. Shell commands go in fenced code blocks; prose guidance goes in bullet points.
74
75```markdown
76# Post-Sync Actions
77
78## Dependencies
79
80Commands to run after pulling to keep local dependencies up to date.
81
82```sh
83npm install
84```
85
86## Conflict Resolution
87
88Project-specific guidance for handling merge conflicts.
89
90- Always accept theirs for `package-lock.json` — regenerate via install command above
91- For `generated/` files, regenerate with `npm run codegen` instead of resolving manually
92
93## Custom
94
95Project-specific scripts or commands to run after sync.
96
97```sh
98npm run codegen
99```
100
101## Notifications
102
103Files and patterns to check for changes after a pull. Alert the user if any were modified.
104
105- `.env.example` — check for new environment variables you may need to add to `.env`
106- `CLAUDE.md` — review if project conventions were updated
107- `config/` — warn about config schema changes
108```
109
110## Constraints
111- Do not force-push or rewrite history.
112- Do not auto-resolve merge conflicts — report them and let the user decide. However, if `sync.md` has a **Conflict Resolution** section, follow its guidance for the specific files/patterns it covers.
113- If stash pop fails due to conflicts, leave the stash intact and report it.
114- Post-sync commands from `sync.md` run in the project root directory.
115- If any post-sync command fails, report the error and continue with remaining actions (do not abort).
116- Never auto-create `sync.md` without explicit user approval.
117- Do not execute commands from `sync.md` sections that are commented out with HTML comments (`<!-- ... -->`).
118
119
120## Default Shipping Contract
121
122Follow the shared shipping contract convention in CLAUDE.md.