一键导入
tests
Good vs bad tests (integration-style, public API, behavior not implementation). Use when writing or reviewing tests, or paired with TDD and mocking skills.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Good vs bad tests (integration-style, public API, behavior not implementation). Use when writing or reviewing tests, or paired with TDD and mocking skills.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reduz consumo de tokens e créditos no Cursor com leitura mínima de contexto. Use quando o usuário pedir para "ler só o necessário", diminuir custo, definir .cursorignore/.gitignore, limitar escopo, ou trabalhar com contexto grande.
Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved under ./prd/PRD-NNN-feature-slug/plan.md (see prd/INDEX.md). Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions "tracer bullets".
Deep vs shallow modules (Ousterhout). Use when designing APIs, reviewing module boundaries, or when the user wants smaller interfaces with richer implementations.
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
Interface design for testability (dependency injection, pure results, small surface). Use when designing APIs, reviewing testability, or refactoring for tests.
When and how to mock (system boundaries only, DI, SDK-style APIs). Use when writing tests, reviewing mocks, or the user asks what to mock.
| name | tests |
| description | Good vs bad tests (integration-style, public API, behavior not implementation). Use when writing or reviewing tests, or paired with TDD and mocking skills. |
Integration-style: Test through real interfaces, not mocks of internal parts.
// GOOD: Tests observable behavior
test("user can checkout with valid cart", async () => {
const cart = createCart();
cart.add(product);
const result = await checkout(cart, paymentMethod);
expect(result.status).toBe("confirmed");
});
Characteristics:
Implementation-detail tests: Coupled to internal structure.
// BAD: Tests implementation details
test("checkout calls paymentService.process", async () => {
const mockPayment = jest.mock(paymentService);
await checkout(cart, payment);
expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
});
Red flags:
// BAD: Bypasses interface to verify
test("createUser saves to database", async () => {
await createUser({ name: "Alice" });
const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
expect(row).toBeDefined();
});
// GOOD: Verifies through interface
test("createUser makes user retrievable", async () => {
const user = await createUser({ name: "Alice" });
const retrieved = await getUser(user.id);
expect(retrieved.name).toBe("Alice");
});