| title | Organization Rules |
|---|---|
| description | Configure global rules that apply across all repositories in your organization |
Organization Rules allow you to specify global instructions that the Codegen agent will follow across all repositories in your organization. These rules act as organization-wide guidelines that ensure consistent behavior and standards across your entire codebase.
When you define Organization Rules, they are automatically applied to every agent run within your organization, regardless of which repository the agent is working on. This provides a centralized way to enforce:
- Coding standards and conventions
- Security practices
- Documentation requirements
- Git workflow preferences
- Communication styles
Organization Rules work in conjunction with Repository Rules to provide flexible rule management:
- Organization Rules are applied first as the baseline for all repositories
- Repository Rules can override or extend Organization Rules for specific repositories
- If both are defined, Repository Rules take precedence for conflicting instructions
This hierarchy allows you to set organization-wide defaults while still maintaining repository-specific customizations when needed.
To configure Organization Rules:
- Navigate to your organization settings
- Select Organization Rules from the sidebar
- Enter your rules in the text area provided
- Click Save to apply the rules
Here are some common examples of Organization Rules:
Always use git add . when staging changes for commit
Never use git push --force under any circumstances
Always create descriptive commit messages following conventional commit format
Always include comprehensive error handling in new functions
Follow the existing code style and formatting conventions
Add unit tests for any new functionality
Include JSDoc comments for all public functions
Never commit sensitive information like API keys or passwords
Always validate user input before processing
Use environment variables for configuration values
Update README files when adding new features
Include inline comments for complex logic
Document any breaking changes in commit messages
- Write rules that are easy to understand and follow
- Be specific about what you want the agent to do or avoid
- Use clear, actionable language
- Ensure Organization Rules don't contradict each other
- Consider how they might interact with Repository Rules
- Test rules with different types of tasks
- Periodically review your Organization Rules for relevance
- Update rules as your organization's practices evolve
- Remove outdated or unnecessary rules
- Use Organization Rules for truly universal standards
- Reserve Repository Rules for project-specific requirements
- Avoid duplicating rules between levels
If your Organization Rules don't seem to be working:
- Check Rule Syntax: Ensure your rules are clearly written and unambiguous
- Verify Save: Make sure you clicked "Save" after entering your rules
- Repository Override: Check if Repository Rules are overriding your Organization Rules
- Rule Conflicts: Look for contradictory instructions that might confuse the agent
If the agent isn't following your rules as expected:
- Simplify Rules: Break complex rules into smaller, more specific instructions
- Add Context: Provide more context about when and how rules should be applied
- Test Incrementally: Add rules gradually to identify which ones work best
- Repository Rules: Set repository-specific rules that can override Organization Rules
- Agent Permissions: Control what actions the agent can perform
- Model Configuration: Configure which AI model the agent uses
Organization Rules provide a powerful way to maintain consistency across your entire organization while still allowing flexibility for individual repositories. Use them to establish your organization's coding culture and ensure all agent interactions align with your standards.