360 Secure SkillHub
360 安全技能中心

update-cursor-settings

该 Skill 指导读取并修改 Codex/VSCode 用户 settings.json,可调整字体、缩进、保存时格式化、主题等常见编辑器设置;要求保留现有配置、处理带注释的 JSON 并校验语法,同时提示部分变更可能需要重载编辑器。

eohmig
eohmig
热度 15.61
最近更新 2026-09-20 04:31:55
分类:效率依赖:读写文件应用场景:工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add update-cursor-settings
Metadata
name
update-cursor-settings
description
Modify Codex/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.
metadata
{"surfaces":["ide"]}

Updating Codex Settings

This skill guides you through modifying Codex/VSCode user settings. Use this when you want to change editor settings, preferences, configuration, themes, keybindings, or any settings.json values.

Settings File Location

OS Path
macOS ~/Library/Application Support/Codex/User/settings.json
Linux ~/.config/Codex/User/settings.json
Windows %APPDATA%\Codex\User\settings.json

Before Modifying Settings

  1. Read the existing settings file to understand current configuration
  2. Preserve existing settings - only add/modify what the user requested
  3. Validate JSON syntax before writing to avoid breaking the editor

Modifying Settings

Step 1: Read Current Settings

// Read the settings file first
const settingsPath = "~/Library/Application Support/Codex/User/settings.json";
// Use the Read tool to get current contents

Step 2: Identify the Setting to Change

Common setting categories:

  • Editor: editor.fontSize, editor.tabSize, editor.wordWrap, editor.formatOnSave
  • Workbench: workbench.colorTheme, workbench.iconTheme, workbench.sideBar.location
  • Files: files.autoSave, files.exclude, files.associations
  • Terminal: terminal.integrated.fontSize, terminal.integrated.shell.*
  • Codex-specific: Settings prefixed with cursor. or aipopup.

Step 3: Update the Setting

When modifying settings.json:

  1. Parse the existing JSON (handle comments - VSCode settings support JSON with comments)
  2. Add or update the requested setting
  3. Preserve all other existing settings
  4. Write back with proper formatting (2-space indentation)

Example: Changing Font Size

If user says "make the font bigger":

{
  "editor.fontSize": 16
}

Example: Enabling Format on Save

If user says "format my code when I save":

{
  "editor.formatOnSave": true
}

Example: Changing Theme

If user says "use dark theme" or "change my theme":

{
  "workbench.colorTheme": "Default Dark Modern"
}

Important Notes

  1. JSON with Comments: VSCode/Codex settings.json supports comments (// and /* */). When reading, be aware comments may exist. When writing, preserve comments if possible.

  2. Restart May Be Required: Some settings take effect immediately, others require reloading the window or restarting Codex. Inform the user if a restart is needed.

  3. Backup: For significant changes, consider mentioning the user can undo via Ctrl/Cmd+Z in the settings file or by reverting git changes if tracked.

  4. Workspace vs User Settings:

    • User settings (what this skill covers): Apply globally to all projects
    • Workspace settings (.vscode/settings.json): Apply only to the current project
  5. Commit Attribution: When the user asks about commit attribution, clarify whether they want to edit the CLI agent or the IDE agent. For the CLI agent, modify ~/.cursor/cli-config.json. For the IDE agent, it is controlled from the UI at Codex Settings > Agent > Attribution (not settings.json).

Common User Requests → Settings

User Request Setting
"bigger/smaller font" editor.fontSize
"change tab size" editor.tabSize
"format on save" editor.formatOnSave
"word wrap" editor.wordWrap
"change theme" workbench.colorTheme
"hide minimap" editor.minimap.enabled
"auto save" files.autoSave
"line numbers" editor.lineNumbers
"bracket matching" editor.bracketPairColorization.enabled
"cursor style" editor.cursorStyle
"smooth scrolling" editor.smoothScrolling

Workflow

  1. Read ~/Library/Application Support/Codex/User/settings.json
  2. Parse the JSON content
  3. Add/modify the requested setting(s)
  4. Write the updated JSON back to the file
  5. Inform the user the setting has been changed and whether a reload is needed