Context files in your repository
cubic automatically detects and uses context files in your repository, includingREADME.md
, context.md
, AGENTS.md
, .cursorrules
, and files in .ai/
directories. These files help the AI understand your project structure, conventions, and guidelines without any additional configuration.
View all supported context files
View all supported context files
README files
README.md
,readme.txt
,ReadMe.rst
(any variation)read.me
,read-me.md
AGENTS.md
- OpenAI/Codex instructionsclaude.md
- Claude-specific guidelines.cursorrules
,.cursor.json
- Cursor editor rulescopilot-instructions.md
,copilot.yaml
- GitHub Copilot configuration.coderabbit.yaml
- CodeRabbit configuration
context.md
- General project contextproject_context.md
- Project-specific informationllm-context.md
- LLM-specific guidelinesai_guidelines.md
- AI coding assistant instructionsCODEBASE-CONTEXT.md
- Codebase overview- Any file ending with
-context.md
(e.g.,auth-context.md
,api-context.md
)
- Files in the
.ai/
directory - Files in the
.cursor/
directory - Files in the
.github/
directory - Files in the
.continue/
directory
What to include in context files
Effective context files typically include:- Architecture overview: High-level system design and component relationships
- Coding conventions: Team-specific patterns and practices
- Domain knowledge: Business logic and terminology
- Common patterns: Preferred approaches for common tasks
- Dependencies: Key libraries and their usage patterns
Manual instructions via settings
For repository-specific guidelines that don’t fit into files, you can add custom instructions directly in the cubic dashboard. Navigate to AI review settings and use the AI review instructions field to provide plaintext instructions that will be included in every review.
- Temporary guidelines during migrations or refactoring
- High-priority reminders that need immediate attention
- General review preferences that apply across the entire codebase
AI review instructions are configured at the repository level. Different repositories can have
different instructions based on their specific needs.
Custom rules for specific checks
When you want cubic to actively flag specific issues or patterns, use custom rules instead of general context. Custom rules are ideal for:- Enforcing specific coding standards
- Detecting anti-patterns unique to your codebase
- Preventing known security vulnerabilities
- Ensuring compliance with team conventions
Best practices
Start with README files
Start with README files
Your main README is the most important context file. Ensure it clearly explains the project’s purpose, architecture, and key conventions.
Keep context files up to date
Keep context files up to date
Outdated context can lead to incorrect suggestions. Review and update your context files
regularly, especially after major architectural changes.
Be specific and actionable
Be specific and actionable
Provide concrete examples and clear guidelines. Instead of “write good code,” specify “use React
hooks instead of class components” or “prefer async/await over Promise chains.”
Organize by domain
Organize by domain
For large projects, create separate context files for different domains (e.g.,
frontend-context.md
, backend-context.md
) to keep information focused and manageable.Use custom rules for enforcement
Use custom rules for enforcement
Context files provide background information, while custom rules actively flag violations. Use custom rules when you need cubic to consistently catch specific issues.