Skip to main content
skill CX Codex

designing-tests — Claude Code skill: testing and installation

designing-tests is a skill for planning test coverage, choosing test types, and investigating failures during test additions or testing-workflow setup.

MIT ★ 1,424 updated 2026-10-06

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add CloudAI-X/claude-workflow-v2
/plugin install project-starter@claude-workflow
Open on GitHub

What designing-tests does

The skill guides testing work from deciding what needs coverage to running checks and fixing failures. It distinguishes unit, integration, and E2E tests, with critical user journeys assigned to E2E checks. Its framework suggestions include Vitest, Jest, and Playwright for JavaScript and TypeScript; pytest and Playwright for Python; and Go’s testing package with supporting tools.

Templates cover unit, integration, and browser tests. The skill also gives guidance on coverage, test-data factories, fixtures, and when to mock external services, databases, time, or random values. Example validation commands include npm test and npm test -- --coverage, plus commands for a single test file and watch mode. The sample Jest configuration sets global thresholds to 80% and src/core/ branch and function thresholds to 95%; Vitest uses test.coverage.thresholds. Treat those figures as configuration examples, not automatic targets for every project.

What it helps with

  • choose a test type for a new feature
  • cover component interactions and API contracts
  • add checks for edge cases and error handling
  • set coverage thresholds for Jest or Vitest
  • investigate failing or flaky tests

Example prompts for the agent

  • Plan tests for a new feature and identify the cases that need coverage.
  • Add integration tests for the API, including error handling.
  • Investigate the failing tests and suggest commands to check coverage.

How to install designing-tests

1Plugin marketplace

/plugin marketplace add CloudAI-X/claude-workflow-v2
/plugin install project-starter@claude-workflow

This installs the whole project-starter plugin with all its skills

2Skills CLI (Vercel)

npx skills add CloudAI-X/claude-workflow-v2 --skill designing-tests -a claude-code

3Manually: put the files in place

~/.claude/skills/designing-tests/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/designing-tests/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about designing-tests

How do I install designing-tests in Claude Code?

Add the marketplace with /plugin marketplace add CloudAI-X/claude-workflow-v2, then install the plugin with /plugin install project-starter@claude-workflow.

What does the designing-tests skill do?

It helps select test types, draft checks from templates, assess coverage, and address test failures. Its guidance spans unit, integration, and E2E testing.

Which testing tools does designing-tests recommend?

For JavaScript and TypeScript, it lists Vitest, Jest, and Playwright; for Python, pytest and Playwright; and for Go, testing, testify, httptest, and chromedp.

Source text

SKILL.md · MIT
---
name: designing-tests
description: Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.
---

# Designing Tests

### When to Load

- **Trigger**: Adding tests, test strategy planning, improving coverage, setting up testing infrastructure
- **Skip**: Non-test code changes where testing is not part of the task

## Test Implementation Workflow

Copy this checklist and track progress:

```
Test Implementation Progress:
- [ ] Step 1: Identify what to test
- [ ] Step 2: Select appropriate test type
- [ ] Step 3: Write tests following templates
- [ ] Step 4: Run tests and verify passing
- [ ] Step 5: Check coverage meets targets
- [ ] Step 6: Fix any failing tests
```

## Testing Pyramid

Apply the testing pyramid for balanced coverage:

```
        /\
       /  \     E2E Tests (10%)
      /----\    - Critical user journeys
     /      \   - Slow but comprehensive
    /--------\  Integration Tests (20%)
   /          \ - Component interactions
  /------------\ - API contracts
 /              \ Unit Tests (70%)
/________________\ - Fast, isolated
                   - Business logic focus
```

## Framework Selection

### JavaScript/TypeScript

| Type        | Recommended     | Alternative         |
| ----------- | --------------- | ------------------- |
| Unit        | Vitest          | Jest                |
| Integration | Vitest + MSW    | Jest + SuperTest    |
| E2E         | Playwright      | Cypress             |
| Component   | Testing Library | Vitest Browser Mode |

### Python

| Type        | Recommended                 | Alternative       |
| ----------- | --------------------------- | ----------------- |
| Unit        | pytest                      | unittest          |
| Integration | pytest + httpx              | pytest + requests |
| E2E         | Playwright                  | Selenium          |
| API         | pytest + FastAPI TestClient | -                 |

### Go

| Type        | Recommended        |
| ----------- | ------------------ |
| Unit        | testing + testify  |
| Integration | testing + httptest |
| E2E         | testing + chromedp |

## Test Structure Templates

### Unit Test

```javascript
describe("[Unit] ComponentName", () => {
  describe("methodName", () => {
    it("should [expected behavior] when [condition]", () => {
      // Arrange
      const input = createTestInput();

      // Act
      const result = methodName(input);

      // Assert
      expect(result).toEqual(expectedOutput);
    });

    it("should throw error when [invalid condition]", () => {
      expect(() => methodName(invalidInput)).toThrow(ExpectedError);
    });
  });
});
```

### Integration Test

```javascript
describe("[Integration] API /users", () => {
  beforeAll(async () => {
    await setupTestDatabase();
  });

  afterAll(async () => {
    await teardownTestDatabase();
  });

  it("should create user and return 201", async () => {
    const response = await request(app)
      .post("/users")
      .send({ name: "Test", email: "[email protected]" });

    expect(response.status).toBe(201);
    expect(response.body.id).toBeDefined();
  });
});
```

### E2E Test

```javascript
import { test, expect } from "@playwright/test";

test.describe("[E2E] User Registration Flow", () => {
  test("should complete registration successfully", async ({ page }) => {
    await page.goto("/register");

    await page.getByTestId("email").fill("[email protected]");
    await page.getByTestId("password").fill("SecurePass123!");
    await page.getByTestId("submit").click();

    await expect(page.locator(".welcome-message")).toBeVisible();
    await expect(page).toHaveURL("/dashboard");
  });
});
```

## Coverage Strategy

### What to Cover

- ✅ Business logic (100%)
- ✅ Edge cases and error handling (90%+)
- ✅ API contracts (100%)
- ✅ Critical user paths (E2E)
- ⚠️ UI components (snapshot + interaction)
- ❌ Third-party library internals
- ❌ Simple getters/setters

### Coverage Thresholds

Jest config shown; the Vitest equivalent is `test.coverage.thresholds` in vitest.config.

```json
{
  "coverageThreshold": {
    "global": {
      "branches": 80,
      "functions": 80,
      "lines": 80,
      "statements": 80
    },
    "src/core/": {
      "branches": 95,
      "functions": 95
    }
  }
}
```

## Test Data Management

### Factories/Builders

```javascript
// factories/user.js
export const userFactory = (overrides = {}) => ({
  id: faker.string.uuid(),
  name: faker.person.fullName(),
  email: faker.internet.email(),
  createdAt: new Date(),
  ...overrides,
});

// Usage
const admin = userFactory({ role: "admin" });
```

### Fixtures

```javascript
// fixtures/users.json
{
  "validUser": { "name": "Test", "email": "[email protected]" },
  "invalidUser": { "name": "", "email": "invalid" }
}
```

## Mocking Strategy

### When to Mock

- ✅ External APIs and services
- ✅ Database in unit tests
- ✅ Time/Date for determinism
- ✅ Random values
- ❌ Internal modules (usually)
- ❌ The code under test

### Mock Examples

```javascript
// API mocking with MSW
import { http, HttpResponse } from "msw";

export const handlers = [
  http.get("/api/users", () => {
    return HttpResponse.json([{ id: 1, name: "John" }]);
  }),
];

// Time mocking
vi.useFakeTimers();
vi.setSystemTime(new Date("2024-01-01"));
```

## Test Validation Loop

After writing tests, run this validation:

```
Test Validation:
- [ ] All tests pass: `npm test`
- [ ] Coverage meets thresholds: `npm test -- --coverage`
- [ ] No flaky tests (run multiple times)
- [ ] Tests are independent (order doesn't matter)
- [ ] Test names clearly describe behavior
```

If any tests fail, fix them before proceeding. If coverage is below target, add more tests for uncovered code paths.

```bash
# Run tests
npm test

# Run with coverage
npm test -- --coverage

# Run specific test file
npm test -- path/to/test.spec.ts

# Run in watch mode during development
npm test -- --watch
```

© CloudAI-X · MIT · CloudAI-X/claude-workflow-v2

Similar skills

All skills for Testing and QA →

From the same set46

The whole set →
managing-git managing-git guides Claude Code through Git workflows, branch naming conventions, Conventional Commits formatting, and pull request review checklists. CX Codex +1 ★ 1,424repo stars code-reviewer code-reviewer — a Claude subagent that reads the changed files first, then reports findings by severity: correctness, security, performance, tests. CX Codex ★ 1,424repo stars designing-architecture designing-architecture — a skill that guides you through selecting an architecture pattern, evaluating project size and team capacity, and structuring your codebase. CX Codex +1 ★ 1,424repo stars optimizing-performance optimizing-performance guides performance profiling and tuning across frontend, backend, and database layers. It enforces measuring baselines before touching code and verifying against latency targets. CX Codex +1 ★ 1,424repo stars debugger debugger finds root causes for test failures, memory leaks, and crashes. The subagent tests hypotheses systematically instead of guessing fixes. CX Codex ★ 1,424repo stars docs-writer The docs-writer subagent reads the implementation before creating or updating docs. Use it for README files, API references, guides, and documentation changes tied to code updates. CX Codex ★ 1,424repo stars parallel-execution parallel-execution — a skill for launching several independent tasks simultaneously using the Agent tool. Speeds up work by a factor of N when tasks don't depend on each other. CX Codex +1 ★ 1,424repo stars tutorial tutorial is a Claude Code command that introduces plugin agents, commands, hooks, and skills through practical examples without editing project files. CX Codex +1 ★ 1,424repo stars

Project sponsors

Companies that keep this analytics open