/security:socketfrom security
Walks through Socket Security GitHub App setup: browser-based OAuth install, API verification that the install targets the correct account and repo, and optional pinned CI workflow scaffold.
Ships in security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Invocation: /security:socket in Claude Code; $security-socket in Codex.
You are setting up Socket Security on the current repo. Socket's integration is a GitHub App, not a checked-in config file. The skill's job is:
Most of this skill is talking, not file-writing. Don't try to automate the browser steps — the OAuth flow needs the user's actual GitHub session.
User-triggered only. Activate when the user invokes /security:socket. Do not self-activate on related natural-language phrasing ("add socket", "set up socket", a mention of typosquats or risky deps) — surface the slash command to the user instead and let them decide.
# 1. We're in a git repo with a GitHub remote
gh repo view --json nameWithOwner,defaultBranchRef,visibility 2>/dev/null \
|| { echo "Not a GitHub repo (or gh not authed). Abort."; exit 1; }
Capture:
REPO (owner/name)OWNER and NAME separately (the App-install verification needs them)DEFAULT_BRANCH (only needed if the user opts into the CI workflow)VISIBILITY (PUBLIC / PRIVATE / INTERNAL)Visibility note. Socket's free tier works on both public and private repos (unlike OpenSSF Scorecard — see [[security-openssf]] for that gate). No refusal here.
Print the steps and stop. Don't try to do anything for the user in this phase; the OAuth flow doesn't work without their browser.
1. Open https://socket.dev/ → click "Sign in with GitHub" (top right).
2. Authorize the OAuth app (read-only profile info — this is just the login,
not the scanning install).
3. On the Socket dashboard, click "Add repositories" → it sends you to
https://github.com/apps/socket-security to install the GitHub App.
4. On the GitHub install screen:
- Pick the account that owns __OWNER__ (your personal account, not an
org, unless this repo lives in an org).
- Select "Only select repositories".
- Make sure __REPO__ is in the list. Add others if you want.
- Click Install (or "Install & Authorize" if it's the first time).
5. You'll land back on socket.dev showing the repo in the dashboard.
Tell me when you're done — I'll verify the install via the GitHub API.
Substitute __OWNER__ and __REPO__ with the captured values. Then wait.
Common stumbles to call out up front so the user doesn't get stuck:
Once the user says they finished, run the verification. Two things to confirm:
socket-security App is installed on the account that owns this repo.# Step 1: list the App installations the authenticated gh user can see.
# The Socket Security App's slug is "socket-security".
gh api --paginate /user/installations \
--jq '.installations[] | select(.app_slug == "socket-security")
| {id: .id, account: .account.login, target_type: .target_type,
repository_selection: .repository_selection}'
Expected output if the install landed:
{
"id": 12345678,
"account": "<owner>",
"target_type": "User",
"repository_selection": "selected"
}
If the JQ filter returns nothing, the App isn't installed under any account this token can see. Likely causes (in priority order):
| Symptom | Likely cause | Fix |
|---|---|---|
| Empty output | User clicked through OAuth login but never reached the GitHub install screen | Re-do step 3 of phase 1 — the "Add repositories" link |
Empty output, gh auth status shows wrong account | gh is authed as a different GitHub user than the browser session | gh auth switch to the matching account, re-run |
If output appears but account ≠ OWNER (e.g. installed on personal account, repo is in an org): tell the user explicitly which account it landed on and link them back to the install screen for the correct account.
# Step 2: if the install exists and `repository_selection == "selected"`,
# confirm the current repo is in the selected list.
INSTALLATION_ID=<id from step 1>
gh api --paginate "/user/installations/$INSTALLATION_ID/repositories" \
--jq ".repositories[] | select(.full_name == \"$REPO\") | .full_name"
If this prints OWNER/NAME, the install is good. If it's silent, the App is installed on the right account but this repo isn't in its selected list — point the user at https://github.com/apps/socket-security and have them click "Configure" → add this repo.
If repository_selection == "all", skip step 2 — the App covers every repo on the account, including this one.
Surface this so the user doesn't think Socket is broken:
Socket only comments on PRs that change a dependency manifest (
package.json,requirements.txt,pyproject.toml,Gemfile, etc.). A PR that only edits source code won't trigger a comment. To see the App work, open a PR that bumps or adds a dep — even a no-op patch bump will do.
The GitHub App's PR comment is the primary surface. A CI workflow on top is redundant for most users — Socket's App already runs on every PR, on every commit, automatically. Offer the workflow only if the user wants one of:
Ask first: "The GitHub App already comments on PRs — a CI workflow is mostly redundant. Want one anyway, e.g. for a required status check?" If no, skip to Phase 4.
Use the template at assets/socket.yml. Substitute:
__DEFAULT_BRANCH__ → captured default branch (e.g. main)__SOCKET_CLI_VERSION__ → pinned Socket CLI version (see below)To resolve the current CLI version:
npm view socket version
# Example: 1.0.45
Show the user the resolved version, then write the file:
mkdir -p .github/workflows
Write to .github/workflows/socket.yml. Show the diff before writing.
The CLI needs a Socket API key. Walk the user through it — this is one-time, not file-writable:
1. Open https://socket.dev/dashboard → top right avatar → API tokens.
2. Create a new token (read-only is enough for `socket scan create`).
3. Pipe it into `gh secret set` so the token never lands in shell history:
gh secret set SOCKET_SECURITY_API_KEY --repo __REPO__
# paste the token when prompted, then press Ctrl-D
If gh secret set errors (Resource not accessible by integration on org repos), the user has to set the secret via the GitHub web UI instead — Settings → Secrets and variables → Actions → New repository secret.
Socket publishes their CLI to npm. Installing via npm i -g socket@<pinned> keeps the version pin visible in the workflow diff and avoids a third-party action in the supply chain. If the user wants the marketplace action (SocketDev/socket-security-action or current equivalent) for CODEOWNERS / Dependabot reasons, respect that — note the trade-off and swap in the action pinned to a commit SHA.
For pre-push scans without going through CI:
npm i -g socket@<version>
socket login # opens browser, stores a token in ~/.socket/
socket scan create . # scans the working tree's manifests
Skip unless the user asks. Most users will rely on the App's PR comments.
Socket Security install verified for __REPO__.
Verified:
✓ GitHub App "socket-security" installed on __OWNER__
✓ __REPO__ is covered by the installation
[✓ CI workflow .github/workflows/socket.yml committed (if Phase 3)]
[✓ SOCKET_SECURITY_API_KEY secret set on __REPO__ (if Phase 3)]
What to do next:
- Socket will comment on the next PR that touches a dependency manifest
(package.json, requirements.txt, etc.). PRs that only edit source code
won't trigger a comment — that's expected.
- Dashboard: https://socket.dev/dashboard
- To turn the App's comment into a required check, configure branch
protection on __DEFAULT_BRANCH__ to require the "socket-security"
status (App PR comments don't gate merges on their own).
If the user comes back later asking about a specific Socket finding:
| Finding type | What it means | What to do |
|---|---|---|
| Typosquat | New dep name is one Levenshtein step from a popular package | Almost always a real concern. Reject the PR; confirm intent of the package author. |
| Install scripts | Package runs code at install time (postinstall etc.) | Audit what the script does. Common in build-tool packages (esbuild, node-gyp); suspicious in random utilities. |
| Native code | Package ships compiled .so / .dylib / .node binaries | Verify it's expected (sharp, better-sqlite3); flag if a pure-JS utility suddenly grows native code. |
| Telemetry / network | Package phones home | Check the destination. Telemetry to the maintainer's analytics may be acceptable; arbitrary POSTs are not. |
| Unmaintained | No commits / releases in N years | Often a false alarm on stable utilities. Weight by what the package does — a string-pad library being "unmaintained" is fine; a crypto library being unmaintained is a smell. |
| High risk score, no specifics | Aggregate of several signals, none individually severe | Click through to the dep page on socket.dev. The breakdown matters more than the score. |
When advising on findings, point the user at the specific finding's URL on socket.dev rather than re-explaining what Socket already says on the PR comment. The dashboard has more detail than the comment.
.github/workflows/socket.yml. Read it, diff against the template, ask before overwriting. The user may already be running Socket via CI.package.json, requirements.txt, pyproject.toml, Gemfile, Cargo.toml, go.mod — most ecosystems are covered. If the user's stack is exotic, check Socket's supported ecosystems list and tell them which manifests will trigger scans.gh api /user/installations before declaring success. "I clicked through it" ≠ "it's installed on the right account."What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub zcaceres/skills --plugin security6 skills in this plugin
/bumblebeeSet up and use Perplexity's bumblebee endpoint scanner for supply-chain exposure checks. Two modes — setup (install the Go binary, pick an output directory, run a first baseline scan, optionally schedule recurring scans and wire up an exposure catalog) and review (read the latest scan, answer advisory lookups like "did I have package X@Y installed", surface drift since the prior scan, optionally re-run with the catalog). Aimed at single developers and small teams (no MDM, no SIEM). User-triggered only — activate when the user invokes `/security:bumblebee`, `/security:bumblebee review`, `/security:bumblebee check <package>`, or `/security:bumblebee setup`./gitleaksSet up gitleaks secret-scanning on a repo. Scans history for existing leaks first — stops if dirty, because installing CI on top of a polluted history makes CI permanently red. If history is clean, scaffolds .gitleaks.toml, a local pre-commit hook, and a pinned CI workflow that scans both git history and working tree. User-triggered only — activate when the user invokes `/security:gitleaks`./openssfScaffold OpenSSF Scorecard GitHub Action on a public repo with a safe two-phase rollout — first run with publish_results false so SARIF findings can be triaged before any score reaches the public dashboard, then flip to true and add a badge once the score is acceptable. Refuses to install on private/internal repos. Subcommand `fix` turns a Scorecard report into a remediation plan and applies it. Use when the user says "add OpenSSF", "set up Scorecard", "OpenSSF boilerplate", "fix the scorecard findings", or "/security:openssf"./scfwSet up and use Datadog's Supply-Chain Firewall (scfw) to block known-malicious npm/PyPI/Poetry packages at install time. Two modes — setup (pipx-install scfw, run `scfw configure` to route pip/npm/poetry through the firewall via shell aliases, smoke-test the pipeline with a dry run, and optionally install a Claude Code or Codex PreToolUse hook so the agent's own installs are vetted too) and review (confirm the firewall is still wired, read the local JSON Lines log for recent blocks/warnings, run `scfw audit` on installed packages, answer "did scfw block/see package X"). Client-side, install-time gate for a single developer machine — complements CI-side scanning, doesn't replace it. User-triggered only — activate via `/security:scfw [subcommand]`, or `$security-scfw [subcommand]` in Codex./snykSet up Snyk on a repo. The integration is a GitHub App plus a Snyk-side "import this repo as a project" step, not a checked-in config, so most of the skill is walking the user through the three browser steps (Snyk login → GitHub App install → Add project) and then verifying via the GitHub API that the App actually landed on the right account. Pre-flips "Automatic fix PRs" off so the install doesn't dump a backlog of fix PRs into the repo. Optionally scaffolds a pinned CI workflow that runs `snyk code test` (SAST), which isn't covered by the App's free tier dependency-CVE scanning. User-triggered only — activate when the user invokes `/security:snyk`.