with one click
update-settings-options
// 同步 Claude settings docs 變更到 repo(type/UI/i18n/tests/docs)
// 同步 Claude settings docs 變更到 repo(type/UI/i18n/tests/docs)
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | update-settings-options |
| description | 同步 Claude settings docs 變更到 repo(type/UI/i18n/tests/docs) |
| model | opus |
| allowed-tools | Read, Write, Edit, Bash, Grep, Glob, Agent, AskUserQuestion, Skill |
同步 Claude settings docs 變更到 repo。4-phase automated pipeline。
sync settings from docsupdate settings optionsClaude settings docs changedhttps://json.schemastore.org/claude-code-settings.json(社群維護,machine-readable)code.claude.com/docs/en/settings + CHANGELOG(每次執行檢查是否有 schema store 遺漏)context7 /websites/code_claude(補充描述/context,≤3 queries,含 official discovery)src/shared/claude-settings-schema.ts、現有 section 實作;只補 literal enum、default、shapeSchema 包含多種 key,僅 user-facing 需同步到 settings UI。完整 key 清單以 references/surface-map.md 為準(避免雙處同步漂移)。
| Category | 處理 |
|---|---|
| user-facing | 同步(按 surface-map 分 section) |
| anti-direction | 同步到 AdvancedSection(啟用後違反低成本/高效率/高精度方向;判定準則見 references/surface-map.md) |
| managed-only | skip(企業管理員專用) |
| plugin-internal | skip(由 plugin/marketplace UI 管理) |
| deprecated | skip(被其他 key 取代) |
| repo-only | 提報給使用者確認(repo 有但 schema / official docs 皆無);不擅自刪除 |
| meta | skip($schema 等 JSON schema 參照) |
references/sources.mdreferences/surface-map.mdreferences/editor-patterns.mdcurl -sL https://json.schemastore.org/claude-code-settings.json(需 -L follow redirect)properties.*:key、type、enum、default、description$defs.hookCommand.anyOf[*]:hook command typesproperties.hooks.properties.*:hook event typesSchema store 是社群維護(anthropics/claude-code#11795),可能落後官方。此步驟交叉比對官方資訊:
context7 query code.claude.com/docs/en/settings(/websites/code_claude),抓 "Available settings" 表格中的 key 清單WebSearch 搜 site:github.com/anthropics/claude-code CHANGELOG settings 找最近新增的 settings keyWebSearch "<key>" site:code.claude.com + WebSearch "\"<key>\":" site:github.com/anthropics/claude-codeknown-env-vars.ts 中 CLAUDE_CODE_* / *_<KEY_UPPER>)、GitHub issue "<key>" 提及repo-onlydocs-only,納入 gap report/websites/code_claudecontext7 /websites/code_claude — query env vars 文件(claude-code-guide agent 可補充)env: Record<string,string>)src/shared/known-env-vars.ts — KNOWN_ENV_VARS registryreferences/env-vars-source.md單一 Explore agent 掃描 repo 現狀:
src/shared/claude-settings-schema.ts — schema 單一來源;value shape 用 valueSchema(kind + enum/min/max/item/...),section 陣列順序即 UI 渲染順序,controlType 由 valueSchema 自動推導,只有 mixed union 或刻意走 custom editor 才加 controlTypeOverride;沒自然落點的 user-facing key 直接放 advanced,不加 hiddensrc/shared/known-env-vars.ts — KNOWN_ENV_VARS registry(valueType 用原生型別)src/webview/i18n/locales/en.ts — i18n key 完整性NOTE: src/shared/claude-settings-types.generated.ts(ClaudeSettings / HookCommand 來源)由 npm run generate:settings-types 從上面 schema 重生,禁止手改、不列 scan target。
深度比對(禁止只比對頂層 key 存在性,這會漏掉 drift):
default / enum options(集合比,順序可不同)/ number minimum|maximum|multipleOf → repo min/max/steppermissions / sandbox.{filesystem,network} / attribution / spinnerVerbs / spinnerTipsOverride / statusLine / fileSuggestion / autoMode / worktree:properties 集合 + required/optional 旗標 + 子屬性 shape$defs.hookCommand.anyOf 每個 variant 的 required/optional properties、allowedMcpServers / deniedMcpServers items anyOf 的 discriminant 與 shapenumberValue() 沒 min/max 要補(例:port 欄位應補 1–65535)產出 diff:{ added: [{key, type, default, source}], removed: [{key}], changed: [{key, field, schema, repo, depth}] },depth = top-level / nested / union / meta
每個 diff key 標記 category(參照上方 Key categories 表)。user-facing 與 anti-direction 進入 Phase 4。repo-only 列表提給使用者確認(不擅自刪除)。
Anti-direction 判定:新 key 先評估是否符合 references/surface-map.md 的 anti-direction 準則(anti-cost / anti-efficiency / anti-user)。符合 → 標記 anti-direction,固定放 AdvancedSection。
Repo-only 判定分兩階:
docs-likely-gap
known-env-vars.ts 有對應 env var(例:autoConnectIde ↔ CLAUDE_CODE_AUTO_CONNECT_IDE)"<key>" 提及 settings 使用方式repo-only,在 gap 表標記、要求使用者確認;若確認為誤加 → 由使用者授權刪除hooks.properties.* vs repo HooksSection 支援(動態 Object.keys() 則自動相容)$defs.hookCommand vs repo HookCommand type unionKNOWN_ENV_VARS registry| Key | Status | Category | Source | Section | Details |
Source 欄位:
schema — schema store 有docs-only — 官方 docs 有但 schema store 無both — 兩者皆有docs-likely-gap — repo 有、docs 無,但有 env var 或 GitHub issue 等 feature 證據(保留,docs 漏寫)repo-only — repo 有、schema store / docs / env var / issues 皆無(提使用者確認)AskUserQuestion 讓用戶確認 section assignment依序執行(參照 references/ 決策):
src/shared/claude-settings-schema.ts — 新 key:在目標 section 陣列加 entry(陣列位置 = UI 渲染順序;沒自然落點放 advanced);既有 key:改 valueSchema / default / nestedUnder / dangerValues;刪 key:從陣列移除。src/shared/claude-settings-types.generated.ts 由 npm run generate:settings-types 自動同步(prebuild/prelint/pretest/pretypecheck 皆會觸發),禁止手改。references/surface-map.md 分配;只有 controlType: Object 的欄位需要在對應 section 手動渲染,其餘走 SchemaFieldRenderer;editor 選型依 references/editor-patterns.mden.ts、ja.ts、zh-TW.ts 增刪 locale keysCLAUDE.md — settings 分區表 + 陷阱src/shared/known-env-vars.ts — 增刪改 env var entriessettings.env.knownVars.* + settings.env.category.* keysnpm run typechecknpm testnpm run build最終回報必列:新增 key、刪除 key、修改 key、excluded keys(with category)、repo-only keys(提使用者確認清單)、hook 覆蓋狀態、受影響 section、驗證結果、official source discovery 結果(是否找到官方 schema URL、docs-only keys)