ワンクリックで
v1-write-tests
Use when writing unit tests for code changes or new functionality. Triggers on "write tests", "add tests", "test this code".
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when writing unit tests for code changes or new functionality. Triggers on "write tests", "add tests", "test this code".
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when explicitly choosing which v1tamins skill fits a task. Triggers on "which v1 skill", "v1 menu", or "/v1-menu".
Use when the user explicitly requests phone-a-friend, a counterpart review, steelman, or peer consult. Triggers on /v1-phone-a-friend or $v1-phone-a-friend only.
Use when explicitly convening several peer agents to review a PR or branch. Triggers on "review board", "multi-agent review", or "fan out a review".
Use when refining working code through a quality pass, deslop, or hindsight rewrite. Triggers on "make this diff simpler", "reduce complexity", or "deslop".
Use when diagnosing a throughput bottleneck in a process, funnel, queue, or WIP system. Triggers on "where is this process stuck?", "find the bottleneck", or "too much WIP".
Use when creating a self-contained HTML page, report, or interactive explainer. Triggers on "one-page dashboard", "shareable page", or "interactive report".
| name | v1-write-tests |
| description | Use when writing unit tests for code changes or new functionality. Triggers on "write tests", "add tests", "test this code". |
| allowed-tools | ["Bash","Read","Write","Edit","Grep"] |
Add focused tests for changed behavior, bug seams, boundary cases, and regression risk using the project's existing test conventions.
Typical invocations:
/v1-write-tests [target]v1-write-tests from the skills menu or use $v1-write-tests [target]Target (optional):
Examples:
/v1-write-tests # Test all changes vs main
/v1-write-tests src/core/query.py # Test specific file
In Codex, the slash examples below map directly to $v1-write-tests ....
Backend (pytest):
tests/unit/ or tests/integration/ (follow project conventions)conftest.pyFrontend (Jest/Vitest):
__tests__/ mirroring src/ structure__mocks__/testUtils.tsStyle:
1. NEVER test mock behavior
2. NEVER add test-only methods to production classes
3. NEVER mock without understanding dependencies
Bad:
// Testing that mock exists, not real behavior
test('renders sidebar', () => {
render(<Page />);
expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument();
});
Fix: Test real component or don't mock it. If you must mock, don't assert on mock elements.
Bad: Adding destroy() to a class only because tests need cleanup.
// BAD: destroy() only used in tests
class Session {
async destroy() { /* cleanup */ }
}
// In tests
afterEach(() => session.destroy());
Fix: Put cleanup utilities in test-utils/, not production code.
// GOOD: Test utility
// test-utils/cleanup.ts
export async function cleanupSession(session: Session) {
const workspace = session.getWorkspaceInfo();
if (workspace) await workspaceManager.destroyWorkspace(workspace.id);
}
// In tests
afterEach(() => cleanupSession(session));
Bad: Mocking "to be safe" without understanding what the test depends on.
// Mock breaks test logic - method had side effects test needed!
vi.mock('ToolCatalog', () => ({
discoverAndCacheTools: vi.fn().mockResolvedValue(undefined)
}));
await addServer(config);
await addServer(config); // Should throw - but won't!
Fix: Run test with real implementation first, then add minimal mocking.
Bad: Mocking only fields you think you need.
const mockResponse = {
status: 'success',
data: { userId: '123' }
// Missing: metadata that downstream code uses
};
Fix: Mirror the complete real API response structure.
*-mock test IDsBefore each mock, ask: "Do I understand what this test actually needs?"
| Question | If No... |
|---|---|
| What side effects does the real method have? | Don't mock yet |
| Does this test depend on any of those side effects? | Mock at lower level |
| Do I fully understand what this test needs? | Run with real impl first |