bump-deps
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBump Dependencies
升级依赖项
Analyze outdated dependencies and safely upgrade them with breaking change detection.
分析过时依赖项并安全升级,同时检测破坏性变更。
Workflow
工作流程
-
Detect package manager based on current directory:
- If in directory or working with TypeScript/JavaScript: use
frontend/referencepnpm - If in directory or working with Python: use
backend/referenceuv
- If in
-
List outdated dependencies using the package manager-specific command from the reference
-
Spawn background analysis tasks for EACH notable upgrade:CRITICAL: You MUST spawn thesub-agent as a background Task for EACH and EVERY notable upgrade. Do NOT take shortcuts.
package-upgrade-analyzerTask( subagent_type="package-upgrade-analyzer", run_in_background=true, prompt="Analyze upgrade for {package_name} from {old_version} to {new_version}. GitHub: {repo_url}" )Notable upgrades include:- Major version bumps (e.g., v4 → v5)
- Packages with known breaking changes
- Core dependencies (React, Next.js, FastAPI, SQLAlchemy, etc.)
Spawn ALL tasks in a single message with multiple tool calls for maximum parallelism. -
Wait for all background tasks to complete:
- Use to retrieve results from each background task
TaskOutput - Once ALL tasks are complete, ultrathink about the suggestions, migration guides, and release notes
- Invoke the tool and its sub-agents to strategically address the breaking changes
Plan - Plan carefully to maintain as much of the original behavior as possible
- Use
-
Ask clarifying questions:
- If the migration path forward is ambiguous, ASK questions
- Do NOT proceed unless you're sure about the safety of the dependency version bumps
-
Generate PR summary document:Write afile using the PR template. Ensure that all package identifiers are properly wrapped in backticks for readability.
.claude/scratchpad/PR.md -
Create PR (user confirmation required):After generating, use
.claude/scratchpad/PR.mdto confirm:AskUserQuestionAskUserQuestion( question="Ready to create the PR? You can edit .claude/scratchpad/PR.md first if needed.", header="Create PR?", options=[ { label: "Create PR", description: "Create the PR with current PR.md content" }, { label: "Let me edit first", description: "I'll edit PR.md and confirm when ready" } ] )Once the user confirms, deriveand create the PR:PR_TITLEDeriving:PR_TITLE- Scope: Use for frontend (pnpm),
appfor backend (uv)api - Content (pick first applicable):
- ≤3 notable packages: List them by name with target major version
→ "deps(app): bump to v5,
react-queryto v15"next - >3 packages with notable ones: Highlight 1-2 notable + count
→ "deps(api): bump to v2 (+4 packages)"
sqlalchemy - Many minor bumps only: Just the count → "deps(app): bump 12 dependencies"
- ≤3 notable packages: List them by name with target major version
→ "deps(app): bump
- Keep under 72 characters
bashPR_TITLE="deps(app): bump react-query to v5, next to v15" gh pr create --base dev --head "$(git rev-parse --abbrev-ref HEAD)" --title "$PR_TITLE" --body-file .claude/scratchpad/PR.mdAfter successful PR creation:bash# Clean up the scratchpad file rm .claude/scratchpad/PR.mdReturn the PR URL to the user. - Scope: Use
-
检测包管理器:基于当前目录自动识别:
- 若处于目录或处理TypeScript/JavaScript项目:使用
frontend/参考文档pnpm - 若处于目录或处理Python项目:使用
backend/参考文档uv
- 若处于
-
列出过时依赖项:使用参考文档中对应包管理器的命令
-
为每个重要升级启动后台分析任务:重要提示:你必须为每一个重要升级启动子Agent作为后台Task。切勿图省事。
package-upgrade-analyzerTask( subagent_type="package-upgrade-analyzer", run_in_background=true, prompt="Analyze upgrade for {package_name} from {old_version} to {new_version}. GitHub: {repo_url}" )重要升级包括:- 主版本号升级(例如:v4 → v5)
- 已知存在破坏性变更的包
- 核心依赖项(React、Next.js、FastAPI、SQLAlchemy等)
为实现最大并行效率,需在单条消息中发起多个工具调用来启动所有任务。 -
等待所有后台任务完成:
- 使用获取每个后台任务的结果
TaskOutput - 待所有任务完成后,仔细梳理建议、迁移指南和发布说明
- 调用工具及其子Agent来针对性处理破坏性变更
Plan - 谨慎规划,尽可能保留原有功能
- 使用
-
提出澄清问题:
- 若迁移路径不明确,务必提出问题
- 除非确定依赖版本升级是安全的,否则不要继续操作
-
生成PR摘要文档:使用PR模板编写文件。 确保所有包标识符都用反引号包裹,以提高可读性。
.claude/scratchpad/PR.md -
创建PR(需用户确认):生成后,使用
.claude/scratchpad/PR.md确认:AskUserQuestionAskUserQuestion( question="Ready to create the PR? You can edit .claude/scratchpad/PR.md first if needed.", header="Create PR?", options=[ { label: "Create PR", description: "Create the PR with current PR.md content" }, { label: "Let me edit first", description: "I'll edit PR.md and confirm when ready" } ] )用户确认后,生成并创建PR:PR_TITLE生成的规则:PR_TITLE- 范围:前端(pnpm)使用,后端(uv)使用
appapi - 内容(按优先级选择):
- ≤3个重要包:列出包名及目标主版本
→ "deps(app): bump to v5,
react-queryto v15"next - >3个包且包含重要包:突出1-2个重要包+总数
→ "deps(api): bump to v2 (+4 packages)"
sqlalchemy - 仅多个小版本升级:仅标注数量 → "deps(app): bump 12 dependencies"
- ≤3个重要包:列出包名及目标主版本
→ "deps(app): bump
- 长度控制在72字符以内
bashPR_TITLE="deps(app): bump react-query to v5, next to v15" gh pr create --base dev --head "$(git rev-parse --abbrev-ref HEAD)" --title "$PR_TITLE" --body-file .claude/scratchpad/PR.mdPR创建成功后:bash# 清理临时文件 rm .claude/scratchpad/PR.md将PR链接返回给用户。 - 范围:前端(pnpm)使用
Important Notes
重要说明
- Always analyze breaking changes BEFORE upgrading
- Use parallel Task agents for efficiency
- Focus on safety over speed - better to ask than to break production
- Consider rollback strategies for risky upgrades
- 升级前务必分析破坏性变更
- 使用并行Task Agent提升效率
- 安全优先于速度——宁可询问也不要破坏生产环境
- 为高风险升级考虑回滚策略
Additional Instructions
额外说明
The remaining instructions are behavior overrides by the user.
<user-guidelines>
$ARGUMENTS
</user-guidelines>以下是用户指定的行为覆盖规则。
<user-guidelines>
$ARGUMENTS
</user-guidelines>