# Cursor AI Agent Rules for C# Projects

**⚠️ IMPORTANT: This file is specifically for Cursor IDE**

For complete AI agent rules that work with any AI assistant (Cursor, GitHub Copilot, ChatGPT, Claude, etc.), please read:

## 📚 Complete Rules

**[AGENTS_RULES.md](./AGENTS_RULES.md)** - Complete AI agent rules (works with all AI assistants)

This file contains all the detailed rules, workflows, and guidelines for C# projects.

---

## Quick Summary for Cursor

### Workflow
1. **Learning** → Read README.md and CONTRIBUTING.md
2. **Planning** → Discuss and get approval for todo-list
3. **Test** → Write tests first (TDD)
4. **Development** → Implement with C# best practices
5. **Commit** → Only after tests pass (90% coverage) and user approval

### Key Principles
- ✅ Test-Driven Development (TDD) - 90% minimum coverage
- ✅ Domain-Driven Design (DDD) - Business vocabulary first
- ✅ Result pattern - Railway-Oriented Programming
- ✅ Fail-fast error handling - No default values to mask issues
- ✅ Type safety - Wrap primitives in types
- ✅ Immutability - Use records and readonly properties
- ✅ Async/await - For all I/O operations
- ✅ Modern C# - Use C# 12+ features

### Build & Test
```bash
# Build
dotnet.exe build

# Run tests with coverage
dotnet.exe test --filter "Category!=End2EndPipelineTests" \
  /p:CollectCoverage=true \
  /p:CoverletOutputFormat=cobertura \
  /p:ExcludeByAttribute="GeneratedCodeAttribute"
```

### Git Commit Format
All commits must use the `(agt)` prefix:
- `feat(agt):` - New feature
- `fix(agt):` - Bug fix
- `refac(agt):` - Refactoring
- `chore(agt):` - Cleanup
- `doc(agt):` - Documentation
- `test(agt):` - Tests only

**Remember**: Always ask permission before committing!

---

## 📖 For Complete Details

Read **[AGENTS_RULES.md](./AGENTS_RULES.md)** for the complete set of rules, examples, and guidelines.

This approach allows:
- ✅ Cursor to use this lightweight file
- ✅ Other AI agents to use AGENTS_RULES.md
- ✅ All documentation in one place
- ✅ Easy maintenance and updates
