# Cursor AI Agent Rules for Perl 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 Perl 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 Perl 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 - Use Result types for error handling
- ✅ Fail-fast error handling - No default values to mask issues
- ✅ Type safety - Use Type::Tiny for type constraints
- ✅ Modern Perl - Use Perl 5.38+ with signatures
- ✅ Moose/Moo - For object-oriented programming
- ✅ Immutability - Use readonly attributes by default

### Build & Test
```bash
# Build
perl Makefile.PL
make

# Run tests with coverage
cover -delete
PERL5OPT=-MDevel::Cover prove -l t/
cover
cover -report text -coverage_threshold 90
```

**Note for WSL users**: Use `perl.exe` and `prove.exe` if targeting Windows Perl.

### 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
