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
This guide covers the TDD integration within the Specification-Driven Development workflow.
TDD in SDD follows the classic RED/GREEN cycle, integrated into the task implementation workflow:
brainstorm → spec-to-tasks → task-tdd (RED) → task-implementation (GREEN) → task-review → code-cleanupThe key difference from traditional TDD: tests are generated from the specification's acceptance criteria, ensuring tests validate the documented requirements.
Generate failing tests before writing any production code.
/specs:task-tdd --lang=spring --task="docs/specs/001-user-auth/tasks/TASK-002.md"Task Parsing (specs-task-tdd-parser.py hook)
Test Skeleton Generation (specs-task-tdd-generator.py hook)
RED Phase Verification (specs-task-tdd-red-phase.py hook)
Task File Update (specs-task-tdd-updater.py hook)
Implementation Handoff (specs-task-tdd-handoff.py hook)
_drift/tdd-handoff-TASK-XXX.mdFor a Spring Boot JWT token service task:
// Generated: src/test/java/com/example/auth/JwtTokenServiceTest.java
class JwtTokenServiceTest {
private JwtTokenService jwtTokenService;
@BeforeEach
void setUp() {
jwtTokenService = new JwtTokenService(secretKey, expirationMs);
}
// AC-01: Generate valid JWT token from user credentials
@Test
void shouldGenerateValidJwtToken() {
// Given
UserDetails user = User.builder()
.username("testuser")
.password("encoded-password")
.roles("USER")
.build();
// When
String token = jwtTokenService.generateToken(user);
// Then
assertThat(token).isNotNull();
assertThat(jwtTokenService.extractUsername(token)).isEqualTo("testuser");
}
// AC-02: Validate token and return user details
@Test
void shouldValidateTokenAndReturnUsername() {
// ... failing test
}
// AC-03: Reject expired tokens
@Test
void shouldRejectExpiredTokens() {
// ... failing test
}
// AC-04: Support token refresh within grace period
@Test
void shouldSupportTokenRefreshWithinGracePeriod() {
// ... failing test
}
}All tests fail because JwtTokenService doesn't exist yet.
| Language | Framework | Test File Pattern | Template |
|---|---|---|---|
| Spring | JUnit 5 + Mockito | *Test.java | spring-test-template.java |
| Java | JUnit 5 | *Test.java | java-test-template.java |
| NestJS | Jest | *.spec.ts | nestjs-test-template.spec.ts |
| TypeScript | Jest / Mocha | *.spec.ts | typescript-test-template.spec.ts |
| React | Jest + RTL | *.test.tsx | react-test-template.test.tsx |
| Node.js | Jest | *.test.ts | nodejs-test-template.test.ts |
| Python | pytest | test_*.py | python-test-template.py |
| PHP | PHPUnit | *Test.php | php-test-template.php |
Templates are located at: hooks/test-templates/
Implement production code to make the failing tests pass.
/specs:task-implementation --lang=spring --task="docs/specs/001-user-auth/tasks/TASK-002.md"The implementation command detects the TDD handoff artifact and:
After implementing JwtTokenService:
# Tests now pass
./mvnw test -Dtest=JwtTokenServiceTest
# Results:
# Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
# GREEN ✓# Already have specification and tasks generated
/specs:spec-to-tasks --lang=nestjs docs/specs/002-notification-system/---
id: TASK-002
title: Implement notification template engine
lang: nestjs
status: pending
provides: [TemplateEngineService, RenderedTemplate]
expects: [TemplateRepository]
---Acceptance Criteria:
{{variable}}{{#if condition}}...{{/if}}/specs:task-tdd --lang=nestjs --task="docs/specs/002-notification/tasks/TASK-002.md"Generates:
// src/template-engine/template-engine.service.spec.ts
describe('TemplateEngineService', () => {
let service: TemplateEngineService;
beforeEach(() => {
service = new TemplateEngineService();
});
// AC-01: Parse template with variable placeholders
it('should parse template with variable placeholders', () => {
const template = 'Hello {{name}}, welcome to {{platform}}!';
const context = { name: 'Alice', platform: 'Developer Kit' };
const result = service.render(template, context);
expect(result).toBe('Hello Alice, welcome to Developer Kit!');
});
// AC-02: Handle missing variables gracefully
it('should handle missing variables gracefully', () => {
const template = 'Hello {{name}}!';
const context = {};
const result = service.render(template, context);
expect(result).toBe('Hello !');
});
// AC-03: Support conditional blocks
it('should support conditional blocks', () => {
const template = 'Order {{#if premium}}priority{{/if}} shipping';
const context = { premium: true };
const result = service.render(template, context);
expect(result).toBe('Order priority shipping');
});
// AC-04: Cache compiled templates
it('should cache compiled templates', () => {
const template = 'Hello {{name}}!';
// First render compiles
service.render(template, { name: 'Alice' });
// Second render uses cache
const result = service.render(template, { name: 'Bob' });
expect(result).toBe('Hello Bob!');
expect(service.getCacheSize()).toBe(1);
});
});Tests fail: TemplateEngineService doesn't exist.
/specs:task-implementation --lang=nestjs --task="docs/specs/002-notification/tasks/TASK-002.md"Claude implements:
// src/template-engine/template-engine.service.ts
@Injectable()
export class TemplateEngineService {
private compiledTemplates = new Map<string, CompiledTemplate>();
render(template: string, context: Record<string, any>): string {
const compiled = this.getOrCompile(template);
return compiled(context);
}
getCacheSize(): number {
return this.compiledTemplates.size;
}
private getOrCompile(template: string): CompiledTemplate {
if (!this.compiledTemplates.has(template)) {
this.compiledTemplates.set(template, this.compile(template));
}
return this.compiledTemplates.get(template)!;
}
private compile(template: string): CompiledTemplate {
// Compile variable placeholders and conditionals
// ...
}
}Tests pass. Proceed to review.
/specs:task-review --lang=nestjs docs/specs/002-notification/tasks/TASK-002.md/developer-kit-specs:specs-code-cleanup --lang=nestjs --task="docs/specs/002-notification/tasks/TASK-002.md"| Scenario | Approach |
|---|---|
| Complex business logic | TDD (RED first) |
| Security-sensitive code | TDD (RED first) |
| Algorithm implementation | TDD (RED first) |
| Simple CRUD endpoints | Direct implementation |
| Boilerplate code | Direct implementation |
| UI components | Direct implementation |
TDD adds ~30% overhead per task but catches design issues early. Use it for tasks with complexity ≥50.
docs
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