agentleFS
MicrosoftKnown publishermicrosoft/powerplatform-vscode/.claude/skills/fix-dependabot-alerts/SKILL.md

fix-dependabot-alerts

Skill278 starsChanged 11 months agoMITView on GitHub

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.

  • Deletes or force-pushes
  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 16 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If a specific alert number or package name was provided, focus on that.

    line 13
  2. Distinctive:

    Check where the package appears:

    line 30
  3. Very specific:

    Check the current version in package.json

    line 39
  4. Distinctive:

    Check if the direct dependency has a newer version that uses the patched transitive dependency

    line 49
  5. Distinctive:

    If yes, update the direct dependency

    line 50
  6. Very specific:

    If no, add a resolution/override in package.json:

    line 51
  7. Very specific:

    Run npm ls <package-name> to confirm the new version

    line 62
  8. Distinctive:

    Run the build to ensure no breaking changes:

    line 63
  9. Distinctive:

    Run the test suite:

    line 67
  10. Distinctive:

    If npm reports peer dependency conflicts:

    line 76
  11. Very specific:

    Check if --legacy-peer-deps or --force resolves it (use cautiously)

    line 77
  12. Distinctive:

    Consider if the conflicting package needs updating first

    line 78
  13. Distinctive:

    If the update introduces breaking changes:

    line 82
  14. Distinctive:

    Read the migration guide from the package

    line 83
  15. Distinctive:

    Update code to accommodate API changes

    line 84
  16. Distinctive:

    Update tests if needed

    line 85
  17. Distinctive:

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

    line 89
  18. Distinctive:

    After verification passes, commit with a descriptive message:

    line 93
  19. Distinctive:

    Document workarounds: - if you use overrides, add a comment explaining why

    line 107
  20. Very specific:

    When npm resolves a cached version that satisfies the constraint, it won't automatically update to a newer version even after changing …

    line 116
  21. Distinctive:

    Instead of manual edits, use one of these methods:

    line 125

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.