This repository contains Cursor Rules designed to enable AI-assisted Test-Driven Development (TDD). These rules teach AI coding assistants to follow proven TDD practices, ensuring high-quality, maintainable code.
Cursor Rules are specialized prompts that guide AI coding assistants (like Claude, GPT, etc.) to follow specific methodologies and best practices. Our rules encode decades of software engineering wisdom into AI-readable instructions.
Complete Test-Driven Development methodology including:
- Red-Green-Refactor cycle discipline
- Baby steps approach
- Prediction-based testing
- Common pitfall avoidance
Kent Beck's four fundamental principles:
- Tests Pass
- Reveals Intent
- No Duplication
- Fewest Elements
Micah Martin's objective code quality measurement system:
- Mass-based code complexity scoring
- Guides toward simpler, functional approaches
- Helps choose between equivalent solutions
- Copy the desired rule sections from the workspace rules
- Add them to your Cursor Rules (
.cursorrulesfile or IDE settings) - Set Rule Type to "Automatic" in Cursor settings for seamless integration
- The AI will automatically apply these methodologies
- Copy rule sections into your AI assistant's context
- Reference them when asking for coding help
- The AI will follow TDD and clean code practices
# The AI will now:
# - Write tests first
# - Take minimal steps
# - Refactor systematically
# - Apply simple design principles
# - Measure code complexity objectivelyPick what you need! Each rule set works independently:
- Use only TDD rules for test-first development
- Add Simple Design rules for cleaner code
- Include APP for complexity measurement
- Combine all for comprehensive AI-assisted development
The stack is TypeScript and Vitest, but these rules work with any programming language and testing framework.
# Installiere Abhängigkeiten
npm install
# Starte Tests
npm test
# Starte Tests im Watch-Modus
npm run devThis project is licensed under the MIT License - see the LICENSE file for details.
Feel free to copy and use the rule files in your own projects! We only ask that you give us credit when you do.