一键导入
sync-template
Update an existing project's Claude Code configuration against the current dotforge template, without losing local customizations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Update an existing project's Claude Code configuration against the current dotforge template, without losing local customizations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | sync-template |
| description | Update an existing project's Claude Code configuration against the current dotforge template, without losing local customizations. |
Update the current project's Claude Code configuration against the latest version of dotforge.
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.
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.
.claude/settings.jsonCLAUDE.md.claude/rules/.claude/hooks/$DOTFORGE_DIR/stacks/detect.md~/.claude/CLAUDE.md to know which rules are already covered globallyFor each component, compare with the dotforge version:
_common.md missing? → propose adding it.claude/rules/domain/ → NEVER TOUCH. Domain rules are project-owned knowledge, not template-managed. Skip entirely during sync.block-destructive.sh missing? → propose adding + chmod +x<!-- forge:custom --> → SKIP entirelyShow the user what would change BEFORE applying anything:
═══ SYNC DRY-RUN: {{project}} ═══
dotforge: {{version}} (current project: {{previous_version or "unknown"}})
NEW FILES (will be created):
+ .claude/rules/_common.md
+ .claude/hooks/block-destructive.sh
UPDATED FILES (merge):
~ .claude/settings.json
+ allow: "Bash(docker *)", "Bash(docker compose *)"
+ deny: "**/.env.local"
(local permissions preserved: "Bash(custom-script *)")
~ .claude/rules/backend.md
diff: +3 lines (new common errors)
NO CHANGES:
= .claude/rules/frontend.md (already up to date)
= .claude/hooks/lint-ts.sh (already up to date)
IGNORED (custom):
⊘ .claude/rules/strategies.md (not in template)
⊘ CLAUDE.md section "<!-- forge:custom -->"
Apply changes? (yes/no/select)
Only apply the changes the user approves.
yes → apply allno → cancelselect → show each change and ask yes/no individuallyFor settings.json: build the final merged JSON. Before writing, validate that the JSON is valid:
echo '<json_content>' | python3 -c 'import json,sys; json.load(sys.stdin)'
If validation fails, show the exact error and DO NOT write the file. Fix the JSON before continuing.
For hooks: copy + chmod +x.
After applying changes, update (or create) .claude/.forge-manifest.json:
shasum -a 256 <file> | cut -d' ' -f1
dotforge_version, synced_at, and stacks (from detected stacks)Format:
{
"dotforge_version": "<version from $DOTFORGE_DIR/VERSION>",
"synced_at": "<current date YYYY-MM-DD>",
"stacks": ["<detected-stack-1>", "<detected-stack-2>"],
"files": {
".claude/settings.json": {"hash": "sha256:<hash>", "source": "template+stacks"},
".claude/rules/_common.md": {"hash": "sha256:<hash>", "source": "template"}
}
}
Include ALL files in .claude/ that are managed by dotforge (not only those that changed in this sync).
Update in $DOTFORGE_DIR/registry/projects.yml:
last_sync: → current datedotforge_version: → current dotforge versionRun the /audit-project logic to confirm the score improved or held steady.
Show score before and after.
Audits the Claude Code configuration of a project against the dotforge template. Generates a report with score and gaps.
Sync all GitHub-backed git repos on this machine with origin. Pulls behind repos, pushes ahead repos, reports dirty/non-main/conflict cases for Claude to resolve.
Generate a Claude Code plugin package from the current project's dotforge configuration, ready for marketplace submission.
Fetch official Anthropic/Claude Code docs, detect changes relevant to dotforge, report deltas.
Process the practices inbox, evaluate, incorporate into dotforge, and suggest propagation to projects.
Restore a project's .claude/ directory to the dotforge template from scratch, with backup and rollback option.