Communitygithub.com

ComeOnOliver/skillshub

审查项目依赖项的安全漏洞、过时版本和许可证合规性。当用户询问依赖项、安全审计或在发布前使用时。

skillshub 是什么?

此技能旨在帮助开发者全面审计项目依赖项,涵盖安全漏洞检测、过时包检查和许可证合规性分析。它支持多种主流包管理器,包括 npm、Yarn、pnpm(JavaScript)、pip、Poetry、Pipenv(Python)、Bundler(Ruby)、Maven、Gradle(Java)、Go modules(Go)、Cargo(Rust)和 Composer(PHP)。技能通过自动检测包管理器、运行相应审计命令(如 `npm audit`、`pip-audit`、`cargo audit`)来识别漏洞,并按严重性分类。它还检查过时包(区分补丁、次要和主要更新)和依赖许可证类型(如 MIT、GPL),标记潜在风险。最终生成包含优先级排序的修复建议、更新策略和持续集成建议的全面审计报告,帮助团队降低安全风险并保持依赖项健康。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazydubya/dependency-audit-assistant

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

依赖审计助手

此技能帮助审计项目依赖项的安全漏洞、过时包和许可证合规性问题。

何时使用此技能

  • 用户请求依赖审计或安全检查
  • 在主要发布或部署之前
  • 用户询问过时包或漏洞
  • 需要许可证合规性审查
  • 用户提到"npm audit"、"security"、"dependencies"或"vulnerabilities"

指令

1. 检测包管理器

识别项目使用的包管理器:

JavaScript/Node.js:

  • npm:package.json + package-lock.json
  • Yarn:package.json + yarn.lock
  • pnpm:package.json + pnpm-lock.yaml

Python:

  • pip:requirements.txt 或 setup.py
  • Poetry:pyproject.toml + poetry.lock
  • Pipenv:Pipfile + Pipfile.lock

Ruby:

  • Bundler:Gemfile + Gemfile.lock

Java:

  • Maven:pom.xml
  • Gradle:build.gradle 或 build.gradle.kts

Go:

  • Go modules:go.mod + go.sum

Rust:

  • Cargo:Cargo.toml + Cargo.lock

PHP:

  • Composer:composer.json + composer.lock

使用 Glob 查找这些文件。

2. 运行安全审计

根据包管理器执行相应的审计命令:

npm: npm audit --json 或 npm audit Yarn: yarn audit --json 或 yarn audit pnpm: pnpm audit --json pip: pip-audit 或 safety check Poetry: poetry check Bundler: bundle audit check --update Maven: mvn dependency:tree + OWASP Dependency Check Go: go list -m all + govulncheck Cargo: cargo audit Composer: composer audit

解析输出以识别:

  • 按严重性(严重、高、中、低)划分的漏洞数量
  • 受影响的包和版本
  • 可用的修复(更新或补丁)
  • CVE 标识符

3. 检查过时包

识别有可用新版本的包:

npm: npm outdated --json Yarn: yarn outdated --json pip: pip list --outdated Poetry: poetry show --outdated Bundler: bundle outdated Cargo: cargo outdated Go: go list -u -m all

对更新进行分类:

  • 补丁更新(1.0.0 → 1.0.1):Bug 修复,安全更新
  • 次要更新(1.0.0 → 1.1.0):新功能,通常安全
  • 主要更新(1.0.0 → 2.0.0):破坏性变更,需要测试

4. 许可证合规性检查

审查所有依赖项的许可证:

步骤:

  1. 从包元数据中提取许可证
  2. 识别许可证类型(MIT、Apache-2.0、GPL 等)
  3. 标记可能存在问题的许可证(商业项目中的 GPL、AGPL)
  4. 检查未授权或未知的许可证
  5. 参考 reference/licenses.md 中的许可证兼容性矩阵

工具:

  • npm: npx license-checker --json 或 npm-license-crawler
  • Python: pip-licenses
  • Ruby: license_finder
  • Go: go-licenses

许可证类别:

  • 宽松型:MIT、Apache-2.0、BSD —— 通常安全
  • 弱 Copyleft:LGPL、MPL —— 需要审查
  • 强 Copyleft:GPL、AGPL —— 可能限制商业使用
  • 未知:缺失或自定义许可证 —— 需要调查

5. 分析依赖树

理解依赖结构:

直接依赖与传递依赖:

  • 直接依赖:在 package.json/requirements.txt 中列出
  • 传递依赖:依赖项的依赖项

识别问题:

  • 不同版本的重复包
  • 深层依赖树(可能导致冲突)
  • 已废弃包(超过 2 年无更新)
  • 高风险传递依赖

命令:

  • npm: npm ls --all
  • Yarn: yarn why <package>
  • pip: pipdeptree
  • Maven: mvn dependency:tree

6. 漏洞优先级排序

根据以下因素对漏洞排序:

严重性级别:

  1. 严重:远程代码执行、权限提升
  2. 高:SQL 注入、XSS、身份验证绕过
  3. 中:DoS、信息泄露
  4. 低:轻微问题、边界情况

可利用性:

  • 已知的公开漏洞利用
  • 是否存在 PoC(概念验证)
  • 是否需要特殊条件

暴露程度:

  • 生产依赖与开发依赖
  • 直接依赖与深层传递依赖
  • 实际在应用中使用的代码路径

7. 生成建议

对每个发现的问题提供:

漏洞:

包:[email protected]
严重性:高
CVE:CVE-2020-8203
问题:原型污染
建议:升级到 [email protected] 或更高版本
命令:npm install [email protected]

过时包:

包:[email protected]
当前版本:16.14.0
最新版本:18.2.0
类型:主要更新
建议:仔细测试后再升级(破坏性变更)
注意:查看迁移指南:https://react.dev/blog/2022/03/08/react-18-upgrade-guide

许可证问题:

包:[email protected]
许可证:GPL-3.0
问题:GPL 许可证可能与专有代码冲突
建议:寻找具有宽松许可证的替代方案,或咨询法务
替代方案:[列出具有 MIT/Apache 许可证的类似包]

8. 更新策略

建议更新方法:

安全更新(自动化):

  • 无破坏性变更的补丁更新
  • 针对漏洞的安全修复
  • 更新:npm update 或 npm audit fix

谨慎更新(手动测试):

  • 次要版本升级
  • 对维护良好的包进行主要更新
  • 逐个更新并测试

需要研究:

  • 主要破坏性变更
  • 已废弃包(寻找替代方案)
  • 许可证冲突

9. 生成总结报告

提供全面的审计总结:

依赖审计报告
=======================

概览:
- 总依赖项:150(120 个直接依赖,30 个传递依赖)
- 漏洞:5(1 个高,3 个中,1 个低)
- 过时包:23
- 许可证问题:2

安全漏洞:
[按严重性列出并提供修复建议]

过时包:
[按更新类型分类:补丁/次要/主要]

许可证合规性:
[列出所有许可证及任何担忧]

建议操作:
1. [立即] 修复高严重性漏洞
2. [尽快] 更新中严重性漏洞的包
3. [审查] 处理许可证合规性问题
4. [可选] 更新过时包到最新版本

要运行的命令:
npm audit fix  # 自动修复漏洞
npm update     # 更新到最新的兼容版本

10. 持续监控

建议持续实践:

  • 自动化审计:在 CI/CD 流水线中运行
  • Dependabot/Renovate:自动创建更新 PR
  • 定期审查:每月或每季度进行审计
  • 安全警报:启用 GitHub/GitLab 安全警报
  • 锁文件:提交锁文件以实现跨环境的一致安装

最佳实践

  1. 及时修复漏洞:特别是高/严重级别
  2. 测试更新:即使是补丁更新也可能引发问题
  3. 阅读变更日志:更新前了解变更内容
  4. 使用锁文件:确保跨环境的一致安装
  5. 最小化依赖:更少的依赖 = 更小的攻击面
  6. 审查新增依赖:添加新依赖前进行审计
  7. 保持最新:定期更新比大跨度升级更容易
  8. 记录决策:为什么固定某些包或不更新

安全最佳实践

  • 切勿在依赖项或环境文件中提交密钥
  • 审查流行/关键依赖项的源代码
  • 对内部包使用私有注册表
  • 在包注册表账户上启用 2FA
  • 对 CDN 资源使用 SRI(子资源完整性)
  • 如果使用 Docker,扫描容器镜像

支持文件

  • scripts/check-licenses.sh:提取并检查许可信息
  • reference/licenses.md:许可证兼容性矩阵
  • reference/common-vulnerabilities.md:常见漏洞模式

常用命令参考

npm:

npm audit                 # 显示漏洞
npm audit fix            # 自动修复漏洞
npm audit fix --force    # 强制主要更新
npm outdated            # 检查过时包
npm update              # 更新到最新兼容版本

Yarn:

yarn audit               # 显示漏洞
yarn upgrade-interactive # 交互式更新
yarn outdated           # 检查过时

pip:

pip-audit               # 审计漏洞
pip list --outdated     # 检查过时
pip install --upgrade   # 更新包

Poetry:

poetry check            # 检查锁文件
poetry show --outdated  # 显示过时包
poetry update           # 更新包

Cargo:

cargo audit             # 审计漏洞
cargo outdated          # 检查过时
cargo update            # 更新包

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相关技能