Claude Code 自訂 slash command 設計器:把重複貼的指令變成一鍵 /command
把你每次都要重貼的 checklist 或多步驟流程,設計成一個自訂 slash command(.claude/commands/<name>.md 或現代的 .claude/skills),含正確 frontmatter、$ARGUMENTS 參數、用 !`cmd` 預先注入即時上下文(git diff、PR 內容),並用 allowed-tools 收斂權限。
你是不是每次都把同一段「幫我做 X 的步驟」貼進 Claude Code?這支 meta-prompt 幫你把它設計成 /your-command:含參數佔位符、用 !`git diff` 把即時狀態先塞進去、用 allowed-tools 免去每次按同意,存進 repo 後全隊都能用。
[ Log in to see the full prompt ]Sign up free to see the full prompt, copy it, save it, and join the discussion. Free content unlocks on login; Pro content is a separate subscription.
【何時用】當你發現自己第三次把同一段「幫我做 X 的步驟」貼進 Claude Code 時。【為何有效】(1) 它先幫你選對載體——輕量需求用 .claude/commands/<name>.md(檔名即指令名,至今仍可用),需要附帶腳本/子代理/自動觸發才升級成 .claude/skills/<name>/SKILL.md;(2) frontmatter 只留真正有用的欄位:description 讓隊友在 / 選單看得懂、allowed-tools 把權限收到剛好(例如只給 Bash(npm run lint:*) 的 lint 指令就不可能誤改檔案)、有副作用的(deploy/commit)加 disable-model-invocation:true 避免 Claude 自作主張;(3) 教你用 !`git diff` 這種『執行注入』把即時狀態在模型讀到前就塞進去,所以模型拿到的是真 diff 而非一句指令。【技巧】把 command 檔 commit 進 .claude/ 後全隊自動共用;專案層的 allowed-tools 要先接受 workspace-trust 對話框才生效。參數用 $ARGUMENTS 抓全部、$1/$2 抓單一位置,多字參數記得加引號。
Chosen format: .claude/commands/summarize-changes.md (lightweight, no supporting files needed) --- description: Summarize uncommitted changes and flag risks. Use when asked what changed or for a commit message. allowed-tools: Bash(git diff:*) Bash(git status:*) --- ## Current changes !`git diff HEAD` ## Task Summarize the diff above in 2-3 bullets, then list risks (missing error handling, hardcoded values, tests to update). If the diff is empty, say there are no uncommitted changes. How to run: /summarize-changes Teammates get it automatically once .claude/commands/ is committed. Project-level allowed-tools activates after you accept the workspace-trust dialog.
Suno Engineer's Mindset: 4 Steps to a Song That Doesn't Sound Like AI
A studio engineer's breakdown of Suno's fatal weaknesses (fried vocals, high-frequency artifacts), plus a 4-step DAW workflow and a Suno Studio cleanup prompt.
5 Claude Weekly Workflows That Stuck After 6 Months
Proposal generator / meeting processor / content repurposer / Friday review / shutdown reset — out of 40 I tried, only these 5 survived, each saving 30+ minutes per run.