refine-task

A command for processing code-review feedback and applying the requested fixes. It expects task, review, and implementation files in a specified workspace structure.

In plain words
What is it for?
Use it after a review to extract blockers and suggestions, create repair tasks, fix them by priority, update task status, and run relevant Maven tests.
Why use it?
It turns review findings into an ordered repair process and checks the project’s tests when the review reports test problems.

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

Made for: Claude Code.

Per session 13 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,930 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.00013 $0.01930
Opus 5 $0.00006 $0.00965
Sonnet 5 $0.00003 $0.00386
Haiku 4.5 $0.00001 $0.00193

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

Security

Grade A, and why

refine-task 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-task.md · 256 lines

How it starts

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

Refinement Task Command

功能说明

处理代码审查中发现的问题,修复代码后重新进入审查流程。此命令用于 code-review 步骤发现需要修改的情况。

⚠️ CRITICAL: 状态更新要求

执行此命令后,你必须立即更新任务状态。参见规则 7。

执行流程

1. 验证前置条件

检查必需文件:

  • .ai-workspace/active/{task-id}/task.md - 任务文件
  • .ai-workspace/active/{task-id}/review.md - 审查报告(或 review-supplement.md)
  • .ai-workspace/active/{task-id}/implementation.md - 实现报告

注意:{task-id} 格式为 TASK-{yyyyMMdd-HHmmss},例如 TASK-20260205-202013

如果任一文件不存在,提示用户先完成前置步骤。

2. 读取审查报告

仔细阅读审查报告(review.mdreview-supplement.mdreview-final.md),提取需要修复的问题:

问题分类

  1. 🔴 必须修复(Blocker) - 阻塞问题,必须修复才能合并
  2. 🟡 建议修改(Major) - 重要建议,强烈推荐修复
  3. 🟢 优化建议(Minor) - 可选优化,可以考虑修复

提取信息

  • 问题标题
  • 文件路径和行号
  • 问题描述
  • 修复建议

3. 使用 TodoWrite 规划修复任务

根据审查报告创建修复任务清单:

使用 TodoWrite 工具创建 todos:
- [ ] 修复问题 1: {问题标题}
- [ ] 修复问题 2: {问题标题}
- [ ] 修复问题 3: {问题标题}
...

优先级

  1. 先修复所有 🔴 必须修复的问题
  2. 再修复 🟡 建议修改的问题
  3. 最后考虑 🟢 优化建议

4. 执行代码修复

按优先级逐个修复问题:

修复流程

  1. 读取相关文件,理解问题上下文
  2. 按照审查建议修复代码
  3. 确保修复不引入新问题
  4. 在 TodoWrite 中标记该问题为已完成

修复原则

  • 严格按照审查建议修复
  • 如果建议不明确,询问用户
  • 如果发现新问题,一并修复
  • 保持代码风格一致

5. 运行测试(如果有测试失败)

如果审查报告中提到测试问题:

# 运行单元测试
mvn test

# 运行特定测试
mvn test -Dtest=TestClassName

# 运行集成测试
mvn verify

确保所有测试通过后再继续。

6. 更新任务状态 (CRITICAL)

必须更新 .ai-workspace/active/{task-id}/task.md

current_step: refinement
assigned_to: {当前AI,例如 claude}
updated_at: {当前时间,格式: yyyy-MM-dd HH:mm:ss}

在工作流进度中标记

## 工作流进度

- [x] requirement-analysis (已完成)
- [x] technical-design (已完成)
- [x] implementation (已完成)
- [x] code-review (已完成 - 发现问题)
- [x] refinement (正在修复)  ← 标记为进行中
- [ ] finalize (待执行)

7. 创建修复报告

创建 .ai-workspace/active/{task-id}/refinement-report.md,记录修复情况:

# 代码修复报告

## 修复概要

- **修复者**: {修复者}
- **修复时间**: {时间}
- **修复范围**: {修复的问题数量}
- **修复来源**: 代码审查反馈

## 修复内容

### 🔴 已修复的阻塞问题

#### 1. {问题标题}
**原问题**: {问题描述}
**修复方式**: {详细说明修复了什么}
**修改文件**: `{file-path}:{line-number}`

### 🟡 已修复的建议问题

#### 1. {问题标题}
**原问题**: {问题描述}
**修复方式**: {详细说明修复了什么}
**修改文件**: `{file-path}:{line-number}`

### 🟢 已采纳的优化建议

#### 1. {优化标题}
**原建议**: {建议描述}
**实施方式**: {详细说明如何实施}
**修改文件**: `{file-path}:{line-number}`

## 未修复的问题(如果有)

### {问题标题}
**原因**: {为什么没有修复}
**计划**: {如何处理}

## 测试结果

- [ ] 单元测试通过
- [ ] 集成测试通过
- [ ] 回归测试通过
- [ ] 新增测试(如果需要)

## 下一步

代码已修复,准备重新进入审查流程。

Read the full file on GitHub · 256 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 · 256 lines · 13 tokens per session scan A 142c1705f774

Subscribe to this mod's changes

refine-task is a command published in the GitHub repository ModelEngine-Group/fit-framework (2,117 stars, last pushed 5mo ago), licensed MIT. It adds 13 tokens to every session and 1,930 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.