Updated on: May 27, 2026
12 min read
Learn how to customize GitLab Duo Agent Platform. Configure chat rules, system prompts, agent tools, agent skills, and flows for your team's needs.

Welcome to Part 8 of our eight-part guide, Getting started with GitLab Duo Agent Platform, where you'll master building and deploying AI agents and workflows within your development lifecycle. Follow tutorials that take you from your first interaction to production-ready automation workflows with full customization.
In this article:
🎯 Try GitLab Duo Agent Platform today!
GitLab Duo Agent Platform delivers powerful capabilities right away, and you can unlock even greater value by tailoring it to your team's specific needs. GitLab offers several customization methods across user, workspace, and project levels. For the full matrix of methods and where they apply (Chat, agents, flows, Code Review), see the Customize GitLab Duo Agent Platform overview.
Custom rules let you set personal preferences and team standards that guide how GitLab Duo Chat, agents, flows, and the GitLab Duo CLI behave — for example, coding style, documentation conventions, or how tests should be written.
Custom rules are available on all supported platforms. For the exact list of supported features (Chat, agents, flows, CLI) and version requirements, see the Custom rules documentation.
User-level rules apply to all your projects. They apply in your local environment (editor extensions and GitLab Duo CLI). For details on where they are honored and all supported locations (including environment variables), refer to Create user-level custom rules.
For detailed instructions on creating user-level custom rules, see the GitLab documentation.
Create the file ~/.gitlab/duo/chat-rules.md in your home directory.
Example rules:
- Always use TypeScript for new code, never JavaScript
- Include JSDoc comments for all functions
- Use single quotes for strings
- Follow the existing code style in the repository
- Write concise explanations, avoid lengthy descriptions
- Suggest tests for any code changes
- Use async/await instead of promises
Project rules apply only to a specific project. They override user-level rules for that project. Project rules are defined in .gitlab/duo/chat-rules.md in your project and are consumed by GitLab Duo Chat, agents, and flows for that project — in IDE extensions, the Duo CLI, and the GitLab platform (GitLab 18.11 and later). For the complete behavior, see Create workspace-level custom rules.
Create the file .gitlab/duo/chat-rules.md in your project root.
Example rules for a Vue.js project:
- Use Vue 3 Composition API with `<script setup>`
- Always include TypeScript types for props
- Use scoped styles with SCSS
- Follow the Slippers UI design system
- Keep components under 300 lines
- Use kebab-case for component names
- Include accessibility attributes (aria-*, role)
Tip: Use Code Owners to manage who approves changes to .gitlab/duo/chat-rules.md.
For a detailed use case tutorial for custom rules, see the Custom rules in GitLab Duo Agentic Chat for greater developer efficiency deep-dive blog post.
Note: Custom rules only apply to new conversations or flows. Existing conversations do not retroactively pick up new or updated rules; see the Custom rules documentation for details.
AGENTS.md provides project-specific context — repository structure, architecture documentation, build and test instructions, and directory-specific conventions — that agents use when working in your codebase. Because it follows an industry standard, it also works with non-GitLab AI tools that support the spec, for example, Claude Code as an external agent.
Use AGENTS.md when you need to give agents deeper understanding of your project structure, or when you want the same context to apply across multiple AI tools. Use custom rules when you want to enforce team standards and preferences within GitLab Duo specifically.
User-level (applies to all your projects and workspaces):
~/.gitlab/duo/AGENTS.md%APPDATA%\GitLab\duo\AGENTS.mdWorkspace-level (applies to a specific project):
AGENTS.md in your project root.Subdirectory-level (applies to specific directories in monorepos):
AGENTS.md in subdirectories for context-specific instructions.For how AGENTS.md files are combined and discovered across user, project, and repository subdirectory levels, see How GitLab Duo uses AGENTS.md files.
# Agent Customization for Our Project
## General Guidelines
- Always prioritize code quality over speed
- Follow our project's architecture patterns
- Reference existing code examples when suggesting changes
- Ask for clarification if requirements are ambiguous
## Code Style
- Use TypeScript for all new code
- Follow ESLint configuration in the project
- Include unit tests for all new functions
- Use descriptive variable names (no single letters except loops)
## Documentation
- Add JSDoc comments to all public functions
- Update README.md if adding new features
- Include examples in code comments
## Security
- Never suggest hardcoding secrets or API keys
- Always validate user input
- Use parameterized queries for database operations
- Flag potential security issues immediately
user_rule context passed from the executor. See the example in Use AGENTS.md with GitLab Duo.Custom review instructions provide specific guidelines for GitLab's AI-powered code review. The instructions ensure consistent code review standards, and can be tailored to specific file types in your project.
Availability depends on how you use it:
Create the file .gitlab/duo/mr-review-instructions.yaml in your project root.
Example review instructions:
instructions:
- name: Ruby Style Guide
fileFilters:
- "*.rb" # Ruby files in the root directory
- "lib/**/*.rb" # Ruby files in lib and its subdirectories
- "!spec/**/*.rb" # Exclude test files
instructions: |
1. Ensure all methods have proper documentation
2. Follow Ruby style guide conventions
3. Prefer symbols over strings for hash keys
- name: TypeScript Source Files
fileFilters:
- "**/*.ts" # TypeScript files in any directory
- "!**/*.test.ts" # Exclude test files
instructions: |
1. Ensure proper TypeScript types (avoid 'any')
2. Follow naming conventions
3. Document complex functions
Best practices for custom review instructions:
fileFilters.Tip: Use Code Owners to protect changes to .gitlab/duo/mr-review-instructions.yaml.
For the full YAML schema, language-specific examples, and how custom instructions are combined with GitLab Duo's built-in review criteria, see the Custom Review Instructions documentation.
Agent Skills provide specialized knowledge and workflows for specific agentic tasks, based on the Agent Skills specification. Refer to the documentation for availability and prerequisites.
Skills work at two levels:
SKILL.md files under skills/<skill-name>/ in your repository.SKILL.md files under ~/.gitlab/duo/skills/<skill-name>/ (Linux/macOS) or %APPDATA%\GitLab\duo\skills\<skill-name>\ (Windows). Requires the --enable-global-skills flag or the GITLAB_ENABLE_GLOBAL_SKILLS environment variable.For the exact file layout, required frontmatter, supported surfaces, and how to wire skills into flows via the workspace_agent_skills context, see the Agent Skills documentation.
Model Context Protocol (MCP) enables agents to access external systems like Jira, Slack, AWS, and more. This section covers MCP configuration for extending agent capabilities.
🎯 Try it now: Interactive demo of MCP - Explore how to use Model Context Protocol.
Model Context Protocol (MCP) enables agents to access external systems like Jira, Slack, AWS, and more.
Scope: User-level (applies to all workspaces) or Workspace-level (project-specific, overrides user config)
Create user configuration:
~/.gitlab/duo/mcp.jsonC:\Users\<username>\AppData\Roaming\GitLab\duo\mcp.jsonGitLab MCP: Open User Settings (JSON)Create workspace configuration:
.gitlab/duo/mcp.json in your project rootBest practices:
.gitlab/duo/mcp.json with Code Owners' approval.For detailed setup instructions and configuration examples, see Part 7: Model Context Protocol (MCP) Integration.
Custom agents and flows allow you to automate your team's specific workflows. Before diving into customization, it's helpful to understand what they are and how they work. Here are parts of the Getting started with GitLab Duo Agent Platform guide that can help.
Once you understand the basics, this section provides an overview of customization options with links to detailed guides.
System prompts define an agent's personality, expertise, and behavior. A well-crafted prompt makes agents more effective and aligned with your team's needs.
What are system prompts? System prompts are instructions that tell an agent how to behave, what expertise it has, and how to respond to requests. They're the foundation of custom agent behavior.
Key elements of a strong system prompt:
Best practices:
For detailed guidance on crafting system prompts and creating custom agents, see Part 3: Understanding agents.
For a complete comparison of when to use each method, see the Customize GitLab Duo Agent Platform overview.
| Tool | Best For | Location |
|---|---|---|
| Custom Rules | Guiding Chat, agents, flows, and CLI (tone, style, behavior) — user-level applies in IDE/CLI; workspace-level also applies in GitLab UI | ~/.gitlab/duo/chat-rules.md (user) or .gitlab/duo/chat-rules.md (workspace) |
| AGENTS.md | Enforcing standards across chat, flows, and other AI tools | ~/.gitlab/duo/AGENTS.md (user) or AGENTS.md (workspace root) |
| Agent Skills | Providing shareable, reusable skills and custom commands for agents | skills/<skill-name>/SKILL.md (workspace, VS Code + Duo CLI); user-level via Duo CLI only — see Agent Skills |
| Custom Review Instructions | Guiding code review standards for specific file types (Code Review Flow only) | .gitlab/duo/mr-review-instructions.yaml (workspace only) |
| System Prompts | Customizing individual agent or flow behavior | AI Catalog when creating an agent or flow |
| MCP Configuration | Connecting agents to external tools | ~/.gitlab/duo/mcp.json (user) or .gitlab/duo/mcp.json (workspace) |
| Custom Agents | Creating specialized agents for team-specific tasks | AI > Agents or AI Catalog |
| Custom Flows | Orchestrating multiple agents in workflows | AI > Flows or AI Catalog |
Congratulations! You've completed the entire GitLab Duo Agent Platform series. You now understand:
Return to complete series overview to review all parts and explore specific topics in depth.
Previous: Part 7: Model Context Protocol integration
Back to start: Complete series overview
Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum.
Share your feedback