A framework for Test-Driven Development with automated setup, test coverage monitoring, and project analysis.
- Automated setup for Node.js, TypeScript, React, Drupal, and PHP projects
- Test framework integration for Jest, PHPUnit, Vitest, and Mocha
- Test coverage tracking with configurable thresholds
- RED-GREEN-REFACTOR workflow guidance
- 7 built-in presets: Enterprise, Startup, React, CLI, API, Library, and Drupal
- Quick setup with single command
- Automatic project type detection
- Custom preset creation
- Analysis of existing projects for TDD adoption
- Migration planning with step-by-step instructions
- Backup and rollback capabilities
- Batch project processing
- Cursor IDE integration with
.cursorrules
generation - Claude Code integration with
CLAUDE.md
files - Code quality recommendations
- TDD compliance analysis
- Integration with Drupal AI ecosystem (
drupal:ai
,drupal:eca
) - Service pattern validation for dependency injection
- ECA workflow generation for automation
- AI service testing patterns
- Node.js/TypeScript with Jest integration
- React applications with testing utilities
- PHP/Drupal with PHPUnit integration
- CLI tools with testing frameworks
npm install -g @bluefly/tddai
# Initialize TDD in existing project
tddai init
# Use a preset for quick setup
tddai preset apply enterprise
# Analyze project for TDD compliance
tddai analyze
# Run TDD workflow
tddai tdd start
# Initialize with automatic detection
tddai init
# Initialize with specific preset
tddai init --preset=react
# Initialize with custom configuration
tddai init --config=custom-config.yml
# List available presets
tddai preset list
# Apply preset to current project
tddai preset apply startup
# Create custom preset
tddai preset create my-preset
# Start TDD workflow
tddai tdd start
# Run specific phase
tddai tdd red # Write failing test
tddai tdd green # Write minimal code
tddai tdd refactor # Improve code
# Monitor compliance
tddai monitor
# Analyze current project
tddai analyze
# Generate migration plan
tddai migrate plan
# Execute migration
tddai migrate execute
# Validate TDD compliance
tddai validate
project:
type: "typescript"
framework: "jest"
testing:
coverage_threshold: 95
test_pattern: "**/*.test.ts"
tdd:
enforce_workflow: true
auto_watch: true
ai:
cursor_integration: true
claude_integration: true
name: "enterprise"
description: "Enterprise TypeScript project"
files:
- template: "jest.config.ts"
- template: "tsconfig.json"
- template: ".cursorrules"
- template: "CLAUDE.md"
dependencies:
- "jest"
- "typescript"
- "@types/jest"
scripts:
test: "jest"
test:watch: "jest --watch"
test:coverage: "jest --coverage"
-
tddai init
- Initialize TDD framework -
tddai analyze
- Analyze project compliance -
tddai validate
- Validate TDD compliance -
tddai monitor
- Real-time compliance monitoring
-
tddai preset list
- List available presets -
tddai preset apply <name>
- Apply preset -
tddai preset create <name>
- Create custom preset
-
tddai tdd start
- Start TDD workflow -
tddai tdd red
- RED phase (failing test) -
tddai tdd green
- GREEN phase (minimal code) -
tddai tdd refactor
- REFACTOR phase
-
tddai migrate plan
- Generate migration plan -
tddai migrate execute
- Execute migration -
tddai migrate rollback
- Rollback changes
# Initialize Drupal project
tddai init --preset=drupal
# Enable AI integration
tddai drupal:ai enable
# Generate ECA workflows
tddai drupal:eca generate
// Generated test pattern
class MyServiceTest extends KernelTestBase {
protected function setUp(): void {
parent::setUp();
$this->installConfig(['my_module']);
}
public function testServiceIntegration(): void {
$service = $this->container->get('my_module.my_service');
$this->assertInstanceOf(MyService::class, $service);
}
}
import { TDDAIFramework } from '@bluefly/tddai';
const tddai = new TDDAIFramework();
// Initialize project
await tddai.init({
preset: 'typescript',
coverage: 95
});
// Analyze compliance
const analysis = await tddai.analyze();
console.log(`Compliance: ${analysis.compliance}%`);
// Apply preset
await tddai.preset.apply('enterprise');
import { TDDAIPlugin } from '@bluefly/tddai';
export class CustomPlugin extends TDDAIPlugin {
name = 'custom-plugin';
async init(config: Config): Promise<void> {
// Plugin initialization
}
async analyze(project: Project): Promise<Analysis> {
// Custom analysis logic
}
}
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test suite
npm run test:unit
npm run test:integration
git clone https://gitlab.bluefly.io/llm/tddai.git
cd tddai
npm install
npm run build
- Fork the repository on GitLab
- Create feature branch
- Write tests for new features
- Ensure all tests pass
- Submit merge request
MIT