agentsclimarketplace

Test driven development

Skill BAKUGOS1/SkilledAgents-Toolkit/plugins/skilled-agents/skills/test-driven-development

Portable open-source Codex toolkit with reusable skills, custom agents, plugins, project profiles, validation tools, and SDK examples.

Install
npx -y skills add BAKUGOS1/SkilledAgents-Toolkit --skill test-driven-development

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when implementing any feature or bugfix in Wrkly — write the test first, watch it fail, write minimal code to pass.

SKILL.md

3.0 KB, as published. Nobody here has run it

Test-Driven Development — Wrkly Edition

Write the test first. Watch it fail. Write minimal code to pass.

Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Red-Green-Refactor Cycle

RED — Write Failing Test

// wrkly-api/tests/routes/boards.test.ts
import { describe, it, expect, vi } from 'vitest';

describe('GET /api/workspaces/:id/boards', () => {
  it('should return 401 when not authenticated', async () => {
    const response = await app.inject({
      method: 'GET',
      url: '/api/workspaces/test-id/boards',
    });
    expect(response.statusCode).toBe(401);
  });
});

Verify RED

cd wrkly-api && pnpm test
# FAIL: expected 401, got... (confirms test catches the right thing)

GREEN — Minimal Code

Write the simplest code to make the test pass. Don't over-engineer.

Verify GREEN

cd wrkly-api && pnpm test
# PASS — all green

REFACTOR — Clean Up

After green only: remove duplication, improve names, extract helpers. Keep tests green.

Wrkly-Specific Test Patterns

Route Tests (Integration)

import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import Fastify from 'fastify';

describe('POST /api/ai/command', () => {
  it('should return 503 when AI_COMMANDS feature is disabled', async () => {
    // Test feature flag gating
  });

  it('should return 400 for invalid boardId', async () => {
    // Test Zod validation
  });

  it('should parse command and return structured actions', async () => {
    // Test happy path with mocked OpenAI
  });
});

Service Tests (Unit)

import { describe, it, expect, vi } from 'vitest';
import { aiService } from '../src/services/ai';

describe('AIService.parseCommand', () => {
  it('should return actions with confidence score', async () => {
    vi.spyOn(aiService['client'].chat.completions, 'create')
      .mockResolvedValue(/* mock OpenAI response */);
    const result = await aiService.parseCommand('move all cards to Done', mockContext);
    expect(result.actions).toBeInstanceOf(Array);
    expect(result.confidence).toBeGreaterThanOrEqual(0);
  });
});

What to Mock

  • ✅ Mock: OpenAI API, Resend email, Redis, external HTTP
  • ❌ Don't mock: Prisma queries (use test DB or in-memory), Zod schemas, your own utils

Verification Checklist

  • Every new function/route has a test
  • Watched each test fail before implementing
  • Each test failed for expected reason
  • Wrote minimal code to pass each test
  • All tests pass: cd wrkly-api && pnpm test
  • Type check passes: npx tsc --noEmit
  • Edge cases and errors covered

Gives 4 of the 12 instructions most tdd skills give

Counted across 439 of the 443 authors here whose files we hold, read 2026-08-06

  • write minimal code to pass the testhere, and in 302 of 439, across 218 files
  • write a failing test firsthere, and in 176 of 439, across 112 files
  • refactor code only after tests passhere, and in 171 of 439, across 101 files
  • watch the test fail before writing codehere, and in 142 of 439, across 93 files
  • test one behavior per testin 106 of 439, across 44 files
  • refactor code while keeping tests greenin 99 of 439, across 86 files
  • delete code written before testsin 98 of 439, across 54 files
  • run tests after each refactor stepin 85 of 439, across 54 files
  • Use real code instead of mocks unless unavoidablein 64 of 439, across 21 files
  • confirm the test fails for the right reasonin 64 of 439, across 60 files
  • reproduce bugs with a test before fixingin 53 of 439, across 36 files
  • write tests before implementationin 48 of 439, across 39 files

Said here and by no other author read

  • verify type checks pass

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.