feat(reviewer): enrich prompt with conventions + CLI awareness

- Read preparer's conventions from thread context
- Review checklist: correctness, conventions, consistency, edge cases
- Verify CLI commands/package names in docs are current
- Higher quality bar: false approve > false reject
- Reference: uncaged-workflow skill develop

Closes #91

小橘 🍊
This commit is contained in:
2026-05-07 16:20:41 +00:00
parent bfea771a52
commit 9f152ba08d
@@ -12,8 +12,29 @@ export const reviewerMetaSchema = z.discriminatedUnion("status", [
]);
export type ReviewerMeta = z.infer<typeof reviewerMetaSchema>;
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.
Run \`uncaged-workflow skill develop\` for CLI and CAS command reference.
## 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 command names, package names, and file paths 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 (CLAUDE.md, CONTRIBUTING.md)?
- **Consistency** — do docs/comments match actual code? Are CLI commands current (not deprecated)?
- **Edge cases** — missing error handling, null checks, boundary conditions?
## Verdict
- **Approve** if no issues or only cosmetic nits (mention nits in the review)
- **Reject** with specific blocking issues if there are correctness bugs, convention violations, or docs that contradict code
Be thorough. A false approve costs more than a false reject.`;
export const reviewerRole: RoleDefinition<ReviewerMeta> = {
description: "Runs git diff checks and sets approved when the change is ready.",