Skip to content

[Due for payment 2026-03-09] Refactor Claude code reviewer to use structured JSON output #83224

Closed

Description

@kacper-mikolajczak

Problem

The Claude code reviewer agent currently handles two separate concerns in one place:

  1. Analyzing code for rule violations
  2. Handling communication with GitHub (calling createInlineComment.sh, addPrReaction.sh)

This coupling causes issues:

  • The agent needs extra tool permissions (Bash(createInlineComment.sh:*), Bash(addPrReaction.sh:*)) that have nothing to do with code analysis
  • Inline prompt instructions duplicate what --json-schema already enforces at the SDK level
  • The agent prompt is bloated with tool usage examples, bash quoting warnings, and posting logic instead of focusing on review rules

Solution

Use claude-code-action's built-in --json-schema flag to enforce a validated { violations: [...] } schema. The agent focuses purely on analysis and returns structured data. A separate workflow step reads structured_output and handles posting comments or adding a reaction.

This separates infrastructure/usage logic from the reviewer's core work, making it easier to extend capabilities or change the use-case without touching the reviewer agent itself.

Activity

  1. kacper-mikolajczak commented on Feb 23, 2026

    @kacper-mikolajczak
    ContributorAuthor

    PR: #83226

  2. kacper-mikolajczak commented on Feb 23, 2026

    @kacper-mikolajczak
    ContributorAuthor
  3. Julesssss commented on Feb 24, 2026

    @Julesssss
    Contributor

    Reviewed PR, just awaiting some changes.

  4. kacper-mikolajczak commented on Feb 25, 2026

    @kacper-mikolajczak
    ContributorAuthor

    PR ready for re-review.

  5. kacper-mikolajczak commented on Feb 26, 2026

    @kacper-mikolajczak
    ContributorAuthor

    PRs merged, comments are posted - looks good at the moment 👍

  6. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 2, 2026
  7. changed the title [-]Refactor Claude code reviewer to use structured JSON output[/-] [+][Due for payment 2026-03-09] Refactor Claude code reviewer to use structured JSON output[/+] on Mar 2, 2026
  8. melvin-bot commented on Mar 2, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  9. melvin-bot commented on Mar 2, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.27-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-03-09. 🎊

    For reference, here are some details about the assignees on this issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions