Provide additional context to BugBot by creating .cursor/BUGBOT.md
files in your repository. These files help BugBot understand your project’s specific patterns, conventions, and areas of focus during code review.
How BugBot rules work
BugBot automatically includes relevant context from .cursor/BUGBOT.md
files during code review:
- Repository root: The
.cursor/BUGBOT.md
file in your repository root is always included in BugBot’s context
- Directory hierarchy: When reviewing a changed file, BugBot looks upward through the file’s directory hierarchy and includes every
.cursor/BUGBOT.md
it encounters along the way
This hierarchical approach allows you to provide both project-wide guidance and specific context for different areas of your codebase.
File structure
Organize BugBot rules by placing .cursor/BUGBOT.md
files throughout your project:
project/
.cursor/BUGBOT.md # Always included (project-wide rules)
backend/
.cursor/BUGBOT.md # Included when reviewing backend files
api/
.cursor/BUGBOT.md # Included when reviewing API files
frontend/
.cursor/BUGBOT.md # Included when reviewing frontend files
Example usage
Use BugBot rules to:
- Highlight security considerations specific to your project
- Explain domain-specific patterns and conventions
- Point out common pitfalls in particular areas of your codebase
- Provide context about architectural decisions
- Define coding standards and best practices
Example .cursor/BUGBOT.md
:
# Project Review Guidelines
## Security Focus Areas
- Always validate user input in API endpoints
- Check for SQL injection vulnerabilities in database queries
- Ensure proper authentication on protected routes
## Architecture Patterns
- Use dependency injection for services
- Follow the repository pattern for data access
- Implement proper error handling with our custom error classes
## Common Issues
- Memory leaks in React components (check useEffect cleanup)
- Missing error boundaries in UI components
- Inconsistent naming conventions (use camelCase for functions)
Responses are generated using AI and may contain mistakes.