Skip to content
Back to skills

Cve Sweep

ASecurity

Weekly CVE patch sweep of one repository: count CVEs before, plan every upgrade to the latest LTS runtime, base image and dependencies (majors flagged with their breaking changes), hand the user a review report with a recommendation for every CVE it cannot close, then execute only after approval in at most three releases, merge on one go-ahead, and count again after. Use for "run the CVE sweep", "patch CVEs in this repo", "Monday security sweep", "bump Node to the new LTS and fix the audit", ...

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 24, 2026
ai-agentsgoreactnodedockersecurity

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned November 24, 2026

npx -y skills add MichaelLeeHobbs/skills --skill cve-sweep --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cve Sweep?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cve Sweep
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/michaelleehobbs-cve-sweep/badge)](https://www.skillsdirectory.com/skills/michaelleehobbs-cve-sweep)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cve-sweep
description: >-
  Weekly CVE patch sweep of one repository: count CVEs before, plan every upgrade to the latest LTS
  runtime, base image and dependencies (majors flagged with their breaking changes), hand the user a
  review report with a recommendation for every CVE it cannot close, then execute only after approval in
  at most three releases, merge on one go-ahead, and count again after. Use for "run the CVE sweep",
  "patch CVEs in this repo", "Monday security sweep", "bump Node to the new LTS and fix the audit", "why
  is Inspector still showing these". NOT for one urgent CVE hotfix (patch it directly), for repos you are
  not about to change, or for several repos at once (one run per repo).
---

# CVE sweep: one repo, scanned, planned, approved, patched

A sweep is worth running only if it closes CVEs in production without breaking anything and without
flooding the release queue. So it measures before and after, shows the plan before touching anything,
caps the releases, and checks next week that last week's fixes actually shipped.

**One repository per run, from inside it.** **The project's own rules win**: if it documents how it
upgrades, tests, branches or reviews, follow that and use this skill for what it leaves silent. Nothing
is changed until the user approves the report in step 4, and nothing is merged until step 6's go-ahead.

## Files the sweep keeps in the repo

All under `security/`, committed with the sweep. Formats in [reference/FILES.md](reference/FILES.md).

| File | What it holds |
|---|---|
| `security/cve-sweep.json` | Repo config: risk owner, extra holds, critical packages, images, cloud and deploy details, release limit (lower only) |
| `security/accepted-risks.md` | Risk register: the standing no-fix policy, then each accepted CVE with its verdict, basis, accepter and expiry |
| `security/cve-sweep-ledger.md` | One line per run: before and after counts, PRs, and whether last run's fixes reached production |

Scanner ignore files (`.trivyignore`, `.grype.yaml`, the package manager's audit ignore list) mirror the
register and are never edited on their own. Create any that are missing in the first sweep's first PR.

## Monorepos: one app per run

In a workspace, a run targets one app the user names (ask if they did not); scan, plan, register and
ledger are scoped to it, files stay at the repo root keyed by app. Root and shared changes go in this
app's run, listed with the other apps they redeploy (outside the release limit), and are verified in
those apps. Details in FILES.md, SCANNING.md and REPORT.md's Shared changes.

## Keeping the run small

Whatever a run reads stays in its context and is paid for again on every later step. Never read raw
scanner output, gate logs, a full lockfile diff or a whole changelog: read script-made summaries, hand
scans and research to workers where you can, and wait on deploys with one blocking command. Shipping
starts from a handoff, not the planning history. Both: [reference/HANDOFF.md](reference/HANDOFF.md).

## 1. Follow through on last week

Take the ids the previous run's report (named by the ledger's last row for this app) lists as closed.
For each, check whether the deployed artifact still has it (cloud registry findings, or a scan of the
running tag) and record it as confirmed, still open (with why) or unknown; fill the previous ledger row's
production column, after-deploy counts and merge results. New registry ids with no fixed upstream
release get policy rows
([reference/RISK.md](reference/RISK.md)). Still-open CVEs go into this week's report. No deployed-artifact
check means `unknown`, never `confirmed`. With no ledger, this is the first sweep: say so.

## 2. Baseline scan

Before changing anything, on a clean checkout of the freshly fetched base branch: the dependency audit,
an image scan of an image built from the current Dockerfile (and each extra image the config lists), and
the cloud registry's findings for the deployed image where the config names the account. Count unique
ids by severity, per source, deduplicated across sources. A scanner that fails or is missing is
`not run: <reason>`, never zero. Commands, cache location and counting rules:
[reference/SCANNING.md](reference/SCANNING.md).

Then read the risk register. Every row RISK.md's "When an acceptance comes back" names returns to the
report as open.

## 3. Plan

Work out every bump. Details, lookups and traps: [reference/PLANNING.md](reference/PLANNING.md).

- **Runtime LTS everywhere at once:** version files, `engines`, Dockerfile `FROM`, CI images, serverless
  runtimes (only where the target region offers them; otherwise hold them and say so), and the runtime's
  type package. Check PLANNING.md's facts for the new major.
- **Base image:** the latest tag for that runtime on the current distro line, pinned by digest, plus an
  OS package upgrade step. Every other `FROM` image gets its latest digest too.
- **Dependencies:** patch and minor go in by default (a `0.x` minor counts as a major). Each major goes
  in flagged, with a breaking-change summary and the call sites it touches. `packageManager` holds the
  package-manager version; every other pin reads it or is checked against it (PLANNING.md).
- **Old-version references:** after a runtime or package-manager major, grep for the old major in
  comments, error messages and setup advice, and fix or explain each hit.
- **Holds and cooldown:** skip anything on the hold list (each with a reason and a lift condition) and any
  version published less than 7 days ago; enforce the cooldown in the package manager where it can.
- **Transitive CVEs:** fix with overrides; remove overrides upstream has made unnecessary.
- **Critical packages** (Drizzle, React, the config's `critical` list) get the full changelog and the
  extra checks in PLANNING.md. A bump that changes what errors carry gets a log-leak check.
- **Every CVE left open** gets a reachability verdict and a recommendation (RISK.md).

**Group into releases.** At most 3 PRs that each end in a release, ideally 1: low-risk bumps together in
the first, risky majors in at most two more. Every major is its own commit so it can be reverted alone.
More than 3 needs a strong reason and the user's explicit approval; otherwise defer the lowest-value
majors to next week.

## 4. Report, then stop

Write the report from [reference/REPORT.md](reference/REPORT.md) and save it to
`security/sweeps/<yyyy-mm-dd>[-<app>].md`, uncommitted; it goes into the first release's first commit.

**Stop for the user's review.** They may edit the plan ("skip Drizzle this week", "accept that one for 30
days"). Apply their edits to the Approved plan section, then execute exactly that. Approval of the report
by the risk owner accepts every "accept" recommendation in it (RISK.md covers another approver); the
agent accepts nothing on its own except under the standing policy the owner adopted.

**Then hand off.** Write the handoff file and ship from an empty context where your agent can, else a
shrunk one, else this one reading only what HANDOFF.md lists.

## 5. Execute

Per release, on its own branch cut from the fresh base (a later release cut from the earlier one's
branch until that merges):

1. Commit in this order: the runtime with its base image (one commit), other image digests, patch and
   minor bumps, overrides, then each other major as its own commit.
2. Install, then summarize the lockfile diff with a script (one line per changed package and version,
   per importer) and read the summary. If anything outside the plan changed, stop and find the loose
   range that caused it; do not commit the drift or hand-edit the lockfile.
3. Build, typecheck, lint (with any lint cache disabled: a stale cache hides new errors), test. Build the
   image and boot it until it serves its health check (or, with none, stays up for 30 seconds with no
   error in its logs).
4. Run the extra checks for critical packages, and the log-leak check (every run; PLANNING.md).
5. A bump that fails and will not be fixed quickly is reverted (its commit alone), recorded as dropped,
   and its CVEs move to "cannot close this week". Never widen the plan to rescue it.
6. Scan again for the after counts as in step 2; the cloud registry reads `pending deploy`. Every id the
   plan did not predict gets a policy row if it has no fixed upstream release, else a hand-back line.
7. Update the register and the ignore files, with expiries computed by code.
8. Have a reviewer with fresh context review the PR's diff adversarially, given the report and the repo's
   contributor rules, not your reasoning. Fix what it finds, rerun step 3, then open the PR. With no
   fresh reviewer available, the check records a failure and the PR says so.

The PR description carries the report's table for that release, the before and after counts, and the
check results. When the last release's PR is open, append this run's ledger row.

## 6. Merge and deploy

When every PR is green, ask once whether to merge them all. On yes, merge in order, retargeting stacked
PRs, waiting for each deploy to come up healthy on the merged build before the next, and confirm
production ends on the newest build. Then tidy up without asking. Details:
[reference/MERGE.md](reference/MERGE.md).

At hand-back, without asking, put the held majors and "hold" CVEs on one follow-up item in the repo's
tracker, with a checklist, assigned to the risk owner and linking the sweep's PRs: update the previous
sweep's item while it is open, else file one. With no tracker you can write to, put the checklist in the
hand-back.

## What it asks

Only three things: approval of the plan, the merge go-ahead, and real exceptions. An exception is a CVE
outside the standing policy with no clear recommendation, missing config the run needs (risk owner,
deploy, an image), an expired scanner sign-in, a fourth release, a new major or lockfile
change outside the plan, a migration the ORM generated, a failing check you cannot explain, or a
breaking change that needs a product call (a browser-support cutoff, say). Batch them, each with your
default; config questions ride in the report's Questions section. Housekeeping, policy acceptances and
the follow-up item are never questions.

## Check

Run [reference/CHECK.md](reference/CHECK.md) before opening each PR, once all PRs are open, and after
merging. It covers scans, plan, commits, lockfile, gates, boot, critical-package and log-leak checks,
fresh review, register, ledger and the final production build. A check that cannot run counts as
failed, not skipped.

Files in this skill

  • SKILL.md10.4 KB
  • reference/CHECK.md6.1 KB
  • reference/FILES.md5.7 KB
  • reference/HANDOFF.md5.1 KB
  • reference/MERGE.md2.8 KB
  • reference/PLANNING.md12.9 KB
  • reference/REPORT.md5.4 KB
  • reference/RISK.md5.1 KB
  • reference/SCANNING.md5.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.