Communitygithub.com

ComeOnOliver/skillshub

審查專案相依套件中的安全性漏洞、過時版本及授權合規性。當使用者詢問相依套件、安全性稽核或是在發布前使用此技能。

skillshub 是什麼?

此技能旨在自動化專案相依套件的安全稽核流程,能偵測安全性漏洞、標記過時套件並檢查授權合規問題。它支援多種套件管理器與語言生態系統,包括 npm、Yarn、pnpm、pip、Poetry、Bundler、Maven、Go Modules、Cargo 與 Composer,因此能廣泛應用於 JavaScript、Python、Ruby、Java、Go、Rust 與 PHP 專案。技能會自動偵測專案使用的套件管理器,執行對應的安全性稽核指令(如 `npm audit` 或 `cargo audit`),解析結果並依嚴重性分級(從低到危急)。除了安全掃描,它還能列出可更新的過時套件,根據更新類型(修補、次要、主要)分類更新建議,並產生存放於 `reference/licenses.md` 的授權相容性矩陣的授權合規報告。最終輸出綜合摘要,包含風險優先級、修復指令及持續監控建議,因此適合在 CI/CD 管線中或發布前使用

相容平台~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」、「安全性」、「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 模組: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):錯誤修正,可安全更新
  • 次要更新 (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 - 通常安全
  • 弱版權:LGPL、MPL - 需要審查
  • 強版權:GPL、AGPL - 可能限制商業使用
  • 未知:遺失或自訂授權 - 需要調查

5. 分析相依樹

了解相依結構:

直接 vs 傳遞:

  • 直接:列在 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(概念驗證)
  • 需要特殊條件

暴露程度:

  • 生產環境相依套件 vs 開發相依套件
  • 直接相依套件 vs 深層傳遞相依套件
  • 應用程式中實際使用的程式碼路徑

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

相關技能