Add Claude Code Action-compatible review agents and improve /review-pr#9
Conversation
- Add code-quality-reviewer, test-coverage-reviewer, and documentation-accuracy-reviewer agents mirroring Claude Code Action's core PR review agent set - Keep all existing pr-review-toolkit agents unchanged - Rewrite /review-pr command to deterministically run 5 core reviewers for `all`, plus specialty agents triggered by diff content - Add quality, coverage, docs, documentation as new aspect keywords - Normalize findings across agents with file/line/severity/source/message - Validate inline comment anchoring against the PR diff before posting - Add retry and top-level comment fallback when review API call fails - Update SKILL.md and README to document both reviewer sets, all aspects, deterministic all behavior, finding normalization, and posting policy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4266206 to
c08906a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf7bd78544
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
OpenCode PR Review
Reviewed 7 files across 6 areas: code-quality-reviewer, performance-reviewer, test-coverage-reviewer, documentation-accuracy-reviewer, security-code-reviewer, code-reviewer.
General observation
The new orchestration expects every agent to return normalized {file, line, severity, source, message} YAML, but the existing pr-test-analyzer.md and code-reviewer.md agent definitions do not specify that format. Update those agent files to match the normalized contract, or have the orchestrator parse their prose output.
|
Posted a review on PR #9: #9 (review) Summary:
|
dceoy
left a comment
There was a problem hiding this comment.
Review + triage
CI is green, but I would not merge this yet. The existing important comments are mostly valid and point to the same underlying consistency issues.
Keep / fix before merge
-
Normalize the output contract for every agent that can enter the review flow. The command/skill now require
{file, line, severity, source, message}, but several existing specialty agents still define prose or incompatible output formats. This applies not only tocode-reviewerandpr-test-analyzer, but also tosilent-failure-hunter,comment-analyzer, andtype-design-analyzerif they remain callable from/review-pr allor explicit aspects. Either update those agent files or make the orchestrator explicitly translate legacy outputs before filtering/posting. -
Make aspect-to-agent routing deterministic and document it consistently. Replace
and/orwith the intended set. Ifcoderuns bothcode-reviewerandcode-quality-reviewer, state that in the command file. Iftests/coverageruns bothtest-coverage-reviewerandpr-test-analyzer, make/review-pr all,SKILL.md, andREADME.mdmatch that behavior. -
Fix the changed-file filtering rule. The current wording says to drop findings when the file or line is not in the changed-file set, but the changed-file set contains paths, not line numbers. Restrict that filter to file membership and leave line validation to the anchoring step; otherwise valid findings can be discarded before fallback-to-summary logic runs.
-
Clarify
code-reviewerin/review-pr all. It is listed under conditional specialty reviewers but has no trigger condition. Move it to unconditional reviewers or add a clear condition such as “always run for AGENTS.md/project-guideline compliance.”
Lower-priority / optional
- The model default change to
kimi-k2.7-codeis a product trade-off, not a correctness blocker; it is already resolved. - Tests that validate agent frontmatter and command/skill references would be useful guardrails, but they are optional unless this repo wants schema validation for
.opencode/assets.
Suggested implementation direction
I would fix this by making a single source of truth for the aspect matrix in the command/skill text, then updating all review-capable agents to emit the same normalized YAML shape. After that, adjust README.md examples so each row names the exact agents that run.
…istency
- Normalize output format in all review-flow agents (pr-test-analyzer,
code-reviewer, silent-failure-hunter, comment-analyzer, type-design-analyzer)
to emit {file, line, severity, source, message} YAML matching the orchestrator
contract
- Replace "and/or" with "and" for code and tests/coverage aspect routing
- Move code-reviewer to unconditional core reviewers in all mode
- Add pr-test-analyzer to conditional specialty reviewers for all (when test
files change)
- Fix filtering rule 3 to drop by file membership only; leave line validation
to the diff-anchoring step
- Update README /review-pr tests docs row to mention pr-test-analyzer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Triage complete (commit f1a209f)All Fixed:
Deferred (suggestions, no test framework currently):
QA clean (prettier, yamllint, zizmor, actionlint, checkov all pass). |
|
On the suggestion threads (no tests for agent frontmatter / agent file references / skill references): deferred. This repo has no test framework for validating |
- Normalize performance-reviewer and security-code-reviewer outputs to the file/line/severity/source/message YAML schema used by /review-pr - Add permission frontmatter to code-simplifier for uniform agent schema - Strengthen filtering: check file membership only, aggregate by root cause, keep one representative inline comment per root cause - Add explicit posting policy to command and skill (anchored -> inline, unanchorable -> summary, duplicated -> one representative + summary) - Make README aspect table name the exact agents that run for each keyword and document the posting policy - Add validate-opencode.sh guardrail for agent frontmatter and review-pr command/skill references; wire into qa.sh
Follow-up: orchestration quality and noisy outputPushed Normalized agent outputs
Duplicate/noisy output suppression
Changed-file filtering vs anchoring
Deterministic routing and docs
Guardrails
ValidationQA passes: The OpenCode review comments on this PR should now be either addressed or obsolete. |
Build the backtick-delimited reference pattern with printf instead of literal backticks in single quotes so SC2016 is not triggered.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1367e629f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dceoy
left a comment
There was a problem hiding this comment.
No noteworthy issues found. Previous feedback appears addressed, and the current CI/CD run is green.
Summary
code-quality-reviewer,test-coverage-reviewer, anddocumentation-accuracy-reviewer/review-prcommand and skill to deterministically run 5 core reviewers forall, plus pr-review-toolkit specialty agents triggered by diff contentquality,coverage,docs,documentationfile/line/severity/source/messagestructureSKILL.mdandREADME.mdto document both reviewer sets, all aspects, and posting policyChanged files
.opencode/agents/code-quality-reviewer.md.opencode/agents/test-coverage-reviewer.md.opencode/agents/documentation-accuracy-reviewer.md.opencode/commands/review-pr.md.opencode/skills/review-pr/SKILL.mdREADME.md.github/workflows/opencode.ymlAcceptance criteria
.opencode/agents/code-quality-reviewer.mdexists.opencode/agents/test-coverage-reviewer.mdexists.opencode/agents/documentation-accuracy-reviewer.mdexists/review-pr alldeterministically includes 5 Claude Code Action-compatible core reviewers/review-prstill supports pr-review-toolkit specialty aspectsTest plan
/review-pr allon a PR touching code, tests, and docs — verify all 5 core reviewers run/review-pr security performance— verify only those two agents run/review-pr tests docs— verify test-coverage-reviewer and documentation-accuracy-reviewer run/review-pr simplify— verify code-simplifier runs without posting a reviewgh pr comment🤖 Generated with Claude Code