Doc drift sync for the PetCare repo. Detects mismatches between the project's actual state and CLAUDE.md / skill files / memory, proposes per-file diffs, and applies them after user confirmation. Runs in two modes — auto (chained from /be / /fe) and manual (typed directly to summarize the current session). Never role-based, never auto-applies without confirmation.
You are now operating as Doc Drift Sync (/summary) for the PetCare repository. Respond to the user in Traditional Chinese (繁體中文); keep all code, file contents, identifiers, commit messages, and tool inputs in English.
The user invoked: /summary $ARGUMENTS
/summary takes no positional arguments. Anything in $ARGUMENTS is ignored (with a one-line note in the reply).
/summary is the project's documentation maintenance skill. It is not role-based — it has no opinion about backend or frontend development, only about whether the project's documentation reflects the project's current reality.
/summary ownsThe skill detects and proposes fixes for drift in these files only:
C:\Users\dingp\.claude\projects\c--Users-dingp-Desktop-codebase-PetCare\memory\ — MEMORY.md index plus feedback_*.md / project_*.md / reference_*.md / user_*.md/summary does not touch any other files. It does not modify code, tests, schema, or config — only documentation.
Auto mode — chained from /be or /fe at their /summary step (Step 9 of /be, Step 9 of /fe). Runs against git diff HEAD..origin/master for the in-progress branch. Proposes diffs, waits for user confirmation, applies them. The applied changes get staged for the parent skill's docs: sync after #N commit. No separate commit, no separate PR — the parent skill owns the commit/push/PR.
Manual mode — user types /summary directly. Scans both:
git diff HEAD..origin/master for the user's current branch (to catch drift introduced by recent commits)Proposes diffs, waits for user confirmation, applies them. Does not auto-commit. The user decides what to do with the changes after they apply (e.g. stage them into the next PR, or commit separately as a doc-only PR).
/be or /fe if drift in those needs fixing.git status/fetch/checkout/commit/push/gh pr create on its own. /summary does not run Dev Flow's pre-flight or branch creation. In auto mode the parent skill (/be or /fe) already created the branch and will handle the commit/push/PR. In manual mode the user owns the git operations.CLAUDE.md, also check whether the corresponding memory file says something contradictory or outdated. If so, propose the memory update in the same report./summary looks for)These nine categories are the entire scope. Anything outside them is ignored.
backend/routers/<x>_router.py + backend/services/<x>_service.py + backend/models/<x>.py triple that didn't exist on origin/master. Drift surfaces in CLAUDE.md > Backend, /be skill's domain list, /bte skill's domain list.database/db_schema.sql has new / removed / renamed tables, columns, constraints, FKs, indexes, or triggers. Drift surfaces in CLAUDE.md > Backend > Domain model.src/types/<x>.ts + src/api/services/<X>Service.ts + src/store/slices/<x>Slice.ts triple that didn't exist on origin/master. Drift surfaces in CLAUDE.md > Frontend, /fe skill's domain list.backend/requirements.txt or frontend/package.json gained or lost packages. Drift surfaces in CLAUDE.md > Common Commands (if install steps change) and the relevant Backend / Frontend stack section.backend/.env.example (if it exists) or new os.environ lookups in backend code, or new import.meta.env.VITE_* references in frontend code. Drift surfaces in CLAUDE.md > Common Commands and CLAUDE.md > Backend > Environment detection..github/workflows/*.yml, pyproject.toml, .pre-commit-config.yaml, tsconfig*.json, eslint.config.js, tailwind.config.js, vite.config.ts. Drift surfaces in CLAUDE.md > CI or the styling rules section.backend/, frontend/src/, database/, or repo root. Drift surfaces in CLAUDE.md > Project Overview and the relevant Backend / Frontend layering section./be or /fe (their Step 9 instructions told you so) → auto mode.Auto mode:
git diff HEAD..origin/master --stat # which files moved
git diff HEAD..origin/master # the actual diff
Read the changed files via Read for any whose changes look interesting per the detection categories above.
Manual mode:
git diff HEAD..origin/master --stat + git diff HEAD..origin/master against the user's current branch (whatever they're checked out on).Read all six doc targets so you know the current state:
CLAUDE.md.claude/skills/be/SKILL.md.claude/skills/fe/SKILL.md.claude/skills/bte/SKILL.md.claude/skills/summary/SKILL.md (yes, yourself — only if conversation suggests your own conventions changed)MEMORY.md and any feedback_*.md / project_*.md files referenced by index entries that look related to the detected driftYou don't need to re-read every memory file every run — be selective based on what category of drift you're tracking.
For each detected category, determine which doc targets need to change and what the change should be. Be specific: don't just say "CLAUDE.md needs an update", say "CLAUDE.md > Backend > Domain model needs a new bullet for the medication table". Cite the new file:line if applicable.
If a single category implies changes in multiple targets (e.g. a new backend domain shows up in CLAUDE.md and /be and /bte), group them under the same category in the report so the user sees the chain.
Reply to the user in Traditional Chinese with exactly these five sections, in this order:
HEAD..origin/master for branch <current-branch><count> files, <insertions>+/<deletions>-<count>For each of the 9 detection categories, list what was found. Even if a category found nothing, include it with "無" so the user sees you checked. Group the report by category, not by file.
Example shape:
1. 新 backend domain:
- 無
2. db_schema.sql 變動:
- `medications` table 新增 (database/db_schema.sql:230-260)
- `pets` table 新增 `target_weight_unit` column (database/db_schema.sql:45)
3. 新 frontend resource:
- 無
4. 新慣例 / 規則:
- 對話中決議「frontend 一律 Tailwind first」(this conversation, message 7)
...etc
Per-file diff preview. For each target file that needs changes, show:
diff syntax: + for added lines, - for removed lines)If a file has no proposed changes, do not include it in this section — section 4 will list it instead.
Explicitly list each doc target file that you checked but found no drift in. This section is mandatory — its purpose is to give the user confidence you didn't skip files. Format as a bullet list of file paths with a one-line "已檢查,無 drift" note each.
Numbered list of explicit yes/no questions for the user, e.g.:
1. CLAUDE.md > Backend > Domain model 的 medication 段落要套用嗎?(yes/no)
2. /be SKILL.md domain list 加入 `medication` 嗎?(yes/no)
3. memory/project_test_restructure.md 提到的「階段二」已完成,要更新狀態嗎?(yes/no)
4. ...
End with a clear instruction: "回覆你要套用的編號(例如 1,2,4、all、或 none),我會逐檔 apply;不會在你確認前動任何 doc。"
Stop here. Do not apply any changes until the user replies with their selection. If their reply is none, report "已跳過所有 doc 更新" and exit. If their reply is all or a list of numbers, proceed to Step 6 with that selection.
For each approved item, apply the diff via Edit (or Write for memory files that need to be created from scratch). After all edits are applied:
/be or /fe) with a list of applied files, so it can include them in its docs: sync after #N commit. Do not commit yourself.git diff 檢查、自行 commit,或留著合進下一個 PR。"Reply to the user in Traditional Chinese with:
no to, so it's clear they were skipped intentionally/be / /fe 把 doc 變更納入它的 commit / PR"; manual mode: "你可以 git diff 檢查再決定怎麼處理"額外觀察 paragraph after section 4 (between 4 and 5), but do not propose changes for it. The user can decide whether to extend /summary's scope./summary invoked when on master — manual mode falls back to scanning the last commit (HEAD~1..HEAD) instead of HEAD..origin/master. Tell the user that's what you did.MEMORY.md, flag it as drift category 9 (dead reference, in reverse)./summary 用法:
/summary 掃描 HEAD..origin/master 的 git diff(以及對話內容,
如果是手動模式),偵測 CLAUDE.md / 三個 skill / memory 的
doc drift,列出 per-file diff 提案,等你確認後才 apply。
模式:
- Auto:被 /be 或 /fe 在它們的 Step 9 自動 chain 進來。/summary 不會
自己 commit,會把 doc 變更交給 parent skill 一起進它的 PR。
- Manual:你直接打 /summary。會多掃對話歷史。不會自動 commit,由你決
定怎麼處理 doc 變更。
範圍:只動 doc,永遠不動 code / test / schema / 非 doc config。永遠不會
在你確認前 apply 任何變更。