원클릭으로
gen-test
Generate unit tests following project conventions. Use when the user asks to create, generate, or write tests for a file or component.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Generate unit tests following project conventions. Use when the user asks to create, generate, or write tests for a file or component.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Drive the real GUI against the real engine via the standalone dev HTTP bridge (`npm run dev:bridge`). Use whenever "does the wiring test actually hold up against real code?" matters — smoke verification, UI development with live engine state, real-engine bug repro, exploratory debugging with Chrome DevTools instruments.
Generate Playwright E2E tests following project conventions (Tauri fixture, storage isolation, helpers).
Scaffold a new React component with co-located test, shadcn/ui primitives, and barrel export registration.
Review changes and determine if PROJECT_SHADOW.md needs updating per AI_CONTRACT.md criteria. Runs automatically during code review.
Scaffold a new Tauri command across Rust backend and TypeScript frontend with proper patterns.
| name | gen-test |
| description | Generate unit tests following project conventions. Use when the user asks to create, generate, or write tests for a file or component. |
Generate unit tests for the specified file or component.
Input: A file path, component name, or utility function to test. If omitted, infer from conversation context.
Steps
foo.ts → foo.test.ts)
npx vitest run <test-file>Project Conventions
src/lib/foo.ts → src/lib/foo.test.ts, src/components/app/bar.tsx → src/components/app/bar.test.tsxvitest: describe, it, expect, vi, beforeEach, afterEachrender, screen, fireEvent, within from @/test/test-utils (NOT directly from @testing-library/react)getByRole → getByLabelText → getByText. Avoid getByTestId unless semantic queries fail. Never use snapshots.@/ path alias for imports (maps to ./src/)vitest.setup.ts — no special handling needed@/test/localStorage-helpers if needed@/test/tauri-bridge-mockdescribe blocksExample Structure
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, fireEvent } from '@/test/test-utils';
import { MyComponent } from './my-component';
describe('MyComponent', () => {
it('renders the primary action button', () => {
render(<MyComponent />);
expect(screen.getByRole('button', { name: /action/i })).toBeInTheDocument();
});
it('calls onSubmit when clicked', async () => {
const onSubmit = vi.fn();
render(<MyComponent onSubmit={onSubmit} />);
fireEvent.click(screen.getByRole('button', { name: /submit/i }));
expect(onSubmit).toHaveBeenCalledOnce();
});
});
Guardrails