Skip to content

Design Duo Code Review prompt that accepts custom instructions

Context

We need to evolve the prompt for Duo Code Review to support custom instructions provided by users (&17685).

The custom instructions have 2 components that need to be taken into account in the prompt:

  • The instruction itself (plain text human language, like a sub-prompt)
  • A glob pattern defining which files the instruction applies to (e.g. ** for all files, tests/**.* for files under the test folder, etc)

Goal

The goal of this issue is to experiment and propose a structural prompt change that will satisfy this requirement. This can be done using Langsmith for quick iteration and testing, and using mock data for the instructions (since we don't have anything in place yet to store these in-product).

Considerations:

  • Ensure the base prompt and custom instructions do not impact each other negatively.
  • Ensure instructions are only applied to files captured by the glob (could be a post-LLM-response filter?).
Edited by François Rosé