skills/security-review/SKILL.md
セキュリティ観点でコードを精査し、脆弱性・リスクをレポートする。 以下のトリガーで自動発動: - 「セキュリティレビューして」「脆弱性チェック」「セキュリティ問題ない?」 - 「認証コードを確認して」「APIキーや秘密情報が漏れていないか確認して」 - /security-review [ファイルパス]
npx skillsauth add oto1720/claude-agents-skills security-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
セキュリティに特化したコードレビューを実施し、脆弱性レポートを生成する。
$ARGUMENTS にファイルパスまたはディレクトリを受け取る。
未指定の場合はプロジェクト全体をスキャンする。
最優先でスキャン:
# ハードコードされたシークレットを検出
grep -rn --include="*.dart" --include="*.go" --include="*.ts" --include="*.env" \
-E "(api_key|apikey|secret|password|passwd|token|private_key|firebase)\s*=\s*['\"][^'\"]{8,}" \
. | grep -v -E "(_test\.|example|mock|dummy|placeholder|your_|<|{)"
# .envファイルがgit管理されていないか
git ls-files | grep -E "\.env$|\.env\."
# pubspec.yamlやpackage.jsonに直書きされていないか
grep -rn "firebase_options\|google-services\|GoogleService" . \
--include="*.dart" --include="*.json" | grep -v ".gitignore"
# 認証なしのAPIエンドポイント
grep -rn "router\.\|app\.\|Route\|endpoint" . \
--include="*.go" --include="*.ts" --include="*.dart" | \
grep -v "auth\|middleware\|guard\|protected"
# Firebaseセキュリティルールの確認
cat firestore.rules 2>/dev/null
cat storage.rules 2>/dev/null
cat database.rules.json 2>/dev/null
# SQLインジェクション(文字列連結でのクエリ構築)
grep -rn "query\s*=\s*.*\+" . --include="*.dart" --include="*.go" --include="*.ts"
grep -rn "\"SELECT.*\$\|\"INSERT.*\$\|\"UPDATE.*\$" .
# コマンドインジェクション
grep -rn "exec\|os\.system\|subprocess\|Process\.run" . \
--include="*.dart" --include="*.go" --include="*.py"
# ユーザー入力が直接使われている箇所
grep -rn "request\.body\|req\.params\|req\.query\|TextEditingController" . \
--include="*.dart" --include="*.ts" | head -30
# バリデーションなしで使われていないか確認
# HTTPSではなくHTTPを使っている箇所
grep -rn "http://" . --include="*.dart" --include="*.go" --include="*.ts" \
| grep -v "localhost\|127.0.0.1\|comment\|//"
# 機密データのローカル保存
grep -rn "SharedPreferences\|localStorage\|UserDefaults\|SecureStorage" . \
--include="*.dart" --include="*.ts" | head -20
# ログへの機密情報出力
grep -rn "print\|debugPrint\|log\|console\.log" . \
--include="*.dart" --include="*.ts" | \
grep -i "password\|token\|secret\|key" | head -20
docs/reviews/security_review_{YYYYMMDD}.md に出力:
# セキュリティレビューレポート
**レビュー日時**: {date}
**対象**: {対象範囲}
**スキャン項目数**: {N}
---
## 🚨 リスクサマリー
| 深刻度 | 件数 | 対応優先度 |
|--------|------|-----------|
| 🔴 Critical (即座に対応) | N | 今すぐ |
| 🟠 High (今週中) | N | 今週中 |
| 🟡 Medium (今月中) | N | 今月中 |
| 🟢 Informational (推奨) | N | 任意 |
**総合リスクレベル**: [CRITICAL / HIGH / MEDIUM / LOW / PASS]
---
## 🔴 Critical Vulnerabilities
### [SEC-C1] {脆弱性名}
**カテゴリ**: Secret Leak / Injection / Authentication / ...
**ファイル**: `path/to/file.dart:行番号`
**CVSS スコア**: ~{N}/10(概算)
**問題のコード**:
```dart
// ❌ 危険なコード
リスク: {攻撃シナリオを具体的に}
例: 「APIキーが公開されると、悪意あるユーザーがFirebaseに無制限にアクセスできる」
修正方法:
// ✅ 安全なコード
参考: [OWASP Top 10 - A02: Cryptographic Failures]
[同様のフォーマット]
[同様のフォーマット]
Generated by Claude Code / security-review skill
## 品質基準
- **誤検知を避ける**: テストコード・モックは除外
- **攻撃シナリオを具体的に記述**: 「危険です」ではなく「〇〇という攻撃が可能になる」
- **必ず修正コードを示す**: 問題の指摘だけでなく解決策も提示
- **OWASPやCWEの参照を含める**: 標準的な脆弱性分類との対応を示す
development
プロジェクト全体の技術構成図(アーキテクチャダイアグラム)を自動生成するスキル。リポジトリやプロジェクトのコードベースを解析し、使用技術・依存関係・レイヤー構造・データフロー・インフラ構成を可視化したMermaid/SVG/HTML図を生成する。「技術構成図を作って」「アーキテクチャ図」「システム構成を可視化」「プロジェクトの全体像」「tech stack diagram」などのリクエストで必ずこのスキルを使用すること。プロジェクトの理解・オンボーディング資料・ドキュメント作成にも活用できる。
testing
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
tools
PRやコミットの差分をレビューして、マージ可否の判断と指摘事項を出力する。 以下のトリガーで自動発動: - 「PRレビューして」「このPRどう思う?」「マージしても大丈夫?」 - 「差分をレビューして」「コミット内容を確認して」 - /pr-review [ブランチ名 or コミットハッシュ]
development
Next.js UIコード規範・規約の適用スキル。Next.jsのコンポーネント、ページ、レイアウト、フォーム、データテーブル、モーダルなどUI要素の作成・レビュー・生成時に使用する。「Next.jsのコンポーネントを作って」「フォームを実装したい」「このページをどう構成すべきか」「Server Componentを書いて」「モーダルを追加して」「データテーブルを作って」「Next.jsのUIパターンを教えて」などのリクエストでトリガーする。ファイル構成、TypeScript規約、Tailwindパターン、shadcn/uiに関する質問でも使用すること。