explain

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Explain Intent

解释设计意图

Explain the intent behind source code by tracing it back to the original conversation where it was created. Works with:
  • Functions — Why does this function exist? What problem was it solving?
  • Files — What's the purpose of this file? What requirements drove its creation?
  • Line changes — Why was this specific line added or modified?
通过追溯到代码创建时的原始对话,解释源代码的设计意图。适用于:
  • 函数 — 这个函数为什么存在?它解决了什么问题?
  • 文件 — 这个文件的用途是什么?哪些需求推动了它的创建?
  • 代码行变更 — 为什么添加或修改了这一行特定的代码?

Response Format

响应格式

Begin the first response to this skill invocation with the line:
Entire Explain:
followed by a blank line, then the content.
  • Apply the header to the first response of the invocation only. Do not re-print it on follow-up turns within the same invocation (e.g. after the user answers a clarifying question).
  • Do not include the header on error or early-exit responses (e.g. "Entire CLI is required but not installed", "this file is not tracked by git", "no session transcript was found for this commit"). The header's presence should signal that the skill ran and produced real output.
首次调用该技能时,响应需以以下行开头:
Entire Explain:
随后空一行,再输出内容。
  • 仅在首次调用响应中添加该头部。在同一次调用的后续交互中(例如用户回答澄清问题后),请勿重复打印该头部。
  • 在错误或提前退出的响应中(例如“需要Entire CLI但未安装”、“此文件未被git追踪”、“未找到该提交的会话记录”),请勿包含该头部。该头部的存在应表明技能已运行并生成了有效输出。

Process

流程

  1. Verify the
    entire
    CLI is installed by running
    entire version
    .
    • If the command is not found, stop and tell the user: "The Entire CLI is required but not installed. Install it from https://entire.io/docs/cli and try again."
  2. Use a Haiku agent to identify the commit that introduced the code via git blame or git log.
    • If the file is not tracked by git, stop and tell the user: "This file is not tracked by git, so I can't trace its history."
    • If git blame returns no useful result (e.g., the code is uncommitted), stop and tell the user: "This code hasn't been committed yet, so there's no history to trace."
  3. Use a Sonnet agent to read the session transcript via
    entire explain --no-pager --commit COMMIT_SHA
    .
    • If the command fails or returns no transcript, stop and tell the user: "No session transcript was found for this commit. It may have been created outside of an Entire session (e.g., a manual commit)."
  1. 通过运行
    entire version
    验证
    entire
    CLI是否已安装。
  2. 使用Haiku agent通过git blame或git log确定引入该代码的提交记录。
    • 如果文件未被git追踪,请停止操作并告知用户:“此文件未被git追踪,无法追溯其历史。”
    • 如果git blame未返回有效结果(例如代码未提交),请停止操作并告知用户:“此代码尚未提交,没有可追溯的历史记录。”
  3. 使用Sonnet agent通过
    entire explain --no-pager --commit COMMIT_SHA
    读取会话记录。
    • 如果命令执行失败或未返回记录,请停止操作并告知用户:“未找到该提交的会话记录。该代码可能是在Entire会话之外创建的(例如手动提交)。”