refine-title

A command that reads a GitHub issue or pull request and proposes a title in Conventional Commits format, such as type(scope): subject.

In plain words
What is it for?
Use it to inspect the issue or pull request body, labels, and changed files, then suggest and optionally apply a clearer title.
Why use it?
It turns a vague or inconsistent title into one that reflects the change type, affected area, and purpose.

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/refine-title
Clone the repo
git clone --depth 1 https://github.com/ModelEngine-Group/fit-framework

Made for: Claude Code.

Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 778 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.00023 $0.00778
Opus 5 $0.00012 $0.00389
Sonnet 5 $0.00005 $0.00156
Haiku 4.5 $0.00002 $0.00078

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

Security

Grade A, and why

refine-title 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/refine-title.md · 92 lines

What it actually says

Refine Title Command

功能说明

针对指定的 GitHub Issue 或 PR,读取其详细描述(Body)、标签(Labels)以及代码变更(如果是 PR),深度理解其意图,然后生成符合 type(scope): subject 规范的新标题并执行修改。

执行流程

1. 识别对象与获取信息

尝试判断 ID 是 Issue 还是 PR,并获取详细信息。

# 尝试获取 Issue 信息
gh issue view <id> --json number,title,body,labels,state

# 如果提示是 PR,或者查不到 Issue 但存在同号 PR,则获取 PR 信息
gh pr view <id> --json number,title,body,labels,state,files

2. 智能分析

根据获取到的 JSON 数据进行分析:

  1. 确定 Type (类型)

    • 阅读 body 中的 "变更类型" 或描述。
    • 检查 labels (如 type: bug -> fix, type: feature -> feat)。
    • 如果是 PR,分析 files (仅文档变动 -> docs,仅测试变动 -> test)。
  2. 确定 Scope (范围)

    • 阅读 body 提及的模块。
    • 检查 labels (如 in: fit -> fit)。
    • 如果是 PR,分析 files 路径 (如 framework/fit/java/... -> fit)。
  3. 生成 Subject (摘要)

    • 忽略原标题(避免受干扰),直接从 body 中提炼核心意图。
    • 确保简练(20字以内)、中文描述、无句号。

3. 生成建议与交互

输出分析结果供用户确认:

🔍 分析对象: Issue #<id> / PR #<id>

当前标题: [原标题]
--------------------------------------------------
🧠 分析依据:
- 原始意图: (从 Body 提取的一句话摘要)
- 推断类型: Fix (依据: 标签 type:bug, Body 关键词 "修复")
- 推断范围: fit (依据: 涉及文件路径 framework/fit/...)
--------------------------------------------------
✨ 建议标题: fix(fit): 修复并发场景下的空指针异常

询问用户:"是否确认修改?(y/n)"

4. 执行修改

用户确认(y)后,根据对象类型执行命令:

# 如果是 Issue
gh issue edit <id> --title "<new-title>"

# 如果是 PR
gh pr edit <id> --title "<new-title>"

参数说明

  • <id>: Issue 或 PR 的编号(必需)。

使用示例

# 智能重命名 Issue #1024
/refine-title 1024

优势

相比于批量修改 (/normalize-titles),本命令:

  1. 修正错误:如果原标题是 "Help me",此命令能读懂内容并改为 "fix(core): 修复启动报错"。
  2. 更精准的 Scope:通过分析 PR 的文件变动,能自动判断是 fit 还是 waterflow,无需人工指定。
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 · 92 lines · 23 tokens per session scan A 9343b2f74053

Subscribe to this mod's changes

refine-title is a command published in the GitHub repository ModelEngine-Group/fit-framework (2,117 stars, last pushed 5mo ago), licensed MIT. It adds 23 tokens to every session and 778 once invoked, about $0.0001 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.