simplify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSimplify
Simplify
Improve the quality of changed code without hunting for correctness bugs:
text
/simplify [target]Use the supplied target when present. Otherwise review the current working-tree
and branch diff against its base. Keep the work inside the changed code's
footprint except when an existing repository helper is the simpler replacement.
The normal mode applies verified cleanups. When a parent workflow or caller sets
a report-only boundary, use Report-only mode and leave the target unchanged.
在不查找正确性缺陷的前提下提升已变更代码的质量:
text
/simplify [target]如果提供了目标,则使用该目标。否则,对当前 working-tree 及其相对 base 的 branch diff 进行审查。除非使用现有的 repository helper 是更简单的替代方案,否则应将工作限制在已变更代码的范围内。
普通模式会应用已验证的清理项。当父级 workflow 或调用方设置仅报告边界时,使用 Report-only 模式,并保持目标不变。
Review the change
审查变更
Read the complete diff, its callers, relevant repository instructions, and the
tests or docs that establish intended behavior. Then assign one fresh,
report-only Reviewer to each angle. Run them concurrently where capacity allows
and serialize only as needed; capacity never removes an angle.
| Angle | Review criterion |
|---|---|
| Reuse | Replace new duplication with an existing helper, utility, type, or installed dependency when that is clearer and preserves behavior. |
| Simplification | Remove redundant or derivable state, needless branches or nesting, copy-paste variation, indirection, and dead code introduced or exposed by the change. |
| Efficiency | Remove demonstrated repeated work, unnecessary I/O, allocation, or overly broad operations; omit speculative micro-optimization. |
| Altitude | Keep policy, orchestration, and low-level mechanics at their appropriate existing boundaries; remove leaky or pass-through abstractions instead of adding new layers. |
Each Reviewer returns only findings with a location, one-line claim, concrete
cost, evidence, and smallest behavior-preserving remedy, or A
Reviewer does not edit, commit, publish, or delegate.
No findings.阅读完整的 diff、调用方、相关的 repository instructions,以及用于确定预期行为的测试或文档。然后为每个审查角度指派一个新的、仅报告模式的 Reviewer。如果容量允许,并发运行这些 Reviewer;仅在必要时串行执行,容量不足也不得省略任何审查角度。
| 审查角度 | 审查标准 |
|---|---|
| Reuse | 当现有 helper、utility、type 或已安装的 dependency 更清晰且能保持行为时,用其替换新引入的重复代码。 |
| Simplification | 移除由本次变更引入或暴露的冗余或可推导状态、不必要的分支或嵌套、复制粘贴差异、间接层以及死代码。 |
| Efficiency | 移除已有证据表明存在重复工作、不必要的 I/O、allocation 或范围过大的操作;不要进行推测性的微优化。 |
| Altitude | 确保 policy、orchestration 和底层机制位于各自合适的现有边界;移除泄漏型或纯透传型 abstraction,而不是增加新的层级。 |
每个 Reviewer 仅返回包含以下内容的发现:位置、单行结论、具体成本、证据,以及最小且能保持行为的修复方案;若无发现,则返回 Reviewer 不负责编辑、commit、publish 或 delegate。
No findings.Synthesize
综合审查结果
Deduplicate findings that name the same mechanism and verify each against the
source and intended behavior. Keep a finding only when its cost is concrete, its
remedy stays in scope, and intended behavior remains unchanged. Reject false
positives, style-only churn, speculative flexibility, and remedies that require
broad adjacent refactors.
Treat a suspected correctness bug as out of scope for this skill and recommend
; do not disguise it as cleanup.
code-review对指出相同机制的发现进行去重,并根据源代码和预期行为逐一验证。只有当问题的成本具体、修复方案在范围内,且预期行为保持不变时,才保留该发现。拒绝误报、仅涉及样式风格的改动、推测性的灵活性,以及需要大范围重构相邻代码的修复方案。
如果怀疑存在正确性缺陷,则该问题不在此 skill 的范围内,应建议使用 ;不要将其伪装成代码清理。
code-reviewReport-only mode
Report-only 模式
Return the verified findings and rejected claims with their reasons. Return
when clean. State that the target was not modified. This mode is
a Composite Review Skill: provenance includes the top-level Simplify Reviewer
and all four angle Reviewers.
No findings.返回已验证的发现及被拒绝的主张,并说明相应原因。如果没有发现,则返回 同时说明目标未被修改。此模式是一种 Composite Review Skill:其 provenance 包括顶层 Simplify Reviewer 和全部四个审查角度的 Reviewer。
No findings.Apply mode
Apply 模式
Apply every verified cleanup as the smallest coherent edit. Run the narrowest
relevant tests, lint, and type checks, plus a direct check of any changed output
surface. Retain an edit only when the checks pass and intended behavior is still
demonstrably unchanged.
Finish with a brief list of fixes, skipped findings with reasons, and checks, or
confirm that the code was already clean. Leave history and publication to the
caller: do not commit, rebase, comment, or push.
将每项已验证的清理应用为最小且连贯的编辑。运行范围最窄的相关测试、lint 和 type checks,并直接检查任何发生变化的输出界面。只有当检查通过且预期行为仍能明确证明未发生改变时,才保留相应编辑。
最后简要列出修复项、跳过的发现及其原因和已执行的检查;如果代码本身已经保持干净,则直接确认。历史记录和发布工作交由调用方处理:不要 commit、rebase、comment 或 push。