
Update repo rules at codegen.com/repos
How Repository Rules Work
When an agent is assigned a task on a repository with defined rules, those rules are automatically prepended or made available to the LLM as part of its context. This means the agent “sees” these rules alongside the actual task or prompt it receives. For example, if you have a rule like “Always use tabs for indentation,” the agent will be reminded of this preference before it starts writing or modifying code in that repository.Accessing and Configuring Repository Rules
You can typically find and configure Repository Rules within the settings page for each specific repository in the Codegen web UI.- Navigate to codegen.com/repos.
- Select the repository for which you want to set rules.
- Look for a section titled “Repository rules” or similar in the repository’s settings.

Update repo rules at codegen.com/repos
Common Use Cases and Examples
Repository rules are flexible and can be used for various purposes:- Enforcing Linting/Formatting:
- “Remember to run the linter with
npm run lintbefore committing.” - “Ensure all Python code follows PEP 8 guidelines. Use
blackfor formatting.”
- “Remember to run the linter with
- Specifying Commit Message Conventions:
- “All commit messages must follow the Conventional Commits specification.”
- “Prefix commit messages with the related Linear issue ID (e.g.,
ENG-123: ...).”
- Highlighting Project-Specific Information:
- “This repository uses TypeScript. All new backend code should be in the
/server/srcdirectory.” - “Avoid using deprecated function
old_function(). Usenew_function()instead.”
- “This repository uses TypeScript. All new backend code should be in the
- Code Style Preferences:
- “Don’t write super long strings, as this will break pre-commit. Do triple-quoted strings with newlines, non-indented, instead!” (As seen in your example image)
- “Prefer functional components over class components in React.”
- Reminders for Testing:
- “Ensure all new features have corresponding unit tests.”
- “Run integration tests with
npm run test:integrationafter significant changes.”
Repository Rules are applied in addition to any global prompting strategies
or agent capabilities. They provide a repository-specific layer of
instruction.