sync-pr

A command that summarizes an AI coding task's progress and posts the update as a comment on its GitHub Pull Request, a proposed code change for review.

In plain words
What is it for?
Use it to read the task and its analysis, plan, implementation, and review documents, then create a progress summary in the related Pull Request.
Why use it?
It keeps reviewers informed about completed work, current status, decisions, files changed, and next steps without making them search through task files.

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/sync-pr
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 2,589 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.02589
Opus 5 $0.00006 $0.01295
Sonnet 5 $0.00003 $0.00518
Haiku 4.5 $0.00001 $0.00259

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

Security

Grade A, and why

sync-pr 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/sync-pr.md · 319 lines

How it starts

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

Sync PR Command

功能说明

将任务的处理进度摘要同步到对应的 Pull Request 评论区中,方便审查者了解开发进展和关键决策。

执行流程

1. 验证任务存在

检查任务文件是否存在:

  • 查找 .ai-workspace/active/{task-id}/task.md
  • 如果不存在,检查 completed/blocked/ 目录
  • 如果都不存在,提示用户任务不存在

2. 读取任务信息

从任务文件中获取:

  • PR 号码(pr_number 字段)
  • 任务标题和描述
  • 当前步骤(current_step
  • 任务状态(status
  • 创建和更新时间
  • 关联的 Issue(issue_number,如果有)

3. 读取上下文文件

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

检查并读取以下文件(如果存在):

  • .ai-workspace/{status}/{task-id}/analysis.md - 需求分析
  • .ai-workspace/{status}/{task-id}/plan.md - 技术方案
  • .ai-workspace/{status}/{task-id}/implementation.md - 实现报告
  • .ai-workspace/{status}/{task-id}/review.md - 审查报告

4. 生成进度摘要

根据当前状态生成清晰的进度摘要:

基本格式

## 🤖 开发进度更新

**任务ID**: {task-id}
**更新时间**: {当前时间}
**当前状态**: {状态描述}

### ✅ 已完成

- [x] 需求分析 - {完成时间}
  - {核心要点摘要 1-2 条}
- [x] 技术方案设计 - {完成时间}
  - {方案选择和关键决策 1-2 条}
- [x] 代码实现 - {完成时间}
  - 修改文件: {数量}
  - 新增测试: {数量}
- [ ] 代码审查(进行中)
- [ ] 最终合并

### 📋 当前进展

{当前步骤的详细说明}

### 🎯 下一步

{下一步计划}

### 📊 技术要点

{关键的技术决策和实现细节,方便审查者理解}

### 📂 相关文档

- 任务文件: `.ai-workspace/active/{task-id}/task.md`
- 需求分析: `.ai-workspace/active/{task-id}/analysis.md`
- 技术方案: `.ai-workspace/active/{task-id}/plan.md`
- 实现报告: `.ai-workspace/active/{task-id}/implementation.md`

---
*由 Claude Code 自动生成 - [任务管理系统](../.agents/README.md)*

摘要原则

  • 面向审查者:突出技术决策和实现要点
  • 简洁清晰:每个阶段只提取核心要点
  • 逻辑连贯:按开发流程展示进展
  • 便于审查:说明关键变更的原因和影响

5. 同步到 PR

使用 gh 命令将摘要发布到 PR 评论:

gh pr comment {pr-number} --body "$(cat <<'EOF'
{生成的进度摘要}
EOF
)"

6. 更新任务状态

在任务文件中记录同步时间:

  • 添加或更新 last_synced_to_pr_at 字段
  • 记录同步的 PR 评论链接(如果 gh 返回)

7. 告知用户

输出格式:

✅ 任务进度已同步到 PR #{pr-number}

**同步内容**:
- 已完成步骤: {数量}
- 当前状态: {状态}
- 下一步: {下一步说明}

**查看链接**:
https://github.com/{owner}/{repo}/pull/{pr-number}

参数说明

  • <task-id>: 任务ID,格式为 TASK-{yyyyMMdd-HHmmss}(必需)

使用示例

# 同步任务进度到对应的 PR
/sync-pr TASK-20251227-104654

进度摘要示例

示例 1:代码实现完成,等待审查

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

Subscribe to this mod's changes

sync-pr 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 2,589 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.