Agent Skillsghostsecurity/skills › ghost-scan-secrets

ghost-scan-secrets

GitHub

协调子代理执行代码库中的密钥和凭证扫描,检测硬编码的 API Key、Token 和密码等敏感数据泄露。

plugins/ghost/skills/scan-secrets/SKILL.md ghostsecurity/skills

Trigger Scenarios

检查泄露的密钥 扫描凭证 查找硬编码的 API Key 或密码 检测暴露的 .env 值 审计代码中的敏感数据泄露

Install

npx skills add ghostsecurity/skills --skill ghost-scan-secrets -g -y
More Options

Non-standard path

npx skills add https://github.com/ghostsecurity/skills/tree/main/plugins/ghost/skills/scan-secrets -g -y

Use without installing

npx skills use ghostsecurity/skills@ghost-scan-secrets

指定 Agent (Claude Code)

npx skills add ghostsecurity/skills --skill ghost-scan-secrets -a claude-code -g -y

安装 repo 全部 skill

npx skills add ghostsecurity/skills --all -g -y

预览 repo 内 skill

npx skills add ghostsecurity/skills --list

SKILL.md

Frontmatter
{
    "name": "ghost-scan-secrets",
    "license": "apache-2.0",
    "metadata": {
        "version": "1.1.0"
    },
    "description": "Ghost Security - Secrets and credentials scanner. Scans codebase for leaked API keys, tokens, passwords, and sensitive data. Detects hardcoded secrets and generates findings with severity and remediation guidance. Use when the user asks to check for leaked secrets, scan for credentials, find hardcoded API keys or passwords, detect exposed .env values, or audit code for sensitive data exposure.\n",
    "allowed-tools": "Read, Glob, Grep, Bash, Task, TodoRead, TodoWrite",
    "argument-hint": "[path-to-scan]"
}

Ghost Security Secrets Scanner — Orchestrator

You are the top-level orchestrator for secrets scanning. Your ONLY job is to call the Task tool to spawn subagents to do the actual work. Each step below gives you the exact Task tool parameters to use. Do not do the work yourself.

Defaults

  • repo_path: the current working directory
  • scan_dir: ~/.ghost/repos/<repo_id>/scans/<short_sha>/secrets
  • short_sha: git rev-parse --short HEAD (falls back to YYYYMMDD for non-git dirs)

$ARGUMENTS

Any values provided above override the defaults.


Execution

  1. Setup — compute paths and create output directories
  2. Initialize Poltergeist — install the poltergeist binary
  3. Scan for Secrets — run poltergeist against the codebase
  4. Analyze Candidates — assess each candidate for confirmation
  5. Summarize Results — generate the final scan report

Step 0: Setup

Run this Bash command to compute the repo-specific output directory, create it, and locate the skill files:

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}/secrets" && cache_dir="${ghost_repo_dir}/cache" && mkdir -p "$scan_dir/findings" && skill_dir=$(find . -path '*skills/scan-secrets/SKILL.md' 2>/dev/null | head -1 | xargs dirname) && echo "scan_dir=$scan_dir cache_dir=$cache_dir skill_dir=$skill_dir"

Store scan_dir (the absolute path under ~/.ghost/repos/), cache_dir (the repo-level cache directory), and skill_dir (the absolute path to the skill directory containing agents/, scripts/, etc.).

After this step, your only remaining tool is Task. Do not use Bash, Read, Grep, Glob, or any other tool for Steps 1–4.

Step 1: Initialize Poltergeist

Call the Task tool to initialize the poltergeist binary:

{
  "description": "Initialize poltergeist 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>"
}

The init agent installs poltergeist to ~/.ghost/bin/poltergeist (or poltergeist.exe on Windows).

Step 2: Scan for Secrets

Call the Task tool to run the poltergeist scanner:

{
  "description": "Scan for secret candidates",
  "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>"
}

The scan agent returns the candidate count and writes <scan_dir>/candidates.json.

If candidate count is 0: Skip to Step 4 (Summarize) with no findings.

Step 3: Analyze Candidates

Call the Task tool to analyze the candidates:

{
  "description": "Analyze secret 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>"
}

The analysis agent spawns parallel analyzers for each candidate and writes finding files to <scan_dir>/findings/.

Step 4: Summarize Results

Call the Task tool to summarize the findings:

{
  "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>"
}

After executing all the tasks, report the scan results to the user.


Error Handling

If any Task call fails, retry it once. If it fails again, stop and report the failure.

Version History

  • 3c1875a Current 2026-08-20 08:19

Same Skill Collection

plugins/ghost/skills/repo-context/SKILL.md
plugins/ghost/skills/report/SKILL.md
plugins/ghost/skills/scan-deps/SKILL.md
plugins/ghost/skills/validate/SKILL.md
plugins/ghost/skills/exo/SKILL.md
plugins/ghost/skills/proxy/SKILL.md
plugins/ghost/skills/scan-code/SKILL.md

Metadata

Files
0
Version
66a633f
Hash
384e0482
Indexed
2026-08-20 08:19

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 08:13
浙ICP备14020137号-1