sync-templatelisted
Install: claude install-skill luiseiman/dotforge
# Sync Template
Update the current project's Claude Code configuration against the latest version of dotforge.
## Principle: merge, not overwrite
NEVER overwrite existing files without confirmation. Compare and propose changes.
NEVER touch `settings.local.json` — it is the user's personal configuration.
NEVER modify sections marked with `<!-- forge:custom -->` in CLAUDE.md.
## Step 0: Verify global
Before syncing the project, verify that `~/.claude/CLAUDE.md` exists and contains behavior rules (communication, planning, autonomy). If global rules are active, the project's `_common.md` only needs technical rules (git, naming, testing, security). Do not duplicate what is already in global.
## Step 1: Detect current state
1. Read the current `.claude/settings.json`
2. Read the current `CLAUDE.md`
3. Read existing `.claude/rules/`
4. Read existing `.claude/hooks/`
5. Detect stacks using `$DOTFORGE_DIR/stacks/detect.md`
6. Read `~/.claude/CLAUDE.md` to know which rules are already covered globally
## Step 2: Compare against template
For each component, compare with the dotforge version:
### settings.json — Smart merge
- **allow**: union of sets. Add missing permissions from base template + stacks. NEVER remove local permissions the project already has.
- **deny**: union of sets. Add missing security denies. NEVER remove local denies.
- **hooks**: add missing hooks from template. Preserve custom project hooks.
- **Other fields**: preserve everything that is not allow/deny/