Sync
Invoke as $sync.
Pull the latest changes from the remote repository and report status.
Workflow
- Check current state:
- Run
git status to check for uncommitted changes.
- If there are uncommitted changes, stash them first, 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, 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 provisioned agent config:
- If
CLAUDE.md or AGENTS.md contains <!-- provision-agentic-config vX.Y -->, extract the version.
- Read the canonical
provision-agentic-config skill from the first existing path in this order:
~/.codex/skills/provision-agentic-config/SKILL.md
~/.claude/skills/provision-agentic-config/SKILL.md
global/codex/provision-agentic-config/SKILL.md in the current repo, when present
global/claude/provision-agentic-config/SKILL.md in the current repo, when present
- Extract the
version: field from the canonical skill's YAML frontmatter.
- Extract the canonical provisioned blocks from the same skill:
CLAUDE.md: the fenced block under Required Claude Block or the section that says "The Claude block to insert into ./CLAUDE.md".
AGENTS.md: the fenced block under Required AGENTS Block or the section that says "The AGENTS block to insert into ./AGENTS.md".
- Compare each existing project file against its corresponding canonical block after normalizing line endings and trimming only leading/trailing whitespace around the block. Do not ignore changed bullets, headings, command examples, or policy text.
- 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 a project file has the current version comment but the provisioned block content differs from the canonical block, warn:
⚠ CLAUDE.md provisioned block differs from the canonical provision-agentic-config vX.Y block — re-run $provision-agentic-config
- If a canonical block cannot be extracted, fall back to the version-only check and note:
ℹ Could not extract canonical provision-agentic-config block; checked version comment only
- If none of the canonical skill files exists, 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
- Agent config drift — provisioning version and canonical block match/drift status for
CLAUDE.md and AGENTS.md, if checked
- 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 in fenced code blocks. Report output briefly.
- Conflict Resolution (aliases: "Conflicts"): If the pull introduced merge conflicts (from step 2), apply the guidance in this section. If no conflicts, skip silently.
- Custom (aliases: "Project-Specific", "Scripts", "Setup"): Execute shell commands in fenced code blocks in order. Report output briefly.
- Notifications (aliases: "Awareness", "Alerts", "Watch"): For each bullet, check if the mentioned file/directory was modified in pulled commits (
git diff --name-only against pre-pull HEAD). If any match, print a prominent alert.
- Unrecognised headings: skip with a note.
- 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 lockfiles), common scripts (package.json, Makefile, Justfile), config templates (.env.example, docker-compose.yml).
- Present a suggested
sync.md following the format below.
- Ask: "Would you like me to create this
sync.md?"
- Only create the file if the user approves.
sync.md format
The sync.md file lives at the project root. H2 sections are categories. Shell commands go in fenced code blocks; prose guidance goes in bullet points.
# Post-Sync Actions
## Dependencies
```sh
npm install
Conflict Resolution
- Always accept theirs for
package-lock.json
Custom
npm run codegen
Notifications
.env.example — check for new environment variables
CLAUDE.md — review if project conventions were updated
## 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.
- Never auto-create `sync.md` without explicit user approval.
- Do not execute commented-out sections (`<!-- ... -->`).
## Default Shipping Contract
Follow the shared shipping contract convention in CLAUDE.md.
1---
2name: sync-4
3description: Pull latest changes from remote and report status
4type: shipping
5version: v0.2
6metadata:
7 source: https://skillmd.com/skills/georgeqle/sync-4
8---
9
10# Sync
11
12Invoke as `$sync`.
13
14Pull the latest changes from the remote repository and report status.
15
16## Workflow
17
181. Check current state:
19 - Run `git status` to check for uncommitted changes.
20 - If there are uncommitted changes, stash them first, pull, then pop the stash. Warn the user about the stash.
212. Pull from remote:
22 - Run `git pull --rebase origin <current-branch>`.
23 - If rebase conflicts occur, abort the rebase, try `git pull --no-rebase` instead, and report any merge conflicts for the user to resolve.
243. Check for outstanding work:
25 - Check if `tasks/roadmap.md` exists for the full plan, and `tasks/todo.md` for the current phase.
26 - If `tasks/todo.md` exists, read it and look for unchecked items (`- [ ]`).
27 - If there are incomplete items, summarise: which phase is current, what the next step is, and how many steps/phases remain.
28 - If `tasks/manual-todo.md` exists, count unchecked manual tasks and include in the summary.
29 - 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.
30 - If all items are checked, report that the plan is complete.
31 - If neither file exists, note that there is no active plan.
324. Check provisioned agent config:
33 - If `CLAUDE.md` or `AGENTS.md` contains `<!-- provision-agentic-config vX.Y -->`, extract the version.
34 - Read the canonical `provision-agentic-config` skill from the first existing path in this order:
35 1. `~/.codex/skills/provision-agentic-config/SKILL.md`
36 2. `~/.claude/skills/provision-agentic-config/SKILL.md`
37 3. `global/codex/provision-agentic-config/SKILL.md` in the current repo, when present
38 4. `global/claude/provision-agentic-config/SKILL.md` in the current repo, when present
39 - Extract the `version:` field from the canonical skill's YAML frontmatter.
40 - Extract the canonical provisioned blocks from the same skill:
41 - `CLAUDE.md`: the fenced block under `Required Claude Block` or the section that says "The Claude block to insert into `./CLAUDE.md`".
42 - `AGENTS.md`: the fenced block under `Required AGENTS Block` or the section that says "The AGENTS block to insert into `./AGENTS.md`".
43 - Compare each existing project file against its corresponding canonical block after normalizing line endings and trimming only leading/trailing whitespace around the block. Do not ignore changed bullets, headings, command examples, or policy text.
44 - 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`
45 - 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`
46 - If a project file has the current version comment but the provisioned block content differs from the canonical block, warn: `⚠ CLAUDE.md provisioned block differs from the canonical provision-agentic-config vX.Y block — re-run $provision-agentic-config`
47 - If a canonical block cannot be extracted, fall back to the version-only check and note: `ℹ Could not extract canonical provision-agentic-config block; checked version comment only`
48 - If none of the canonical skill files exists, skip this check silently.
495. Report status:
50 - Branch name
51 - Commits pulled (if any) — show short log of new commits
52 - Whether stashed changes were re-applied
53 - Any conflicts that need manual resolution
54 - Current `git status`
55 - **Agent config drift** — provisioning version and canonical block match/drift status for `CLAUDE.md` and `AGENTS.md`, if checked
56 - **Outstanding work** — summary from step 3 (next step, current phase, remaining work, pending manual tasks) or "No active plan"
57 - **Advisory tasks** — pending record/recurring counts, if those files exist
586. Post-sync actions:
59 a) Check if `sync.md` exists at the project root.
60 b) **If `sync.md` exists** — parse and execute it:
61 - Read `sync.md` and identify sections by H2 headings.
62 - **Dependencies** (aliases: "Deps", "Dependency Management"): Execute shell commands in fenced code blocks. Report output briefly.
63 - **Conflict Resolution** (aliases: "Conflicts"): If the pull introduced merge conflicts (from step 2), apply the guidance in this section. If no conflicts, skip silently.
64 - **Custom** (aliases: "Project-Specific", "Scripts", "Setup"): Execute shell commands in fenced code blocks in order. Report output briefly.
65 - **Notifications** (aliases: "Awareness", "Alerts", "Watch"): For each bullet, check if the mentioned file/directory was modified in pulled commits (`git diff --name-only` against pre-pull HEAD). If any match, print a prominent alert.
66 - Unrecognised headings: skip with a note.
67 - Report a summary of all post-sync actions taken.
68 c) **If `sync.md` does not exist** — suggest creating one:
69 - Analyse the project to detect: package manager (look for lockfiles), common scripts (package.json, Makefile, Justfile), config templates (.env.example, docker-compose.yml).
70 - Present a suggested `sync.md` following the format below.
71 - Ask: "Would you like me to create this `sync.md`?"
72 - **Only create the file if the user approves.**
73
74## sync.md format
75
76The `sync.md` file lives at the project root. H2 sections are categories. Shell commands go in fenced code blocks; prose guidance goes in bullet points.
77
78```markdown
79# Post-Sync Actions
80
81## Dependencies
82
83```sh
84npm install
85```
86
87## Conflict Resolution
88
89- Always accept theirs for `package-lock.json`
90
91## Custom
92
93```sh
94npm run codegen
95```
96
97## Notifications
98
99- `.env.example` — check for new environment variables
100- `CLAUDE.md` — review if project conventions were updated
101```
102
103## Constraints
104
105- Do not force-push or rewrite history.
106- 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.
107- If stash pop fails due to conflicts, leave the stash intact and report it.
108- Post-sync commands from `sync.md` run in the project root directory.
109- If any post-sync command fails, report the error and continue with remaining actions.
110- Never auto-create `sync.md` without explicit user approval.
111- Do not execute commented-out sections (`<!-- ... -->`).
112
113
114## Default Shipping Contract
115
116Follow the shared shipping contract convention in CLAUDE.md.