升级依赖
SkillAI & modelsLets your agent upgrade a project dependency package to a new version using npm and verify the changes.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the 升级依赖 skill
About this skill
Upgrades a specified dependency package in the project to a new version and verifies the changes. Use when you need to upgrade a dependency and validate the modifications. Parameters: package name, old version, and new version.
What this skill tells your AI
The instructions your AI receives, as published by fitlab-ai/agent-infra in .agents/skills/upgrade-dependency/SKILL.md and read by ahel’s review.
将依赖包升级到指定版本,并进行构建和测试验证。
本项目使用 npm、package.json 和 package-lock.json 管理依赖。
执行流程
1. 解析参数
从参数中提取:包名、原版本、新版本。
2. 查找依赖位置
在 package.json 和 package-lock.json 中确认目标包、当前版本和依赖类型。
3. 更新版本
使用 npm 更新依赖并同步 lockfile:
npm install {package}@{new-version}
4. 验证类型与核心测试
npm run typecheck
npm run test:core
npm run test:core 会先构建项目。
5. 运行完整测试(高风险升级)
主版本升级、构建工具升级或影响多个运行路径时执行:
npm test
6. 输出结果
报告:
- 修改的文件
- 构建状态(通过/失败)
- 测试状态(通过/失败)
- 发现的任何弃用警告或破坏性变更
建议下一步:
渲染下一步前先读取
.agents/rules/next-step-output.md,仅为已选场景调用统一 helper,并将 stdout 填入{next-step-commands}。
使用 agent-infra-internal agent-client next-steps --skill commit 生成本场景的 {next-step-commands}。
下一步 - 提交代码:
{next-step-commands}
注意事项
- 禁止自动提交:不要自动提交变更
- 主版本升级:警告潜在的破坏性变更
- 测试失败:报告失败详情并等待用户决定
- 锁文件:如果项目使用锁文件(package-lock.json、yarn.lock 等),确保一并更新
- 传递依赖:注意升级是否影响传递依赖
错误处理
- 包未找到:提示 "Package {name} not found in dependency files"
- 构建失败:输出错误并建议检查破坏性变更
- 测试失败:输出测试错误并建议查看迁移指南
Signals
- GitHub stars
- 86
- Forks
- 5
- Last commit
- Oct 2026
ahel review
K1binfo
installs-packages
Automated review, not a security audit. Ruleset v1+k2.
Advanced
- Item type
- skill
- Key
upgrade-dependency- Source
- github.com/fitlab-ai/agent-infra
github.com/fitlab-ai/agent-infra
Related picks
Skill · thedaviddias
The pick for JavaScriptmodern-javascript-patterns
Skill · wshobson
The pick for JavaScriptsetup-ts-deep-modules
Skill · mattpocock
The pick for TypeScripttypescript-pro
Skill · jeffallan
The pick for TypeScriptskill-creator
Skill · anthropics
More in AI & modelswayfinder
Skill · mattpocock
More in AI & models