# Cursor Rules – TaskLedger.Api

STACK
- C# .NET 8
- ASP.NET Core Web API
- Entity Framework Core
- SQL Server (local only)
- xUnit for tests

ARCHITECTURE
- Controllers thin
- Business logic in services
- EF Core DbContext in Infrastructure layer
- No static state

DATABASE SAFETY
- NEVER connect to or reference production databases
- SQL Server is local only (localhost)
- Migrations must be generated but NEVER applied automatically
- Always generate idempotent SQL migration scripts
- No destructive SQL (DROP DATABASE, TRUNCATE)

ALLOWED COMMANDS
- dotnet new
- dotnet restore
- dotnet build
- dotnet test
- dotnet ef migrations add
- dotnet ef migrations script --idempotent

DENIED COMMANDS
- dotnet ef database update
- sqlcmd DROP
- rm -rf
- any network calls

TESTING
- All features require unit tests
- Tests must pass via `dotnet test`

COMMITS
- Conventional commits
- One logical change per commit

BITBUCKET
- Create feature branches
- Do not push directly to main
- Open pull requests for review
