restraint

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Restraint

克制

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
copy
. Reusing an existing part belongs to
reuse
.
如果某个元素、选项或代码路径不是用户要求的,且需求并不需要它才能工作,则应将其作为一项审查发现。尚未发布的工作无需考虑向后兼容性。用户未批准的删减只是建议,而不是已执行的改动。
标签文案属于
copy
。复用现有部件属于
reuse
。

Nothing 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-ui
。

No 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-feedback
。

The 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
<video controls>
works is
restraint-smallest-build
. A preference nobody will change is
restraint-no-needless-setting
.
优先使用原生元素而非自定义元素,优先使用单个应用而非 monorepo,优先使用固定值而非可配置项。在
<video controls>
可用时使用自定义视频播放器,属于
restraint-smallest-build
。没人会更改的偏好设置属于
restraint-no-needless-setting
。

No defensive code before release

发布前不编写防御性代码

Keep no legacy branch and no compatibility shim in unshipped work. That is
restraint-no-legacy
. Do not add a fallback for a value that is always set. That is
restraint-no-fallbacks
.
在尚未发布的工作中,不保留旧版分支和兼容性 shim。这属于
restraint-no-legacy
。不要为始终有值的参数添加 fallback。这属于
restraint-no-fallbacks
。

Remove means delete

移除就是删除

When the user says remove, delete the code and its styles, variables, routes and menu entries. "Deferred for review" is
restraint-delete-dont-defer
. A removed package that leaves its variables in
theme.css
is
restraint-remove-the-trail
.
Asked for a cleanup, list unused files, exports, styles, dependencies and leftover prototypes. Delete them once approved.
用户要求移除时,删除相关代码及其样式、变量、路由和菜单项。“留待审查后再处理”属于
restraint-delete-dont-defer
。已移除的包如果仍在
theme.css
中留下变量,属于
restraint-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-comments
。

The pair

成对呈现

Every check is a pair. The broken line sits beside the line that replaces it.
RuleBrokenReplacement
restraint-no-unrequested-ui
A count badge on every rowNo badge
restraint-no-redundant-feedback
A toast after a move the user can seeNo toast
restraint-smallest-build
A custom video player
<video controls>
restraint-no-needless-setting
A preference for a gap nobody changesA fixed
--gap
restraint-no-legacy
A legacy branch kept "for safety"Deleted
restraint-no-fallbacks
value ?? defaultValue
for a value that is always set
value
restraint-delete-dont-defer
"Deferred for your review"Deleted, or one question
restraint-remove-the-trail
A removed package's variables left in
theme.css
The variables removed with it
restraint-no-narrating-comments
// Render the header
No comment
每项检查均成对展示。错误示例紧挨着替代写法。
规则错误示例替代方案
restraint-no-unrequested-ui
每一行都带计数徽章不加徽章
restraint-no-redundant-feedback
在用户能看到移动结果后显示 toast不显示 toast
restraint-smallest-build
自定义视频播放器
<video controls>
restraint-no-needless-setting
为没人会更改的间距提供偏好设置固定的
--gap
restraint-no-legacy
“以防万一”而保留旧版分支删除
restraint-no-fallbacks
对始终有值的参数使用
value ?? defaultValue
value
restraint-delete-dont-defer
“留待你审查”删除,或提出一个问题
restraint-remove-the-trail
已移除包的变量仍留在
theme.css
中
随之删除这些变量
restraint-no-narrating-comments
// Render the header
不加注释

Reporting

报告

Severity.
HIGH
is a feature, setting or code path nobody asked for, or a "removed" item that still exists.
MEDIUM
is a fallback, a legacy branch or a leftover variable.
LOW
is a narrating comment.
Format. One finding per root cause:
file:line - [rule-id] what is wrong
Then a
Rule | Count | Severity
summary.
Block
when any
HIGH
remains,
Approve
otherwise. Never
Approve
a file you did not read. Mark every check you could not run as
Not verified
.
严重程度。
HIGH
表示存在无人要求的功能、设置或代码路径,或仍然存在的“已移除”项。
MEDIUM
表示存在 fallback、旧版分支或遗留变量。
LOW
表示存在复述代码的注释。
格式。 每个根本原因对应一项审查发现:
file:line - [rule-id] what is wrong
然后提供 Rule | Count | Severity 汇总。只要仍有一项
HIGH
,结论即为
Block
;否则为
Approve
。绝不能对未读取的文件给出
Approve
。每项无法执行的检查都应标记为
Not verified
。