Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/bovinphang/frontend-craft/fec-component-testingnpx skills add bovinphang/frontend-craft --skill fec-component-testinggit clone --depth 1 https://github.com/bovinphang/frontend-craftWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/bovinphang/frontend-craft/fec-component-testing)<a href="https://agentmods.dev/skills/bovinphang/frontend-craft/fec-component-testing"><img src="https://agentmods.dev/badge/skills/bovinphang/frontend-craft/fec-component-testing.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00123 | $0.01207 |
| Opus 5 | $0.00062 | $0.00603 |
| Sonnet 5 | $0.00025 | $0.00241 |
| Haiku 4.5 | $0.00012 | $0.00121 |
Grade A, and why
fec-component-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
组件测试
用途
用贴近代码和用户行为的测试验证纯逻辑、组件契约与轻量模块协作,减少重构和 UI 交互回归。
流程
1. 先确定测试层级
- 单元测试:纯函数、hooks/composables、utils、状态逻辑、schema。
- 组件测试:props/emits、回调、用户交互、loading/error/empty、mock 边界。
- 轻量集成测试:表单 + API mock + Router/Store/Provider 上下文。
跨页面真实浏览器流程分流到 E2E workflow;测试层选择不清楚时先做测试分层规划。
2. 优先按用户可感知行为测试
每个测试保持 Arrange / Act / Assert 清晰分段:准备数据和渲染、执行用户动作、断言用户可见结果或公开契约。
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { SearchBox } from "./SearchBox";
test("submits the entered keyword", async () => {
const user = userEvent.setup();
const onSearch = vi.fn();
render(<SearchBox onSearch={onSearch} />);
await user.type(screen.getByRole("searchbox", { name: /keyword/i }), "orders");
await user.click(screen.getByRole("button", { name: /search/i }));
expect(onSearch).toHaveBeenCalledWith("orders");
});
3. Vue 组件使用可访问查询或明确文本断言
import { mount } from "@vue/test-utils";
import UserMenu from "./UserMenu.vue";
test("emits logout when the logout item is clicked", async () => {
const wrapper = mount(UserMenu, {
props: { userName: "Ada" },
});
await wrapper.get('[data-testid="logout-button"]').trigger("click");
expect(wrapper.emitted("logout")).toHaveLength(1);
});
优先使用角色、标签和可见文本;仅在没有稳定语义时使用 data-testid。
4. 控制 mock 边界
vi.mock("../api/users", () => ({
fetchUsers: vi.fn(async () => [{ id: "1", name: "Ada" }]),
}));
- mock 网络、时间、路由和浏览器 API。
- 不 mock 被测组件的内部函数。
- 对设计系统基础组件只做轻量 mock,保留可访问行为。
- mock 数据应表达业务场景,不使用只有测试作者能理解的随意字符串。
- 共享 fixture 应保持可读,复杂对象用 builder 补默认值;每个测试只覆盖与场景相关的字段。
- mock 网络时优先模拟用户可见结果和错误形状,不复制后端实现细节。
5. 覆盖关键状态
每个复杂组件至少覆盖:
- 默认渲染。
- 用户交互和回调。
- loading / empty / error。
- 权限或禁用态。
- 键盘交互和焦点行为(适用时)。
6. 保持测试可维护
function setup() {
const user = userEvent.setup();
const onSubmit = vi.fn();
render(<ProfileForm onSubmit={onSubmit} />);
return { user, onSubmit };
}
将重复渲染逻辑放入 setup,但不要隐藏测试的核心操作和断言。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 120 lines · 123 tokens per session scan A a086fc1675db
fec-component-testing is a skill published in the GitHub repository bovinphang/frontend-craft (21 stars, last pushed 4d ago), licensed MIT. It adds 123 tokens to every session and 1,207 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
brand-design
Brand-aware design system generator that acts as Head of Brand. Translates abstract brand language into a mathematically-validated, implementation-ready design system, writes creative-brief.md as the source of truth for all UI/UX in a project, and optionally compiles it to framework tokens (Tailwind v4 @theme, v3…
deslop
去除中文网文里的 AI 味。当用户说正文"太像AI写的/有翻译腔/太工整/没人味/排比堆砌/读起来假"、嫌"无缘无故的修辞""引用奇怪跨度大/语域不一致"、嫌"重复的修辞句式""同义反复(他非常生气他怒了)""极端词太多(非常/极大)""莫名其妙的陈述句""句号当顿号""段落太对仗工整行数雷同",或要把 AI 稿改得像真人时使用。产出更口语、更有网感、风格统一的网文文字。.
english
英文网文出海写作(Wattpad / Royal Road / Webnovel / Radish / KDP)。当用户要写英文小说、出海英文平台、把中文故事改写成英文原生(不是翻译腔)、问英文平台怎么写/选哪个、或要去掉英文里的"中国网文翻译腔/AI腔"时使用。按英文网文规则产出像当地作者写的英文。.
ai-translating-content
Translate text between languages with AI while preserving brand voice and terminology. Use when translating app copy to Spanish, localizing marketing content, multilingual support tickets, i18n with AI, machine translation with brand voice, translating product descriptions, localizing help docs, batch translating i18n…
localize
Full localization pipeline: scan for hardcoded strings, extract and manage string tables, validate translations, generate translator briefings, run cultural/sensitivity review, manage VO localization, test RTL/platform requirements, enforce string freeze, and report coverage.
chinese-documentation
中文文档排版参考——中英文空格、全半角标点、术语保留、链接格式、中文文案排版指北约定。仅在用户显式 /chinese-documentation 时调用,不要根据上下文自动触发。.