Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.
90
90%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
Generate failing tests (RED phase) from task specifications before implementation, following Test-Driven Development principles within the Specification-Driven Development workflow.
This command implements the RED phase of TDD by generating test files that reflect task requirements and verifying they fail before implementation begins. This ensures tests drive implementation rather than the reverse.
Workflow Position:
brainstorm → spec-to-tasks → task-tdd (RED) → task-implementation (GREEN) → task-review → code-cleanup → spec-sync-with-code
↑ ↑
(this command) (implementation)Input: Task file generated by /specs:spec-to-tasks
Output: Generated test files that fail (RED phase verification)
/specs:task-implementation with test files readyTask parsing and validation are handled by plugins/developer-kit-specs/hooks/specs-task-tdd-parser.py, which validates task frontmatter and extracts the Test Instructions section before generation proceeds. Shared RED-phase skeleton rendering, naming, and file location logic are handled by plugins/developer-kit-specs/hooks/specs-task-tdd-generator.py. Executable RED verification is handled by plugins/developer-kit-specs/hooks/specs-task-tdd-red-phase.py, which selects the language-appropriate runner, executes the generated test file, and reports red-confirmed vs unexpected-pass.
Task file updates are handled by plugins/developer-kit-specs/hooks/specs-task-tdd-updater.py, which preserves the task body, merges testReferences metadata into frontmatter, and writes a replaceable RED-phase summary block. Implementation handoff preparation is handled by plugins/developer-kit-specs/hooks/specs-task-tdd-handoff.py, which creates _drift/tdd-handoff-*.md in the spec folder with the generated test summary, RED status, preserved task context, and the exact /specs:task-implementation command for GREEN phase.
# Basic usage - generate tests for a specific task
/specs:task-tdd --task="docs/specs/001-hotel-search/tasks/TASK-003.md"
# With language specification
/specs:task-tdd --lang=spring --task="docs/specs/001-user-auth/tasks/TASK-005.md"
/specs:task-tdd --lang=typescript --task="docs/specs/001-api-integration/tasks/TASK-012.md"
/specs:task-tdd --lang=nestjs --task="docs/specs/001-user-auth/tasks/TASK-008.md"
/specs:task-tdd --lang=react --task="docs/specs/001-ui-components/tasks/TASK-015.md"
/specs:task-tdd --lang=python --task="docs/specs/001-data-processing/tasks/TASK-007.md"
/specs:task-tdd --lang=php --task="docs/specs/001-wordpress-plugin/tasks/TASK-009.md"
# General language (template structure, language-agnostic)
/specs:task-tdd --lang=general --task="docs/specs/002-tdd-command/tasks/TASK-001.md"| Argument | Description | Required |
|---|---|---|
--task | Path to task file (from spec-to-tasks) | Yes |
--lang | Programming language/framework | Yes |
| Language | --lang Value | Test Framework | File Location |
|---|---|---|---|
| Java/Spring | spring or java | JUnit 5, Mockito | src/test/java/ |
| TypeScript/Node.js | typescript or ts | Jest, Mocha | __tests__/, *.test.ts |
| NestJS | nestjs | Jest | *.spec.ts |
| React | react | Jest, React Testing Library | *.test.tsx, *.spec.tsx |
| Python | python or py | pytest | tests/, test_*.py |
| PHP | php | PHPUnit | tests/, *Test.php |
| General | general | Template structure | Language-agnostic |
This command bridges the gap between specification and implementation:
# Generate tests for a Spring service task
/specs:task-tdd --lang=spring --task="docs/specs/001-user-service/tasks/TASK-004.md"
# Output:
# - src/test/java/com/hotels/user/UserServiceTest.java (failing tests)
# - RED phase verification: Tests fail (expected)# Generate tests for an API endpoint task
/specs:task-tdd --lang=typescript --task="docs/specs/001-api-gateway/tasks/TASK-007.md"
# Output:
# - __tests__/api-gateway.test.ts (failing tests)
# - RED phase verification: Tests fail (expected)# Generate tests for a NestJS controller task
/specs:task-tdd --lang=nestjs --task="docs/specs/001-payment-service/tasks/TASK-006.md"
# Output:
# - src/payment/payment.controller.spec.ts (failing tests)
# - RED phase verification: Tests fail (expected)# Generate tests for a React component task
/specs:task-tdd --lang=react --task="docs/specs/001-search-ui/tasks/TASK-011.md"
# Output:
# - src/components/SearchBar.test.tsx (failing tests)
# - RED phase verification: Tests fail (expected)# Generate tests for a Python service task
/specs:task-tdd --lang=python --task="docs/specs/001-data-processor/tasks/TASK-008.md"
# Output:
# - tests/test_data_processor.py (failing tests)
# - RED phase verification: Tests fail (expected)# Generate tests for a WordPress plugin task
/specs:task-tdd --lang=php --task="docs/specs/001-wp-plugin/tasks/TASK-009.md"
# Output:
# - tests/PluginTest.php (failing tests)
# - RED phase verification: Tests fail (expected)This command verifies RED status through the dedicated verifier hook:
# After test generation, run:
python3 plugins/developer-kit-specs/hooks/specs-task-tdd-red-phase.py \
--task="docs/specs/.../tasks/TASK-XXX.md" \
--lang=python \
--project-root=.
# Result statuses:
# - red-confirmed: generated tests fail as expected
# - unexpected-pass: generated tests passed unexpectedly (A4 flow)
# - execution-timeout / error JSON: RED verification could not completeIf tests accidentally pass (should not happen), the command will:
After RED phase verification, this command provides a clear handoff:
# Next step: Implement code to make tests pass
/specs:task-implementation --lang=spring --task="docs/specs/001-feature/tasks/TASK-004.md"The implementation command will:
Before that handoff, run the updater hook so the task file records:
python3 plugins/developer-kit-specs/hooks/specs-task-tdd-updater.py \
--task="docs/specs/.../tasks/TASK-XXX.md" \
--lang=python \
--project-root=.This updates the task file with:
Test Instructions block for traceabilityThen prepare the implementation handoff artifact:
python3 plugins/developer-kit-specs/hooks/specs-task-tdd-handoff.py \
--task="docs/specs/.../tasks/TASK-XXX.md" \
--lang=python \
--project-root=.This creates _drift/tdd-handoff-task-xxx.md with:
/specs:task-implementation command to run nextThis command enhances the existing SDD workflow by adding explicit TDD support:
Without TDD Command:
brainstorm → spec-to-tasks → task-implementation → task-review
(implementation first, tests later)With TDD Command:
brainstorm → spec-to-tasks → task-tdd → task-implementation → task-review
(tests first, implementation second)Both workflows are valid—the TDD command is optional and teams can choose whether to adopt TDD practices.
Generated tests follow these principles:
If generated tests pass instead of fail:
# Possible causes:
# 1. Implementation already exists (tests are testing existing code)
# 2. Test assertions are incorrect (tests aren't properly failing)
# 3. Mock/stub setup is incorrect (tests mock non-existent dependencies)
# Solution: Review test file and adjust assertionsIf your language/framework isn't listed:
# Use --lang=general for template structure
/specs:task-tdd --lang=general --task="docs/specs/001-feature/tasks/TASK-001.md"
# Output: Language-agnostic test template that you can adapt# Error: Task file not found
# Solution: Ensure you've run spec-to-tasks first
/specs:spec-to-tasks docs/specs/001-feature/
# Then run task-tdd
/specs:task-tdd --lang=spring --task="docs/specs/001-feature/tasks/TASK-001.md"/specs:brainstorm - Create functional specification from idea/specs:spec-to-tasks - Convert specification into executable tasks/specs:task-implementation - Implement a specific task (GREEN phase)/specs:task-review - Verify implementation meets requirements/developer-kit-specs:specs-code-cleanup - Final cleanup after review approvaldocs
plugins
developer-kit-ai
developer-kit-aws
agents
docs
skills
aws
aws-cli-beast
aws-cost-optimization
aws-drawio-architecture-diagrams
aws-sam-bootstrap
aws-cloudformation
aws-cloudformation-auto-scaling
aws-cloudformation-bedrock
aws-cloudformation-cloudfront
aws-cloudformation-cloudwatch
aws-cloudformation-dynamodb
aws-cloudformation-ec2
aws-cloudformation-ecs
aws-cloudformation-elasticache
references
aws-cloudformation-iam
references
aws-cloudformation-lambda
aws-cloudformation-rds
aws-cloudformation-s3
aws-cloudformation-security
aws-cloudformation-task-ecs-deploy-gh
aws-cloudformation-vpc
references
developer-kit-core
agents
commands
skills
developer-kit-devops
developer-kit-java
agents
commands
docs
skills
aws-lambda-java-integration
aws-rds-spring-boot-integration
aws-sdk-java-v2-bedrock
aws-sdk-java-v2-core
aws-sdk-java-v2-dynamodb
aws-sdk-java-v2-kms
aws-sdk-java-v2-lambda
aws-sdk-java-v2-messaging
aws-sdk-java-v2-rds
aws-sdk-java-v2-s3
aws-sdk-java-v2-secrets-manager
clean-architecture
graalvm-native-image
langchain4j-ai-services-patterns
references
langchain4j-mcp-server-patterns
references
langchain4j-rag-implementation-patterns
references
langchain4j-spring-boot-integration
langchain4j-testing-strategies
langchain4j-tool-function-calling-patterns
langchain4j-vector-stores-configuration
references
qdrant
references
spring-ai-mcp-server-patterns
spring-boot-actuator
spring-boot-cache
spring-boot-crud-patterns
spring-boot-dependency-injection
spring-boot-event-driven-patterns
spring-boot-openapi-documentation
spring-boot-project-creator
spring-boot-resilience4j
spring-boot-rest-api-standards
spring-boot-saga-pattern
spring-boot-security-jwt
assets
references
scripts
spring-boot-test-patterns
spring-data-jpa
references
spring-data-neo4j
references
unit-test-application-events
unit-test-bean-validation
unit-test-boundary-conditions
unit-test-caching
unit-test-config-properties
references
unit-test-controller-layer
unit-test-exception-handler
references
unit-test-json-serialization
unit-test-mapper-converter
references
unit-test-parameterized
unit-test-scheduled-async
references
unit-test-service-layer
references
unit-test-utility-methods
unit-test-wiremock-rest-api
references
developer-kit-php
developer-kit-project-management
developer-kit-python
developer-kit-specs
commands
docs
hooks
test-templates
tests
skills
developer-kit-tools
developer-kit-typescript
agents
docs
hooks
rules
skills
aws-cdk
aws-lambda-typescript-integration
better-auth
clean-architecture
drizzle-orm-patterns
dynamodb-toolbox-patterns
references
nestjs
nestjs-best-practices
nestjs-code-review
nestjs-drizzle-crud-generator
nextjs-app-router
nextjs-authentication
nextjs-code-review
nextjs-data-fetching
nextjs-deployment
nextjs-performance
nx-monorepo
react-code-review
react-patterns
shadcn-ui
tailwind-css-patterns
tailwind-design-system
references
turborepo-monorepo
typescript-docs
typescript-security-review
zod-validation-utilities
references
github-spec-kit