[No QA] Refactor Claude code reviewer to use structured JSON output#83226
[No QA] Refactor Claude code reviewer to use structured JSON output#83226kacper-mikolajczak wants to merge 4 commits intoExpensify:mainfrom
Conversation
Leverage claude-code-action's --json-schema flag to enforce validated JSON output from the reviewer agent instead of having the agent call shell scripts directly. Comment posting and PR reactions are now handled in a dedicated workflow step that consumes the structured_output.
|
@ShridharGoel Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Hi @ShridharGoel! It was premature undrafting - there is no need for review for now. Sorry about that ❤️ |
|
@Julesssss could I ask you to run this improvement against #82206 in order to check its correctness? Thanks! ❤️ |
| name: code-inline-reviewer | ||
| description: Reviews code and creates inline comments for specific rule violations. | ||
| tools: Glob, Grep, Read, TodoWrite, Bash, BashOutput, KillBash | ||
| tools: Glob, Grep, Read, Bash, BashOutput |
There was a problem hiding this comment.
Recently I improved MelvinBot by passing the Repo's settings.json file into the GitHub action confirg, this sets the file to Claude's user level settings. Preventing the need for manual tool definition for subagents.
Seems like something we could apply to the AI reviewer too perhaps?
There was a problem hiding this comment.
Great improvement! As you said, let's have it as a follow-up.
Julesssss
left a comment
There was a problem hiding this comment.
Looking good, conflicts and a couple of improvements. @kacper-mikolajczak I'll merge this one first tomorrow to avoid another conflict
Sure, I did this locally again. Seems that the JSON improvement worked well. Reviewed the PR again
|
|
Thanks for the review @Julesssss! All the comments were addressed. As those changes touch critical parts of the reviewer pipeline, I'd suggest we test it once again before merging. |

Explanation of Change
Replace the Claude code reviewer's direct shell script calls (
createInlineComment.sh,addPrReaction.sh) with structured JSON output enforced byclaude-code-action's--json-schemaflag. The agent now returns a validated{ violations: [...] }object, and a separate workflow step handles posting inline comments or adding a PR reaction.This separates infrastructure/usage logic from the reviewer's core analysis work, making it easier to extend capabilities or change the use-case without touching the reviewer agent itself.
Fixed Issues
$ #83224
Tests
Offline tests
N/A - CI workflow only
QA Steps
// [No QA] - CI/tooling change only, no user-facing impact
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A - CI/tooling change only
Android: mWeb Chrome
N/A - CI/tooling change only
iOS: Native
N/A - CI/tooling change only
iOS: mWeb Safari
N/A - CI/tooling change only
MacOS: Chrome / Safari
N/A - CI/tooling change only