diffity-resolve
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDiffity Resolve Skill
Diffity Resolve Skill
You are reading open review comments and resolving them by making the requested code changes.
你正在查看未处理的评审意见,并通过按照要求修改代码来解决这些问题。
Arguments
参数
- (optional): Resolve a specific thread by ID instead of all open threads. Example:
thread-id/diffity-resolve abc123
- (可选):通过ID解决特定的讨论线程,而非所有未处理线程。示例:
thread-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,--lineare required for--bodycomment - defaults to
--end-line(single-line comment)--line - defaults to
--sidenew - creates a diff-level comment not tied to any file or line
general-comment - accepts full UUID or 8-char prefix
<id>
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 - 默认值为
--sidenew - 用于创建不关联任何文件或行的差异级评论
general-comment - 支持完整UUID或8字符前缀
<id>
Prerequisites
前置条件
- Check that is available: run
diffity. If not found, install it withwhich diffity.npm install -g diffity - Check that a review session exists: run . If the file doesn't exist or is stale, tell the user to start diffity first.
cat .diffity/current-session
- 检查是否可用:执行
diffity。如果未找到,使用which diffity进行安装。npm install -g diffity - 检查是否存在评审会话:执行。如果文件不存在或已过期,请告知用户先启动diffity。
cat .diffity/current-session
Instructions
操作步骤
- List open comment threads with full details:
If a
diffity agent list --status open --jsonargument was provided, filter to just that thread. The JSON output includes the full comment body, file path, line numbers, and side for each thread.thread-id - If there are no open threads, tell the user there's nothing to resolve.
- For each open thread:
a. Skip general comments (filePath ) — these are summaries, not actionable code changes. b. Skip threads where the comment body starts with an explicit
__general__or[question]tag prefix — these don't require code changes. Tell the user you skipped them and why.[nit]- Important: Only skip if the comment body literally begins with or
[question]. 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:[nit] - 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?"
diffity agent resolve <thread-id> --summary "Fixed: <brief description of what was changed>" - Important: Only skip if the comment body literally begins with
- After resolving all applicable threads, run to confirm status.
diffity agent list - Tell the user to check the browser — resolved status will appear within 2 seconds via polling.
- 列出所有未处理的讨论线程及完整详情:
如果提供了
diffity agent list --status open --json参数,则仅筛选该线程。JSON输出包含每个线程的完整评论内容、文件路径、行号和对应版本(side)。thread-id - 如果没有未处理的线程,告知用户没有需要解决的内容。
- 对于每个未处理的线程:
a. 跳过通用评论(文件路径为)——这些是总结性内容,无需执行代码修改。 b. 跳过评论内容以明确的
__general__或[question]标签开头的线程——这些不需要修改代码。告知用户已跳过这些线程及原因。[nit]- **重要提示:**仅当评论内容确实以或
[question]开头时才跳过。不要仅仅因为评论以问句形式呈现就跳过(例如“我们应该添加X吗?”或“我们可以重命名这个吗?”)。没有明确标签的问句形式评论属于建议,应视为需要执行的修改请求。 c. 读取JSON输出中的评论内容,理解所需的修改内容,解读其意图:[nit] - 如果评论建议修改代码,则进行代码修改。
- 如果评论建议添加文档,则添加或更新相关文档。
- 如果评论是带有行动暗示的问题(例如“我们应该添加X吗?”),则将其视为执行该行动的请求。
- 如果评论内容确实不明确,无法确定需要执行什么操作,则回复请求澄清,而不是默默跳过:
diffity agent reply <thread-id> --body "Could you clarify what change you'd like here?"
diffity agent resolve <thread-id> --summary "Fixed: <brief description of what was changed>" - **重要提示:**仅当评论内容确实以
- 解决所有适用线程后,执行确认状态。
diffity agent list - 告知用户查看浏览器——通过轮询,已解决状态将在2秒内显示。