Claude Code向けの再利用可能なスラッシュコマンドを構築します。コマンド構造、YAMLフロントマターのオプション、動的引数、ファイル参照、bash実行を学び、一般的なワークフローを自動化します。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“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/ディレクトリに出力を書き込む
安全审计
安全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.
风险因素
⚙️ 外部命令 (5)
📁 文件系统访问 (3)
🌐 网络访问 (1)
质量评分
你能构建什么
コードレビューを自動化
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への指示ではなくユーザーへのメッセージとしてコマンドを書く
- 引数やファイル参照の欠落に対するエラーハンドリングを省略する