sync-template
Skill0 starsChanged 42 days agoMITView on GitHub
Pull the roots template's shared mechanics into this repository. Bootstrap the script if missing, run the sync, review the staged diff, apply the printed follow-ups, run the done gate, and propose the commit. Use when the user says "sync from template", "pull template updates", "update the mechanics", or "sync roots". Never commits or pushes on its own.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- Littlpinguin/marketing-cockpit-templatetheir own version, first seen Nov 3, 2026
- AIBiz-Automatyzacje/claude-code-startertheir own version, first seen Nov 3, 2026
- AIBiz-Automatyzacje/claude-crontheir own version, first seen Nov 2, 2026
- dagonet/claude-code-toolkittheir own version, first seen Nov 1, 2026
- vandalsvq/edt1c-ai-templatetheir own version, first seen Oct 29, 2026
- luiseiman/dotforgetheir own version, first seen Oct 13, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- dotnize/react-tanstarter★ 1.4ksame name
- mugnavo/tanstarter★ 1.4ksame name
- IcelandicIcecream/aphex★ 277same name
- josipjelic/orchestrated-project-template★ 96same name
- AIBiz-Automatyzacje/claude-code-starter★ 94same name
- tranhieutt/software_development_department★ 71same name
- vandalsvq/edt1c-ai-template★ 23same name
- lhpaul/ai-dev-framework-template★ 9same name
- Littlpinguin/marketing-cockpit-template★ 9same name
- luiseiman/dotforge★ 8same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- first-runSkill
- fix-ciSkill
- new-adrSkill
- new-packageSkill
- new-specSkill
- prSkill
- releaseSkill
- sync-templateSkill
- update-depsSkill
- verify-docsSkill
- first-runSkill
- fix-ciSkill
- new-adrSkill
- new-packageSkill
- new-specSkill
- prSkill
- releaseSkill
- update-depsSkill
- verify-docsSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 0 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Start clean. The script refuses uncommitted changes under the synced paths, and an untracked .template-sync.json or one with unstaged edits.
- Very specific: line 32
Run pnpm sync:template, or node scripts/sync-template.mts while package.json has no sync:template script (add the fork URL if this repo …
- Very specific: line 37
If it stops on an invalid .template-sync.json, fix the field it names.
- Very specific: line 39
Read the output top to bottom.
- Very specific: line 82
Never apply a "changed on both sides" entry either: this repository changed that value on purpose too (a packageManager raised with …
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sync from the template
pnpm sync:template stages the template's version of the synced paths, records
the sync point in .template-sync.json, and prints the follow-ups a file copy
cannot carry: the template commits since the last sync (breaking ones marked
!), the package.json and pnpm-workspace.yaml entries that differ, the
files the template added outside the synced paths, and the
.claude/settings.json entries the template has and this repo lacks. The synced paths, the recipe,
and the contract are in docs/template/sync-template.md.
- Bootstrap only a missing or old script. If
scripts/sync-template.mtsis missing, or predates the state file (grep -q template-sync.json scripts/sync-template.mtsfails), overwrite it with a current copy fetched with plain git (behavior 7 says why) from the template this repository tracks:urlandrefin.template-sync.json, else thetemplateremote, in place of the roots URL andmainbelow. Otherwise skip this step: that copy records the sync point and updates itself, and no.template-sync.jsononly means it has never synced. Thesync:templatescript shows up as a missing follow-up on a first run:mkdir -p scripts && git fetch --no-tags https://github.com/RemiMyrset/roots.git main && git show FETCH_HEAD:scripts/sync-template.mts > scripts/sync-template.mts - Start clean. The script refuses uncommitted changes under the synced paths,
and an untracked
.template-sync.jsonor one with unstaged edits; commit them first, never discard them. Never stash them: linked worktrees share one stash list (docs/template/agent-surfaces.md, Permission prompts), and with.template-sync.jsonstashed the sync runs without itsexcludeandinclude. - Run
pnpm sync:template, ornode scripts/sync-template.mtswhilepackage.jsonhas nosync:templatescript (add the fork URL if this repo tracks a fork, or--ref <branch|tag>to pin a template branch or tag; both are remembered). Claude Code runs thepnpmform without a prompt and asks before thenodeone; Codex and Gemini ask. If it stops on an invalid.template-sync.json, fix the field it names; deleting the file drops itsexcludeandinclude. Read the output top to bottom. On a first sync, theBaseline:line says how the starting point was found:root timeis approximate,nonemeans no commit list this run. A warning that.template-sync.jsoncame with this repository's first commit means it was made from a repository that syncs, such as an organization's fork of roots: the sync took that repository as the template, or the warning asks for its URL. Tell the user which template was used. ARecorded this repository as <url>line names the URL a repository made from this one will sync from; when it is a personal fork or a mirror, setrepoin.template-sync.jsonto the canonical URL. - Breaking commits first. Every
!line and itsBREAKING CHANGEparagraph is an instruction for a hand-edit outside the synced paths: a.claude/settings.jsonentry, a devDependency, an orphan file to delete. Apply each one, or tell the user why not. When a hand-edit takes the template's text for a file the sync does not stage, the sync has fetched it:git show <sha>:<path>prints it, where<sha>is the one afteraton theFetchedline (thecommitnow in.template-sync.json), never the older sync point in parentheses. Never readtemplate/<ref>instead; Edge cases indocs/template/sync-template.mdsay why. - Review the staged diff with
git diff --cached. Deliberate local divergence in a synced file is normal: discard that path withgit restore --staged --worktree <path>. A file of your own at a path the template now ships shows asM; discard it too. ADline is a file the template retired: one in its tree at the sync point, your edits included, or a byte-identical copy of a version it shipped there. Discard it to keep the file; an unedited one comes back asDnext sync until you move it. AKeptblock lists files that stayed but may be the template's: each is yours or one the template retired;git rmthe template's. ASkippedblock means a checkout failed; fix the path and re-run. A skill is two synced paths,.claude/skills/<name>/and its generated mirror.agents/skills/<name>/: discard, keep, orgit rmboth. After discarding under.claude/skillsalone, runpnpm docs:gen && git add .agents/skills; a template mirror left staged fails thedocs:gendrift gate. - Apply the follow-ups.
Follow-upslines arepackage.jsonedits andWorkspacelines arepnpm-workspace.yamledits: "missing here" and "changed on the template" entries are edits to make; "differs" (first sync) needs judgment; "customized locally" is informational, leave those alone. A dependency is the exception: list thedevDependencies.*andcatalog.*entries to add or re-range for the user and edit only those they confirm, per the ask-first rule inAGENTS.md. Never edit anallowBuilds.*line:AGENTS.mdleaves each one to a human, so hand them over. AdevDependenciesentry ofcatalog:needs itscatalog.*entry too. Never apply a "changed on both sides" entry either: this repository changed that value on purpose too (apackageManagerraised withcorepack use, say), so list it with itsbase:,template:, andyours:values and edit only what the user confirms. An entry with a "which this sync deletes" note needs a fix even when it is customized: drop the deleted file from the value, or discard that file'sDline.Fileslines are template files outside the synced paths: run the printedgit restorefor each one this repo needs, such as a config a synced gate reads, and skip the rest; it writes and stages the file.Settingslines are.claude/settings.jsonedits: add each rule, output style, and hook registration marked "missing here", beside your own hooks. For a hook that "differs", theyours:lines are registrations the template replaced: remove them and add thetemplate:one, unless you changed that matcher on purpose. Never remove a hook noyours:line names. Edit by hand; never copy the template's settings file over yours. - Done gate.
pnpm installifpackage.jsonorpnpm-workspace.yamlchanged, thenpnpm verify; it stops at the first failure and names it. Fix at the source; never loosen a synced checker. - Stage the follow-ups. The sync stages only its own paths and
.template-sync.json, sogit addevery file edited in steps 4, 6, and 7 (package.json,pnpm-workspace.yaml,pnpm-lock.yaml,.claude/settings.json, any file a footer named) andgit rmevery orphan a footer said to delete. Thengit status --porcelainmust show nothing the new mechanics need as unstaged or untracked; a commit without them passes locally and fails in CI. - Hand off: summarize what came in, what was discarded and why, which
follow-ups were applied, and propose
git commit -m "chore: sync mechanics from template". Do not commit or push unless asked.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

