Support custom review prompt via file reference #5

Closed
opened 2026-05-01 18:23:30 +00:00 by rodin · 1 comment
Owner

Problem

The system prompt is currently hardcoded in review/prompt.go. Different repos may want different review styles, focus areas, or output formats.

Proposed Solution

Add a --prompt-file / PROMPT_FILE option that accepts a path to a file containing the system prompt template.

review-bot --prompt-file .review-prompt.md ...

The file could be:

  • A local path in the repo (loaded during CI)
  • A path fetched from the repo via Gitea API (like conventions-file already does)

Behavior

  • If --prompt-file is set, use its contents as the system prompt
  • The file can reference template variables like {{.Diff}}, {{.Conventions}}, {{.CIStatus}}
  • If not set, fall back to the built-in default prompt
  • The conventions file content would still be injected into the prompt context

Use Cases

  • Elixir repos want OTP-specific review criteria
  • Go repos want stdlib-idiom focus
  • Some repos want stricter (any finding = REQUEST_CHANGES) vs lenient (only MAJOR blocks)
  • Custom output format or severity definitions per project
## Problem The system prompt is currently hardcoded in `review/prompt.go`. Different repos may want different review styles, focus areas, or output formats. ## Proposed Solution Add a `--prompt-file` / `PROMPT_FILE` option that accepts a path to a file containing the system prompt template. ```bash review-bot --prompt-file .review-prompt.md ... ``` The file could be: - A local path in the repo (loaded during CI) - A path fetched from the repo via Gitea API (like `conventions-file` already does) ## Behavior - If `--prompt-file` is set, use its contents as the system prompt - The file can reference template variables like `{{.Diff}}`, `{{.Conventions}}`, `{{.CIStatus}}` - If not set, fall back to the built-in default prompt - The conventions file content would still be injected into the prompt context ## Use Cases - Elixir repos want OTP-specific review criteria - Go repos want stdlib-idiom focus - Some repos want stricter (any finding = REQUEST_CHANGES) vs lenient (only MAJOR blocks) - Custom output format or severity definitions per project
Author
Owner

Closing as implemented. The --system-prompt-file / SYSTEM_PROMPT_FILE option (added in a prior PR) covers this use case:

review-bot --system-prompt-file SECURITY_REVIEW.md ...

Since CI runners check out the repo, any file in the repo is available as a local path. The --conventions-file flag additionally fetches from the Gitea API for repo-level conventions without checkout.

Between these two flags, per-repo prompt customization is fully supported.

Closing as implemented. The `--system-prompt-file` / `SYSTEM_PROMPT_FILE` option (added in a prior PR) covers this use case: ```bash review-bot --system-prompt-file SECURITY_REVIEW.md ... ``` Since CI runners check out the repo, any file in the repo is available as a local path. The `--conventions-file` flag additionally fetches from the Gitea API for repo-level conventions without checkout. Between these two flags, per-repo prompt customization is fully supported.
rodin closed this issue 2026-05-02 19:07:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/review-bot#5