← Back to Pull requests

docs(skills): add review mode to therock-pr-quality and two Python style rules #9910

Open
unknown opened this pull request with 457 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 11, 2026 19:03 UTC
Author

Motivation

We add a review mode to the therock-pr-quality skill so that an AI-assisted review of a TheRock PR, including a self-review before requesting review, follows the same steps every time. The review mode builds on the existing rocm-pr-quality base and the therock-pr-quality overlay, and keeps their finding tiers, their assessment values, and the rule never to post to GitHub. It is based on reviews of real TheRock PRs. Each verification rule exists because skipping it produced a wrong or missed finding in one of those reviews.

In addition, we add two rules to the Python style guide that came up repeatedly in reviews: no single-use module-level constants, and single rather than double backticks for code in comments and docstrings.

Technical Details

skills/therock-pr-quality/review.md is read for the base skill's review action and applies to every TheRock PR, not only to the build-repo scope of the overlay. It adds:

  • Prior discussion: the review collects every channel (conversation, review summaries, inline comments, and the invoking user's own pending draft comments) and paginates the GitHub list endpoints, so busy PRs are not cut off at 30 items. Points that were already raised are listed separately instead of being repeated. For a self-review, each existing thread is marked as addressed or still open.

  • Diff-first setup: the review starts from gh pr diff and reads source only when the diff cannot answer a question. The user's branch is never switched without asking.

  • Title and description check: TheRock squash-merges, so the title and body become the commit message. The review flags claims the code does not back up, changes the description does not mention, and text that will be wrong once the requested changes are applied.

  • Verification rules: comments are claims, not evidence; a fail-fast raise is only as strong as its caller; naming and classification findings need real data; coupled sites are flagged together; unhappy paths are traced; "do it like X" needs a cited precedent; changes to established behavior need a check of who relies on it. The effort is kept in proportion to the risk, so a style point does not trigger a repository-wide sweep.

  • Output: findings are ordered by file and line so the author can walk the diff top to bottom. A separate BLOCKING list at the top keeps the base skill's severity-first view. The review ends with a whole-PR design pass ("Reviewer's take").
  • therock-pr-quality/SKILL.md gains a "Review mode" section that points to review.md, and its description now lists review triggers ("review PR", "code review PR #N") so that review requests route to this skill. The Scope section names review mode as the exception that applies to every PR. AGENTS.md and skills/README.md link the review mode.

    python_style_guide.md gains the two rules with preferred and avoid examples, and two matching entries in the code review checklist. The single-use constant rule defers to "No magic numbers" for values that are not self-explanatory. The backtick rule applies to new and modified code only; existing comments do not need to be changed just for this.

    Test Results

  • pre-commit run on all changed files.

  • The review mode was run on several open TheRock PRs; example outputs are posted in a comment on this PR.

  • The review mode was run as a self-review on this PR, and its findings are applied.
  • Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.
  • 🤖 Generated with Claude Code

    Diff: 457 lines (+342 / -115) across 5 files Reviewer: geomin12 Review duration: 4827m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 457 lines diff across 5 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.367
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #9910"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.5% (MEDIUM) · Higher = larger blast radius
    45.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.3% · Safe to merge
    24.3%
    Repository