Communitygithub.com

技能管理

管理本地技能 - 列出、新增、移除、搜尋、編輯、設定精靈

技能管理 是什麼?

這是 oh-my-claudecode 的一個後設技能,專門用於透過類似 CLI 的指令來管理本地技能。它支援列出(依內建、使用者、專案三種範圍分類顯示)、新增(互動式精靈建立含 YAML 前言的技能檔案)、移除(確認後刪除目錄)、編輯(互動式修改名稱、觸發詞、參數提示或全文)、搜尋(比對名稱、描述、觸發詞及全文內容並排序)、以及同步(在使用者與專案範圍間複製技能)。 此技能特別適合頻繁使用 Claude Code 或類似 AI 編碼代理的開發者,幫助他們將重複的除錯模式、專案特定工作流程或錯誤解決方案結構化為可重複使用的技能。它會自動掃描位於 `~/.claude/skills/omc-learned/` 的使用者技能目錄與 `.omc/skills/` 的專案技能目錄,並提供 `/skill setup` 與 `/skill scan` 等快速設定與盤點功能。 支援的指令包括:`/skill list`、`/skill add <name>`、`/skill remove <name>`、`/skill edit <name>`、`/skill search <query>`、`/skill info <name>`、`/skill sync`、`/skill setup` 及 `/skill scan`。所有操作皆包含安全確認機制,內建技能為唯讀,無法透過此工具刪除或修改。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

技能管理 CLI

用於管理 oh-my-claudecode 技能的後設技能,透過類似 CLI 的指令操作。

子指令

/skill list

顯示所有可用技能,依範圍分類。

行為:

  1. 掃描外掛 skills/ 目錄中的內建技能(唯讀)
  2. 掃描 ${CLAUDE_CONFIG_DIR:-~/.claude}/skills/omc-learned/ 的使用者技能
  3. 掃描 .omc/skills/ 的專案技能
  4. 解析 YAML 前言以取得中繼資料
  5. 以結構化表格顯示:
內建技能(與 oh-my-claudecode 同捆):
| 名稱              | 描述                    | 範圍     |
|-------------------|------------------------|----------|
| visual-verdict    | 結構化視覺問答判決      | built-in |
| ralph             | 持續性迴圈              | built-in |

使用者技能(~/.claude/skills/omc-learned/):
| 名稱              | 觸發詞           | 品質   | 使用次數 | 範圍 |
|-------------------|------------------|--------|---------|------|
| error-handler     | fix, error       | 95%    | 42      | user |
| api-builder       | api, endpoint    | 88%    | 23      | user |

專案技能(.omc/skills/):
| 名稱              | 觸發詞           | 品質   | 使用次數 | 範圍   |
|-------------------|------------------|--------|---------|---------|
| test-runner       | test, run        | 92%    | 15      | project |

回退: 若無品質/使用統計資料,則顯示「N/A」

內建技能注意: 內建技能與 oh-my-claudecode 同捆,可被發現與讀取,但無法透過 /skill remove 或 /skill edit 刪除或編輯。


/skill add [name]

用於建立新技能的互動式精靈。

行為:

  1. 詢問技能名稱(若指令中未提供)
    • 驗證:須為小寫、僅可使用連字號、無空格
  2. 詢問描述
    • 簡潔、明確的一行說明
  3. 詢問觸發詞(逗號分隔的關鍵字)
    • 範例:「error, fix, debug」
  4. 詢問參數提示(選用)
    • 範例:「 [options]」
  5. 詢問範圍:
    • user → ${CLAUDE_CONFIG_DIR:-~/.claude}/skills/omc-learned/<name>/SKILL.md
    • project → .omc/skills/<name>/SKILL.md
  6. 建立技能檔案,使用以下範本:
---
name: <名称>
description: <描述>
triggers:
  - <觸發詞1>
  - <觸發詞2>
argument-hint: "<參數>"
---

# <名稱> 技能

## 目的

[描述此技能的功能]

## 啟用時機

[描述觸發條件與情境]

## 工作流程

1. [步驟 1]
2. [步驟 2]
3. [步驟 3]

## 範例

/oh-my-claudecode:<名稱> 範例參數


## 備註

[額外背景、邊界情況、陷阱]
  1. 回報成功,附上檔案路徑
  2. 建議: 「使用 /skill edit <名稱> 自訂內容」

範例:

使用者:/skill add custom-logger
助手:正在建立新技能 'custom-logger'...

描述:具有結構化輸出的增強型日誌記錄
觸發詞(逗號分隔):log, logger, logging
參數提示(選用):<level> [message]
範圍(user/project):user

✓ 已建立技能於 ~/.claude/skills/omc-learned/custom-logger/SKILL.md
→ 使用以下指令編輯:/skill edit custom-logger

/skill remove <名稱>

依名稱移除技能。

行為:

  1. 搜尋技能,遍查兩個範圍:
    • ${CLAUDE_CONFIG_DIR:-~/.claude}/skills/omc-learned/<名稱>/SKILL.md
    • .omc/skills/<名稱>/SKILL.md
  2. 若找到:
    • 顯示技能資訊(名稱、描述、範圍)
    • 要求確認:「是否刪除技能 '<名稱>'(範圍:<範圍>)?(yes/no)」
  3. 若確認:
    • 刪除整個技能目錄(例如 ${CLAUDE_CONFIG_DIR:-~/.claude}/skills/omc-learned/<名稱>/)
    • 回報:「✓ 已從 <範圍> 移除技能 '<名稱>'」
  4. 若未找到:
    • 回報:「✗ 未在使用者或專案範圍中找到技能 '<名稱>'」

安全性: 除非獲得明確使用者確認,否則絕不刪除。

範例:

使用者:/skill remove old-logger
助手:在使用者範圍中找到技能 'old-logger':
  描述:舊版日誌工具
  範圍:user (~/.claude/skills/omc-learned/)

是否刪除技能 'old-logger'?(yes/no)

使用者:yes
助手:✓ 已從使用者範圍移除技能 'old-logger'

/skill edit <名稱>

互動式編輯現有技能。

行為:

  1. 依名稱尋找技能(搜尋兩個範圍)
  2. 透過 Read 工具讀取目前內容
  3. 顯示目前值:
    目前技能 'custom-logger':
    - 描述:具有結構化輸出的增強型日誌記錄
    - 觸發詞:log, logger, logging
    - 參數提示:<level> [message]
    - 範圍:user
    
  4. 詢問要修改的項目:
    • description - 更新描述
    • triggers - 更新觸發關鍵字
    • argument-hint - 更新參數提示
    • content - 編輯完整 Markdown 內容
    • rename - 重新命名技能(移動檔案)
    • cancel - 退出,不做任何變更
  5. 針對選取欄位:
    • 顯示目前值
    • 詢問新值
    • 更新 YAML 前言或內容
    • 回寫至檔案
  6. 回報成功,附上變更摘要

範例:

使用者:/skill edit custom-logger
助手:目前技能 'custom-logger':
  - 描述:具有結構化輸出的增強型日誌記錄
  - 觸發詞:log, logger, logging
  - 參數提示:<level> [message]

您想要編輯什麼?(description/triggers/argument-hint/content/rename/cancel)

使用者:triggers
助手:目前觸發詞:log, logger, logging
新觸發詞(逗號分隔):log, logger, logging, trace

✓ 已更新技能 'custom-logger' 的觸發詞

/skill search <查詢>

依內容、觸發詞、名稱或描述搜尋技能。

行為:

  1. 掃描所有技能,遍查兩個範圍
  2. 比對查詢(不區分大小寫)與以下項目:
    • 技能名稱
    • 描述
    • 觸發詞
    • 完整 Markdown 內容
  3. 顯示配對結果,附帶上下文:
找到 3 個技能符合「typescript error」:

1. typescript-fixer (user)
   描述:修復常見的 TypeScript 錯誤
   配對:「typescript error handling patterns」

2. error-handler (user)
   描述:通用錯誤處理工具
   配對:「Supports TypeScript and JavaScript errors」

3. lint-fix (project)
   描述:自動修復 lint 錯誤
   配對:「TypeScript ESLint error resolution」

排序: 優先比對名稱/觸發詞的結果,其次才是內容比對

範例:

使用者:/skill search api endpoint
助手:找到 2 個技能符合「api endpoint」:

1. api-builder (user)
   描述:產生 REST API 端點
   觸發詞:api, endpoint, rest

2. backend-scaffold (project)
   描述:搭建後端服務
   配對:「Creates API endpoint boilerplate」

/skill info <名稱>

顯示技能的詳細資訊。

行為:

  1. 依名稱尋找技能(搜尋兩個範圍)
  2. 解析 YAML 前言與內容
  3. 顯示完整細節:
技能:custom-logger
範圍:user (~/.claude/skills/omc-learned/custom-logger/)
描述:具有結構化輸出的增強型日誌記錄
觸發詞:log, logger, logging
參數提示:<level> [message]
品質:95%(若有提供)
使用次數:42 次(若有提供)
檔案路徑:/home/user/.claude/skills/omc-learned/custom-logger/SKILL.md

--- 完整內容 ---
[完整 Markdown 內容]

若未找到: 回報錯誤,並建議使用 /skill search

範例:

使用者:/skill info custom-logger
助手:技能:custom-logger
範圍:user
描述:具有結構化輸出的增強型日誌記錄
觸發詞:log, logger, logging
檔案:~/.claude/skills/omc-learned/custom-logger/SKILL.md

--- 內容 ---
# Custom Logger 技能

## 目的
具有結構化 JSON 輸出的增強型日誌記錄...
[其餘內容]

/skill sync

同步使用者與專案範圍之間的技能。

行為:

  1. 掃描兩個範圍:
    • 使用者技能:${CLAUDE_CONFIG_DIR:-~/.claude}/skills/omc-learned/
    • 專案技能:.omc/skills/
  2. 比較並分類:
    • 僅使用者擁有的技能(不在專案中)
    • 僅專案擁有的技能(不在使用者中)
    • 共同技能(兩者皆有)
  3. 顯示同步機會:
同步報告:

僅使用者擁有的技能(5 個):
  - error-handler
  - api-builder
  - custom-logger
  - test-generator
  - deploy-helper

僅專案擁有的技能(2 個):
  - test-runner
  - backend-scaffold

共同技能(3 個):
  - frontend-ui-ux
  - git-master
  - planner

選項:
  [1] 將使用者技能複製到專案
  [2] 將專案技能複製到使用者
  [3] 檢視差異
  [4] 取消
  1. 處理使用者選擇:
    • 選項 1:選取要複製到專案的技能
    • 選項 2:選取要複製到使用者的技能
    • 選項 3:對共同技能顯示並排差異
    • 選項 4:退出

安全性: 未經確認絕不覆寫

範例:

使用者:/skill sync
助手:找到 5 個僅使用者擁有的技能與 2 個僅專案擁有的技能。

是否將 'error-handler' 從使用者複製到專案?(yes/no/skip)
使用者:yes
助手:✓ 已將 'error-handler' 複製至 .omc/skills/

是否將 'api-builder' 從使用者複製到專案?(yes/no/skip)
使用者:skip
...

/skill setup

用於設定與管理本地技能的互動式精靈(原為 local-skills-setup)。

行為:

步驟 1:目錄檢查與設定

首先檢查技能目錄是否存在,並在需要時建立:

# 檢查並建立使用者層級技能目錄
USER_SKILLS_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/omc-learned"
if [ -d "$USER_SKILLS_DIR" ]; then
  echo "使用者技能目錄已存在:$USER_SKILLS_DIR"
else
  mkdir -p "$USER_SKILLS_DIR"
  echo "已建立使用者技能目錄:$USER_SKILLS_DIR"
fi

# 檢查並建立專案層級技能目錄
PROJECT_SKILLS_DIR=".omc/skills"
if [ -d "$PROJECT_SKILLS_DIR" ]; then
  echo "專案技能目錄已存在:$PROJECT_SKILLS_DIR"
else
  mkdir -p "$PROJECT_SKILLS_DIR"
  echo "已建立專案技能目錄:$PROJECT_SKILLS_DIR"
fi

步驟 2:技能掃描與庫存

掃描兩個目錄並顯示完整的庫存:

# 掃描使用者層級技能
echo "=== 使用者層級技能(~/.claude/skills/omc-learned/) ==="
if [ -d "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/omc-learned" ]; then
  USER_COUNT=$(find "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/omc-learned" -name "*.md" 2>/dev/null | wc -l)
  echo "技能總數:$USER_COUNT"

  if [ $USER_COUNT -gt 0 ]; then
    echo ""
    echo "找到的技能:"
    find "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/omc-learned" -name "*.md" -type f -exec sh -c '
      FILE="$1"
      NAME=$(grep -m1 "^name:" "$FILE" 2>/dev/null | sed "s/name: //")
      DESC=$(grep -m1 "^description:" "$FILE" 2>/dev/null | sed "s/description: //")
      MODIFIED=$(stat -c "%y" "$FILE" 2>/dev/null || stat -f "%Sm" "$FILE" 2>/dev/null)
      echo "  - $NAME"
      [ -n "$DESC" ] && echo "    描述:$DESC"
      echo "    修改時間:$MODIFIED"
      echo ""
    ' sh {} \;
  fi
else
  echo "找不到目錄"
fi

echo ""
echo "=== 專案層級技能(.omc/skills/) ==="
if [ -d ".omc/skills" ]; then
  PROJECT_COUNT=$(find ".omc/skills" -name "*.md" 2>/dev/null | wc -l)
  echo "技能總數:$PROJECT_COUNT"

  if [ $PROJECT_COUNT -gt 0 ]; then
    echo ""
    echo "找到的技能:"
    find ".omc/skills" -name "*.md" -type f -exec sh -c '
      FILE="$1"
      NAME=$(grep -m1 "^name:" "$FILE" 2>/dev/null | sed "s/name: //")
      DESC=$(grep -m1 "^description:" "$FILE" 2>/dev/null | sed "s/description: //")
      MODIFIED=$(stat -c "%y" "$FILE" 2>/dev/null || stat -f "%Sm" "$FILE" 2>/dev/null)
      echo "  - $NAME"
      [ -n "$DESC" ] && echo "    描述:$DESC"
      echo "    修改時間:$MODIFIED"
      echo ""
    ' sh {} \;
  fi
else
  echo "找不到目錄"
fi

# 摘要
TOTAL=$((USER_COUNT + PROJECT_COUNT))
echo "=== 摘要 ==="
echo "所有目錄中的技能總數:$TOTAL"

步驟 3:快速動作選單

掃描完成後,使用 AskUserQuestion 工具提供以下選項:

問題:「您想要對本地技能做什麼?」

選項:

  1. 新增技能 - 啟動技能建立精靈(呼叫 /skill add)
  2. 列出所有技能(含詳細資訊) - 顯示完整的技能庫存(呼叫 /skill list)
  3. 掃描對話中的模式 - 分析目前對話,找出值得建立技能的模式
  4. 匯入技能 - 從 URL 或貼上內容匯入技能
  5. 完成 - 退出精靈

選項 3:掃描對話中的模式

分析目前對話的上下文,找出潛在的、值得建立技能的模式。請留意:

  • 最近的除錯工作階段,且解決方法不顯而易見
  • 需要調查的棘手錯誤
  • 程式碼庫專屬的解決方法
  • 花了很長時間才解決的錯誤模式

回報發現結果,並詢問使用者是否要將其萃取為技能(呼叫 /skillify;/learner 已棄用,僅為相容性保留)。

選項 4:匯入技能

要求使用者提供:

  • URL:從 URL 下載技能(例如 GitHub gist)
  • 貼上內容:直接貼上技能的 Markdown 內容

然後詢問範圍:

  • 使用者層級(~/.claude/skills/omc-learned/)- 所有專案皆可使用
  • 專案層級(.omc/skills/)- 僅限此專案

驗證技能格式,並儲存至選定位置。


/skill scan

快速指令,用於掃描兩個技能目錄(為 /skill setup 步驟 2 的子集)。

行為: 執行 /skill setup 中步驟 2 的掃描,不啟動互動式精靈。


技能範本

透過 /skill add 或 /skill setup 建立技能時,提供常見技能類型的快速範本:

錯誤解決方案範本

---
id: error-[唯一識別碼]
name: [錯誤名稱]
description: [特定錯誤在特定上下文中的解決方案]
source: conversation
triggers: ["錯誤訊息片段", "檔案路徑", "症狀"]
quality: high
---

# [錯誤名稱]

## 洞見
此錯誤的根本原因是什麼?你發現了什麼原則?

## 為何重要
如果不了解這一點會發生什麼問題?什麼症狀導致了這個問題?

## 辨識模式
如何知道這個解決方案適用了?有哪些跡象?
- 錯誤訊息:「[確切錯誤]」
- 檔案:[特定檔案路徑]
- 上下文:[此問題何時發生]

## 解決方案

...

[因篇幅而截斷]

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

相關技能