| name | sync-config |
| description | Synchronizes CLAUDE.md and .claude/ configurations across similar projects. Detects project type, compares against templates, and propagates updates. Use when user says "sync configs", "update CLAUDE.md across projects", "standardize configs", or "check config consistency". Do NOT use for initial project setup from scratch.
|
| argument-hint | [target project path] |
| metadata | {"author":"roberto-ramirez","version":"1.0.0","category":"workflow-automation","tags":["configuration","claude","sync","cross-project"]} |
/sync-config
You are synchronizing Claude Code configurations: Detect project type, compare against templates, propagate updates.
Input
$ARGUMENTS
If $ARGUMENTS is empty, ask the user:
- Mode —
check (compare only) or apply (propagate changes)
- Projects — List of project directories to sync
Step 1 — Detect project type
For each project directory, detect the type by examining config files, project files, and structure. Common indicators:
- Build tool configs (package.json, *.csproj, Cargo.toml, go.mod, pyproject.toml, etc.)
- Framework configs (vite.config, next.config, angular.json, etc.)
- Language markers (tsconfig.json, .eslintrc, rustfmt.toml, etc.)
Report detected types:
Project Detection
═════════════════
~/project-a → [detected type]
~/project-b → [detected type]
...
Step 2 — Read current configurations
For each project, read:
CLAUDE.md (root-level)
.claude/CLAUDE.md (if exists)
.claude/agents/*.md (agent definitions)
Step 3 — Compare against templates
Load the appropriate templates from this skill's references/ directory:
references/base-template.md — required/recommended sections for ALL projects
references/node-template.md — Node.js/TypeScript projects (detected via package.json, tsconfig.json)
references/dotnet-template.md — .NET projects (detected via *.sln, *.csproj)
references/python-template.md — Python projects (detected via pyproject.toml, requirements.txt)
references/go-template.md — Go projects (detected via go.mod)
Compare each project's CLAUDE.md against the base template + the detected type template:
Divergence Report: ~/project-a
═════════════════════════════════
Type: [detected type]
Templates: base + [type-specific]
[REQUIRED] sections missing in project:
- [section name]
[RECOMMENDED] sections missing in project:
- [section name]
Sections in project but not in template:
- [section name] (project-specific, keep)
Sections that differ:
- [section name] — [what's different]
Step 4 — Apply changes (if mode is apply)
- Show diff for each file before applying
- Ask for confirmation per project
- Apply changes, preserving project-specific sections
- Report results
Gotchas
These are common failure modes when syncing configs. Watch for them:
- Overwriting project-specific content. A project's CLAUDE.md may have custom sections (e.g., "Deployment", "Known issues") that don't exist in any template. Never delete or overwrite these — they are project-specific and intentional.
- Applying the wrong type template. A monorepo may have both
package.json and *.csproj. Detect the primary type based on the root-level build tool, or apply both templates and let the user resolve conflicts.
- Treating RECOMMENDED as REQUIRED. Missing a RECOMMENDED section is a suggestion, not a failure. Only flag REQUIRED sections as needing action.
- Syncing agent definitions.
.claude/agents/ files are project-specific — agents for a billing service are useless in a docs site. Never sync these across projects.
Important constraints
- Never overwrite project-specific sections. Only sync template sections.
- Always show diffs before applying. User must approve changes.
- Preserve existing agent definitions.
.claude/agents/ files are project-specific.