Communitygithub.com

Break — 组件压力测试

选中一个组件,在所有能到达它的场景下将其渲染到临时页面,并进行压力测试。

Break — 组件压力测试 是什么?

Break 是一个专注于组件级压力测试的智能体技能。它不进行主观审美评判,而是通过将单个组件置于所有可能的生产场景(如超长文本、空数据、不同容器宽度等)中,以视觉报告的形式暴露其边界缺陷。该技能的核心原则是“构建一次、查看一次、报告一次”,整个过程只需几分钟。它支持在任意框架(如 React、Next.js 等)的项目中使用,通过导入真实组件而非模拟副本,并强制在客户端渲染以避免数据丢失。技能不涉及浏览器调试、截图或多次加载,最终产出是一个包含所有场景渲染结果和标注的页面,配合一个发现表格,其中列出的每个缺陷明确归属到对应的领域技能(如 `better-typography`)。如果所有场景都通过,则简明报告“Everything survived”。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/LIKELION-CAPSULE/Landing_Page/tree/HEAD/.agents/skills/break

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Break

此技能取一个组件,将其渲染到一个全新页面上,置于所有实际可以到达它的场景中。生成的页面就是交付物:一份可视报告,用户可滚动浏览,所有场景并排展示,并标注出破坏点。

它只观察,不评判。这里的“发现”指页面上可见的破坏,并用负责修复领域的术语命名。对照标准审查代码是 interface-review 和 better-interface;探索设计替代方案是 variant;逐一检查组件的产品状态是 state-machine。

与 variant 坚持使用真实页面不同,本技能刻意隔离。你并非评判组件在上下文中的外观,而是检查它在最坏内容下是否能自我防御。

整个过程是:构建、查看一次、报告,只需几分钟,而非一次会议。其中没有任何理由需要检测工具、浏览器调试或第二次通过。

1. 限定一个组件

每次运行只限一个组件。“设置页面”不是组件;个人资料表单中的文本输入框才是。如果请求涉及多个组件,列出候选并询问要测试哪一个。

用一句话重述该组件是什么:它接受什么,渲染什么,以及它将在何处存在。

2. 从组件推断场景

只测试变化的量。只有当组件接受某物且该物在生产中可能呈现特定形态时,该场景才获得一席。因此,首先阅读组件:它的 props、插槽、状态以及它渲染的数据。

scenarios.md 包含了轴、每个轴上的值以及一个提示,以判断某个轴是否适用。对照组件逐项检查,只保留提示匹配的轴。文本输入框只获取内容长度和状态,从不获取项目数量。带有固定标签的静态图标按钮只获取容器和环境,从不获取长文本。

在构建前写下保留的场景,每行一个。然后以一行说明你舍弃了哪些轴以及原因,这样错误的推断也能轻易被发现。

3. 构建测试页面

一个一次性页面在单列中为每个场景渲染一次组件,每个实例上方带有简短文本标签。

应用内的一个临时路由包含真实的组件,从项目导入且保持不变。该路由自动继承应用的布局、字体、全局样式和 provider。

当框架区分服务器组件和客户端组件时,页面应为客户端代码,在 Next.js 中使用 "use client"。否则,ficture 数据可能静默丢失(跨过边界),导致页面渲染为空。

标签、容器宽度和 fixture props 是页面添加的所有内容。没有自己的字体或样式,没有模拟的主题或样式令牌交换,没有探测。在这些条件下观察到的组件是不同的组件。

将场景作为 props 和 fixture 数据传递。测试页面从不导入生产状态,从不连接到实时数据,生产中也从不从测试页面导入。

4. 查看一次

在手头的浏览器中加载页面一次,从上到下快速浏览每个场景,记下明显可见的破坏点。“文本溢出字段的右边缘”,而非“间距感觉太紧”。预期中的失败不是发现。

如果没有浏览器,请说明情况并将 URL 交给用户检查。启动、调整窗口或调试浏览器不在预算之内。当您跳过查看时,报告应为 URL 和场景列表,不包含发现表格和页面注释。

然后,在页面上为每个你看到的破坏点做标记,在该场景标签下方添加一行注释,通过一次编辑完成。页面本身需作为独立的报告。

5. 报告问题并停止

将发现以表格形式报告,首先列出有问题的场景:

场景观察结果所属领域
一个不可分割的 60 字符字符串溢出卡片,无换行,无截断better-typography
零个项目空白区域,无任何消息better-writing

本技能不拥有任何领域规则,也不做出判断。

“一切正常”是一份完整且有用的报告。说明页面上有哪些场景以及它在何处运行,以便用户可以亲眼查看每个场景。到此结束,不要用偏好设定填充结果。

未经请求,不要修复任何东西。当收到修复请求时,遵循所属领域技能的规则,然后重新渲染失败的场景以确认修复。

6. 保持页面运行,按要求删除

页面是报告的一半,因此它的生命周期应超过发现表格。让它保持运行。仅当用户表示不再需要时,才删除该页面及其 fixture 文件。然后搜索路由和 fixture 名称,并检查 diff 不留下测试页面的任何痕迹。

开始之前

错误修复
每个轴都应用于每个组件只保留提示匹配的轴,并说明舍弃了哪些
将预期失败报告为观察到渲染它,或排除它
场景缺少其输入的内容测试页面有 bug,而非组件有 bug;使页面为客户端代码并重新加载一次
在测试页面中使用重新构建的仿制组件从项目导入真实组件
测试页面重新设置样式或主题应用现有的布局、字体和令牌;只添加标签和宽度
为每个场景启动、调试或截图浏览器一次加载和一次查看,或提供 URL 并跳过查看
以审美偏好形式描述发现报告页面上可见的内容,或什么都不报告
报告了破坏点但未指定所属领域技能用诊断规则的领域技能名称来命名
干净运行却补充了建议“一切正常”加上场景列表就是报告
逐个场景调整视口大小宽度是页面上固定的容器;一次加载即可显示所有
表格中有破坏点但页面上未标记在该场景标签下做标记;页面本身需作为独立的报告
在报告的同时删除页面页面是报告的一半;只有用户明确要求时才删除

Individual skills in this repo

This repo contains 14 individual skills — each has its own dedicated page.

LIKELION-CAPSULE/Landing_Page

Reviews and fixes keyboard and focus behavior, ARIA, accessible names, forms, screen-reader announcements, motion and zoom in your project against WCAG 2.2.

LIKELION-CAPSULE/Landing_Page

Helps you build and check a color system for your project. It generates palettes, names semantic tokens, converts between formats and measures contrast.

LIKELION-CAPSULE/Landing_Page

Combines all of the `better-*` skills into a single review across accessibility, layout, writing, typography, color and UI polish.

LIKELION-CAPSULE/Landing_Page

Helps with grouping, alignment, reading order, responsive structure and room for translated text, so a layout holds up when it is resized, translated or mirrored.

LIKELION-CAPSULE/Landing_Page

Sets and reviews how text renders in your product, from the type scale and spacing to font features, wrapping, truncation and punctuation.

LIKELION-CAPSULE/Landing_Page

Polishes the surfaces, icons and motion in your project with exact values for border radius, optical alignment, shadows, icon states and animation.

LIKELION-CAPSULE/Landing_Page

Writes and reviews your interface copy, from labels and errors to empty states and confirmations, so it matches your product's voice and tells people what to do next.

LIKELION-CAPSULE/Landing_Page

Try to break a piece of UI by feeding it worst-case data — long names, unbreakable emails, one-letter names, missing fields, huge counts, zero items, long labels, non-Latin text, emoji, extreme numbers — then render it behind a "Demo data / Worst case" toggle and report everything that broke, with the fix for each. Use when the user asks to stress-test, break, or find edge cases in a component or screen, or to "try the worst case". For visual design critique use emil-design-eng; for motion use review-animations.

LIKELION-CAPSULE/Landing_Page

Builds UI from a Figma file or a design image so it matches the design, using your project's existing tokens and components.

LIKELION-CAPSULE/Landing_Page

Explains how a website, a visual effect or an animation was built, from a live URL or a screenshot.

LIKELION-CAPSULE/Landing_Page

Reviews a branch, pull request or uncommitted change for the interface problems it introduced or regressed, across accessibility, layout, writing, typography, color and UI.

LIKELION-CAPSULE/Landing_Page

Make a web app feel native on a phone — the small CSS and meta-tag fixes that separate "a website in a browser" from something that feels installed. Covers sticky hover states, tap highlight flashes, the 100vh bug, inputs that zoom the page, laggy taps, pull-to-refresh hijacking scroll, content under the notch, long-press selecting button text, carousels that scroll the wrong way, mismatched status bars, and the rule that you test on real hardware. Use when a web app is being built for or reviewed on mobile, when something "works in Chrome but feels wrong on my phone", when building a PWA, a bottom sheet, a carousel, a full-screen layout, or any touch interaction. For motion itself use animate; for React Native use animate-expo.

LIKELION-CAPSULE/Landing_Page

Renders every state of a component you choose on a throwaway page, with mock data and a switcher, so you can work on each state.

LIKELION-CAPSULE/Landing_Page

Builds multiple variants of a component you're working on and helps you iterate and pick one.

相关技能