绝对升级
dhruvjainin2026-10-27查看 544复制 296
> 依赖项升级:过时/易受攻击的 deps 计划到 semver 波中(补丁/次要批处理、主要门控和更改日志读取),增量应用并重新生成锁定文件,并在每次更新后进行绿色测试。在绿色主线上运行。 触发“绝对升级”、“升级我们的依赖项”、“升级依赖项”、“更新包”、“移走已弃用的 X”、“清除 Dependabot 积压”。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md4501 chars
--- name: absolute-upgrade version: 0.5.0 description: > Dependency upgrades: outdated/vulnerable deps planned into semver waves (patch/minor batched, majors gated and changelog-read), applied incrementally with lockfiles regenerated and tests green after each. Runs on green main. Triggers on "absolute upgrade", "upgrade our dependencies", "bump deps", "update packages", "move off the deprecated X", "clear the Dependabot backlog". category: workflow tags: - workflow - maintenance - dependencies - upgrade - security platforms: - claude-code - gemini-cli - openai-codex - mcp user-invocable: true argument-hint: "[target]" license: MIT maintainers: - github: maddhruv --- > Start your first response with the ⬆️ emoji. ## Absolute Upgrade Bring dependencies current — safely, in risk-ranked waves, with tests green after each. Not a blind `npm update`: outdated and vulnerable deps are grouped by blast radius (patch/minor → safe wave; major/breaking → gated, one at a time, changelog-read), applied incrementally, and verified against the project's own test suite. Runs the shared engine in **`references/health-engine.md`** — read it for the DETECT → SCAN → TRIAGE → FIX → VERIFY → REPORT loop and the safety contract. This file covers only what's specific to dependency upgrades. --- ## When to use - Routine "bring deps up to date" / "upgrade our dependencies". - A specific bump: "upgrade React to 19", "move off the deprecated X package". - Clearing `npm outdated` / Dependabot backlog without 40 separate PRs. **Not** for: adding a *new* dependency (that's a `work`/feature decision), or auditing *vulnerabilities* specifically → use **`/absolute audit`** (it triages CVEs; `upgrade` moves versions). --- ## What it scans Per ecosystem, list outdated deps with current → wanted → latest and the jump type: | Ecosystem | Detect outdated | Lockfile / manifest | |---|---|---| | npm | `npm outdated --json` | `package-lock.json` | | pnpm | `pnpm outdated --format json` | `pnpm-lock.yaml` | | yarn | `yarn outdated --json` | `yarn.lock` | | Python (pip) | `pip list --outdated --format=json` | `requirements*.txt` | | Python (poetry/uv) | `poetry show --outdated` / `uv pip list --outdated` | `pyproject.toml` + lock | | Go | `go list -u -m -json all` | `go.mod` / `go.sum` | Also flag: deps with known deprecations, duplicate/multiple versions of the same package, and direct vs transitive (only direct deps are upgrade targets; transitives follow). --- ## Risk ranking (TRIAGE) Group the upgrade plan into waves by semver jump — safest first: | Wave | Jump | Default | |---|---|---| | 1 | patch (`x.y.Z`) | batch together, fix now | | 2 | minor (`x.Y.z`) | batch by package family, fix now | | 3 | major (`X.y.z`) / pre-1.0 minor | **one at a time, gated** — read the changelog/migration guide first, list breaking changes | For every major bump: locate breaking changes (CHANGELOG, release notes, codemod if the package ships one), inventory call sites that touch the changed API, and state the migration before applying. Peer-dependency conflicts get resolved in the same wave as their driver. --- ## Fix & verify - Apply a wave, regenerate the lockfile, run the project's **full** test + build (a passing install is not a passing upgrade). - Majors: apply the version bump *and* the required code migration in the same wave, or the build breaks. Use the package's codemod where one exists. - A wave that can't go green within reason → revert it, report it as blocked with the error, keep the green waves. Never `--force` / `--legacy-peer-deps` to mask a real conflict. --- ## Gotchas 1. **Lockfile-only "upgrade".** Bumping the manifest without regenerating + committing the lockfile ships untested transitive versions. Always regenerate. 2. **Batching a major in with patches.** One breaking bump fails the whole wave and hides which change broke it. Majors are always solo. 3. **Green install ≠ green project.** `npm install` succeeding proves nothing — run tests. 4. **Pinning around a failure.** If a bump breaks something, fix or defer it; don't pin the dependency tree to dodge it silently. --- ## Companion commands - **`/absolute audit`** — if the goal is fixing *vulnerabilities*, start there; it'll route back here for the version moves. - **`/absolute deflake`** — flaky tests can mask whether an upgrade truly passed. - **`/absolute work`** — if an upgrade needs real feature-level migration work, hand off.