Audit Hex deps for supply-chain security risk — bidi chars, compile-time exec, maintainer changes, typosquats, CVEs. Use after mix deps.update, when checking if a package upgrade is safe, or reviewing mix.lock PR diffs.
npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill phx-deps-audit
Non-mutating supply-chain audit for Hex packages. Runs an 8-rule MVP catalogue
against changed packages, enriches with Hex API metadata, wraps existing tools
(mix hex.audit, mix_audit, OSV-Scanner), and emits a triage table.
mix deps.update or mix deps.get brought in new versionsmix.lock (pre-merge gate)--preview <pkg>)on the unpacked NEW tarball. "Looks fine" without a tool run is a false
pass. Always write .claude/deps-audit/last-run.json — its absence
is evidence the audit didn't actually run.
mix_audit / osv-scanner — even if asked. Detect,warn with install instructions, skip cleanly if missing. If the user
says "install it," respond with the install command (e.g.,
mix deps.add mix_audit --only dev) and do not execute it. The
audit skill is non-mutating; mix.exs / mix.lock are off-limits
regardless of consent.
shows rule_id, severity, file:line, snippet, message. No
handwaving.
Cache metadata 7 days, top-500 list 1 day.
tell the user which mode (A/B/C) is active and which (old, new) pairs
resolved.
are deterministic. The hex-deps-triager agent runs only when score
> 10 (1 BLOCK or 3+ WARNs), and its verdicts are advisory — never
auto-suppress a finding without human review.
| Mode | Trigger | Old source | New source |
|------|---------|-----------|-----------|
| B (default) | /skill:phx-deps-audit | git show HEAD:mix.lock | working mix.lock |
| C (PR) | /skill:phx-deps-audit --base main | git show <ref>:mix.lock | working mix.lock |
| A (preview) | /skill:phx-deps-audit --preview httpoison | locked version | Hex API latest |
See references/operating-modes.md for full resolver logic.
Default = full 8-rule scan with streaming progress. --quick opts out
to CVE + retirement only. See references/execution-flow.md.
Parse the mix.lock Erlang term format for both old and new sources. Emit a
list of {pkg, old_version, new_version} tuples. Surface
new-only and removed-only packages separately (a removed package is not
audited; a brand-new package gets old_version = nil and skips diff-only
rules).
See references/diff-resolver.md for shell + mix run -e snippets per mode and the JSON output contract.
For each (pkg, old, new):
mix hex.package fetch <pkg> <old> --unpack -o ${AUDIT_TMPDIR}/tarballs/<pkg>/<old>/
mix hex.package fetch <pkg> <new> --unpack -o ${AUDIT_TMPDIR}/tarballs/<pkg>/<new>/
All ephemeral artifacts live under ${AUDIT_TMPDIR} (driver-owned, removed
on exit). See references/audit-tmpdir.md and
references/tarball-fetcher.md.
| # | Rule | Sev | Method |
|---|------|-----|--------|
| 1 | Bidi Unicode control chars in .ex/.exs/.erl | BLOCK | grep |
| 2 | Code.eval_* / :erlang.apply with non-literal MFA at module scope | BLOCK | AST (Sourceror or regex+scope) |
| 3 | System.cmd / :os.cmd / Port.open at compile time | BLOCK | AST |
| 4 | :erlang.binary_to_term/1 on literal without :safe | BLOCK | AST |
| 5 | New :git/:path dep in mix.exs (vs old) | BLOCK | AST diff |
| 6 | Maintainer change between versions | BLOCK | Hex API |
| 7 | Base64 blobs >256 chars outside priv/static/, test/fixtures/, assets/ | WARN | regex |
| 8 | Levenshtein ≤2 from top-500 + download delta >1000× | BLOCK | Hex API + fuzzy |
Full catalogue (35 rules, MVP marked) in references/heuristics.md.
Bash + mix run -e implementations for all 8 MVP rules in
references/rules-impl.md (single-pass NEW + diff rules +
Hex API rules, with run_all_rules master loop).
mix hex.audit — retired-package check, always availablemix_audit — CVE check via GHSA, if installed (else warn + skip; do NOT install)osv-scanner — CVE check via OSV.dev, if installed (else warn + skip; do NOT install)See references/external-tools.md for detection, output parsing, and severity mapping per tool.
GET /api/packages/:name — owners, downloads, inserted_atGET /api/packages/:name/releases/:version — per-release publisherdays_since_publish, owner_age_days, download_velocityCap at 5 req/sec. Per-run cache under ${AUDIT_TMPDIR}/hex-api/.
See references/hex-api.md for endpoint contracts,
caching strategy, Rule 6/8 detection, and Levenshtein implementation.
hex_vet.exs ledger (if present)If hex_vet.exs exists at project root, vetted-version findings are
downgraded to INFO. Unvetted versions retain their severity.
Lock-vs-ledger disagreement: lock wins. See the deps-vet skill's
hex-vet schema doc for the "Lock-vs-ledger disagreement" section.
Use /skill:phx-deps-vet <pkg> <version> (separate skill) to add entries.
When run with DIFFERENTIAL=1 (default), findings that existed in the
OLD tarball are downgraded to INFO. Net-new signals reach the renderer
at full severity. See references/differential.md.
For packages where the aggregate score exceeds 10, the
hex-deps-triager sonnet agent reads finding + diff windows and
produces structured verdicts (confidence, verdict, rationale,
fp_reasons[]). A context-supervisor (haiku) consolidates verdicts
across packages into triage/consolidated.md. Main skill reads only
the consolidated file.
See references/llm-triage.md.
Per-package weighted sum: BLOCK = 10, WARN = 3, INFO = 1.
Risk band: 0 clean · 1–5 low · 6–15 medium · 16+ high.
Output:
pkg | old → new | risk | findings | diff.hex.pm | maintainer-change plus a per-package detail section for any non-clean row..claude/deps-audit/last-run.json. The Phase 3 gate reads this; an audit that doesn't write it is a no-op for the gate. Always emit, even on clean runs.--json flag emits JSON to stdout instead of markdown. See
references/output-renderer.md for table format,
sidecar schema, exit-code rubric, and --quiet mode.
mix.lock, mix.exs, or any project file (non-mutating)mix deps.{get,update,compile} via deps-audit-gate.sh. See references/hook.md./skill:phx-compound after BLOCK findings — corpus self-feeds.--sarif <path> and gate CI via --ci.references/heuristics.md — full 35-rule cataloguereferences/rules-impl.md — bash + mix run -e for the 8 MVP rulesreferences/operating-modes.md — Mode A/B/C resolverreferences/diff-resolver.md — shell snippets, lock parserreferences/tarball-fetcher.md — fetch wrapper, parallel cap, cache prunereferences/external-tools.md — mix_audit, osv-scanner wrappersreferences/hex-api.md — endpoint contracts, rate limit, Rule 6/8references/output-renderer.md — markdown, JSON v1, exit codes, SARIFreferences/testing.md — smoke runner, fixture matrixreferences/differential.md / llm-triage.md — Phase 2 NDJSON subtract + triagerreferences/semgrep.md / yara.md — Phase 2 precision layers (soft deps)references/cassettes.md / sarif.md / hook.md / ci-integration.md — Phase 3 surfacereferences/trusted-publishers.md / skill-checklist.md — upstream + evalreferences/audit-tmpdir.md — Phase 5 per-run ephemeral storage contractreferences/execution-flow.md / differential-cve.md — Phase 5 default scan + CVE diffExpert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.
Expert in secure mobile coding practices specializing in input validation, WebView security, and mobile-specific security patterns. Use PROACTIVELY for mobile security implementations or mobile security code reviews.
Expert in secure frontend coding practices specializing in XSS prevention, output sanitization, and client-side security patterns. Use PROACTIVELY for frontend security implementations or client-side security code reviews.
Security hardening reviewer for GitHub Actions workflow files (.github/workflows/*.yml). Reasons about the Actions threat model that pattern matchers and general code linters miss — untrusted-input script injection, privileged triggers running fork code, mutable action references, and over-scoped tokens. Use this skill when asked to review, audit, harden, or secure a GitHub Actions workflow, when writing a new workflow, or for any request like "is this workflow safe?", "review my CI for security issues", "why is pull_request_target dangerous here?", "pin my actions", or "lock down GITHUB_TOKEN permissions". Covers script injection via ${{ }} interpolation, pull_request_target / workflow_run privilege escalation, SHA-pinning of third-party actions, least-privilege permissions, GITHUB_ENV/GITHUB_OUTPUT injection, secret exposure, OIDC over long-lived credentials, and self-hosted runner exposure on public repositories.
Review a PR, or a PR linked to an issue, for security risks. Check nine categories and report PASS, WARNING, or FAIL. Use when reviewing code for vulnerabilities, secrets, injection, authorization bypasses, or unsafe configuration. Trigger keywords - security review, code review, appsec, vulnerability assessment, security audit, review PR security.
>- Run Semgrep static analysis scan on a codebase using parallel subagents. Supports two scan modes — "run all" (full ruleset coverage) and "important only" (high-confidence security vulnerabilities). Automatically detects and uses Semgrep Pro for cross-file taint analysis when available. Use when asked to scan code for vulnerabilities, run a security audit with Semgrep, find bugs, or perform static analysis. Spawns parallel workers for multi-language codebases.
Expands one confirmed or suspected vulnerability into a Trailmark graph neighborhood of variant candidates by finding sibling functions, shared callers and callees, common sensitive sinks, common entrypoint paths, interface implementations, override relationships, type/reference neighbors, and structurally similar nodes. Use after one issue is found to seed variant-analysis, semgrep-rule-creator, static-analysis, or manual review with graph-derived candidate locations.
Apply modern web development best practices for security, compatibility, and code quality. Use when asked to "apply best practices", "security audit", "modernize code", "code quality review", or "check for vulnerabilities". Do NOT use for accessibility (use web-accessibility), SEO (use seo), performance (use core-web-vitals), or comprehensive multi-area audits (use web-quality-audit).
Take oliver-kriska/claude-elixir-phoenix-pi-phx-deps-audit from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.