upgrade-dependency

A command for changing a named software dependency from one version to another and checking the resulting change.

In plain words
What is it for?
Upgrading packages in Maven, Node.js, or Gradle projects and updating related static resources when required.
Why use it?
It gives a consistent process for finding the right dependency files and updating the requested version.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/modelengine-group/fit-framework/upgrade-dependency
Clone the repo
git clone --depth 1 https://github.com/ModelEngine-Group/fit-framework

Made for: Claude Code.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.01438
Opus 5 $0.00004 $0.00719
Sonnet 5 $0.00002 $0.00288
Haiku 4.5 $0.00001 $0.00144

Measured yesterday against content hash d312c0dee2ed, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

upgrade-dependency scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/upgrade-dependency.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Upgrade Dependency Command

功能说明

升级项目中的指定依赖包到新版本,并验证变更。

用法

/upgrade-dependency <package-name> <from-version> <to-version>

例如:

/upgrade-dependency swagger-ui 5.30.0 5.30.2

执行步骤

1. 解析参数

  • 包名:第一个参数
  • 原版本:第二个参数
  • 新版本:第三个参数

2. 查找依赖文件

使用 Grep 搜索包含该依赖的文件:

# 搜索包名
grep -r "<package-name>" --include="pom.xml" --include="package.json" --include="build.gradle"

# 搜索旧版本号
grep -r "<from-version>" --include="pom.xml" --include="package.json" --include="build.gradle"

3. 更新依赖版本

根据项目类型更新对应的依赖文件:

Maven 项目 (pom.xml):

<!-- 从 -->
<dependency>
    <groupId>...</groupId>
    <artifactId>{package-name}</artifactId>
    <version>{from-version}</version>
</dependency>

<!-- 更新为 -->
<dependency>
    <groupId>...</groupId>
    <artifactId>{package-name}</artifactId>
    <version>{to-version}</version>
</dependency>

Node.js 项目 (package.json):

{
  "dependencies": {
    "{package-name}": "{to-version}"
  }
}

Gradle 项目 (build.gradle):

implementation '{group}:{package-name}:{to-version}'

4. 更新相关静态资源

如果依赖包含静态资源(如 swagger-ui 的 HTML/CSS/JS 文件),同步更新:

  • 版本号引用
  • CDN 链接
  • 文档中的版本说明

5. 验证变更

5.1 查看变更
git diff

确认变更正确,没有误改其他内容。

5.2 编译验证
# Maven 项目
mvn clean package -Dmaven.test.skip=true

# Node.js 项目
npm install
npm run build

# Gradle 项目
./gradlew clean build -x test
5.3 运行测试(推荐)
# Maven 项目
mvn test

# Node.js 项目
npm test

# Gradle 项目
./gradlew test

6. 输出变更摘要

告知用户升级完成的情况:

✅ 依赖升级完成

**依赖信息**:
- 包名: {package-name}
- 原版本: {from-version}
- 新版本: {to-version}

**变更文件**:
- {file-path-1}
- {file-path-2}

**验证结果**:
- 编译状态: {成功/失败}
- 测试状态: {通过/失败/未运行}

**下一步**:
请人工检查变更内容,确认无误后提交:
- Claude Code / OpenCode: `/commit`
- Gemini CLI: `/fit:commit`
- Codex CLI: `/prompts:fit-commit`

参数说明

  • <package-name>: 依赖包名称(必需)
  • <from-version>: 当前版本号(必需)
  • <to-version>: 目标版本号(必需)

使用示例

示例1:升级 Swagger UI

Read the full file on GitHub · 236 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 236 lines · 8 tokens per session scan A d312c0dee2ed

Subscribe to this mod's changes

upgrade-dependency is a command published in the GitHub repository ModelEngine-Group/fit-framework (2,117 stars, last pushed 5mo ago), licensed MIT. It adds 8 tokens to every session and 1,438 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.