Command Palette

Search for a command to run...

Назад к скиллам
скилл № 74714

hoc-npm-vulnerability

How to settle what `npm audit` reports, and how the audit and the release-age quarantine together keep a vulnerable version out of a project. Use when an…

БесплатноБез исполняемых скриптов
openreachtechот openreachtech★ 17 звёзд на GitHub

Установить hoc-npm-vulnerability в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

npm Vulnerability

Two mechanisms keep a vulnerable version out, answering two different questions. The audit answers what is known to be bad. The quarantine answers what nobody has looked at yet. Neither covers the other's ground.

The order of work when npm audit reports

Take the steps in this order. A later step is reached only for what the earlier ones left.

1. Raise the declared dependencies within their minor range

Raise each declared entry to the newest minor or patch release its own range permits, as the dependency-raising convention does, and never across a major. Read the audit after its single install, never before. Part of what the audit reported may already be fixed by a newer release.

  • Measured: raising one declared entry by a single patch release took a report from four vulnerable copies to two, with nothing else changed.

2. Raise the transitive dependency with overrides

An advisory usually names a package the project never asked for. Where the vulnerable package is a dependency of a dependency, raise it through overrides in package.json.

  "overrides": {
    "alpha-package": "^3.4.4",
    "beta-package@2": "^2.3.2"
  }
  • Write it in overrides, never leave it to npm audit fix. That command raises the version in package-lock.json alone, and the record of why disappears with it. A fact held only in a generated file cannot be read by anyone. overrides states it in the manifest.
  • The direct dependency stays where it is. Its version becomes a separate decision, taken later on its own merits.
  • A key scoped to a major line (name@major) touches only that line. An unscoped key moves every copy, at every depth, whatever each dependant declared.
  • Go to the dependant's source and read what it calls. A range says which version was asked for; only the call says whether the version delivered answers. Where the call site survives, leave the key unscoped; where it does not, scope the key to the major line the advisory names. Neither the package's reputation nor the size of the jump settles it.
  • Safety outweighs staying within a major. Where the fix lies in a major release that the declared range excludes, take it: raise the declared range for a direct dependency, or write the override for one reached through another package. Whether a major was crossed does not decide this; whether the raise makes the project safe does. This is the exception to the dependency-raising convention's rule that a major is a decision of its own, and it holds for the fix of an advisory only.
  • The raise holds only while the tests and the lint pass. Run both after it. Where either fails, the fix cannot be taken as it stands, and the report goes to step 4.

3. A fix exists but is younger than the quarantine

An override names a version, and that version is subject to the quarantine like any other. Read when the fix was published from the registry before writing the override, not after an install fails.

  • Where the fix is younger than the quarantine, waiting is not an option. The audit keeps failing until the fix is taken, and a pull request cannot merge while it fails. Severity does not decide this; whether the pull request can merge does.
  • Confirm that the diff of that package is safe, and take the fix as an exception with the --min-release-age-exclude route /hoc-npm-install defines. The quarantine stays on every other package.
  • --min-release-age=0 is never used, for any reason. See /hoc-npm-install.

4. No release fixes the advisory

An override needs a version to raise to. Where the advisory names no patched release, or the fix cannot be taken — not even through the exception of step 3, or because the tests or the lint fail after the raise — the report is not resolved. It is decided, and the user decides it. Report the advisory and the manifest field its package is reached through, and present the two ways: listing it, or reworking the code.

  • Answer from the paths, not from the package's name. npm explain <package> lists every route by which the package is in the tree, and one route through dependencies or peerDependencies is enough for the package to count as shipped.
The vulnerable package is reached through Way forward
devDependencies only List it
dependencies or peerDependencies, directly or through another package The user chooses between listing it and reworking the code
  • Severity does not decide any of this. What decides it is that the pull request cannot merge while the audit fails.
  • Listing is the only way to merge without reworking the code. It is a stopgap and not a resolution. In a shipped dependency it leaves the vulnerable code in what is deployed, so the report to the user says that in plain words.
  • Reworking the code always needs the user's explicit go. It costs much, so the agent
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл hoc-npm-vulnerability?

How to settle what `npm audit` reports, and how the audit and the release-age quarantine together keep a vulnerable version out of a project. Use when an audit reports an advisory, when a fix is younger than the quarantine, or when no release fixes it. Raising declared versions belongs to the dependency-raising convention; bypassing the quarantine for one install, to the install convention; install scripts, to the install-scripts convention; `.npmrc`, to the npmrc convention.

Как установить скилл hoc-npm-vulnerability?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл hoc-npm-vulnerability запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить hoc-npm-vulnerability с