Skip to main content
ClaudeWave
Skill829 repo starsupdated 4d ago

ship-safe-scan

Quick scan for leaked secrets — API keys, passwords, tokens, database URLs. Use when the user wants to check for hardcoded secrets or exposed credentials.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/asamassekou10/ship-safe /tmp/ship-safe-scan && cp -r /tmp/ship-safe-scan/claude-code-plugin/skills/ship-safe-scan ~/.claude/skills/ship-safe-scan
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Ship Safe — Secret Scan

You are scanning this project for leaked secrets using Ship Safe's pattern matching and entropy analysis engine.

## Step 1: Run the scan

```bash
npx ship-safe@latest scan $ARGUMENTS --json 2>/dev/null
```

If `$ARGUMENTS` is empty, default to `.`:

```bash
npx ship-safe@latest scan . --json 2>/dev/null
```

The command exits 0 if clean, 1 if secrets found. Capture stdout regardless.

## Step 2: Parse the JSON output

The JSON output has this structure:

```json
{
  "filesScanned": 234,
  "totalFindings": 5,
  "clean": false,
  "findings": [
    {
      "file": "src/config.js",
      "findings": [
        {
          "line": 42,
          "type": "Stripe Live Secret Key",
          "severity": "critical",
          "description": "Hardcoded Stripe live secret key found",
          "matched": "sk_live_****"
        }
      ]
    }
  ]
}
```

## Step 3: Report

**If clean:** Confirm no secrets were found. Report how many files were scanned. This is good news!

**If secrets found:**

1. List each finding grouped by file:
   - File path and line number
   - Secret type (e.g., "AWS Access Key", "GitHub Token", "Database URL")
   - Severity level
2. **Never display actual secret values** — even partial matches should be referred to by type only
3. If multiple secrets are in the same file, group them together

## Step 4: Remediate

For each secret found, offer to fix it:

1. **Replace** the hardcoded secret with an environment variable reference:
   - JavaScript/TypeScript: `process.env.VARIABLE_NAME`
   - Python: `os.environ.get('VARIABLE_NAME')`
   - Use a descriptive variable name based on the secret type (e.g., `STRIPE_SECRET_KEY`, `DATABASE_URL`)

2. **Create or update `.env.example`** with placeholder values:
   ```
   STRIPE_SECRET_KEY=sk_live_your_key_here
   DATABASE_URL=postgresql://user:password@host:5432/db
   ```

3. **Ensure `.env` is in `.gitignore`** — check and add if missing

4. **Warn about git history** — if the secret was already committed, it exists in git history. Recommend:
   - Rotating the credential immediately (mention `npx ship-safe rotate`)
   - Consider using `git filter-branch` or BFG Repo Cleaner to remove from history

5. **Suggest auto-fix** — mention `/ship-safe-fix` for bulk remediation, or `/ship-safe-baseline` to baseline known findings

Read the file and surrounding context before making any changes. Apply fixes only after presenting the findings, unless the user asked for auto-fix.
ship-safe-baselineSkill

Manage your security baseline — accept current findings as known debt, then only report new regressions on future scans. Use when the user wants to adopt security scanning incrementally or suppress existing findings.

ship-safe-ciSkill

Run Ship Safe in CI mode — compact output, exit codes, SARIF generation. Use when the user wants to set up CI/CD security gates or test their pipeline configuration.

ship-safe-deepSkill

Run a deep security audit with LLM-powered taint analysis — regex scan nominates findings, then an LLM verifies taint reachability and exploitability. Use when the user wants thorough, high-confidence results with fewer false positives.

ship-safe-fixSkill

Auto-fix security issues — remediate hardcoded secrets and common vulnerabilities (TLS bypass, debug mode, XSS, shell injection, Docker :latest). Use when the user wants to automatically fix security findings.

ship-safe-hooksSkill

Install ship-safe as real-time Claude Code hooks — blocks secrets and dangerous commands before they land on disk. Use when the user wants automatic security scanning on every file write or bash command.

ship-safe-red-teamSkill

Run a multi-agent red team scan — 29 specialized security agents scan for 80+ attack classes including injection, auth bypass, SSRF, supply chain, Supabase RLS, MCP security, agentic AI, RAG poisoning, PII compliance, and more. Use when the user wants a deep security analysis beyond just secrets.

ship-safe-scoreSkill

Get your project's security health score (0-100, A-F grade). Use when the user wants a quick security check or asks "is my code safe to ship?

ship-safeSkill

Run a full security audit on this project — 16 agents scan for secrets, injections, auth bypass, SSRF, supply chain, Supabase RLS, MCP security, agentic AI, RAG poisoning, PII compliance, and more. Use when the user wants a security audit, vulnerability scan, or asks if their code is safe to ship.