supply-chain-defense
Behavioural-first software supply chain defense - catches poisoned npm/PyPI packages in the publish-to-advisory window that CVE tools miss. Use BEFORE every install or version bump (not only when an attack is suspected) - the 7-day cooldown gate + behavioural score catches freshly-published malware that CVE tools won't see for days. Socket.dev integration (free CLI + GitHub app + depscore MCP for Claude Code), stale-OIDC audit, dependency cooldown policy, publish-token rotation, VS Code extension audit, and a self-integrity scan that detects worm persistence hooks injected into Claude Code / VS Code settings. Triggers on: pip install, uv add, uv tool install, npm install, pnpm add, yarn add, cargo add, go get, composer require, gem install, upgrade dependency, dependency upgrade, version bump, bump version, bump package, adding dependency, new dependency, vetting a dependency, vet package, is this package safe, safe to install, should I install, before installing, pre-install check, preinstall scan, preinstall-check, PyPI cooldown, npm cooldown, release cooldown, minimumReleaseAge, score a package, package score, depscore, socket score, supply chain, supply chain attack, malicious package, poisoned dependency, npm worm, Shai-Hulud, behavioural scanning, Socket.dev, socket scan, dependency security, postinstall malware, OIDC token theft, compromised maintainer, typosquat, dependency confusion, package provenance, SLSA, persistence hook, malicious VS Code extension.
What this skill does
# Supply Chain Defense Proactive, behavioural-first defense against the 2026 software supply chain threat: self-propagating worms (Shai-Hulud / Mini Shai-Hulud) that poison popular npm and PyPI packages, steal credentials, republish from stolen tokens, and inject persistence hooks into **Claude Code and VS Code settings** specifically. ## Helps with Every install or version bump is a use case for this skill, not just suspected attacks — the routine cooldown gate + behavioural score is the whole point. Deciding whether a dependency you're about to add is safe — getting a behavioural verdict on an npm or PyPI package *before* `npm install` / `pip install`, not days later when a CVE drops. `socket package score`, the depscore MCP, or `scripts/preinstall-check.sh`. A teammate or CI just pulled a freshly-published package version and you need to know if it's poisoned. The Shai-Hulud / Mini Shai-Hulud worm ships malicious versions that live for only hours (axios 1.14.1 / 0.30.4 were live ~3h). `npm audit` / `pip-audit` come back clean but you're uneasy — those are CVE/advisory-driven and blind to malware that hasn't been reported yet. You want behavioural analysis (new `postinstall` hooks, unexpected network calls, obfuscated payloads), not a CVE lookup. Setting up Socket.dev on a budget — the free `socket` CLI, the GitHub PR app, or the `depscore` MCP for Claude Code (`claude mcp add --transport http socket-mcp https://mcp.socket.dev/`, no API key). Deciding free vs paid tiers. Auditing GitHub Actions for the stale-OIDC / `pull_request_target` misconfiguration that Mini Shai-Hulud abused to mint npm publish tokens from an orphaned workflow. `zizmor`, or `scripts/integrity-audit.sh`. Hardening installs against `postinstall` / `preinstall` lifecycle-script malware — `npm config set ignore-scripts true`, the `socket` wrapper, `lockfile-lint`, or the `pre-install-scan.sh` hook. Checking whether *this* machine is already compromised — detecting worm persistence hooks injected into `~/.claude/settings.json`, `~/.claude.json`, or VS Code `settings.json`. `scripts/integrity-audit.sh`. Choosing among supply-chain scanners — when to reach for Socket vs GuardDog vs OSV-Scanner vs zizmor vs Harden-Runner. See `references/tooling-landscape.md`. Enforcing a release-age cooldown so production never pulls a day-zero version (Renovate `minimumReleaseAge`), and rotating long-lived npm/PyPI publish tokens to short-lived OIDC. Responding to a fresh advisory — it names a poisoned package, version, or **malicious VS Code / Cursor extension** and you need to know whether any project or machine actually has it installed *right now*. `scripts/exposure-check.py` matches on-disk npm / PyPI / Composer / Cargo / Go / RubyGems lockfiles **and installed editor extensions** against an IOC catalog seeded with cited 2026 incidents (axios 1.14.1, Laravel-Lang tag rewrite, Nx Console 18.95.0 → the GitHub breach). For fleet-scale exposure response on macOS/Linux, see Bumblebee in `references/tooling-landscape.md`. Wanting proof the skill covers a specific attack — the `references/threat-model.md` "Coverage" matrix maps every 2026 vector (maintainer compromise, OIDC theft, lifecycle scripts, persistence hooks, forged provenance, tag-rewrite, malicious extensions, MCP attacks) to its control + caveat. ## Overview This skill is the operational complement to two siblings: - **`security-ops`** is *reactive* — it runs `npm audit` / `pip-audit` / `govulncheck` against the **CVE/advisory database**. Necessary, but blind to a malicious package that hasn't been reported yet. - **`supply-chain-defense`** (this skill) is *proactive* — it analyses what a freshly-published package actually **does** (new install scripts, network calls, obfuscation) within seconds of publication, before any CVE exists. > The defensive gap is the window between "package published" and "advisory > issued" — typically 30 minutes to 6 hours. A worm does real damage in that > window. Behavioural analysis is the only control that closes it. See > `references/threat-model.md` for why lockfiles, `npm audit`, 2FA, and even > Sigstore/SLSA provenance were each bypassed in the wild in 2026. ## The four layers | Layer | Control | What it stops | |---|---|---| | 1. Detection | Behavioural scanner (Socket.dev) on every dependency change | Poisoned package merged via PR or pulled by an install | | 2. Interception | `socket` CLI wrapper + `pre-install-scan.sh` hook | Lifecycle scripts (`postinstall`, sdist `setup.py`) executing on install | | 3. Hygiene | Stale-OIDC audit, dep cooldown, token rotation, extension audit | The *entry points* worms use to mint publish access | | 4. Self-integrity + exposure | `integrity-audit.sh` (persistence hooks in AI-tool / editor configs) + `exposure-check.py` (am I running a named-bad package?) | Worm persistence on *this* machine; latent exposure to a fresh advisory | ## Cost reality — free is enough to start **The Socket CLI is open-source and free. The free account tier defends against this exact campaign at $0.** Paid tiers buy noise-reduction and scale, not the core malware detection. | Capability | Free ($0) | Paid (Team $25/dev → Enterprise) | |---|---|---| | `socket` CLI (open source) | ✅ | ✅ | | Malware / behavioural blocking, 70+ risk types | ✅ | ✅ | | Private repos (unlimited) | ✅ | ✅ | | Scans / month | 1,000 | 5,000 → unlimited | | Members | 3 | 10 → unlimited | | **depscore MCP for Claude Code (no API key)** | ✅ | ✅ | | Reachability analysis (cuts CVE false positives) | ❌ | ✅ (Team+) | | SSO/SAML, SBOM, GitHub Actions + AI-model scanning | ❌ | ✅ (Business+) | | OSS projects | Free **Team** account on request | — | Start free. Move to Team only when CVE false-positive noise or seat count justifies it. Full breakdown + exact commands in `references/socket-cli.md`. ## Setup (one-time) All free, in priority order. The **scripts in this skill need no setup** — run them directly. What you switch on is the live tooling: 1. **depscore MCP** — behavioural package scoring inside Claude Code, no API key: `claude mcp add --transport http socket-mcp https://mcp.socket.dev/` 2. **Install-scan hook** — advisory on every dependency install. Wire `pre-install-scan.sh` into `~/.claude/settings.json` (see "Hook setup" below); set `SUPPLY_CHAIN_BLOCK=1` for a hard gate. Restart Claude Code after editing. 3. **Socket CLI wrapper** (optional, zero-auth): `npm i -g socket`, then `socket npm install <pkg>` or `socket wrapper on`. `socket login` is only needed for `scan` / `score` / `ci`, not the install wrapper. 4. **Behavioural engine (optional, on-demand)** for `scan-extensions.sh --deep`: `uv tool install guarddog semgrep`. **Not installed by default** — stay lean. `--deep` auto-detects it; if absent, that mode runs inventory + recency and loudly recommends installing rather than reporting a scan it didn't run. On Windows GuardDog needs `PYTHONUTF8=1` (the script sets it for you). Situational extras — install only when the need arises (`references/tooling-landscape.md`): the behavioural engine above, OSV-Scanner (CVE breadth), zizmor + Harden-Runner (CI hardening). The minimum viable set is Socket's MCP + the cooldown + `ignore-scripts`; everything else is on-demand. ## Safety tiers | Operation | Tier | Execution | |---|---|---| | Score / scan a package before adding it | T1 | Inline (depscore MCP or `socket package score`) | | Detect project stack + installed tools | T1 | Inline | | Run `integrity-audit.sh` (read-only) | T1 | Inline | | Run `preinstall-check.sh` on a package spec | T1 | Inline | | Behavioural scan of full manifest (`socket scan`) | T2 | Inline / background | | Audit GitHub Actions for stale OIDC trust | T2 | Inline (read workflows) | | **Install / upgrade a dependency** | T3 | Confirm + scan first | | **Rotate publish tokens / revoke OIDC trust** | T3 | Confirm — changes live infra | | **Remove a flagged persistence hook from
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.