Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Cross-language testing strategies and patterns. Triggers on: test pyramid, unit test, integration test, e2e test, TDD, BDD, test coverage, mocking strategy, test doubles, test isolation.
.claude/skills/aiskillstore-testing-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -15% | 0% |
| case-06 | ✓→✗ | ▼ Worse | 13% | 0% |
| case-17 | ✓→✗ | ▼ Worse | 108% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 6% | 0% |
When to Use: Writing tests for new features, agents, API routes
Command: npm run test Required: 100% pass rate Location: tests/ directory
typescriptimport { describe, it, expect, vi, beforeEach } from 'vitest'; import { MyService } from '@/lib/services/my-service'; describe('MyService', () => { let service: MyService; beforeEach(() => { vi.clearAllMocks(); service = new MyService(); }); it('should process data correctly', () => { const input = { value: 42 }; const result = service.process(input); expect(result).toBeDefined(); expect(result.value).toBe(42); }); it('should handle errors', () => { expect(() => service.process(null)).toThrow(); }); });
typescriptimport { describe, it, expect, vi } from 'vitest'; import { MyAgent } from '@/lib/agents/my-agent'; // Mock Supabase vi.mock('@supabase/supabase-js', () => ({ createClient: vi.fn(() => ({ from: vi.fn(() => ({ select: vi.fn().mockReturnThis(), eq: vi.fn().mockResolvedValue({ data: [], error: null }) })) })) })); describe('MyAgent', () => { it('processes task successfully', async () => { const agent = new MyAgent(); const task = { id: 'test-1', workspace_id: 'ws-123', task_type: 'test', payload: {}, priority: 5, retry_count: 0, max_retries: 3 }; const result = await agent.processTask(task); expect(result).toBeDefined(); }); });
typescriptimport { describe, it, expect } from 'vitest'; import { GET } from '@/app/api/my-endpoint/route'; import { NextRequest } from 'next/server'; describe('GET /api/my-endpoint', () => { it('requires workspace_id', async () => { const req = new NextRequest('http://localhost:3008/api/my-endpoint'); const response = await GET(req); const data = await response.json(); expect(response.status).toBe(400); expect(data.error).toContain('workspaceId required'); }); });
typescriptconst mockSelect = vi.fn().mockReturnThis(); const mockEq = vi.fn().mockReturnThis(); const mockInsert = vi.fn().mockReturnThis(); const mockFrom = vi.fn(() => ({ select: mockSelect, eq: mockEq, insert: mockInsert })); vi.mock('@supabase/supabase-js', () => ({ createClient: vi.fn(() => ({ from: mockFrom })) })); // Set return values mockEq.mockResolvedValue({ data: [{ id: '1', name: 'Test' }], error: null });
Target: 100% pass rate (no failures allowed)
Standard: All code must have tests, all tests must pass
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,850 | 9,341 | -33% | 1 | 1 | 0% | 2,811 | 2,627 | -7% | 0 | 0 | — |
case-02 | fail→pass | 16,247 | 9,320 | -43% | 1 | 1 | 0% | 3,181 | 2,701 | -15% | 0 | 0 | — |
case-03 | pass→pass | 8,212 | 4,409 | -46% | 1 | 1 | 0% | 1,584 | 1,672 | +6% | 0 | 0 | — |
case-04 | pass→pass | 6,248 | 3,114 | -50% | 1 | 1 | 0% | 1,073 | 1,444 | +35% | 0 | 0 | — |
case-05 | fail→fail | 14,181 | 10,608 | -25% | 1 | 1 | 0% | 2,335 | 2,675 | +15% | 0 | 0 | — |
case-06 | pass→fail | 18,540 | 16,358 | -12% | 1 | 1 | 0% | 3,390 | 3,814 | +13% | 0 | 0 | — |
case-07 | pass→pass | 11,705 | 3,717 | -68% | 1 | 1 | 0% | 2,021 | 1,495 | -26% | 0 | 0 | — |
case-08 | pass→pass | 8,506 | 4,114 | -52% | 1 | 1 | 0% | 1,473 | 1,503 | +2% | 0 | 0 | — |
case-09 | pass→pass | 17,030 | 13,160 | -23% | 1 | 1 | 0% | 2,975 | 3,270 | +10% | 0 | 0 | — |
case-10 | pass→pass | 5,295 | 3,486 | -34% | 1 | 1 | 0% | 909 | 1,419 | +56% | 0 | 0 | — |
case-11 | pass→pass | 15,961 | 13,422 | -16% | 1 | 1 | 0% | 2,764 | 3,195 | +16% | 0 | 0 | — |
case-12 | pass→pass | 18,875 | 7,479 | -60% | 1 | 1 | 0% | 1,873 | 2,404 | +28% | 0 | 0 | — |
case-13 | pass→pass | 17,218 | 10,005 | -42% | 1 | 1 | 0% | 3,078 | 2,635 | -14% | 0 | 0 | — |
case-14 | pass→pass | 16,070 | 8,849 | -45% | 1 | 1 | 0% | 3,017 | 2,610 | -13% | 0 | 0 | — |
case-15 | pass→pass | 8,954 | 5,937 | -34% | 1 | 1 | 0% | 1,681 | 1,874 | +11% | 0 | 0 | — |
case-16 | pass→pass | 6,132 | 2,568 | -58% | 1 | 1 | 0% | 923 | 1,148 | +24% | 0 | 0 | — |
case-17 | pass→fail | 5,508 | 4,271 | -22% | 1 | 1 | 0% | 751 | 1,561 | +108% | 0 | 0 | — |
case-18 | pass→pass | 23,103 | 5,701 | -75% | 1 | 1 | 0% | 2,432 | 2,018 | -17% | 0 | 0 | — |
case-19 | pass→pass | 13,224 | 5,315 | -60% | 1 | 1 | 0% | 2,147 | 1,878 | -13% | 0 | 0 | — |
case-20 | pass→pass | 4,312 | 3,245 | -25% | 1 | 1 | 0% | 690 | 1,398 | +103% | 0 | 0 | — |
case-21 | pass→pass | 2,530 | 2,653 | +5% | 1 | 1 | 0% | 356 | 1,239 | +248% | 0 | 0 | — |
case-22 | pass→pass | 3,317 | 2,213 | -33% | 1 | 1 | 0% | 428 | 1,208 | +182% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of -33 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.