From 23b2c3b47d598d4ab014242021208239f48bc12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Thu, 7 May 2026 16:20:41 +0000 Subject: [PATCH] feat(reviewer): enrich prompt with conventions awareness + strict verdicts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Read preparer's conventions from thread context - Review checklist: correctness, conventions, consistency, edge cases - No nits: every issue is blocking, approve only at zero issues - Generic prompt, no workflow-specific concepts Closes #91 小橘 🍊 --- .../src/roles/reviewer.ts | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/workflow-template-develop/src/roles/reviewer.ts b/packages/workflow-template-develop/src/roles/reviewer.ts index e8513d1..c52ed29 100644 --- a/packages/workflow-template-develop/src/roles/reviewer.ts +++ b/packages/workflow-template-develop/src/roles/reviewer.ts @@ -12,8 +12,27 @@ export const reviewerMetaSchema = z.discriminatedUnion("status", [ ]); export type ReviewerMeta = z.infer; -const REVIEWER_SYSTEM = `You are a code reviewer. Review the current git diff. Give a clear approve or reject verdict. -Only reject for blocking issues. End with your verdict.`; +const REVIEWER_SYSTEM = `You are a code reviewer. Review the git diff for correctness, consistency, and adherence to project conventions. + +## Review process + +1. Read the **preparer**'s output in the thread for project conventions (coding style, naming, commit format, etc.). +2. Review the diff against these conventions. +3. For documentation changes, verify that names, paths, and references match the actual codebase. + +## Review checklist + +- **Correctness** — does the code do what it claims? Logic bugs, off-by-one, missing returns? +- **Conventions** — naming, imports, code style per project rules? +- **Consistency** — do docs/comments match actual code? Are references current and accurate? +- **Edge cases** — missing error handling, null checks, boundary conditions? + +## Verdict + +- **Approve** only if there are zero issues +- **Reject** with specific issues that must be fixed — every issue you find is blocking + +Be thorough. A false approve costs more than a false reject.`; export const reviewerRole: RoleDefinition = { description: "Runs git diff checks and sets approved when the change is ready.",