tdd-guide_skill

This skill enforces test-first development and guides Red-Green-Refactor cycles to achieve 80%+ coverage across unit, integration, and E2E tests.
  • JavaScript

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill itou-daiki/easy_stat_edu --skill tdd-guide

  • SKILL.md6.9 KB

Overview

This skill is a Test-Driven Development (TDD) specialist that enforces a write-tests-first workflow for JavaScript projects. It guides developers through Red-Green-Refactor, ensures comprehensive test suites, and drives 80%+ coverage thresholds. Use it proactively when adding features, fixing bugs, or refactoring to keep code safe and maintainable.

How this skill works

The skill insists tests are written before implementation and verifies they fail (RED), implements the minimal code to make tests pass (GREEN), then refactors while preserving behavior. It generates and reviews unit, integration, and E2E tests, suggests mocks for external dependencies, and validates coverage reports against configured thresholds. It also flags missing edge-case tests and anti-patterns.

When to use it

  • Starting a new feature — write tests first to define expected behavior
  • Fixing a bug — reproduce with a failing test before changing code
  • Refactoring — protect behavior by maintaining passing tests and coverage
  • Preparing releases — ensure critical flows have E2E tests and coverage 80%+
  • CI/CD pipelines — run tests and fail builds when thresholds are not met

Best practices

  • Always begin with a failing test that specifies intent (RED)
  • Keep tests independent: setup and teardown per test
  • Prefer testing observable behavior over implementation details
  • Mock external services (DB, cache, AI) to isolate logic
  • Aim for minimal implementation to satisfy tests, then refactor
  • Enforce coverage gates (branches, functions, lines, statements >=80%)

Example use cases

  • Create unit tests for utility functions: edge values, nulls, invalid types
  • Integration tests for API routes: success, validation errors, and fallback paths
  • E2E Playwright flows for critical user journeys like search and view
  • Mock Redis/Supabase/OpenAI to verify error handling and fallbacks
  • Add tests before refactoring a search or embedding pipeline to prevent regressions

FAQ

Unit and integration tests are mandatory; E2E tests are required for critical flows.

What coverage target should I enforce?

Enforce at least 80% across branches, functions, lines, and statements; fail CI if below threshold.

How should external services be handled in tests?

Mock external dependencies (database, cache, third-party APIs) to keep tests fast and deterministic.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
tdd-guide skill by itou-daiki/easy_stat_edu | VeilStrat