Skip to content

Add Organization Rules Documentation #1117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"group": "Settings",
"pages": [
"settings/agent-permissions",
"settings/organization-rules",
"settings/repo-rules",
"settings/model-configuration"
]
Expand Down
118 changes: 118 additions & 0 deletions docs/settings/organization-rules.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
title: "Organization Rules"
description: "Configure global rules that apply across all repositories in your organization"
---

# Organization Rules

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.

## How Organization Rules Work

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

## Rule Hierarchy

Organization Rules work in conjunction with Repository Rules to provide flexible rule management:

1. **Organization Rules** are applied first as the baseline for all repositories
2. **Repository Rules** can override or extend Organization Rules for specific repositories
3. 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.

## Setting Up Organization Rules

To configure Organization Rules:

1. Navigate to your organization settings
2. Select **Organization Rules** from the sidebar
3. Enter your rules in the text area provided
4. Click **Save** to apply the rules

## Example Organization Rules

Here are some common examples of Organization Rules:

### Git Workflow Standards
```
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
```

### Code Quality Standards
```
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
```

### Security Guidelines
```
Never commit sensitive information like API keys or passwords
Always validate user input before processing
Use environment variables for configuration values
```

### Documentation Requirements
```
Update README files when adding new features
Include inline comments for complex logic
Document any breaking changes in commit messages
```

## Best Practices

### Keep Rules Clear and Specific
- 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

### Avoid Conflicting Rules
- Ensure Organization Rules don't contradict each other
- Consider how they might interact with Repository Rules
- Test rules with different types of tasks

### Regular Review and Updates
- Periodically review your Organization Rules for relevance
- Update rules as your organization's practices evolve
- Remove outdated or unnecessary rules

### Balance Global vs Repository-Specific Rules
- Use Organization Rules for truly universal standards
- Reserve Repository Rules for project-specific requirements
- Avoid duplicating rules between levels

## Troubleshooting

### Rules Not Being Applied
If your Organization Rules don't seem to be working:

1. **Check Rule Syntax**: Ensure your rules are clearly written and unambiguous
2. **Verify Save**: Make sure you clicked "Save" after entering your rules
3. **Repository Override**: Check if Repository Rules are overriding your Organization Rules
4. **Rule Conflicts**: Look for contradictory instructions that might confuse the agent

### Agent Behavior Issues
If the agent isn't following your rules as expected:

1. **Simplify Rules**: Break complex rules into smaller, more specific instructions
2. **Add Context**: Provide more context about when and how rules should be applied
3. **Test Incrementally**: Add rules gradually to identify which ones work best

## Related Settings

- **[Repository Rules](/settings/repo-rules)**: Set repository-specific rules that can override Organization Rules
- **[Agent Permissions](/settings/agent-permissions)**: Control what actions the agent can perform
- **[Model Configuration](/settings/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.

Loading