エージェントの実用例
4. 権限・セキュリティコマンド / 機能
様々なユースケースのエージェント例すぐに使えるエージェント設定
設定例
{
"agents": [
{
"name": "dependency-checker",
"description": "依存関係の脆弱性チェックとアップデート提案",
"prompt": "依存関係を分析し、脆弱性やアップデート可能なパッケージを報告してください。",
"tools": ["Bash", "Read"],
"allowedCommands": ["npm audit", "npm outdated", "yarn audit"]
},
{
"name": "doc-generator",
"description": "コードからドキュメントを自動生成",
"prompt": "指定されたコードの JSDoc/TSDoc ドキュメントを生成してください。",
"tools": ["Read", "Write", "Glob"]
},
{
"name": "git-helper",
"description": "Git 操作の補助。status, diff, log の確認とコミット支援",
"prompt": "Git の状態を確認し、適切なコミットメッセージを提案してください。",
"tools": ["Bash", "Read"],
"allowedCommands": ["git status", "git diff", "git log*", "git add*", "git commit*"]
},
{
"name": "performance-analyzer",
"description": "パフォーマンス分析。ボトルネックを特定",
"prompt": "コードのパフォーマンスを分析し、最適化の提案をしてください。",
"tools": ["Read", "Grep", "Glob", "Bash"],
"allowedCommands": ["npm run benchmark*", "node --prof*"]
}
]
}こんな時に使う
- 実用的なエージェントを設定したい時
- エージェント設定の参考にしたい時
使い方
- 1上記の設定を settings.json にコピー
- 2プロジェクトに合わせて調整
- 3不要なエージェントは削除
Tips
- description を具体的に書くと Claude の選択精度が上がる
- エージェントは必要になってから追加でOK
- 同じタスクでも prompt を変えると結果が変わる