/ 目錄 / 演練場 / wshobson commands
● 社群 wshobson ⚡ 即開即用

wshobson commands

作者 wshobson · wshobson/commands

60+ 個 Claude Code 斜線指令——/commit、/review、/test、/docs、/refactor——跨專案保持一致。

wshobson/commands 是一套精選的 Claude Code 斜線指令。每個指令是 ~/.claude/commands 中帶有精準提示和說明的 Markdown 檔案。執行 /commit 根據差異獲取乾淨的慣例提交訊息,/review 取得結構化的 PR 審查等。與 wshobson/agents 自然搭配。

為什麼要用

核心特性

即時演示

實際使用效果

就緒

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "wshobson-commands-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/wshobson/commands",
        "~/.claude/commands"
      ],
      "_inferred": true
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "wshobson-commands-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/wshobson/commands",
        "~/.claude/commands"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "wshobson-commands-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/wshobson/commands",
        "~/.claude/commands"
      ],
      "_inferred": true
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "wshobson-commands-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/wshobson/commands",
        "~/.claude/commands"
      ],
      "_inferred": true
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "wshobson-commands-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/wshobson/commands",
        "~/.claude/commands"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "wshobson-commands-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/wshobson/commands",
          "~/.claude/commands"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add wshobson-commands-skill -- git clone https://github.com/wshobson/commands ~/.claude/commands

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: wshobson commands

不需要手動撰寫,直接獲取乾淨的慣例提交訊息

👤 提交訊息寫得鬆散的開發者 ⏱ ~5 min beginner

何時使用: 你出貨速度很快,提交日誌看起來像「wip」、「fix」、「wip2」。

前置條件
  • 已安裝指令 — git clone https://github.com/wshobson/commands ~/.claude/commands
步驟
  1. 暫存你的變更
    git add -p the relevant hunks (or full files).✓ 已複製
    → 暫存差異可見
  2. 生成提交訊息
    /commit✓ 已複製
    → 提出慣例風格訊息
  3. 審查並提交
    Edit if needed, then git commit -m '...'✓ 已複製
    → 乾淨的日誌條目

結果: PR 描述中不會讓你感到羞愧的提交日誌。

注意事項
  • 自動偵測的範圍錯誤 — 明確傳入範圍:/commit feat auth
搭配使用: wshobson-agents-skill

用 /test 從最新差異生成測試

👤 過敏於 TDD 但確實想要覆蓋率的開發者 ⏱ ~15 min beginner

何時使用: 你已發布邏輯,現在在 PR 前想要後置測試。

步驟
  1. 執行 /test
    /test✓ 已複製
    → 測試檔案框架涵蓋新邏輯
  2. 執行測試
    Run the test suite. Fix anything that fails.✓ 已複製
    → 綠色測試

結果: 你手動不會寫的覆蓋率。

使用 /refactor 搭配內建安全提示重構熱點

👤 想要不破壞行為的重構的開發者 ⏱ ~30 min intermediate

何時使用: 函式很亂;你想要清理而不造成退化。

步驟
  1. 識別
    /refactor src/auth.ts:authenticate✓ 已複製
    → 帶有理由和測試計畫的差異
  2. 驗證
    Run tests after each step✓ 已複製
    → 逐步驗證

結果: 更乾淨的程式碼,相同的行為。

搭配使用: wshobson-agents-skill

組合

與其他 MCP 搭配,撬動十倍槓桿

wshobson-commands-skill + wshobson-agents-skill

指令觸發特定代理

wshobson-commands-skill + wshobson-skills-skill

指令作為快速觸發器,技能用於更深的專業知識

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
/commit type? scope? 任何 git commit 之前 0
/review (diff implied) 開啟 PR 之前 0
/test (diff implied) 按需覆蓋率 0
/refactor target 程式碼清理 0
/docs target? 功能工作完成後 0

成本與限制

運行它的成本

API 配額
不適用——本地
每次呼叫 Token 數
每個指令不同(/commit 較小,/refactor 較大)
費用
免費(MIT)
提示
編輯個別指令的 Markdown 以裁剪冗長的模板

安全

權限、密鑰、影響範圍

最小權限: filesystem-read filesystem-write
憑證儲存:
資料出站: 無——純提示

故障排查

常見錯誤與修復

/command 無法識別

確認檔案在 ~/.claude/commands/ 中,帶有 .md 副檔名;重新啟動 Claude Code

驗證: 在對話中用 / 列出指令
引數解析失敗

某些指令期待位置引數,某些期待命名引數——讀取指令檔案以確認

輸出格式不一致

每個指令都有固定模板;若有偏差,模型正在覆蓋——確認沒有全局系統提示與它衝突

替代方案

wshobson commands 對比其他方案

替代方案何時用它替代權衡
wshobson/agents (sibling)你想要子代理而非斜線指令不同的呼叫介面
Hesreallyhim/awesome-claude-code你想要精選的指令和技能 awesome 清單目錄,而非執行期

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills