building-commands
為 Claude Code 建立斜槓命令
使用者需要一種方式來為其 Claude Code 工作流程建立標準化、經過驗證的斜槓命令。此技能提供有關命令結構、YAML 結構描述、參數處理和安全最佳實踐的專業指導。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「building-commands」。 建立一個名為 create-component 的斜槓命令來產生 React 元件
預期結果:
- Created: .claude/commands/create-component.md
- Model: claude-sonnet-4-5 (平衡的程式碼生成)
- Allowed tools: Read, Write, Grep, Glob
- Arguments: [component-name]
- Validation: Passed
正在使用「building-commands」。 驗證我的 git-commit 命令
預期結果:
- Validation passed
- Name: git-commit (動作導向)
- Description: clear and concise
- Model: claude-sonnet-4-5 (有效的版本別名)
- Tools: Read, Grep, Bash (最小)
安全審計
低風險Documentation and validation skill with no code execution capabilities. The included Python validation script reads and validates command files using only Python standard library functions. The static scanner flagged 548 patterns in documentation markdown files as potential threats, but all are false positives - code examples in documentation were misinterpreted as executable code with vulnerabilities. The skill contains no network calls, no external command execution, no credential handling, and no data exfiltration capabilities.
風險因素
⚡ 包含腳本 (1)
📁 檔案系統存取 (1)
品質評分
你能建構什麼
建構外掛命令
為遵循市場慣例的外掛建立標準化的斜槓命令
標準化團隊工作流程
為常見的團隊操作(如部署和測試)定義共享的斜槓命令
建立自動化命令
為基礎設施任務和系統維護建立參數化命令
試試這些提示
建立一個名為 run-tests 的斜槓命令來執行測試套件。使用 haiku 模型以獲得快速執行。
驗證 .claude/commands/my-command.md 中的命令並顯示任何錯誤。
將我使用 model: haiku 的命令遷移為使用正確的版本別名格式。
審查我使用 Bash 工具的命令並建議安全性改進。
最佳實務
- 在模型欄位中使用像 claude-haiku-4-5 這樣的版本別名 - 簡短別名會在命令中導致 API 錯誤
- 從最小的工具權限開始,只有在真正必要時才新增 Write、Edit 或 Bash
- 使用 argument-hint 欄位記錄所有參數並說明 $1、$2 和 $ARGUMENTS 的用法
避免
- 在命令中使用簡短的模型別名(haiku、sonnet、opus)- 它們會導致「找不到模型」錯誤
- 當命令只需要一種檔案操作類型時,卻同時包含 Write 和 Edit 工具
- 在未經驗證的情況下直接在 bash 命令中使用 $ARGUMENTS - 會造成命令注入風險
常見問題
哪些模型可以在斜槓命令中使用?
命令名稱的最大長度是多少?
我可以將此技能用於專案層級的命令嗎?
驗證腳本可以安全執行嗎?
為什麼我的命令會失敗並顯示「找不到模型」?
這與建構代理程式有何不同?
開發者詳情
授權
MIT
引用
main