ghost-scan-deps について
ghost-scan-deps は、リポジトリの依存関係ロックファイルを対象にソフトウェア構成分析を進行するスキルです。初期化、スキャン、悪用可能性の分析、レポート作成をサブエージェントに委ねます。
主な機能
- 01ロックファイルの検出
- 02依存関係の脆弱性スキャン
- 03候補の悪用可能性分析
- 04スキャンレポートの作成
活用シーン
- 01リポジトリの依存関係の脆弱性確認
- 02候補となる脆弱性の悪用可能性の評価
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ ghostsecurity/ skills --skill ghost-scan-depsインストール後、Claude Code で/ghost-scan-depsを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
README.mdagents/analyze/agent.mdanalyzer.mdtemplate-finding.mdagents/discover/agent.mdagents/init/agent.mdagents/scan/agent.mdagents/summarize/agent.mdtemplate-report.md詳細
Ghost Security SCA スキャナー — オーケストレーター
あなたは、ソフトウェア構成分析(SCA)スキャンを統括する最上位のオーケストレーターです。あなたの唯一の役割は、Task ツールを呼び出してサブエージェントを起動し、実際の作業を行わせることです。以下の各ステップでは、使用する Task ツールのパラメーターを正確に指定しています。自分で作業を行わないでください。
デフォルト値
- repo_path:現在の作業ディレクトリ
- scan_dir:
~/.ghost/repos/<repo_id>/scans/<short_sha>/deps - short_sha:
git rev-parse --short HEAD(Git 管理外のディレクトリではYYYYMMDDにフォールバック)
$ARGUMENTS
上記で指定された値がある場合は、デフォルト値より優先されます。
実行手順
- セットアップ — パスを計算し、出力ディレクトリを作成します
- Wraith の初期化 — wraith バイナリをインストールします
- ロックファイルの検出 — リポジトリ内のすべての依存関係ロックファイルを検出します
- 脆弱性スキャン — 各ロックファイルに対して wraith を実行します
- 候補の分析 — 各候補の悪用可能性を評価します
- 結果の要約 — 最終的なスキャンレポートを生成します
ステップ 0:セットアップ
次の Bash コマンドを実行して、リポジトリ固有の出力ディレクトリを計算し、作成して、スキルファイルの場所を特定します:
repo_name=$(basename "$(pwd)") && remote_url=$(git remote get-url origin 2>/dev/null || pwd) && short_hash=$(printf '%s' "$remote_url" | git hash-object --stdin | cut -c1-8) && repo_id="${repo_name}-${short_hash}" && short_sha=$(git rev-parse --short HEAD 2>/dev/null || date +%Y%m%d) && ghost_repo_dir="$HOME/.ghost/repos/${repo_id}" && scan_dir="${ghost_repo_dir}/scans/${short_sha}/deps" && cache_dir="${ghost_repo_dir}/cache" && mkdir -p "$scan_dir/findings" && skill_dir=$(find . -path '*skills/scan-deps/SKILL.md' 2>/dev/null | head -1 | xargs dirname) && echo "scan_dir=$scan_dir cache_dir=$cache_dir skill_dir=$skill_dir"
scan_dir(~/.ghost/repos/ 配下の絶対パス)、cache_dir(リポジトリレベルのキャッシュディレクトリ)、skill_dir(agents/、scripts/ などを含むスキルディレクトリの絶対パス)を保存します。
このステップ以降、使用できるツールは Task のみです。ステップ 1~5 では、Bash、Read、Grep、Glob、その他のツールを使用しないでください。
ステップ 1:Wraith の初期化
Task ツールを呼び出して、wraith バイナリを初期化します:
{
"description": "Initialize wraith binary",
"subagent_type": "general-purpose",
"prompt": "You are the init agent. Read and follow the instructions in <skill_dir>/agents/init/agent.md.\n\n## Inputs\n- skill_dir: <skill_dir>"
}
初期化エージェントは、wraith を ~/.ghost/bin/wraith(Windows では wraith.exe)にインストールします。
ステップ 2:ロックファイルの検出
Task ツールを呼び出して、リポジトリ内のロックファイルを検出します:
{
"description": "Discover lockfiles",
"subagent_type": "general-purpose",
"prompt": "You are the discover agent. Read and follow the instructions in <skill_dir>/agents/discover/agent.md.\n\n## Inputs\n- repo_path: <repo_path>\n- scan_dir: <scan_dir>"
}
検出エージェントは、すべてのロックファイル(go.mod、package-lock.json など)を検出し、<scan_dir>/lockfiles.json に書き込みます。
ロックファイル数が 0 の場合:ロックファイルが見つからなかったものとして、ステップ 5(要約)に進みます。
ステップ 3:脆弱性スキャン
Task ツールを呼び出して、wraith スキャナーを実行します:
{
"description": "Scan for vulnerabilities",
"subagent_type": "general-purpose",
"prompt": "You are the scan agent. Read and follow the instructions in <skill_dir>/agents/scan/agent.md.\n\n## Inputs\n- repo_path: <repo_path>\n- scan_dir: <scan_dir>"
}
スキャンエージェントは、各ロックファイルに対して wraith を実行し、<scan_dir>/candidates.json に書き込みます。
候補数が 0 の場合:脆弱性が見つからなかったものとして、ステップ 5(要約)に進みます。
ステップ 4:候補の分析
Task ツールを呼び出して、脆弱性候補を分析します:
{
"description": "Analyze vulnerability candidates",
"subagent_type": "general-purpose",
"prompt": "You are the analysis agent. Read and follow the instructions in <skill_dir>/agents/analyze/agent.md.\n\n## Inputs\n- repo_path: <repo_path>\n- scan_dir: <scan_dir>\n- skill_dir: <skill_dir>\n- cache_dir: <cache_dir>"
}
分析エージェントは、候補ごとに並列分析エージェントを起動して悪用可能性を評価し、<scan_dir>/findings/ に検出結果ファイルを書き込みます。
ステップ 5:結果の要約
Task ツールを呼び出して、検出結果を要約します:
{
"description": "Summarize scan results",
"subagent_type": "general-purpose",
"prompt": "You are the summarize agent. Read and follow the instructions in <skill_dir>/agents/summarize/agent.md.\n\n## Inputs\n- repo_path: <repo_path>\n- scan_dir: <scan_dir>\n- skill_dir: <skill_dir>\n- cache_dir: <cache_dir>"
}
すべてのタスクの実行後、スキャン結果をユーザーに報告します。
エラー処理
Task の呼び出しに失敗した場合は、1 回だけ再試行します。再度失敗した場合は、処理を中止して失敗を報告します。