pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Use this template for writing the PR body:
markdown
undefined
使用以下模板编写 PR 正文:
markdown
undefined

Summary

Summary

<diagram, diff-sketch, or tree>
<diagram, diff-sketch, or tree>

Evidence

Evidence

  • Before: <screenshot/output/failing test run> After: <screenshot/output/passing test run>
  • Before: <screenshot/output/failing test run> After: <screenshot/output/passing test run>

Merge Danger

Merge Danger

Door: one-way or two-way Blast Radius: <potential ramifications of merge>
undefined
Door: one-way or two-way Blast Radius: <potential ramifications of merge>
undefined

Sections

Sections(章节)

Skip all preambles and keep prose brief. Use the user's domain language from
CONTEXT.md
.
省略所有前言,保持文字简洁。使用用户在
CONTEXT.md
中使用的领域语言。

Summary

Summary(概述)

Pick the smallest view that makes the key point clear.
  • Show logic or an algorithm as pseudocode:
text
on(save)
  if content is unchanged
    return cached result
  write new content
  return fresh result
  • Show runtime control flow as a call tree:
text
submitForm
  createSession
    persistPrompt
    launchAgent
  navigateToSession
  • Show UI structure as a component tree, including state and module boundaries that matter:
tsx
<SessionPage>(apps / example / src / routes / session.tsx);
useSessionEvents() < SessionToolbar > <RunSkillButton>(packages / ui);
  • Show file responsibility or a broad refactor as a shallow file tree:
text
src/
├── commands/       # parses user actions
├── sessions/       # owns session state
└── transport/      # sends API requests
  • Show component interaction, control flow, or data flow with Mermaid:
mermaid
sequenceDiagram
    participant User
    participant UI
    participant Daemon
    User->>UI: choose command
    UI->>Daemon: send expanded prompt
    Daemon-->>UI: stream result
  • Use
    diff
    when the point is what changes and the surrounding shape already exists. Match the diff shape to the topic.
For a component change:
diff
 <SessionPage>
   useSessionEvents()
   <SessionToolbar>
+    <RunSkillButton />
   <SessionTimeline>
+    <SkillResultCard />
For a file-layout change:
diff
 src/
 ├── commands/
+│   └── show-me.ts       # expands the slash command
 ├── sessions/
-└── transport.ts
+└── transport/
+    ├── client.ts
+    └── stream.ts
For a call-tree or call-stack change:
diff
 submitForm
   createSession
     persistPrompt
+    expandSkillMention
     launchAgent
-  navigateToSession
+  navigateToSession
+    subscribeToEvents
For a state or control-flow change:
diff
 on(save)
-  write content
+  if content is unchanged
+    return cached result
+  write new content
+  invalidate cache
  • Show the whole block when most of it is new, when omitted context would hide ownership or order, or when the user needs a copyable target shape:
ts
function expandSkill(command: string): string {
  const skillName = command.slice(1);
  return `use the ${skillName} skill`;
}
选择足以清楚表达关键点的最小视图。
  • 将逻辑或算法展示为伪代码:
text
on(save)
  if content is unchanged
    return cached result
  write new content
  return fresh result
  • 将运行时控制流展示为调用树:
text
submitForm
  createSession
    persistPrompt
    launchAgent
  navigateToSession
  • 将 UI 结构展示为组件树,其中包括重要的状态和模块边界:
tsx
<SessionPage>(apps / example / src / routes / session.tsx);
useSessionEvents() < SessionToolbar > <RunSkillButton>(packages / ui);
  • 将文件职责或大范围重构展示为浅层文件树:
text
src/
├── commands/       # parses user actions
├── sessions/       # owns session state
└── transport/      # sends API requests
  • 使用 Mermaid 展示组件交互、控制流或数据流:
mermaid
sequenceDiagram
    participant User
    participant UI
    participant Daemon
    User->>UI: choose command
    UI->>Daemon: send expanded prompt
    Daemon-->>UI: stream result
  • 当重点是发生的变化且周围结构已经存在时,使用
    diff
    。根据主题选择合适的 diff 形式。
对于组件变更:
diff
 <SessionPage>
   useSessionEvents()
   <SessionToolbar>
+    <RunSkillButton />
   <SessionTimeline>
+    <SkillResultCard />
对于文件布局变更:
diff
 src/
 ├── commands/
+│   └── show-me.ts       # expands the slash command
 ├── sessions/
-└── transport.ts
+└── transport/
+    ├── client.ts
+    └── stream.ts
对于调用树或调用栈变更:
diff
 submitForm
   createSession
     persistPrompt
+    expandSkillMention
     launchAgent
-  navigateToSession
+  navigateToSession
+    subscribeToEvents
对于状态或控制流变更:
diff
 on(save)
-  write content
+  if content is unchanged
+    return cached result
+  write content
+  invalidate cache
  • 当大部分内容都是新增内容、省略上下文会掩盖所有权或执行顺序,或者用户需要可复制的目标结构时,展示整个代码块:
ts
function expandSkill(command: string): string {
  const skillName = command.slice(1);
  return `use the ${skillName} skill`;
}

Guidance

Guidance(指导原则)

Place each visual next to the short text it supports. Keep only the calls, files, props, states, and boundaries needed to answer the user's current question or the options to resolve the current discussion point.
You may use one of these, you may use several, it is unlikely you will use all of them. Use your judgement and don't overwhelm the user.
将每个可视化内容放在其所支持的简短文字旁边。仅保留回答用户当前问题或解决当前讨论点所需的调用、文件、props、状态和边界。
可以使用其中一种,也可以使用多种,但不太可能需要全部使用。自行判断,不要让用户不知所措。

Evidence

Evidence(证据)

Concrete evidence that the change works. Show a before and after.
Screenshots are S-tier - when the environment is set up for it and the change is visual.
Execution-based evidence is A-tier. Test results, console output. Show the exact test that now fails and passes, using pseudocode.
提供证明变更有效的具体证据。展示变更前和变更后的结果。
截图属于 S 级——当环境已配置妥当且变更是视觉性的。
基于执行的证据属于 A 级,例如测试结果和控制台输出。使用伪代码展示能够证明测试由失败变为通过的准确测试。

Merge Danger

Merge Danger(合并风险)

Describe whether it's a one-way or two-way door. You can walk back through two-way doors, but not one-way doors. A PR that is cheap to roll back is lower risk. Changes that involve destructive actions or hard-to-reverse decisions are one-way doors.
The blast radius is the potential impact or scope of the changes introduced by this PR. Consider all possibilities. Examples are layout shift, breakages for consumers, mobile responsiveness, etc.
描述它是单向门(one-way door)还是双向门(two-way door)。双向门可以回退,但单向门不可回退。易于回滚的 PR 风险较低。涉及破坏性操作或难以撤销决策的变更属于单向门。
影响范围(blast radius)是本 PR 引入的变更可能产生的影响或波及范围。考虑所有可能性,例如布局偏移、消费者端故障、移动端响应性等。