dependabot-alerts-update
БесплатноЗапускает вложенные скриптыНе проверенAutomatically fetch and fix Dependabot security alerts by querying GitHub REST API for open alerts, identifying vulnerable packages, researching secure…
Об этом скилле
Dependabot Alerts Update
Automatically fetch Dependabot security alerts from GitHub and update vulnerable packages to secure versions.
Workflow
1. Fetch Dependabot Alerts
Use GitHub REST API to fetch open Dependabot alerts:
# Get repository owner and name from git remote
git remote get-url origin
# Fetch alerts (requires GITHUB_TOKEN)
curl -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/{owner}/{repo}/dependabot/alerts?state=open"
Or use the GitHub CLI if available:
gh api repos/{owner}/{repo}/dependabot/alerts --jq '.[] | select(.state == "open")'
Required environment variable: GITHUB_TOKEN with security_events scope.
2. Parse and Categorize Alerts
For each alert, extract:
- Package name (
dependency.package.name) - Severity (
security_advisory.severity:critical,high,moderate,low) - Vulnerable versions (
security_vulnerability.vulnerable_version_range) - CVE/GHSA ID (
security_advisory.ghsa_idorsecurity_advisory.cve_id) - Manifest path (
dependency.manifest_path)
Group alerts by:
- Direct dependencies (in package.json files)
- Transitive dependencies (will be resolved via direct dependency updates)
- Severity (prioritize critical/high first)
3. Research Secure Versions
For each vulnerable package, determine the minimum secure version:
Check alert API response - The
security_vulnerability.first_patched_versionfield often contains the fixed version:gh api repos/{owner}/{repo}/dependabot/alerts/{alert_number} | jq '.security_vulnerability.first_patched_version'Search for security advisories:
- GitHub Security Advisories:
https://github.com/advisories?query={package} - npm security:
npm audit {package} - Snyk:
https://security.snyk.io/package/npm/{package}
- GitHub Security Advisories:
Web search for CVE details and fixed versions:
- Search:
{package} {CVE_ID} fixed version - Search:
{package} {GHSA_ID} fixed version - Check package changelog/release notes
- Search:
Verify compatibility:
- Check if secure version is compatible with current version range
- Consider breaking changes in major version updates
- For peer dependencies, ensure the providing package is updated
4. Update package.json Files
Identify All package.json Files
For monorepos, find all package.json files:
find . -name "package.json" -not -path "*/node_modules/*" -not -path "*/.git/*"
Update Strategy
- Direct dependencies: Update version in package.json
- Transitive dependencies: Update parent package that brings in the vulnerable dependency
- Workspace dependencies: Update in root or specific workspace package
Update Pattern
For each vulnerable package found in package.json:
// Before
"package-name": "^1.2.3"
// After (if 1.5.0 fixes the vulnerability)
"package-name": "^1.5.0"
Use ^ prefix to allow patch/minor updates unless major version is required.
Monorepo Considerations
- pnpm workspaces: Update in the specific workspace package.json
- npm workspaces: Same approach
- Lerna: Update in individual package.json files
- Root dependencies: Update root package.json if used across workspaces
5. Handle Special Cases
Multiple Versions of Same Package
If the same package appears in multiple package.json files with different versions:
- Update all instances to the same secure version
- Ensure compatibility across workspaces
Peer Dependencies
For peer dependencies, update the package that provides the dependency, not the peer dependency declaration itself.
Lock Files
After updating package.json:
- pnpm: Run
pnpm installto updatepnpm-lock.yaml - npm: Run
npm installto updatepackage-lock.json - yarn: Run
yarn installto updateyarn.lock
Note: Some example directories may have separate lock files that need individual updates.
6. Verification
After updates:
Check remaining alerts:
gh api repos/{owner}/{repo}/dependabot/alerts?state=openRun audit:
pnpm audit # or npm audit / yarn auditTest build:
pnpm run build
Implementation
Using the Script
A Node.js script is provided in scripts/fetch_and_fix_alerts.mjs that automates the workflow:
# Set GitHub token
export GITHUB_TOKEN=your_token_here
# Dry run to see what would be updated
node scripts/fetch_and_fix_alerts.mjs --dry-run
# Actually update packages
node scripts/fetch_and_fix_alerts.mjs
# Or specify repo explicitly
node scripts/fetch_and_fix_alerts.mjs --owner OWNER --repo REPO --token TOKEN
The script:
- Auto-detects repository from git remote
- Fetches all open Dependabot alerts
- Finds packages in package.json files
- Updates versions (uses
first_patched_versionfrom API when available)
Установить dependabot-alerts-update в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dependabot-alerts-update?
Automatically fetch and fix Dependabot security alerts by querying GitHub REST API for open alerts, identifying vulnerable packages, researching secure versions, and updating package.json files across monorepo workspaces. Use when user mentions Dependabot alerts, security vulnerabilities, or wants to update vulnerable dependencies automatically.
Как установить скилл dependabot-alerts-update?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dependabot-alerts-update запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic