Claude Code Custom Command
๊ธฐ๋ณธ slash command
https://code.claude.com/docs/en/slash-commands
์ปค์คํ
slash command ๋ง๋ค๊ธฐ
ํ์ผ ์์น
์ ์ฒด ์ ์ฉ : ~/.claude/commands
Project ๋ณ ์ ์ฉ : ํ๋ก์ ํธ ๋ฃจํธ์
.claude/commands
์ปค๋งจ๋ ๋ง๋ค๊ธฐ
์ฌ๋์ ์ดํ์ ์ธ ์ปค๋งจ๋ ์ด๋ฆ์ผ๋ก ๋งํฌ๋ค์ด ํ์ผ์ ๋ง๋ ๋ค.
mkdir -p ~/.claude/commands
echo "Review this code for security vulnerabilities:" > ~/.claude/commands/security-review.mdgit commit message๋ฅผ ๋ง๋ค์ด์ฃผ๊ณ commit / push
vi git-commit.md---
title: git add, commit, push
# allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
description: Create a git commit
model: haiku
---
## git commit message๋ฅผ ๋ง๋ค์ด์ฃผ๊ณ commit / push
git์ commitํ commit message๋ฅผ ๋ง๋ ๋ค.
์ด์ commit ๋ฐ push๋ฅผ ํ์.
git add --all && git commit -m "$message" && git push
$message์ ์ ๋นํ ๋ฉ์ธ์ง๋ฅผ ์ถ๊ฐํด์คarguments ์ฌ์ฉํ๊ธฐ
$ARGUMENTS ๋ณ์๋ฅผ ์ฌ์ฉํ์ฌ ์ปค๋งจ๋์ ์ธ์๋ฅผ ์ ๋ฌํ ์ ์๋ค.
echo 'Fix issue #$ARGUMENTS following our coding standards' > fix-issue.md๊ฐ๋ณ arguments with $1, $2
$1, $2 ๋ฑ์ ์ฌ์ฉํ์ฌ ๊ฐ๋ณ ์ธ์์ ์ ๊ทผํ ์ ์๋ค.
echo 'Review PR #$1 with priority $2 and assign to $3' > .claude/commands/review-pr.md
/review-pr 456 high alicebash ์ฌ์ฉ
์ฌ๋์ ๋ช ๋ น์ด ์คํ๋๊ธฐ ์ ์ !์ ๋์ฌ๋ฅผ ์ฌ์ฉํ์ฌ bash ๋ช ๋ น์ ์คํํฉ๋๋ค.
allowed-tools ๋ฉํ๋ฐ์ดํฐ ํ๋๋ฅผ ์ฌ์ฉํ์ฌ ํน์ bash ๋ช ๋ น์ ํ์ฉํ ์๋ ์์ต๋๋ค.
---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
description: Create a git commit
---
## Context
- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`
## Your task
Based on the above changes, create a single git commit.ํ์ผ ์ฐธ์กฐ
md์์ @์ ์ฌ์ฉํด์ ๊ฒฝ๋ก๋ฅผ ์ ์ผ๋ฉด ํ์ผ์ ์ฐธ์กฐํ ์ ์๋ค.
# Reference a specific file
Review the implementation in @src/utils/helpers.js
# Reference multiple files
Compare @src/old-version.js with @src/new-version.jsfrontmatter ๋ฉํ๋ฐ์ดํฐ
allowed-tools
์ปค๋งจ๋์์ ์ฌ์ฉํ ์ ์๋ ๋๊ตฌ ๋ชฉ๋ก
๋ํ์์ ์์
argument-hint
์ฌ๋์ ์ปค๋งจ๋์ ๋ํ ์ธ์ ํํธ. ์: argument-hint: add [tagId] | remove [tagId] | list. ์ฌ์ฉ์๊ฐ ์ฌ๋์ ์ปค๋งจ๋๋ฅผ ์๋์์ฑํ ๋ ํ์๋จ
None
description
์ปค๋งจ๋์ ๋ํ ๊ฐ๋จํ ์ค๋ช
prompt์ ์ฒซ ๋ฒ์งธ ์ค์ ์ฌ์ฉ
model
ํน์ ๋ชจ๋ธ ๋ฌธ์์ด (Models overview ์ฐธ์กฐ)
๋ํ์์ ์์
disable-model-invocation
SlashCommand ๋๊ตฌ๊ฐ ์ด ์ปค๋งจ๋๋ฅผ ํธ์ถํ๋ ๊ฒ์ ๋ฐฉ์งํ ์ง ์ฌ๋ถ
false
---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
argument-hint: [message]
description: Create a git commit
model: haiku
---
Create a git commit with message: $ARGUMENTSExample using positional arguments:
---
argument-hint: [pr-number] [priority] [assignee]
description: Review pull request
---
Review PR #$1 with priority $2 and assign to $3.
Focus on security, performance, and code style.์ฌ์ฉ
/command-name arg1 arg2mcp๋ฅผ slash command๋ก ์ฌ์ฉํ๊ธฐ
/mcp__<server-name>__<prompt-name> [arguments]๋ณดํต ์๋์ผ๋ก ์คํ๋จ.
์์
# ์ธ์ ์์
> /mcp__github__list_prs
# ์ธ์ ํฌํจ
> /mcp__github__pr_review 456
> /mcp__jira__create_issue "Bug title" high์๋ํ
claude๊ฐ ์๋์ผ๋ก slash command๋ฅผ ์คํํ ์ ์๋ค.
๋ค์์ฒ๋ผ prompt๋ฅผ ์์ฑํด๋ผ
Claude๊ฐ SlashCommand ๋๊ตฌ๋ฅผ ํธ๋ฆฌ๊ฑฐํ๋๋ก ๊ถ์ฅํ๋ ค๋ฉด ์ง์นจ (prompt, CLAUDE.md ๋ฑ)์ด ์ผ๋ฐ์ ์ผ๋ก ์ฌ๋์์ ํจ๊ป ๋ช
๋ น์ด ์ด๋ฆ์ ์ฐธ์กฐํด์ผ ํฉ๋๋ค.claude๊ฐ ์๋์ผ๋ก ํธ์ถํ๋๊ฒ์ ๋ง์ผ๋ ค๋ฉด
---
title: test
disable-model-invocation: true์ด๋ ๊ฒ ์ฌ์ฉํ๋ค.
slash command vs skills
์ฌ๋์ ๋ช
๋ น์ด (Slash Commands)
์ฌ์ฉ ๋์: ๋น ๋ฅด๊ณ ์์ฃผ ์ฌ์ฉํ๋ ํ๋กฌํํธ
ํน์ง:
๊ฐ๋จํ ํ๋กฌํํธ ์ค๋ํซ
๋น ๋ฅธ ๋ฏธ๋ฆฌ ์๋ฆผ ๋๋ ํ ํ๋ฆฟ
ํ ํ์ผ์ ๋ง๋ ์์ฃผ ์ฌ์ฉํ๋ ์ง์นจ
์์:
/reviewโ "Review this code for bugs and suggest improvements"/explainโ "Explain this code in simple terms"/optimizeโ "Analyze this code for performance issues"
์คํฌ (Skills)
์ฌ์ฉ ๋์: ๊ตฌ์กฐ๊ฐ ์๋ ํฌ๊ด์ ์ธ ๊ธฐ๋ฅ
ํน์ง:
์ฌ๋ฌ ๋จ๊ณ๊ฐ ์๋ ๋ณต์กํ ์ํฌํ๋ก์ฐ
์คํฌ๋ฆฝํธ ๋๋ ์ ํธ๋ฆฌํฐ๊ฐ ํ์ํ ๊ธฐ๋ฅ
์ฌ๋ฌ ํ์ผ์ ๊ฑธ์ณ ๊ตฌ์ฑ๋ ์ง์
ํ์คํํ๋ ค๋ ํ ์ํฌํ๋ก์ฐ
์์:
์์ ์์ฑ ์คํฌ๋ฆฝํธ ๋ฐ ๊ฒ์ฆ์ด ์๋ PDF ์ฒ๋ฆฌ ์คํฌ
๋ค์ํ ๋ฐ์ดํฐ ์ ํ์ ๋ํ ์ฐธ์กฐ ๋ฌธ์๊ฐ ์๋ ๋ฐ์ดํฐ ๋ถ์ ์คํฌ
์คํ์ผ ๊ฐ์ด๋ ๋ฐ ํ ํ๋ฆฟ์ด ์๋ ๋ฌธ์ ์คํฌ
์ฃผ์ ์ฐจ์ด์
๋ณต์ก์ฑ
๊ฐ๋จํ ํ๋กฌํํธ
๋ณต์กํ ๊ธฐ๋ฅ
๊ตฌ์กฐ
๋จ์ผ .md ํ์ผ
SKILL.md + ๋ฆฌ์์ค๊ฐ ์๋ ๋๋ ํ ๋ฆฌ
๋ฐ๊ฒฌ
๋ช ์์ ํธ์ถ (/command)
์๋ (์ปจํ ์คํธ ๊ธฐ๋ฐ)
ํ์ผ
ํ ํ์ผ๋ง
์ฌ๋ฌ ํ์ผ, ์คํฌ๋ฆฝํธ, ํ ํ๋ฆฟ
์์ ๋น๊ต
์ฌ๋์ ๋ช
๋ น์ด๋ก
ํ์ผ ๊ตฌ์กฐ:
.claude/commands/review.md๋ด์ฉ:
Review this code for:
- Security vulnerabilities
- Performance issues
- Code style violations์ฌ์ฉ๋ฒ: /review (์๋ ํธ์ถ)
skill
ํ์ผ ๊ตฌ์กฐ:
.claude/skills/code-review/
โโโ SKILL.md (overview and workflows)
โโโ SECURITY.md (security checklist)
โโโ PERFORMANCE.md (performance patterns)
โโโ STYLE.md (style guide reference)
โโโ scripts/
โโโ run-linters.sh์ฌ์ฉ๋ฒ: "Can you review this code?" (์๋ ๋ฐ๊ฒฌ)
๊ฒฐ๋ก : ์คํฌ์ ๋ ํ๋ถํ ์ปจํ ์คํธ, ๊ฒ์ฆ ์คํฌ๋ฆฝํธ ๋ฐ ๊ตฌ์ฑ๋ ์ฐธ์กฐ ์๋ฃ๋ฅผ ์ ๊ณตํฉ๋๋ค.
๋์ ๊ฒฐ๋ก
๋๋ ์์ง ์ ๊ตฌ๋ถ์ด ์๋จ. /command๋ ํญ์ ๋ด๊ฐ ํ์ํ ๋ ๊ฐ์ ๋ก ์์ฒญ claude๊ฐ ์๋์ผ๋ก ์ด๊ฑธ ์ฌ์ฉํ๋ฉด skills์ ๋น์ทํ๊ฑฐ๊ฐ์.
๋๋ค ๋น์ทํ๊ฑฐ๊ฐ์.
Last updated
Was this helpful?