Skip to content

chore(claude): update audit-dependencies skill with lockfile strategy and override rules#16106

Merged
denolfe merged 1 commit intomainfrom
claude/update-audit-dep-skill
Mar 30, 2026
Merged

chore(claude): update audit-dependencies skill with lockfile strategy and override rules#16106
denolfe merged 1 commit intomainfrom
claude/update-audit-dep-skill

Conversation

@denolfe
Copy link
Copy Markdown
Member

@denolfe denolfe commented Mar 30, 2026

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

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]
Loading

@denolfe denolfe changed the title chore: update audit-dependencies skill with lockfile strategy and override rules chore(claude): update audit-dependencies skill with lockfile strategy and override rules Mar 30, 2026
@denolfe denolfe merged commit 974870a into main Mar 30, 2026
21 checks passed
@denolfe denolfe deleted the claude/update-audit-dep-skill branch March 30, 2026 20:34
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

🚀 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]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant