技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
audit-dependency-versions【数据与研究】Audit project dependencies for version staleness, security vulnerabilities, and compatibility issues. Covers lock file analysis, upgrade path planning, and breaking change assessment. Use before a release to ensure dependencies are current and secure, during periodic maintenance reviews, after receiving a security advisory, when upgrading to a new la…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
審依項之陳、險、相容。自鎖檔起錄依,較最新版,分陳級,識險,出序升報。
尋、解依檔以建全錄。
R 包:
# Direct dependencies from DESCRIPTION
grep -A 100 "^Imports:" DESCRIPTION | grep -B 100 "^[A-Z]" | head -50
grep -A 100 "^Suggests:" DESCRIPTION | grep -B 100 "^[A-Z]" | head -50
# Pinned versions from renv.lock
cat renv.lock | grep -A 3 '"Package"'
Node.js:
# Direct dependencies
cat package.json | grep -A 100 '"dependencies"' | grep -B 100 "}"
cat package.json | grep -A 100 '"devDependencies"' | grep -B 100 "}"
# Pinned versions from lock file
cat package-lock.json | grep '"version"' | head -20
Python:
# From requirements or pyproject
cat requirements.txt
cat pyproject.toml | grep -A 50 "dependencies"
# Pinned versions
cat requirements.lock 2>/dev/null || pip freeze
Rust:
# From Cargo.toml
grep -A 50 "\[dependencies\]" Cargo.toml
# Pinned versions
cat Cargo.lock | grep -A 2 "name ="
立錄表:
| Package | Pinned Version | Type | Ecosystem |
|---|---|---|---|
| dplyr | 1.1.4 | Import | R |
| testthat | 3.2.1 | Suggests | R |
| express | 4.18.2 | dependency | Node.js |
| pytest | 8.0.0 | dev | Python |
得: 直依與(可選)傳依之全錄,附釘版。
敗: 鎖檔缺→專案不可復。記為發現,自清單檔(DESCRIPTION、package.json)以宣版束代釘版錄之。
每依定最新可得版。
R:
# Check available versions
available.packages()[c("dplyr", "testthat"), "Version"]
# Or via CLI
Rscript -e 'cat(available.packages()["dplyr", "Version"])'
Node.js:
# Check outdated packages
npm outdated --json
# Or individual package
npm view express version
Python:
# Check outdated
pip list --outdated --format=json
# Or individual
pip index versions requests 2>/dev/null
Rust:
# Check outdated
cargo outdated
# Or individual
cargo search serde --limit 1
錄附最新版:
| Package | Pinned | Latest | Gap |
|---|---|---|---|
| dplyr | 1.1.4 | 1.1.6 | patch |
| ggplot2 | 3.4.0 | 3.5.1 | minor |
| Rcpp | 1.0.10 | 1.0.14 | patch |
| shiny | 1.7.4 | 1.9.1 | minor |
得: 每依定最新版與差(patch/minor/major)。
敗: 包庫不可達→記此依「不可察」而續。勿因一庫不達阻全審。
每依賦陳級:
| 級 | 定義 | 行 |
|---|---|---|
| 現 | 最新或最新 patch 內 | 無需 |
| patch 落 | 同 major.minor,patch 舊 | 低優先升,多安 |
| minor 落 | 同 major,minor 舊 | 中優先,閱更新志 |
| major 落 | major 舊 | 高優先,升多破 |
| EOL/封存 | 不再維護 | 危:尋代或叉 |
出陳概:
### Staleness Summary
- **Current**: 12 packages (48%)
- **Patch behind**: 8 packages (32%)
- **Minor behind**: 3 packages (12%)
- **Major behind**: 1 package (4%)
- **EOL/Archived**: 1 package (4%)
**Overall health**: AMBER (major-behind and EOL packages present)
色分:
得: 每依分陳級,附總健評。
敗: 版較邏輯模糊(非 SemVer、日期版)→保守分為「minor 落」並記非標版制。
依生態行險審工具:
R:
Node.js:
# Built-in audit
npm audit --json
# Severity levels: info, low, moderate, high, critical
npm audit --audit-level=moderate
Python:
# Using pip-audit
pip-audit --format=json
# Or safety
safety check --json
Rust:
# Using cargo-audit
cargo audit --json
錄發現:
### Security Findings
| Package | Version | CVE | Severity | Fixed In | Description |
|---|---|---|---|---|---|
| express | 4.18.2 | CVE-2024-XXXX | High | 4.19.0 | Path traversal in static file serving |
| lodash | 4.17.20 | CVE-2021-23337 | Critical | 4.17.21 | Command injection via template |
**Security status**: RED (1 critical, 1 high)
得: 險識附 CVE、嚴、涉版、修版。
敗: 此生態無審工具→手查 GitHub Security Advisories。記無工具則審盡力而為。
依險與影分升序:
### Upgrade Plan
#### Priority 1: Security Fixes (do immediately)
| Package | Current | Target | Risk | Notes |
|---|---|---|---|---|
| lodash | 4.17.20 | 4.17.21 | Low (patch) | Fixes CVE-2021-23337 |
| express | 4.18.2 | 4.19.0 | Low (minor) | Fixes CVE-2024-XXXX |
#### Priority 2: EOL Replacements (plan within 1 month)
| Package | Current | Replacement | Migration Effort |
|---|---|---|---|
| request | 2.88.2 | node-fetch 3.x | Medium (API change) |
#### Priority 3: Major Version Upgrades (plan for next release cycle)
| Package | Current | Target | Breaking Changes |
|---|---|---|---|
| webpack | 4.46.0 | 5.90.0 | Config format, plugin API |
#### Priority 4: Minor/Patch Updates (batch in maintenance window)
| Package | Current | Target | Notes |
|---|---|---|---|
| dplyr | 1.1.4 | 1.1.6 | Patch fixes only |
| ggplot2 | 3.4.0 | 3.5.1 | New geom functions added |
每 major 升→察其更新志以知破改。
得: 序升謀:險先、EOL 次、major、minor/patch 末批。
敗: 依無清升路(棄且無叉)→記險並薦:(一)藏存當版、(二)尋代、(三)承險而監。
每計升→評相容:
### Compatibility Assessment
#### express 4.18.2 -> 4.19.0
- **API changes**: None (patch-level fix)
- **Node.js requirement**: Same (>=14)
- **Test impact**: Run full test suite; expect zero failures
- **Confidence**: HIGH
#### webpack 4.46.0 -> 5.90.0
- **API changes**: Config file format changed, several plugins removed
- **Node.js requirement**: >=10.13 (unchanged)
- **Test impact**: Build configuration must be rewritten; all tests need re-run
- **Confidence**: LOW (requires dedicated migration effort)
- **Migration guide**: https://webpack.js.org/migrate/5/
書全審報於 DEPENDENCY-AUDIT.md 或 DEPENDENCY-AUDIT-2026-02-17.md。
得: 每顯升錄相容險。全審報已書。
敗: 相容非試不可評→薦枝法:造枝、施升、行試、評果而後合。
npm ls 或 renv::dependencies() 察全樹。Rscript 或解為跨平臺包裝非原 R。察 which Rscript && Rscript --version。宜用原 R(如 Linux/WSL /usr/local/bin/Rscript)以穩。詳 Setting Up Your Environment。apply-semantic-versioning — 依升或觸發版升manage-renv-dependencies — R 專依管以 renvsecurity-audit-codebase — 廣安審含依險manage-changelog — 更新志錄依升plan-release-cycle — 依升排於發版時程內