|
| 1 | +# Claude AI Assistant Guidelines |
| 2 | + |
| 3 | +This document provides guidelines for AI assistants (particularly Claude) when working on the coreprotect-ruby project. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +**coreprotect-ruby** is a Ruby utility for purging old CoreProtect data in production environments. |
| 8 | + |
| 9 | +- **Language**: Ruby |
| 10 | +- **Purpose**: Database cleanup utility for Minecraft CoreProtect plugin data |
| 11 | +- **Status**: In development - use with caution |
| 12 | + |
| 13 | +## Critical Prerequisites |
| 14 | + |
| 15 | +### 1. ALWAYS Verify CONTRIBUTING.md First |
| 16 | + |
| 17 | +Before ANY work: |
| 18 | +```bash |
| 19 | +# Check if CONTRIBUTING.md is up-to-date |
| 20 | +curl -s https://denpaio.github.io/CONTRIBUTING.md | diff CONTRIBUTING.md - |
| 21 | + |
| 22 | +# If outdated, update it first |
| 23 | +curl -o CONTRIBUTING.md https://denpaio.github.io/CONTRIBUTING.md |
| 24 | +``` |
| 25 | + |
| 26 | +**Source of Truth**: https://denpaio.github.io/CONTRIBUTING.md |
| 27 | + |
| 28 | +### 2. Follow Contribution Standards |
| 29 | + |
| 30 | +All standards in `CONTRIBUTING.md` are MANDATORY: |
| 31 | +- ✅ Code comments in English (or follow existing context) |
| 32 | +- ✅ Follow Rubocop conventions (`.rubocop.yml`) |
| 33 | +- ✅ Use Conventional Commits format |
| 34 | +- ✅ Run linters before committing |
| 35 | +- ✅ Ensure all tests pass |
| 36 | + |
| 37 | +## Development Workflow |
| 38 | + |
| 39 | +### Before Making Changes |
| 40 | + |
| 41 | +1. **Verify CONTRIBUTING.md** is current (see above) |
| 42 | +2. **Read relevant code** - Never propose changes to unread code |
| 43 | +3. **Check existing conventions** in the codebase |
| 44 | +4. **Run linters** to understand current state |
| 45 | + |
| 46 | +### During Development |
| 47 | + |
| 48 | +```bash |
| 49 | +# Run Rubocop with auto-fix |
| 50 | +rubocop -A |
| 51 | + |
| 52 | +# Run tests (if available) |
| 53 | +bundle exec rake test |
| 54 | +# or |
| 55 | +bundle exec rspec |
| 56 | +``` |
| 57 | + |
| 58 | +### Before Committing |
| 59 | + |
| 60 | +1. **Lint the code**: |
| 61 | + ```bash |
| 62 | + rubocop -A |
| 63 | + ``` |
| 64 | + |
| 65 | +2. **Verify tests pass** |
| 66 | + |
| 67 | +3. **Use Conventional Commit format**: |
| 68 | + ``` |
| 69 | + type(scope): description |
| 70 | +
|
| 71 | + Examples: |
| 72 | + feat(purge): add support for filtering by action type |
| 73 | + fix(database): resolve connection timeout issue |
| 74 | + docs(readme): update installation instructions |
| 75 | + refactor(cli): simplify argument parsing |
| 76 | + ``` |
| 77 | + |
| 78 | +### Commit Types |
| 79 | +- `feat`: New feature |
| 80 | +- `fix`: Bug fix |
| 81 | +- `docs`: Documentation changes |
| 82 | +- `style`: Code style changes (formatting, etc.) |
| 83 | +- `refactor`: Code refactoring |
| 84 | +- `test`: Adding or updating tests |
| 85 | +- `chore`: Maintenance tasks |
| 86 | + |
| 87 | +## Project-Specific Guidelines |
| 88 | + |
| 89 | +### Ruby Standards |
| 90 | +- Follow Rubocop rules defined in `.rubocop.yml` |
| 91 | +- Prefer self-documenting code over comments |
| 92 | +- Use Ruby idioms and best practices |
| 93 | + |
| 94 | +### Database Operations |
| 95 | +- Be extremely careful with purge operations |
| 96 | +- Always validate timestamps and filters |
| 97 | +- Consider data safety in all changes |
| 98 | + |
| 99 | +### CLI Interface |
| 100 | +- Maintain consistency with existing Thor command structure |
| 101 | +- Provide clear help messages |
| 102 | +- Validate user input thoroughly |
| 103 | + |
| 104 | +## Code Review Checklist |
| 105 | + |
| 106 | +Before marking work complete: |
| 107 | +- [ ] CONTRIBUTING.md is up-to-date |
| 108 | +- [ ] All changes follow Rubocop conventions |
| 109 | +- [ ] Tests pass (if applicable) |
| 110 | +- [ ] Commit messages follow Conventional Commits |
| 111 | +- [ ] Code is self-documenting |
| 112 | +- [ ] No security vulnerabilities introduced |
| 113 | +- [ ] Database operations are safe and validated |
| 114 | + |
| 115 | +## Resources |
| 116 | + |
| 117 | +- **CONTRIBUTING.md**: Project contribution guidelines (MUST be current) |
| 118 | +- **README.md**: Project documentation and usage examples |
| 119 | +- **Conventional Commits**: https://www.conventionalcommits.org/ |
| 120 | +- **Rubocop**: https://rubocop.org/ |
| 121 | + |
| 122 | +--- |
| 123 | + |
| 124 | +**Remember**: Quality over speed. Always verify standards compliance before completing any task. |
0 commit comments