chore(claude): update audit-dependencies skill with lockfile strategy and override rules#16106
Merged
chore(claude): update audit-dependencies skill with lockfile strategy and override rules#16106
Conversation
… and override rules
Contributor
|
🚀 This is included in version v3.81.0 |
milamer
pushed a commit
to milamer/payload
that referenced
this pull request
Apr 20, 2026
… and override rules (payloadcms#16106) # Overview Updates the audit-dependencies skill to include a lockfile-update strategy as an intermediate fix between direct dependency bumps and pnpm overrides. Also adds documentation for common pnpm override pitfalls learned from recent audit work. ## Key Changes - **Added lockfile update as a fix strategy** - When a transitive dependency's parent uses a semver range that already includes the fixed version, `pnpm update --recursive` is enough. No `package.json` changes needed. The workflow now checks pinned vs ranged before falling back to overrides. - **Documented pnpm override syntax rules** - Added guidance on using `^` ranges instead of `>=` (which can cross major versions), single-level parent scoping limitations, unsupported version selectors in keys, and risks of global overrides across multiple major versions. - **Added user confirmation step before applying fixes** - The workflow now requires presenting a summary table of proposed fixes and getting user confirmation before making changes. This prevents wasted effort from incorrect fix strategies. ## Design Decisions The fix priority order is now: direct bump > lockfile update > override. The lockfile update step was added because several audit vulnerabilities were resolvable without any `package.json` changes — the parent's semver range already covered the fix, but the lockfile had a stale resolution. Recognizing this case avoids unnecessary overrides that add long-term maintenance burden. The override syntax rules were added because pnpm's override behavior has non-obvious edge cases (e.g., `>=` crossing majors, no nested scoping) that caused issues in practice. ## Overall Flow ```mermaid flowchart TD A[Run audit script] --> B[Group by package] B --> C[Trace dependency chain] C --> D{Can bump direct dep?} D -->|yes| E[Research breaking changes] D -->|no| F{Pinned or ranged?} E --> G{Breaking changes ok?} G -->|yes| H[Apply direct bump] G -->|no| F F -->|ranged, fix in range| I[Lockfile update] F -->|pinned| J[Apply pnpm override] H --> K{More packages?} I --> K J --> K K -->|yes| C K -->|no| L[Present plan to user] L --> M[Install and verify] M --> N[Build and verify] N --> O[Commit and create PR] ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Updates the audit-dependencies skill to include a lockfile-update strategy as an intermediate fix between direct dependency bumps and pnpm overrides. Also adds documentation for common pnpm override pitfalls learned from recent audit work.
Key Changes
Added lockfile update as a fix strategy
pnpm update --recursiveis enough. Nopackage.jsonchanges needed. The workflow now checks pinned vs ranged before falling back to overrides.Documented pnpm override syntax rules
^ranges instead of>=(which can cross major versions), single-level parent scoping limitations, unsupported version selectors in keys, and risks of global overrides across multiple major versions.Added user confirmation step before applying fixes
Design Decisions
The fix priority order is now: direct bump > lockfile update > override. The lockfile update step was added because several audit vulnerabilities were resolvable without any
package.jsonchanges — the parent's semver range already covered the fix, but the lockfile had a stale resolution. Recognizing this case avoids unnecessary overrides that add long-term maintenance burden.The override syntax rules were added because pnpm's override behavior has non-obvious edge cases (e.g.,
>=crossing majors, no nested scoping) that caused issues in practice.Overall Flow
flowchart TD A[Run audit script] --> B[Group by package] B --> C[Trace dependency chain] C --> D{Can bump direct dep?} D -->|yes| E[Research breaking changes] D -->|no| F{Pinned or ranged?} E --> G{Breaking changes ok?} G -->|yes| H[Apply direct bump] G -->|no| F F -->|ranged, fix in range| I[Lockfile update] F -->|pinned| J[Apply pnpm override] H --> K{More packages?} I --> K J --> K K -->|yes| C K -->|no| L[Present plan to user] L --> M[Install and verify] M --> N[Build and verify] N --> O[Commit and create PR]