| name | fix-vulns |
| description | Check for vulnerabilities with pnpm audit and raise a PR to fix them. Use when the user asks to "fix vulnerabilities", "fix vulns", "audit dependencies", or "fix security issues". |
| disable-model-invocation | true |
| allowed-tools | Bash, Read, Edit |
fix-vulns
Check for pnpm dependency vulnerabilities and raise a PR that addresses all of them.
Instructions
- Run the audit:
zsh -i -c "pnpm audit"
-
If no vulnerabilities are found, report that and stop.
-
If vulnerabilities are found, fetch the latest main and create a branch:
git fetch origin main
git checkout -b fix/security-vulnerabilities origin/main
- Attempt to fix all vulnerabilities automatically:
zsh -i -c "pnpm audit --fix"
- If any vulnerabilities remain after
--fix, resolve them by manually updating the affected packages to the minimum safe version identified in the audit output:
zsh -i -c "pnpm update <package-name>"
- Re-run the audit to confirm all vulnerabilities are resolved:
zsh -i -c "pnpm audit"
- Commit the changes:
git add pnpm-lock.yaml package.json
git commit -m "fix(deps): resolve pnpm audit vulnerabilities"
- Push the branch and raise a draft PR. The PR body must list every vulnerability that was fixed, including package name, severity, and the resolution applied.