Files
rustfs/CLAUDE.md
安正超 581607da6a feat: optimize AI rules with unified .rules.md (#401)
* feat: optimize AI rules with unified .rules.md and entry points

- Create .rules.md as the central AI coding rules file
- Add .copilot-rules.md as GitHub Copilot entry point
- Add CLAUDE.md as Claude AI entry point
- Incorporate principles from rustfs.com project
- Add three critical rules:
  1. Use English for all code comments and documentation
  2. Clean up temporary scripts after use
  3. Only make confident modifications

* Update CLAUDE.md

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-08-14 00:18:09 +08:00

2.6 KiB

Claude AI Rules for RustFS Project

Core Rules Reference

This project follows the comprehensive AI coding rules defined in .rules.md. Please refer to that file for the complete set of development guidelines, coding standards, and best practices.

Claude-Specific Configuration

When using Claude for this project, ensure you:

  1. Review the unified rules: Always check .rules.md for the latest project guidelines
  2. Follow branch protection: Never attempt to commit directly to main/master branch
  3. Use English: All code comments, documentation, and variable names must be in English
  4. Clean code practices: Only make modifications you're confident about
  5. Test thoroughly: Ensure all changes pass formatting, linting, and testing requirements
  6. Clean up after yourself: Remove any temporary scripts or test files created during the session

Quick Reference

Critical Rules

  • 🚫 NEVER commit directly to main/master branch
  • ALWAYS work on feature branches
  • 📝 ALWAYS use English for code and documentation
  • 🧹 ALWAYS clean up temporary files after use
  • 🎯 ONLY make confident, necessary modifications

Pre-commit Checklist

# Before committing, always run:
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo check --all-targets
cargo test

Branch Workflow

git checkout main
git pull origin main
git checkout -b feat/your-feature-name
# Make your changes
git add .
git commit -m "feat: your feature description"
git push origin feat/your-feature-name
gh pr create

Claude-Specific Best Practices

  1. Task Analysis: Always thoroughly analyze the task before starting implementation
  2. Minimal Changes: Make only the necessary changes to accomplish the task
  3. Clear Communication: Provide clear explanations of changes and their rationale
  4. Error Prevention: Verify code correctness before suggesting changes
  5. Documentation: Ensure all code changes are properly documented in English

Important Notes

  • This file serves as an entry point for Claude AI
  • All detailed rules and guidelines are maintained in .rules.md
  • Updates to coding standards should be made in .rules.md to ensure consistency across all AI tools
  • When in doubt, always refer to .rules.md for authoritative guidance
  • Claude should prioritize code quality, safety, and maintainability over speed

See Also