技能 command-development

command-development

安全 ⚙️ 外部命令📁 文件系统访问🌐 网络访问

Claude Codeのスラッシュコマンドを作成する

也可从以下获取: davila7,anthropics

Claude Code向けの再利用可能なスラッシュコマンドを構築します。コマンド構造、YAMLフロントマターのオプション、動的引数、ファイル参照、bash実行を学び、一般的なワークフローを自動化します。

支持: Claude Codex Code(CC)
🥉 74 青铜
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“command-development”。 Create a slash command called /git-pr that shows the current pull request status

预期结果:

  • .claude/commands/git-pr.mdをフロントマター付きで作成
  • GitHub CLIにgh pr viewコマンドを使用
  • PR番号、タイトル、作者、ステータスを表示
  • セキュリティのためallowed-tools: Bash(gh:*)を含める

正在使用“command-development”。 Build a /lint command that runs eslint on staged files

预期结果:

  • git diff --name-onlyで変更ファイルを取得
  • xargs eslintにパイプしてlintを実行
  • allowed-tools: Bash(git:*), Bash(xargs:*)を設定
  • すべてのlintエラーをファイルと行番号付きで報告

正在使用“command-development”。 Make a documentation command that auto-generates API docs

预期结果:

  • @構文でソースファイルを読み込む
  • 関数、クラス、パラメータを抽出
  • Markdownドキュメントを生成
  • docs/api/ディレクトリに出力を書き込む

安全审计

安全
v4 • 1/16/2026

Official Anthropic documentation skill for Claude Code slash command development. All 1,317 static findings are false positives triggered by documentation examples demonstrating legitimate Claude Code features like bash execution, file references, and argument passing. Pure markdown content with no executable code, network access, or credential handling.

12
已扫描文件
12,429
分析行数
3
发现项
4
审计总数
审计者: claude 查看审计历史 →

质量评分

59
架构
100
可维护性
85
内容
20
社区
100
安全
91
规范符合性

你能构建什么

コードレビューを自動化

git diffを実行して変更されたファイルの品質問題を分析する /review コマンドを作成します。

デプロイを標準化

環境検証とnpmスクリプト実行を含む /deploy コマンドを構築します。

コマンドをパッケージ化

ポータブルなスクリプトのために ${CLAUDE_PLUGIN_ROOT} を使って、プラグインとともに再利用可能なコマンドをバンドルします。

试试这些提示

基本コマンド
Create a slash command called /test that runs npm test for the current file. Include proper frontmatter with allowed-tools.
引数付き
Create a /deploy command that accepts environment and version as arguments. Validate environment is staging or production.
ファイル参照付き
Create a /document command that generates documentation for a file specified as argument. Use the @ syntax to include the file.
マルチスクリプト・ワークフロー
Create a /build-test command that runs a build script, then runs tests, and reports results. Use the ${CLAUDE_PLUGIN_ROOT} variable.

最佳实践

  • allowed-toolsを使ってコマンド権限を必要最小限に制限する
  • argument-hintを追加してユーザーの自動補完のために想定引数を文書化する
  • デプロイ前に異なる引数の組み合わせでコマンドをテストする

避免

  • Bash(git:*)のような具体的な制限ではなくBash(*)を使用する
  • Claudeへの指示ではなくユーザーへのメッセージとしてコマンドを書く
  • 引数やファイル参照の欠落に対するエラーハンドリングを省略する

常见问题

スラッシュコマンドはどこに保存しますか?
プロジェクトのコマンドは.claude/commands/、個人用は~/.claude/commands/、プラグインのコマンドはplugin-name/commands/に置きます。
コマンドが使用できるツールを制限するには?
フロントマターのallowed-toolsフィールドを使います。例: allowed-tools: Read, Bash(git:*).
スラッシュコマンドに引数を渡せますか?
はい。位置引数には$1、$2、すべての引数を単一文字列にする場合は$ARGUMENTSを使います。
コマンドにファイル内容を含めるには?
@file-path構文を使います。例: Review @$1で引数$1で指定されたファイルを含めます。
!`command`構文は何のためですか?
bashコマンドを実行し、その出力をコマンドのコンテキストに含めます。git statusやnpmスクリプトなどに便利です。
多数のコマンドはどう整理すればよいですか?
名前空間化のためにサブディレクトリを使います。例: .claude/commands/git/commit.md は /commit(project:git)になります。