Agentic MR Review: Support reuse of existing prompts and skills from external tools (e.g. Cursor rules) in Custom Flows
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=596271) </details> <!--IssueSummary end--> ## Problem to Solve Teams that have already invested in building review skills, rules, and prompts in IDE-based tools (e.g. Cursor rules, team-maintained `.cursorrules` files, shared prompt libraries) cannot reuse or import these into GitLab Custom Flows. They must manually re-enter all prompt content in the GitLab UI, which is: - **Time-consuming** — duplicating work already done in another tool - **Error-prone** — manual re-entry introduces drift between the IDE and platform-side review behaviour - **A barrier to adoption** — teams that have invested heavily in IDE-based tooling see little incremental value in GitLab's platform-side review if they have to start from scratch Customer feedback: > "No skill reuse. Teams couldn't import or link existing Cursor/team skills into the custom flow without manually re-entering them in the UI." This was a recurring theme: several engineers noted that the feature did not provide meaningful additional value beyond what they already get from code review tooling in their existing IDEs. ## Intended Users - **Development teams** who have existing prompt libraries, rules, or skills in IDE-based tools (Cursor, Windsurf, GitHub Copilot, etc.) - **Platform teams** who maintain shared review standards and want to apply them consistently across both IDE and platform-side review - **Teams adopting GitLab Duo** who want to migrate or extend their existing AI tooling investment ## User Experience Goal Teams should be able to: 1. **Import or reference existing prompt/rule files** (e.g. `.cursorrules`, markdown prompt files, YAML skill definitions) when creating a Custom Flow, rather than re-entering content manually 2. **Link to a file in the repository** as the source of a prompt or system instruction, so the prompt stays in sync with the repo and doesn't need to be maintained in two places 3. **Share and reuse prompts across flows** — a prompt defined once should be referenceable by multiple flows without duplication ## Proposal ### File-Based Prompt Sourcing - Allow Custom Flow prompt definitions to reference a file path in the repository (e.g. `path: .gitlab/duo/review-prompt.md`) instead of requiring inline text - The flow executor reads the file at runtime, keeping prompts in sync with the repo ### Import from Common Formats - Support importing prompt/rule content from common formats used by IDE tools: - `.cursorrules` (Cursor) - `AGENTS.md` / `.ai/` directory conventions (already used in GitLab's own repo) - Generic markdown or YAML prompt files - Provide a UI affordance to upload or paste existing prompt content when creating a flow ### Cross-Flow Prompt Reuse - Allow a prompt defined in one flow to be referenced by another (similar to CI/CD `include` or `extends`) - Support a shared prompt library at the group or project level ## Benefits 1. **Reduces onboarding friction** — teams can bring their existing investment rather than starting from scratch 2. **Keeps prompts in sync** — file-based sourcing means the platform-side review stays aligned with IDE-side rules 3. **Increases perceived value** — teams see GitLab as extending their existing tooling, not replacing it with a worse version 4. **Encourages adoption** — lower barrier to getting value from platform-side agentic review ## Permissions and Security - File-based prompt sourcing should respect repository access controls - Imported prompts should be reviewed/approved before use in automated flows (consistent with existing flow approval mechanisms) ## Availability - GitLab.com (SaaS) - Self-Managed - Dedicated ## Related Issues - [#588653](https://gitlab.com/gitlab-org/gitlab/-/issues/588653) — Allow custom agents and flows to be used as automatic MR reviewers - [#592644](https://gitlab.com/gitlab-org/gitlab/-/issues/592644) — Provide more prescriptive setup guidance in public documentation
issue