Skip to content
Development
Skill

/sync-template

Syncs the .claude/ directory from an upstream template repository, showing a diff and applying new or modified files without overwriting local customizations. Use when updating SDD template files or when the user mentions template sync or upstream update.

From plugin
software-development-department
74116 skills28 agents1 MCP

Claude Code

$ npx -y skills add tranhieutt/software_development_department --skill sync-template --agent claude-code

SKILL.md

sync-template.SKILL.md
name: sync-template
type: workflow
description: "Syncs the .claude/ directory from an upstream template repository, showing a diff and applying new or modified files without overwriting local customizations. Use when updating SDD template files or when the user mentions template sync or upstream update."
argument-hint: "[upstream-repo-url]"
user-invocable: true
allowed-tools: Read, Bash, Glob
effort: 3
when_to_use: "Use when updating the .claude/ directory from an upstream SDD template repository, or when the user mentions template sync or upstream update."

Sync the `.claude/` directory from an upstream template repository into this project.

Determine the upstream URL

If `$ARGUMENTS` is provided, use it as the upstream repository URL.

If `$ARGUMENTS` is empty, check `CLAUDE.md` for a line like:

**Template upstream**: <url>

If no URL is found in either place, ask the user: > "What is the upstream template repository URL to sync from? (e.g. https://github.com/owner/repo)"

Do not proceed until a URL is confirmed.

---

Steps

1. Fetch the upstream template

Run:

SYNC_TMP=$(mktemp -d /tmp/template-sync-XXXXXX)
git clone --filter=blob:none --sparse "$UPSTREAM_URL" "$SYNC_TMP" 2>&1
cd "$SYNC_TMP" && git sparse-checkout set .claude

If the clone fails (no internet, repo moved, auth required, etc.) stop immediately and report the error clearly. Do not attempt fallbacks.

2. Show a diff summary

Compare `$SYNC_TMP/.claude/` against the project's `.claude/` directory and report:

  • **New files** — present in upstream but not locally (will be added)
  • **Modified files** — present in both but with different content (will be overwritten)
  • **Local-only files** — present locally but not in upstream (will be **kept unchanged** — these are project-specific customizations)

If there are no differences, say so and skip to clean-up.

3. Ask for confirmation

Present the diff summary and ask:

> "Apply these changes from `<upstream-url>`? Type **yes** to apply or **no** to cancel."

Do not proceed until the user explicitly confirms with "yes".

4. Apply the changes

From the project root, run:

cp -r "$SYNC_TMP/.claude/." .claude/

This will:

  • **Overwrite** files that exist in both upstream and locally
  • **Add** new files from upstream
  • **Preserve** all local-only files (project-specific agents, skills, rules, hooks)

5. Report

List each file that was added or updated, grouped by type:

  • Added: `[file list]`
  • Updated: `[file list]`

6. Clean up

rm -rf "$SYNC_TMP"

Confirm: "Sync complete. Temp directory removed."

---

Important constraints

  • Never delete local files that don't exist in upstream — they may be project-specific customizations (agents, skills, rules, hooks added after the template was cloned)
  • Never modify `CLAUDE.md`, `PRD.md`, `TODO.md`, or any files outside `.claude/` — this skill only touches `.claude/`
  • If the user's `.claude/` has meaningful customizations to a file that upstream has also changed, flag it specifically: "Note: `[file]` was modified locally — upstream changes will overwrite. Review diff before confirming if you want to preserve local changes."
Read more
@tranhieutt
Ships withsoftware-development-department

Software Development Department

74116 skills28 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
74
Star history of tranhieutt/software_development_department on GitHub, a chart by star-history.com

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc11d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about sync-template.

Which coding agents can use sync-template?
sync-template installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.