Tdd guide

From BbgnsurfTech/claude-skills-collection · View interactive version

Tdd guide is an AI agent skill from the GitHub repository BbgnsurfTech/claude-skills-collection. Comprehensive Test Driven Development guide for engineering subagents with multi-framework support, coverage analysis, and intelligent test generation

How to use this skill

Skill file

TDD Guide - Test Driven Development for Engineering Teams

A comprehensive Test Driven Development skill that provides intelligent test generation, coverage analysis, framework integration, and TDD workflow guidance across multiple languages and testing frameworks.

Capabilities

Test Generation

TDD Workflow Support

Coverage & Metrics Analysis

Framework Integration

Comprehensive Metrics

Input Requirements

The skill supports automatic format detection for flexible input:

Source Code

Test Artifacts

Requirements (Optional)

Input Methods

Output Formats

The skill provides context-aware output optimized for your environment:

Code Files

Reports

Smart Defaults

Progressive Disclosure

How to Use

Basic Usage

@tdd-guide

I need tests for my authentication module. Here's the code:
[paste code or provide file path]

Generate comprehensive test cases covering happy path, error cases, and edge cases.

Coverage Analysis

@tdd-guide

Analyze test coverage for my TypeScript project. Coverage report: coverage/lcov.info

Identify gaps and provide prioritized recommendations.

TDD Workflow

@tdd-guide

Guide me through TDD for implementing a password validation function.

Requirements:
- Min 8 characters
- At least 1 uppercase, 1 lowercase, 1 number, 1 special char
- No common passwords

Multi-Framework Support

@tdd-guide

Convert these Jest tests to Pytest format:
[paste Jest tests]

Scripts

Core Modules

Utilities

Best Practices

Test Generation

  1. Start with Requirements: Write tests from user stories before seeing implementation
  2. Test Behavior, Not Implementation: Focus on what code does, not how it does it
  3. One Assertion Focus: Each test should verify one specific behavior
  4. Descriptive Names: Test names should read like specifications

TDD Workflow

  1. Red: Write failing test first
  2. Green: Write minimal code to make it pass
  3. Refactor: Improve code while keeping tests green
  4. Repeat: Small iterations, frequent commits

Coverage Goals

  1. Aim for 80%+: Line coverage baseline for most projects
  2. 100% Critical Paths: Authentication, payments, data validation must be fully covered
  3. Branch Coverage Matters: Line coverage alone is insufficient
  4. Don't Game Metrics: Focus on meaningful tests, not coverage numbers

Test Quality

  1. Independent Tests: Each test should run in isolation
  2. Fast Execution: Keep unit tests under 100ms each
  3. Deterministic: Tests should always produce same results
  4. Clear Failures: Assertion messages should explain what went wrong

Framework Selection

  1. Jest: JavaScript/TypeScript projects (React, Node.js)
  2. Pytest: Python projects (Django, Flask, FastAPI)
  3. JUnit: Java projects (Spring, Android)
  4. Vitest: Modern Vite-based projects

Multi-Language Support

TypeScript/JavaScript

Python

Java

Limitations

Scope

Coverage Analysis

Test Generation

Framework Integration

When NOT to Use This Skill

Example Workflows

Workflow 1: Generate Tests from Requirements

Input: User story + API specification
Process: Parse requirements → Generate test cases → Create test stubs
Output: Complete test files ready for implementation

Workflow 2: Improve Coverage

Input: Coverage report + source code
Process: Identify gaps → Suggest tests → Generate test code
Output: Prioritized test cases for uncovered code

Workflow 3: TDD New Feature

Input: Feature requirements
Process: Guide red-green-refactor → Validate each step → Suggest refactorings
Output: Well-tested feature with clean code

Workflow 4: Framework Migration

Input: Tests in Framework A
Process: Parse tests → Translate patterns → Generate equivalent tests
Output: Tests in Framework B with same coverage

Integration Points

CI/CD Integration

IDE Integration

Code Review

Version Support

Related Skills

This skill works well with:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.