diffity-resolve

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Diffity Resolve Skill

Diffity Resolve Skill

You are reading open review comments and resolving them by making the requested code changes.
你正在查看未处理的评审意见,并通过按照要求修改代码来解决这些问题。

Arguments

参数

  • thread-id
    (optional): Resolve a specific thread by ID instead of all open threads. Example:
    /diffity-resolve abc123
  • thread-id
    (可选):通过ID解决特定的讨论线程,而非所有未处理线程。示例:
    /diffity-resolve abc123

CLI Reference

CLI 参考

diffity agent list [--status open|resolved|dismissed] [--json]
diffity agent comment --file <path> --line <n> [--end-line <n>] [--side new|old] --body "<text>"
diffity agent general-comment --body "<text>"
diffity agent resolve <id> [--summary "<text>"]
diffity agent dismiss <id> [--reason "<text>"]
diffity agent reply <id> --body "<text>"
  • --file
    ,
    --line
    ,
    --body
    are required for
    comment
  • --end-line
    defaults to
    --line
    (single-line comment)
  • --side
    defaults to
    new
  • general-comment
    creates a diff-level comment not tied to any file or line
  • <id>
    accepts full UUID or 8-char prefix
diffity agent list [--status open|resolved|dismissed] [--json]
diffity agent comment --file <path> --line <n> [--end-line <n>] [--side new|old] --body "<text>"
diffity agent general-comment --body "<text>"
diffity agent resolve <id> [--summary "<text>"]
diffity agent dismiss <id> [--reason "<text>"]
diffity agent reply <id> --body "<text>"
  • 使用
    comment
    命令时,
    --file
    --line
    --body
    为必填项
  • --end-line
    默认值为
    --line
    (即单行评论)
  • --side
    默认值为
    new
  • general-comment
    用于创建不关联任何文件或行的差异级评论
  • <id>
    支持完整UUID或8字符前缀

Prerequisites

前置条件

  1. Check that
    diffity
    is available: run
    which diffity
    . If not found, install it with
    npm install -g diffity
    .
  2. Check that a review session exists: run
    cat .diffity/current-session
    . If the file doesn't exist or is stale, tell the user to start diffity first.
  1. 检查
    diffity
    是否可用:执行
    which diffity
    。如果未找到,使用
    npm install -g diffity
    进行安装。
  2. 检查是否存在评审会话:执行
    cat .diffity/current-session
    。如果文件不存在或已过期,请告知用户先启动diffity。

Instructions

操作步骤

  1. List open comment threads with full details:
    diffity agent list --status open --json
    If a
    thread-id
    argument was provided, filter to just that thread. The JSON output includes the full comment body, file path, line numbers, and side for each thread.
  2. If there are no open threads, tell the user there's nothing to resolve.
  3. For each open thread: a. Skip general comments (filePath
    __general__
    ) — these are summaries, not actionable code changes. b. Skip threads where the comment body starts with an explicit
    [question]
    or
    [nit]
    tag prefix — these don't require code changes. Tell the user you skipped them and why.
    • Important: Only skip if the comment body literally begins with
      [question]
      or
      [nit]
      . Do NOT skip comments just because they are phrased as a question (e.g. "should we add X?" or "can we rename this?"). Comments phrased as questions without explicit tags are suggestions — treat them as actionable requests. c. Read the comment body from the JSON output and understand what change is requested. Interpret the intent:
    • If the comment suggests a code change, make the change.
    • If the comment suggests adding documentation, add or update the relevant docs.
    • If the comment asks a question that implies an action (e.g. "should we add X?"), treat it as a request to do that action.
    • If the comment is genuinely unclear and you cannot determine what action to take, reply asking for clarification instead of silently skipping:
      diffity agent reply <thread-id> --body "Could you clarify what change you'd like here?"
    d. Read the relevant source file to understand the full context around the commented lines, then make the requested change using the Edit tool. e. After making the change, resolve the thread with a summary:
    diffity agent resolve <thread-id> --summary "Fixed: <brief description of what was changed>"
  4. After resolving all applicable threads, run
    diffity agent list
    to confirm status.
  5. Tell the user to check the browser — resolved status will appear within 2 seconds via polling.
  1. 列出所有未处理的讨论线程及完整详情:
    diffity agent list --status open --json
    如果提供了
    thread-id
    参数,则仅筛选该线程。JSON输出包含每个线程的完整评论内容、文件路径、行号和对应版本(side)。
  2. 如果没有未处理的线程,告知用户没有需要解决的内容。
  3. 对于每个未处理的线程: a. 跳过通用评论(文件路径为
    __general__
    )——这些是总结性内容,无需执行代码修改。 b. 跳过评论内容以明确的
    [question]
    [nit]
    标签开头的线程——这些不需要修改代码。告知用户已跳过这些线程及原因。
    • **重要提示:**仅当评论内容确实以
      [question]
      [nit]
      开头时才跳过。不要仅仅因为评论以问句形式呈现就跳过(例如“我们应该添加X吗?”或“我们可以重命名这个吗?”)。没有明确标签的问句形式评论属于建议,应视为需要执行的修改请求。 c. 读取JSON输出中的评论内容,理解所需的修改内容,解读其意图:
    • 如果评论建议修改代码,则进行代码修改。
    • 如果评论建议添加文档,则添加或更新相关文档。
    • 如果评论是带有行动暗示的问题(例如“我们应该添加X吗?”),则将其视为执行该行动的请求。
    • 如果评论内容确实不明确,无法确定需要执行什么操作,则回复请求澄清,而不是默默跳过:
      diffity agent reply <thread-id> --body "Could you clarify what change you'd like here?"
    d. 读取相关源文件,理解评论所在代码行的完整上下文,然后使用编辑工具进行所需的修改。 e. 修改完成后,使用总结信息标记该线程已解决:
    diffity agent resolve <thread-id> --summary "Fixed: <brief description of what was changed>"
  4. 解决所有适用线程后,执行
    diffity agent list
    确认状态。
  5. 告知用户查看浏览器——通过轮询,已解决状态将在2秒内显示。