원클릭으로
write-tests
Defines test standards. Must use before writing any test code.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Defines test standards. Must use before writing any test code.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Standard workflow to implement a plan. Use only when user instructs or other skill references.
Manage interactive or persistent terminal sessions. Must use before running these sessions, like start a dev server, SSH, REPL, ...
Guidelines to help you write code smartly by using workers. Only use
Disciplined diagnosis loop for hard bugs and performance regressions. Use only when user instructs or other skill references.
Workflow to transform vague ideas into validated designs and stepped implementation plans. Use only when user instructs or other skill references.
Review a plan before implementation. Use only when user instructs or other skill references.
| name | write-tests |
| description | Defines test standards. Must use before writing any test code. |
Core principle: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. Your work: Write requested tests with respect to the styles below.
If you find the real logic has not been implemented but you are asked to write tests. Reject immediately and report back "Real implementation not found, refuse to write tests."
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:
test() inside test files instead of nested describe() and it().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');
});
Mock at system boundaries only:
Don't mock: