Skip to content

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Sep 14, 2025

This PR updates the "Repo Rules" documentation to comprehensively cover the full agent rules system, including organization rules and the rule hierarchy.

Key Changes

📝 Renamed and Expanded Scope

  • Changed title from "Repository Rules" to "Agent Rules" to reflect the broader rule system
  • Updated content to cover both organization and repository rules

🏗️ Added Rule Hierarchy Documentation

  • Documented the two-level rule system: Organization Rules → Repository Rules
  • Explained rule precedence: Repository rules override organization rules when conflicts exist
  • Added clear examples showing how rules interact across levels

⚙️ Configuration Instructions

  • Added detailed steps for configuring organization rules
  • Updated repository rule configuration instructions
  • Included links to appropriate settings pages

📚 Enhanced Examples and Use Cases

  • Split examples into organization-level vs repository-level categories
  • Added practical scenarios showing rule hierarchy in action
  • Included real-world examples of coding standards, security requirements, and process rules

🔗 Improved Structure

  • Better organized content with clear sections for each rule type
  • Added helpful tips and notes about rule management
  • Maintained all existing information about automatic rule file detection

Why This Matters

The previous documentation only covered repository rules, leaving users unaware of the powerful organization-level rule capabilities. This update provides a complete picture of how teams can use Codegen's hierarchical rule system to:

  • Set organization-wide standards that apply to all repositories
  • Override those standards for specific repositories when needed
  • Maintain consistency across their entire codebase while allowing flexibility

Related

This documentation update is based on the implementation in the cloud repository, specifically:

  • Organization rules: settings_organization_rules field in Organization model
  • Repository rules: settings_agent_rules field in Repo model
  • Rule resolution logic in app/agents/prompts/builder.py

💻 View my work • 👤 Initiated by Jay Hack • 💬 Initiated in #demoAbout Codegen
⛔ Remove Codegen from PR🚫 Ban action checks

- Renamed from 'Repository Rules' to 'Agent Rules' to reflect broader scope
- Added comprehensive explanation of organization rules vs repository rules
- Documented rule hierarchy: repository rules override organization rules
- Added detailed configuration instructions for both rule types
- Included practical examples showing rule hierarchy in action
- Updated use cases to show organization-level vs repository-level examples
@codecov
Copy link

codecov bot commented Sep 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

- Added user rules as the first level in the three-tier hierarchy
- Updated rule precedence: Repository > Organization > User
- Added user rules configuration section with 'Coming Soon' note
- Included user-level rule examples for personal preferences
- Updated rule resolution process to include all three levels
- Enhanced hierarchy examples to show user, org, and repo rules working together

Co-authored-by: Jay Hack <jay@codegen.com>
@jayhack jayhack merged commit c548996 into develop Sep 14, 2025
19 checks passed
@jayhack jayhack deleted the codegen-bot/update-repo-rules-docs-1757888395 branch September 14, 2025 23:27
@github-actions
Copy link
Contributor

🎉 This PR is included in version 0.56.21 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants