break

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Break

Break

This skill takes one component, renders it on a fresh page under every scenario that can actually reach it and reports what broke. A component built against one happy path looks finished right up until real content arrives.
It observes rather than judges. A finding here is something that visibly broke on the page, named in the vocabulary of the domain skill that owns the fix. Reviewing code against a standard is
interface-review
and
better-interface
; exploring design alternatives is
variant
.
Where
variant
insists on the real page, this skill isolates on purpose. You are not judging how the component looks in context. You are checking whether it defends itself when the content is worst-case.
该Skill针对单个组件,在全新页面中模拟所有实际可能遇到的场景进行渲染,并报告出现损坏的部分。仅按照理想路径构建的组件,在真实内容到来前看似已完成,但实际可能存在隐患。
它只做观察,不做评判。这里的发现指页面上可见的损坏问题,并用负责修复该问题的领域Skill术语来描述。按照标准审查代码对应的是
interface-review
better-interface
Skill;探索设计替代方案对应的是
variant
Skill。
variant
Skill要求在真实页面中测试,而本Skill则刻意将组件隔离。你无需评判组件在上下文环境中的外观,只需检查当内容处于最坏情况时,组件能否自我防护。

1. Scope one component

1. 确定单个组件的测试范围

One component per run. "The settings page" is not a component; the profile form's text input is. Where the request spans several, list the candidates and ask which one to test, rather than picking on the user's behalf.
Restate what the component is in one sentence: what it accepts, what it renders and where it will live.
每次运行仅测试一个组件。“设置页面”并非单个组件,而“个人资料表单的文本输入框”才是。若请求涉及多个组件,请列出候选组件并询问用户测试哪一个,而非自行决定。
用一句话重述该组件的信息:它接收什么输入、渲染什么内容以及部署位置。

2. Infer the scenarios from the component

2. 从组件推断测试场景

Stress only what varies. A scenario earns a slot when the component accepts something that can take that shape in production. So read the component first: its props, its slots, its states and the data it renders.
scenarios.md holds the axes, the values on each and the cue that says whether an axis applies. Walk it against the component and keep only the axes whose cue matches. A text input gets content length and states, never item quantity. A static icon button with a fixed label gets container and environment, never long text.
Write the kept scenarios down before building, one line each, so the harness renders a planned set rather than whatever came to mind. Then say which axes you dropped and why, in one line, so a wrong inference is cheap to catch.
仅针对可变因素进行压力测试。当组件在生产环境中可能接收某种形式的输入时,该场景才值得测试。因此需先分析组件:它的props、插槽、状态以及渲染的数据。
scenarios.md包含测试维度、各维度的取值,以及判断维度是否适用的依据。对照组件逐一筛选,仅保留符合依据的维度。例如,文本输入框需测试内容长度和状态,无需测试项目数量;带有固定标签的静态图标按钮需测试容器和环境,无需测试长文本。
在构建测试环境前,将选定的场景逐条记录下来,确保测试环境渲染的是预先规划的场景集合,而非临时想到的内容。然后用一句话说明你舍弃了哪些维度及原因,以便及时发现错误的推断。

3. Build the harness page

3. 构建测试 harness 页面

One throwaway page, holding the real component imported from the project, rendered once per scenario in a single column. Label every instance with its scenario name, and give the harness a dashed outline around each instance so overflow past the component's own box is visible.
Use the project's own stack: a scratch route in its dev server where one exists, a single self-contained HTML file where none does. Feed scenarios as props and fixture data. The harness never imports production state, never wires to live data and production never imports from the harness.
Keep the harness visibly outside the design system, plain and unstyled, so nothing it adds is mistaken for the component's own rendering.
创建一个临时页面,导入项目中的真实组件,每个场景渲染一次,按单列排列。为每个组件实例标注场景名称,并在每个实例周围添加虚线边框,以便清晰看到组件自身边界外的溢出内容。
使用项目自身的技术栈:若项目有开发服务器,则在其中创建一个临时路由;若无,则创建一个独立的HTML文件。将场景作为props和测试数据传入。测试 harness 绝不导入生产状态,不连接实时数据,生产代码也绝不会导入测试 harness 的内容。
保持测试 harness 的外观明显区别于设计系统,采用简洁无样式的风格,避免将测试 harness 添加的元素误认为是组件自身的渲染内容。

4. Render and observe

4. 渲染并观察

A run that never rendered is a code review wearing a costume. Load the page, look at every scenario and record only what you saw. Reading the CSS and predicting "this would probably overflow" is not a finding.
With a scriptable browser, screenshot the page, resize to 320px and screenshot again, and tab through the interactive scenarios. Without one, start the dev server or write the file, then ask the user to open it and continue from what they report.
For each scenario record one of two outcomes: survived, or broke with what was visible. "Text escapes the card's right edge", never "spacing feels tight".
从未进行渲染的测试只是披着外衣的代码审查。加载页面,查看每个场景,仅记录你实际看到的内容。仅通过阅读CSS预测“这可能会溢出”不能作为发现的问题。
若使用可脚本化浏览器,先截图页面,再将窗口调整为320px后再次截图,并遍历所有交互式场景。若无此类浏览器,则启动开发服务器或打开HTML文件,请求用户打开页面并根据他们的反馈继续操作。
为每个场景记录两种结果之一:正常运行,或出现可见损坏。例如记录“文本超出卡片右边缘”,而非“间距看起来过紧”。

5. Report what broke and stop

5. 报告损坏情况并结束

Report findings as a table, broken scenarios first:
ScenarioObservedOwner
One unbreakable 60-character stringOverflows the card, no wrap and no truncation
better-typography
Zero itemsBlank region with no message
better-writing
The owner column names the domain skill whose rules diagnose the break, so the fix starts in the right place. This skill owns no domain rules and issues no verdict.
"Everything survived" is a complete and useful report. Say which scenarios ran and at which widths, and end there rather than padding the result with preferences.
Do not fix anything unasked. On a request to fix, follow the owner skill's rules, then re-render the failing scenarios to confirm.
以表格形式报告发现的问题,先列出出现损坏的场景:
场景观察结果负责Skill
一段60字符的不可换行字符串超出卡片范围,无换行或截断处理
better-typography
零条数据空白区域无提示信息
better-writing
“负责Skill”列填写能诊断该损坏问题的领域Skill名称,以便修复工作从正确的方向开始。本Skill不包含任何领域规则,也不给出评判结论。
“所有场景均正常运行”是一份完整且有用的报告。说明运行了哪些场景以及测试的窗口宽度,无需添加主观建议来凑内容。
未经请求不得修复任何问题。若收到修复请求,请遵循对应负责Skill的规则,然后重新渲染失败场景以确认修复效果。

6. Delete the harness

6. 删除测试 harness

The harness is the instrument, not the deliverable. Once the report is delivered, delete the page and its fixtures unless asked to keep them.
测试 harness 是工具,而非交付物。报告提交后,除非用户要求保留,否则删除该页面及其测试数据。

Before you finish

完成前检查

MistakeFix
Every axis run against every componentKeep only the axes whose cue matches, and say which you dropped
A predicted failure reported as observedRender it, or leave it out
A rebuilt lookalike component in the harnessImport the real component from the project
Findings phrased as tasteReport what was visible on the page, or nothing
A break reported without an ownerName the domain skill whose rules diagnose it
A clean run padded with suggestions"Everything survived" plus the scenario list is the report
Judged at one width320px and a wide viewport at minimum
Harness left behindDelete it unless asked to keep it
错误修复方案
对所有组件使用所有测试维度仅保留符合依据的维度,并说明舍弃的维度
将预测的故障当作已观察到的问题报告进行渲染测试,或排除该问题
在测试 harness 中重建组件的相似版本从项目中导入真实组件
发现的问题以主观感受描述报告页面上可见的内容,或不记录
报告损坏问题但未指定负责Skill填写能诊断该问题的领域Skill名称
无问题的测试报告添加多余建议报告内容为“所有场景均正常运行”加场景列表即可
仅在一种窗口宽度下测试至少在320px和宽屏两种尺寸下测试
保留测试 harness除非用户要求,否则删除