feat(review): --prompt-file flag#64
Merged
Merged
Conversation
Lets callers append extra reviewer guidance to the hardcoded review prompt without forking the prompt builder. The flag accepts a file path (read with utf8) or '-' to read from stdin, and is plumbed through reviewCommand → reviewFeature → buildReviewPrompt as an optional customPrompt argument. Default behavior is unchanged when the flag is omitted: customPrompt defaults to null and the additional- guidance block is skipped entirely. Why: downstream consumers (e.g. Tribunal, which dispatches three lens-specific reviews) want to drive lens-aware prompts instead of post-hoc category bucketing. Today the prompt is fixed; this is the smallest change that unlocks that without breaking any existing user. Tests: three new cases in workflow.test.ts covering presence, ordering (guidance block lands before JSON shape + file blocks), and absence (omitting the flag leaves the prompt byte-identical to the no-arg case).
# Conflicts: # src/cli.ts # src/workflow.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
--prompt-file <path>flag toclawpatch reviewthat appends extra reviewer guidance to the prompt built bybuildReviewPrompt(). The flag accepts a file path (UTF-8) or-to read from stdin.Why
Today the review prompt is fixed inside
buildReviewPrompt(). Downstream consumers that want to drive multiple specialised passes (e.g. one each for arch/sec/perf lenses) have to either fork the prompt builder or bucket findings after the fact bycategory. This flag is the smallest hook that lets them inject focused guidance per pass without touching the rest of the prompt.Behavior
customPromptdefaults tonulland the additional-guidance block is skipped entirely. Default behavior is byte-identical.reviewCommandentry and threaded throughreviewFeature→buildReviewPromptas an optional argument. The block lands after the Feature JSON and before the Review-categories list / JSON-shape template, so it reads as setup, not as part of the expected response.--prompt-file -reads from stdin (rejected if stdin is a TTY).Tests
Three new cases in `workflow.test.ts`:
Full suite: 463 passing locally.
Notes