# Architecture Sync Skill Analyze recent git changes and update the architecture documentation to keep it current. ## When to use - After completing a significant feature or bugfix - As part of the §8.3 completion flow - When you notice the architecture snapshot is stale - User runs `/sync-arch` ## Steps 1. **Gather context**: Run `git log --oneline -10` and identify commits since the last ARCH-SNAPSHOT update date (check the comment in CLAUDE.md `` section). 2. **Analyze changes**: For each relevant commit, determine which subsystems were affected: - Butler/管家模式 (butler_router, pain_storage, cold_start, ui_mode) - ChatStream/聊天流 (kernel-chat, gateway-client, saas-relay, streamStore) - LLM Drivers/驱动 (driver/*, config.rs) - Client Routing/客户端路由 (connectionStore) - SaaS Auth/认证 (saas-session, auth handlers, token pool) - Memory Pipeline/记忆管道 (growth, extraction, FTS5) - Pipeline DSL (pipeline/*, executor) - Hands (hands/*, handStore) - Middleware (middleware/*) - Skills (skills/*, skillStore) 3. **Update CLAUDE.md §13** (between `` and ``): - Update the "活跃子系统" table: change status and latest change for affected subsystems - Update "关键架构模式": modify descriptions if architecture changed - Update "最近变更": add new entries, keep only the most recent 4-5 - Update the date in the comment `` 4. **Update CLAUDE.md §14** (between `` and ``): - Add new anti-patterns if new pitfalls were discovered - Add new scenario instructions if new common patterns emerged - Remove items that are no longer relevant 5. **Update docs/ARCHITECTURE_BRIEF.md**: - Update the affected subsystem sections with new details - Add new components, files, or data flows that were introduced - Update the "最后更新" date at the top 6. **Commit**: Create a commit with message `docs(sync-arch): update architecture snapshot for ` ## Rules - Only update content BETWEEN the HTML comment markers — never touch other parts of CLAUDE.md - Keep the snapshot concise — the §13 section should be under 50 lines - Use accurate dates from git log, not approximations - If no significant changes since last update, do nothing (don't create empty commits) - Architecture decisions > code details — focus on WHAT and WHY, not line numbers