restraint
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRestraint
克制
This skill cuts a change down to the ask. It removes extra interface, options and code and treats "remove" as delete.
此 skill 会将改动缩减到需求本身。它会移除多余的界面、选项和代码,并将“移除”视为彻底删除。
Build the ask
构建需求边界
An element, option or code path the user did not ask for is a finding unless the ask needs it to work. Work that has not shipped carries no backwards compatibility. A cut the user has not approved is a proposal, not an edit.
Label wording belongs to . Reusing an existing part belongs to .
copyreuse如果某个元素、选项或代码路径不是用户要求的,且需求并不需要它才能工作,则应将其作为一项审查发现。尚未发布的工作无需考虑向后兼容性。用户未批准的删减只是建议,而不是已执行的改动。
标签文案属于 。复用现有部件属于 。
copyreuseNothing beside the ask
需求之外,不添加任何内容
Add no sections, badges, counts, captions, footers, icons inside buttons, sounds or decorative effects the user did not request. A count badge on every row is .
restraint-no-unrequested-ui不得添加用户未要求的区块、徽章、计数、说明文字、页脚、按钮内图标、声音或装饰效果。每一行都添加计数徽章属于 。
restraint-no-unrequested-uiNo feedback the screen already gives
不重复反馈屏幕已有的信息
Do not add a toast or a dialog for an action whose result is already on screen. That is .
restraint-no-redundant-feedback对于操作结果已经显示在屏幕上的操作,不要再添加 toast 或 dialog。这属于 。
restraint-no-redundant-feedbackThe smallest build that works
构建最小可用实现
Use the native element before a custom one, one app before a monorepo and a fixed value before a setting. A custom video player where works is . A preference nobody will change is .
<video controls>restraint-smallest-buildrestraint-no-needless-setting优先使用原生元素而非自定义元素,优先使用单个应用而非 monorepo,优先使用固定值而非可配置项。在 可用时使用自定义视频播放器,属于 。没人会更改的偏好设置属于 。
<video controls>restraint-smallest-buildrestraint-no-needless-settingNo defensive code before release
发布前不编写防御性代码
Keep no legacy branch and no compatibility shim in unshipped work. That is . Do not add a fallback for a value that is always set. That is .
restraint-no-legacyrestraint-no-fallbacks在尚未发布的工作中,不保留旧版分支和兼容性 shim。这属于 。不要为始终有值的参数添加 fallback。这属于 。
restraint-no-legacyrestraint-no-fallbacksRemove means delete
移除就是删除
When the user says remove, delete the code and its styles, variables, routes and menu entries. "Deferred for review" is . A removed package that leaves its variables in is .
restraint-delete-dont-defertheme.cssrestraint-remove-the-trailAsked for a cleanup, list unused files, exports, styles, dependencies and leftover prototypes. Delete them once approved.
用户要求移除时,删除相关代码及其样式、变量、路由和菜单项。“留待审查后再处理”属于 。已移除的包如果仍在 中留下变量,属于 。
restraint-delete-dont-defertheme.cssrestraint-remove-the-trail如果用户要求清理,应列出未使用的文件、导出项、样式、依赖项和遗留原型。获得批准后将其删除。
Comments state constraints or go
注释要么说明约束,要么删除
Delete comments that narrate the code. Keep one only when it states a constraint the code cannot show. A narrating comment is .
restraint-no-narrating-comments删除仅用于复述代码行为的注释。只有当注释说明了代码本身无法呈现的约束时才保留。复述代码的注释属于 。
restraint-no-narrating-commentsThe pair
成对呈现
Every check is a pair. The broken line sits beside the line that replaces it.
| Rule | Broken | Replacement |
|---|---|---|
| A count badge on every row | No badge |
| A toast after a move the user can see | No toast |
| A custom video player | |
| A preference for a gap nobody changes | A fixed |
| A legacy branch kept "for safety" | Deleted |
| | |
| "Deferred for your review" | Deleted, or one question |
| A removed package's variables left in | The variables removed with it |
| | No comment |
每项检查均成对展示。错误示例紧挨着替代写法。
| 规则 | 错误示例 | 替代方案 |
|---|---|---|
| 每一行都带计数徽章 | 不加徽章 |
| 在用户能看到移动结果后显示 toast | 不显示 toast |
| 自定义视频播放器 | |
| 为没人会更改的间距提供偏好设置 | 固定的 |
| “以防万一”而保留旧版分支 | 删除 |
| 对始终有值的参数使用 | |
| “留待你审查” | 删除,或提出一个问题 |
| 已移除包的变量仍留在 | 随之删除这些变量 |
| | 不加注释 |
Reporting
报告
Severity. is a feature, setting or code path nobody asked for, or a "removed" item that still exists. is a fallback, a legacy branch or a leftover variable. is a narrating comment.
HIGHMEDIUMLOWFormat. One finding per root cause:
file:line - [rule-id] what is wrongThen a summary. when any remains, otherwise. Never a file you did not read. Mark every check you could not run as .
Rule | Count | SeverityBlockHIGHApproveApproveNot verified严重程度。 表示存在无人要求的功能、设置或代码路径,或仍然存在的“已移除”项。 表示存在 fallback、旧版分支或遗留变量。 表示存在复述代码的注释。
HIGHMEDIUMLOW格式。 每个根本原因对应一项审查发现:
file:line - [rule-id] what is wrong然后提供 Rule | Count | Severity 汇总。只要仍有一项 ,结论即为 ;否则为 。绝不能对未读取的文件给出 。每项无法执行的检查都应标记为 。
HIGHBlockApproveApproveNot verified