Communitygithub.com

omc-setup

安裝或更新 oh-my-claudecode,用於插件、npm 和本地開發環境的標準設定流程

omc-setup 是什麼?

此技能會引導使用者完成 oh-my-claudecode (OMC) 的初始安裝、更新或修復。它會根據使用者是否傳遞 `--local`、`--global` 或 `--force` 等旗標,自動選擇適當的安裝路徑——包括互動式初始化精靈、僅限本地或全域的設定,或者是強制重新執行完整精靈。此技能仰賴專屬的 shell 腳本 (`scripts/setup-claude-md.sh`) 來協調 CLAUDE.md 的安裝,並利用 `jq` 檢查既有的 `.omc-config.json` 來判斷是否已設定完成,以避免不必要的重複流程。若偵測到先前已完成設定,系統會提供快速更新選項,僅更新 CLAUDE.md 並清除已棄用的設定值(例如 `defaultExecutionMode`),無需重新執行整個精靈。此技能支援 Claude Code 環境,並遵循 `CLAUDE_CONFIG_DIR` 環境變數來決定設定檔的路徑。

相容平台✓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 本身時,選擇此設定流程。

  • 市集/插件安裝使用者應在 /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

相關技能