FI

fix-dependabot-alerts

Fixes security vulnerabilities in npm dependencies by identifying alerts and applying patched versions.

Install

mkdir -p .claude/skills/fix-dependabot-alerts && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1887" && unzip -o skill.zip -d .claude/skills/fix-dependabot-alerts && rm skill.zip

Installs to .claude/skills/fix-dependabot-alerts

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Fix Dependabot security alerts by updating vulnerable npm dependencies. Use when the user mentions "dependabot", "security alerts", "vulnerability", "CVE", or wants to update packages with security issues.
205 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Retrieve open Dependabot security alerts via GitHub API
  • Distinguish between direct and transitive dependency vulnerabilities
  • Apply package updates for direct dependencies
  • Implement dependency overrides for transitive vulnerabilities
  • Verify security fixes through build and test execution

How it works

The agent queries the GitHub API for security alerts, identifies the dependency type using npm commands, and applies either direct updates or resolution overrides. It then validates the changes by running build and test scripts to ensure stability.

Inputs & outputs

You give it
Alert number or package name
You get back
Updated package version and verified build status

When to use fix-dependabot-alerts

  • Fix Dependabot security alerts
  • Update vulnerable npm dependencies
  • Analyze dependency vulnerability impact
  • Apply security patches

About this skill

Fix Dependabot Security Alerts

You are tasked with fixing Dependabot security alerts for this repository. Follow these steps carefully to resolve vulnerabilities while minimizing risk.

Step 1: Identify the Vulnerability

If a specific alert number or package name was provided, focus on that. Otherwise, check for open alerts:

gh api repos/microsoft/powerplatform-vscode/dependabot/alerts --jq '.[] | select(.state=="open") | {number, package: .security_vulnerability.package.name, severity: .security_vulnerability.severity, vulnerable_versions: .security_vulnerability.vulnerable_version_range, patched_versions: .security_vulnerability.first_patched_version.identifier, summary: .security_advisory.summary}'

To get details on a specific alert:

gh api repos/microsoft/powerplatform-vscode/dependabot/alerts/<alert-number>

Step 2: Analyze the Dependency

Determine if the vulnerable package is:

  • A direct dependency (listed in package.json)
  • A transitive dependency (dependency of a dependency)

Check where the package appears:

npm ls <package-name>

Step 3: Choose the Fix Strategy

For Direct Dependencies

  1. Check the current version in package.json
  2. Review the changelog/release notes for breaking changes between versions
  3. Update using:
    npm install <package-name>@<patched-version> --save
    

For Transitive Dependencies

  1. Identify which direct dependency brings in the vulnerable package
  2. Check if the direct dependency has a newer version that uses the patched transitive dependency
  3. If yes, update the direct dependency
  4. If no, add a resolution/override in package.json:
    {
      "overrides": {
        "<vulnerable-package>": "<patched-version>"
      }
    }
    

Step 4: Verify the Fix

  1. Run npm ls <package-name> to confirm the new version
  2. Run the build to ensure no breaking changes:
    npm run build
    
  3. Run the test suite:
    npm test
    

Step 5: Handle Common Issues

Version Conflicts

If npm reports peer dependency conflicts:

  • Check if --legacy-peer-deps or --force resolves it (use cautiously)
  • Consider if the conflicting package needs updating first

Breaking Changes

If the update introduces breaking changes:

  1. Read the migration guide from the package
  2. Update code to accommodate API changes
  3. Update tests if needed

Multiple Vulnerabilities in Same Package

If multiple CVEs affect the same package, ensure the patched version addresses all of them before updating.

Step 6: Commit the Changes

After verification passes, commit with a descriptive message:

Fix Dependabot security vulnerability in <package-name>

- Updated <package-name> from <old-version> to <new-version>
- Addresses CVE-XXXX-XXXXX (<severity>)
- <any additional context about breaking changes handled>

Important Notes

  • Never skip tests - security fixes should not break functionality
  • Review changelogs - understand what changed between versions
  • Check for multiple alerts - sometimes one update fixes multiple vulnerabilities
  • Document workarounds - if you use overrides, add a comment explaining why
  • For this codebase, run npm run build which uses gulp to build the extension

Critical: Never Manually Edit package-lock.json Integrity Hashes

Never manually edit integrity hashes in package-lock.json. These are SHA-512 checksums of the actual tarball content from the npm registry. If you manually change them, CI builds will fail with EINTEGRITY errors.

Why This Happens

When npm resolves a cached version that satisfies the constraint, it won't automatically update to a newer version even after changing package.json. Manually editing the lock file with an incorrect hash causes:

npm error code EINTEGRITY
npm error sha512-<expected>== integrity checksum failed when using sha512: wanted sha512-<expected>== but got sha512-<actual>==

Correct Approach to Force Version Updates

Instead of manual edits, use one of these methods:

# Option 1: Clean install (recommended)
rm -rf node_modules
rm package-lock.json
npm install

# Option 2: Update specific package
npm update <package-name>

# Option 3: Force reinstall specific package
npm install <package-name>@<version> --save

These commands let npm fetch the tarball and compute the correct integrity hash automatically.

When not to use it

  • When the repository does not use npm
  • When manual editing of package-lock.json integrity hashes is required

Limitations

  • Requires manual resolution of peer dependency conflicts
  • Manual code adjustments are necessary if updates introduce breaking changes

How it compares

This workflow automates the identification and resolution process using specific CLI commands and API calls rather than manually inspecting dependency trees and editing lock files.

Compared to similar skills

fix-dependabot-alerts side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
fix-dependabot-alerts (this skill)186moReviewIntermediate
dependency-upgrade04moReviewAdvanced
tech-debt12moReviewBeginner
windsurf-linting-config12moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by microsoft

View all by microsoft

wiki-architect

microsoft

Analyzes code repositories and generates hierarchical documentation structures with onboarding guides. Use when the user wants to create a wiki, generate documentation, map a codebase structure, or understand a project's architecture at a high level.

1144

azure-ai-vision-imageanalysis-py

microsoft

Azure AI Vision Image Analysis SDK for captions, tags, objects, OCR, people detection, and smart cropping. Use for computer vision and image understanding tasks. Triggers: "image analysis", "computer vision", "OCR", "object detection", "ImageAnalysisClient", "image caption".

622

fastapi-router-py

microsoft

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

525

playwright-mcp-dev

microsoft

Explains how to add and debug playwright MCP tools and CLI commands.

529

react-flow-node-ts

microsoft

Create React Flow node components with TypeScript types, handles, and Zustand integration. Use when building custom nodes for React Flow canvas, creating visual workflow editors, or implementing node-based UI components.

530

release-note-generation

microsoft

Toolkit for generating PowerToys release notes from GitHub milestone PRs or commit ranges. Use when asked to create release notes, summarize milestone PRs, generate changelog, prepare release documentation, request Copilot reviews for PRs, update README for a new release, manage PR milestones, or collect PRs between commits/tags. Supports PR collection by milestone or commit range, milestone assignment, grouping by label, summarization with external contributor attribution, and README version bumping.

537

Search skills

Search the agent skills registry