Back to Gitlabhq

Customize GitLab Duo Agent Platform

doc/user/duo_agent_platform/customize/_index.md

18.11.22.4 KB
Original Source

You can customize the Agent Platform to match your workflow, coding standards, or project requirements.

Customization options

MethodAI featureUse cases
Use custom rules to provide instructions.- GitLab Duo Chat
  • Agents
  • Flows | - Apply personal preferences.
  • Enforce team standards. | | Create an AGENTS.md file to provide instructions. | - GitLab Duo Chat
  • Flows
  • Other non-GitLab AI coding tools | - Account for project-specific context.
  • Organize a monorepo.
  • Enforce directory-specific conventions. | | Create MR review instructions to ensure consistent and specific code review standards in your project. | - Code Review Flow | Apply:
  • Language-specific review rules.
  • Security standards.
  • Code quality requirements.
  • File-specific guidelines. | | Create Agent Skills to provide skills. | - GitLab Duo Chat
  • Flows
  • Other non-GitLab AI coding tools | - Provide shareable skills
  • Add custom slash commands |

Best practices

When you customize the Agent Platform, apply the following best practices:

  • Start with minimal, clear, and simple instructions, and add more as needed. Keep the instruction file as short as possible.

  • Make sure the instructions are specific and actionable. Provide examples as needed.

  • Choose the method that matches your use case.

  • Combine multiple methods to tailor and control how GitLab Duo behaves.

  • If you use multiple methods, consider the following file structure for your project:

    plaintext
    Project root directory
    |─ AGENTS.md                         # Applies to multiple Duo features
    |- skills/<skill-name>/
       |─ SKILL.md                       # Applies to multiple Duo features
    |─ .gitlab/duo/
       |─ chat-rules.md                  # Custom Chat-specific rules
       |─ mr-review-instructions.yaml    # Custom code review standards
       |─ ...                            # Other configuration as needed
    

    You can include other configuration files in the .gitlab/duo/ folder, such as custom flow definitions, or an MCP server configuration file.

  • Document your choices in comments to explain why certain instructions exist.

  • Protect customization files with Code Owners to manage changes.