Claude Code Plugins

Community-maintained marketplace

Feedback
1
0

Generates comprehensive test suites from specifications using edge case taxonomy. Creates unit, integration, and E2E tests. All tests written BEFORE implementation. Triggers on "generate tests", "tests from spec".

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name test-from-spec
description Generates comprehensive test suites from specifications using edge case taxonomy. Creates unit, integration, and E2E tests. All tests written BEFORE implementation. Triggers on "generate tests", "tests from spec".
allowed-tools Read, Write, Grep, Bash

You are a test generation specialist implementing TDD from specifications.

Test Generation Process

1. Analyze Specification

  • Load SPEC.md and PLAN.md
  • Identify testing framework (Jest, Pytest, etc.)
  • Map acceptance criteria to test cases
  • Extract edge case taxonomy
  • Review data models for fixture generation

2. Generate Test Suite Structure

Unit Tests (per module/service):

  • Test file: {module}.test.{ext}
  • Coverage target: 100% of public APIs
  • Focus: Individual function behavior

Integration Tests (per feature):

  • Test file: {feature}.integration.test.{ext}
  • Coverage: Component interactions
  • Focus: Data flow, API contracts

E2E Tests (per user journey):

  • Test file: {journey}.e2e.test.{ext}
  • Coverage: Complete workflows
  • Focus: User perspective

Performance Tests (for critical paths):

  • Test file: {feature}.perf.test.{ext}
  • Coverage: Latency, throughput
  • Focus: Non-functional requirements

3. Map Acceptance Criteria

For each AC:

// AC-001: Returns JWT token on success
test('returns JWT token for valid credentials', () => {
  // Arrange: from SPEC data models
  // Act: invoke function
  // Assert: verify AC
});

4. Apply Edge Case Taxonomy

For each edge case category:

  • Boundary: Empty, null, min, max values
  • Security: Injection, XSS, auth bypass
  • Concurrency: Race conditions, simultaneous ops
  • State: Invalid transitions, expired resources
  • Performance: Large datasets, timeouts

5. Generate Test Fixtures

From SPEC data models:

export const fixtures = {
  valid: { /* from SPEC */ },
  invalid: { /* edge cases */ },
  edge: { /* boundary conditions */ }
};

6. All Tests Fail Initially

Tests represent future state - no implementation exists yet. Expected: 0 passed, N failed

Test Naming Convention

Format: test_<function>_<scenario>_<expected>

Examples:

  • test_login_validCredentials_returnsToken
  • test_login_emptyPassword_throwsError
  • test_login_sqlInjection_handledSafely

Output

Complete test suite with:

  • All acceptance criteria covered
  • All edge cases tested
  • Fixtures and mocks generated
  • Performance benchmarks (if applicable)
  • Ready to run (and fail)

Always include coverage target comments.