Communitygithub.com

OMC 设置

安装或刷新 oh-my-claudecode,用于插件、npm 和本地开发环境的规范设置流程。

OMC 设置 是什么?

此技能是 oh-my-claudecode (OMC) 的设置入口,用于在 Claude Code、Cursor 或 Codex 等 AI 编程助手环境中初次安装、刷新或修复 OMC。用户只需运行这一个命令,后续所有配置都将自动完成。它支持三种主要安装方式:marketplace/plugin 安装、npm 全局安装、以及本地开发或 worktree 环境。技能内置了智能标志解析(--local/--global/--force/--help),可分别处理项目级、全局级配置或强制重新设置。已配置的用户会收到更新或重新运行的选项,避免重复执行完整向导。整个流程分为四个阶段:安装 CLAUDE.md、环境配置(含 HUD/状态栏)、集成设置和完成欢迎。设置过程支持断点续传,遇到中断可以从中断处继续。技能还设计了一套预检查机制,通过检查 ~/.claude/.omc-config.json 来判断是否已配置,并自动清理已废弃的配置值(如 5.0.0 移除的 defaultExecutionMode)。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Yeachan-Heo/oh-my-claudecode/tree/main/skills/omc-setup

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

OMC 设置 是做什么的?

这是你唯一需要学习的命令。运行此命令后,其他一切都会自动完成。

当此技能被调用时,请立即执行下面的工作流。不要仅向用户复述或总结这些指令。

注意:本指南中所有 ~/.claude/... 路径在设置了 CLAUDE_CONFIG_DIR 环境变量时,会优先使用该变量。

最佳适用场景

当用户想要安装、刷新或修复 OMC 本身时,选择此设置流程。

  • Marketplace/插件安装用户应在执行 /plugin install oh-my-claudecode 后进入此流程
  • npm 用户应在执行 npm i -g oh-my-claude-sisyphus@latest 后进入此流程
  • 本地开发和工作树用户应在更新签出仓库并重新运行设置后进入此流程

标志解析

检查用户调用中的标志:

  • --help → 显示帮助文本(见下文)并停止
  • --local → 仅执行阶段 1(目标=local),然后停止
  • --global → 仅执行阶段 1(目标=global),然后停止
  • --force → 跳过预设置检查,直接执行完整设置(阶段 1 → 2 → 3 → 4)
  • 无标志 → 执行预设置检查,然后根据需要执行完整设置

帮助文本

用户使用 --help 运行时,显示以下内容并停止:

OMC 设置 - 配置 oh-my-claudecode

用法:
  /oh-my-claudecode:omc-setup           运行初始设置向导(如果已配置,则进行更新)
  /oh-my-claudecode:omc-setup --local   配置本地项目(.claude/CLAUDE.md)
  /oh-my-claudecode:omc-setup --global  配置全局设置(~/.claude/CLAUDE.md)
  /oh-my-claudecode:omc-setup --force   强制运行完整设置向导(即使已配置)
  /oh-my-claudecode:omc-setup --help    显示此帮助信息

模式:
  初始设置(无标志)
    - 首次设置的交互式向导
    - 配置 CLAUDE.md(本地或全局)
    - 设置 HUD 状态栏
    - 检查更新
    - 清理已废弃的设置值(5.0.0 移除了 defaultExecutionMode)并将 MCP 注册指向 Claude Code 的本机配置
    - 配置团队模式默认值(代理数量、类型、模型)
    - 如果已配置,提供快速更新选项

  本地配置(--local)
    - 通过 `scripts/setup-claude-md.sh` 调用插件本地协调器;shell 会在执行任何安装后工作前验证协调器的响应及其退出状态
    - 仅报告协调器创建的、对已修改文件的字节完全相同的备份
    - 项目特定设置
    - 在 OMC 升级后使用此选项更新项目配置

  全局配置(--global)
    - 通过 `scripts/setup-claude-md.sh` 调用插件本地协调器;shell 会在执行任何安装后工作前验证协调器的响应及其退出状态
    - 仅报告协调器创建的、对已修改全局文件的字节完全相同的备份
    - 默认:显式覆盖 ~/.claude/CLAUDE.md,使普通的 `claude` 也能使用 OMC
    - 可选保留模式:保留用户的基础 `CLAUDE.md`,并将 OMC 安装到 `CLAUDE-omc.md` 中,用于 `omc` 启动
    - 应用于所有 Claude Code 会话
    - 保留同名旧版钩子文件,除非其确切历史内容已独立验证
    - 在 OMC 升级后使用此选项更新全局配置

  强制完整设置(--force)
    - 绕过“已配置”检查
    - 从头开始运行完整的设置向导
    - 当你想要重新配置偏好时使用

示例:
  /oh-my-claudecode:omc-setup           首次设置(或更新 CLAUDE.md)
  /oh-my-claudecode:omc-setup --local   更新此项目
  /oh-my-claudecode:omc-setup --global  更新所有项目
  /oh-my-claudecode:omc-setup --force   重新运行完整设置向导

更多信息:https://github.com/Yeachan-Heo/oh-my-claudecode

设置调用

不要在此技能中独立扫描插件缓存目录或选择插件根目录。从正在运行的插件环境提供的插件根目录调用安装脚本:

bash "${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/setup-claude-md.sh" <local|global> [overwrite|preserve]

该脚本是唯一的缓存解析器。它只接受完整的插件根目录(规范化的 docs/CLAUDE.md、协调器工件和 wiki 技能),选择严格的完整 SemVer 缓存版本,验证编译源代码握手,并在协调器协议或状态不一致时关闭失败。不要下载配置或在该协调器之外修改 CLAUDE.md。

预设置检查:是否已配置?

关键:在做任何事情之前,先检查设置是否已完成。这可以防止用户在每次更新后都必须重新运行完整的设置向导。

# 检查设置是否已完成
CONFIG_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
case "$CONFIG_DIR" in
  "~")
    CONFIG_DIR="$HOME" ;;
  "~/"*)
    CONFIG_DIR="$HOME/${CONFIG_DIR#\./}" ;;
  "~\\"*)
    CONFIG_DIR="$HOME/${CONFIG_DIR#\.\}" ;;
esac
CONFIG_FILE="$CONFIG_DIR/.omc-config.json"

if [ -f "$CONFIG_FILE" ]; then
  if ! command -v jq >/dev/null 2>&1; then
    echo "错误:需要 jq 来检查现有的 OMC 设置状态。未修改现有配置。"
    exit 1
  fi
  if ! SETUP_COMPLETED=$(jq -r '.setupCompleted // empty' "$CONFIG_FILE" 2>/dev/null) \
    || ! SETUP_VERSION=$(jq -r '.setupVersion // empty' "$CONFIG_FILE" 2>/dev/null); then
    echo "错误:现有的 OMC 配置是无效的 JSON。未修改现有配置。"
    exit 1
  fi

  if [ -n "$SETUP_COMPLETED" ] && [ "$SETUP_COMPLETED" != "null" ]; then
    echo "OMC 设置已在 $SETUP_COMPLETED 完成"
    [ -n "$SETUP_VERSION" ] && echo "设置版本:$SETUP_VERSION"
    ALREADY_CONFIGURED="true"
  fi
fi

如果已配置(且没有 --force 标志)

如果 ALREADY_CONFIGURED 为 true 且用户没有传递 --force、--local 或 --global 标志:

使用 AskUserQuestion 进行提示:

问题: "OMC 已配置。你想做什么?"

选项:

  1. 更新 CLAUDE.md 并清理已废弃的设置值 - 安装当前插件的规范化 CLAUDE.md 并运行阶段 2 步骤 2.4,无需重新运行完整设置
  2. 重新运行完整设置 - 执行完整的设置向导
  3. 取消 - 退出,不做任何更改

如果用户选择"更新 CLAUDE.md 并清理已废弃的设置值":

  • 检测是否存在本地(.claude/CLAUDE.md)或全局(~/.claude/CLAUDE.md)配置
  • 如果存在本地配置,运行:bash "${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/setup-claude-md.sh" local
  • 如果仅存在全局配置,运行:bash "${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/setup-claude-md.sh" global
  • 运行阶段 2 步骤 2.4 以清理已废弃的 defaultExecutionMode 键
  • 跳过清理之后的所有其他步骤
  • 报告成功并退出

如果用户选择"重新运行完整设置":

  • 继续执行下面的恢复检测

如果用户选择"取消":

  • 退出,不做任何更改

强制标志覆盖

如果用户传递了 --force 标志,则跳过此检查,直接进入设置。

恢复检测

在开始任何阶段之前,检查是否存在现有的状态:

bash "${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/setup-progress.sh" resume

如果存在状态(输出不是 "fresh"),使用 AskUserQuestion 进行提示:

问题: "发现之前的设置会话。你想恢复还是重新开始?"

选项:

  1. 从步骤 $LAST_STEP 恢复 - 继续上次中断的地方
  2. 重新开始 - 从头开始(清除保存的状态)

如果用户选择"重新开始":

bash "${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/setup-progress.sh" clear

阶段执行

对于 --local 或 --global 标志:

读取 ${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/skills/omc-setup/phases/01-install-claude-md.md 文件并遵循其指示。 (阶段文件自行处理标志模式下的提前退出。)

对于完整设置(默认或 --force):

按顺序执行各个阶段。对于每个阶段,读取对应的文件并遵循其指示:

  1. 阶段 1 - 安装 CLAUDE.md:读取 ${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/skills/omc-setup/phases/01-install-claude-md.md 并遵循其指示。

  2. 阶段 2 - 环境配置:读取 ${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/skills/omc-setup/phases/02-configure.md 并遵循其指示。阶段 2 必须将 HUD/状态栏的设置委托给 hud 技能;不要在此处内联生成或修改 statusLine 路径。

  3. 阶段 3 - 集成设置:读取 ${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/skills/omc-setup/phases/03-integrations.md 并遵循其指示。

  4. 阶段 4 - 完成:读取 ${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/skills/omc-setup/phases/04-welcome.md 并遵循其指示。

正常中断处理

重要:此设置过程会在每个阶段后通过 ${OMC_SETUP_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/setup-progress.sh 保存进度。如果被中断(Ctrl+C 或连接丢失),设置可以从中断处恢复。

保持最新

安装 oh-my-claudecode 更新后(通过 npm 或插件更新):

自动:只需运行 /oh-my-claudecode:omc-setup - 它会检测到你已配置,并提供"更新 CLAUDE.md 并清理已废弃的设置值"的快速选项,跳过向导的其余部分。

快速更新路径必须仍然执行阶段 2 步骤 2.4,以便升级移除已废弃的 defaultExecutionMode 值;且不得写入任何替代的执行模式设置。

手动选项:

  • /oh-my-claudecode:omc-setup --local 仅更新项目配置
  • /oh-my-claudecode:omc-setup --global 仅更新全局配置
  • /oh-my-claudecode:omc-setup --force 重新运行完整向导(重新配置偏好)

这样可以确保你拥有最新的功能和代理配置,而无需消耗额外的 token 来重复完整设置。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

agent-doc-discipline

Writing-time discipline for documents agents consume (the five surfaces, specs, tickets, .omc/skills/) — every rule checkable and carrying a why, steps before reference, one meaning in one home, no restating what the environment already says. Mandatory at drydock seed generation and the launch C5 sediment pass; opt-in for any other agent-facing doc edit. The companion of minimal-code-discipline: that one disciplines code, this one disciplines papers.

ai-slop-cleaner

Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode

ask

Process-first advisor routing for Claude, Codex, Gemini, Antigravity, Grok, or Cursor via `omc ask`, with artifact capture and no raw CLI assembly

ask-navigator

Shipyard

autopilot

Full autonomous execution from idea to working code

autoresearch

Stateful single-mission improvement loop with strict evaluator contract, markdown decision logs, and max-runtime stop behavior

cancel

Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state

configure-notifications

Configure notification integrations (Telegram, Discord, Slack) via natural language

debug

Diagnose the current OMC session or repo state using logs, traces, state, and focused reproduction

deepinit

Deep codebase initialization with hierarchical AGENTS.md documentation

deep-interview

Socratic deep interview with mathematical ambiguity gating before explicit execution approval

drydock

Lay the keel of the shipyard harness in any repo — the 4-pillar shared environment (Context, Rules, Tools, Standards) across 5 surfaces (CLAUDE.md, skills, design-system, mcp/cli, shared context) so that every human and agent inherits the same design language and anyone can ship. Run once per repo; re-run with --check to audit drift.

execute

Carry an approved task through to working, verified code

external-context

Invoke parallel document-specialist agents for external web searches and documentation lookup

graph

Deterministic orchestration graph runtime - declarative DAG pipelines with journal-based crash recovery

harbor

Harbor intake for external work — the captain only handles unresolved decisions. Sweeps incoming issues and PRs, verifies every claim before disposition, reuses every decision already made, and hands the maintainer a docket whose pending items each carry one question with options, recommendation, impact and evidence. Agent-autonomous for facts and for actions covered by standing authorization; signed for every new judgment. Never merges.

hud

Configure HUD display options (layout, presets, display elements)

launch

Shipyard

loft

Loft the shape before cutting steel — answer a design question that prose cannot settle by building a throwaway artifact: a pure logic module in a clickable shell, or structurally different UI variants behind one route. The captain reacts to the artifact; the answer folds into the decision; the artifact never docks. Use when a design question stalls in words, when a navigator map carries a loft ticket, or when a spec discussion reaches

minimal-code-discipline

YAGNI-ladder coding discipline for writing changes — existence-first, reuse before writing, dependency ladder, shortest correct diff, with non-negotiables that must never be minimized away

相关技能