Skip to content

ci: enhance claude code review and clean up enhance-claude-docs skill#366

Merged
ninja-shreyash merged 3 commits intomainfrom
feat/claude-review-dedupe-and-optout
Apr 14, 2026
Merged

ci: enhance claude code review and clean up enhance-claude-docs skill#366
ninja-shreyash merged 3 commits intomainfrom
feat/claude-review-dedupe-and-optout

Conversation

@ninja-shreyash
Copy link
Copy Markdown
Contributor

@ninja-shreyash ninja-shreyash commented Apr 13, 2026

Why

Three pain points across our review/docs automation:

  1. Bombardment in claude-code-review.yml — every push re-runs a full review with no awareness of prior comments, re-posting the same inline comments even after fixes/resolves/declines.
  2. No way to opt out of the review workflow on WIP or trivial PRs.
  3. enhance-claude-docs skill bakes provenance into doc files(Source: PR #184) and @swati354-style references end up permanently inside agent_docs/*.md (see docs: update Claude docs from PR review analysis #360), creating cross-link noise and burning contributor handles into long-lived docs.

What this PR does

1. Resolved-thread dedupe (claude-code-review.yml)

Fetches existing review threads via GraphQL before reviewing, then gates every inline-comment posting:

Prior thread Original was Code now Action
Unresolved (any) (any) Skip
Resolved Actionable ask Fix applied Skip
Resolved Actionable ask Fix NOT applied Unresolve the thread (no new comment)
Resolved Author replied "won't fix" / "intentional" (any) Skip
Resolved Nit / FYI (any) Skip

Decline detection reads thread reply text — no labels or syntax needed.

2. Opt-out label (claude-code-review.yml)

if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-claude-review') }}

Apply skip-claude-review (label created in this repo) → workflow skipped on subsequent commits. Remove → re-enabled. Symmetric.

3. Silence summary on no-op runs (claude-code-review.yml)

The current workflow posts zero plugin summary comments on most PRs (e.g., 8 commits on #358 → 0 plugin summaries). Without explicit guidance, the new dedupe prompt would have started posting filler summaries like "No new issues" on runs where nothing actually happened.

STEP 5 of the prompt now gates the summary: post only if the run produced an action (a new inline comment or an unresolved thread). Otherwise stay silent. Preserves current "no chat on no-op" behavior while keeping audit value when state actually changed.

4. Content rules for enhance-claude-docs skill

Step 6 of .claude/skills/enhance-claude-docs/SKILL.md now forbids #N refs, @username mentions, and verbatim quoting inside the doc files. Provenance stays in the PR body and terminal output.

Testing — review workflow

Validated end-to-end on ninja-shreyash/cherrypick-test#20 across 8 scenarios. All passed.

# Scenario Validates Result
1 Baseline — open PR with 3 deliberate issues Initial review posts findings 3 inline threads at lines 3, 4, 8 ✅
2 Idle re-run (empty commit) No duplicate inline comments Still 3 threads, 1 comment each ✅
3 Resolve thread without fix → push Bot unresolves the thread Thread flipped resolved → unresolved, 0 new comments ✅
4 Resolve + apply fix → push Bot leaves it resolved Stayed resolved (line 8 → 12 drift tracked correctly), 0 new comments ✅
5 Reply "won't fix", resolve → push Bot respects decline Stayed resolved, 0 new comments ✅
6 (Emergent) Bot finds new issue near existing thread New finding on different topic posts; bot references existing thread Posted on line 5 about a logic bug, body referenced line-4 thread ✅
7a Add skip-claude-review label → push Opt-out skips workflow Run completed in 1s with status skipped, no compute ✅
7b Remove label → push Workflow resumes normally Ran successfully, dedupe respected ✅
8 No-op push after silence-on-no-op clause added Bot posts no filler summary Same threads, comment count unchanged, 0 new summaries posted ✅

Across 4 follow-up pushes (scenarios 2–5), zero duplicate inline comments were posted. Scenario 8 confirms the silence-on-no-op clause from change #3 fully suppresses filler summaries — same conditions previously produced a ## Code Review — No New Issues summary, now produces nothing.

Test PR: ninja-shreyash/cherrypick-test#20

Testing — docs skill change

Prompt-level change. Exercised by the next scheduled claude-docs-update.yml run (Mondays 9am UTC) or manual workflow_dispatch. Next run's docs PR should have no #N or @username strings inside modified agent_docs/*.md files.

Risk

  • CI / skill files only — no SDK code touched.
  • Backward-compatible: PRs without the opt-out label behave as before, plus dedupe.
  • If the GraphQL query fails, falls back to prior full-review behavior. Worst case = one run of duplicate comments, not a broken workflow.

Two changes to the claude-code-review workflow:

1. Resolved-thread dedupe — fetch existing review threads via GraphQL
   before reviewing and apply a posting gate to every inline comment:
   - Skip if an unresolved thread already covers the same (path, line, topic)
   - Skip resolved threads where the fix was applied or author declined
   - Unresolve the original thread (no new comment) if a resolved actionable
     ask was not addressed in the current code

2. Opt-out label — `skip-claude-review` on a PR suppresses the workflow
   on subsequent commits. Removing the label re-enables it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ninja-shreyash ninja-shreyash requested a review from a team April 13, 2026 18:56
The enhance-claude-docs skill was baking provenance like (Source: PR #184)
and reviewer @-mentions directly into the documentation files (e.g.,
agent_docs/conventions.md), creating permanent cross-link noise in source
PRs and burning contributor handles into long-lived docs.

Updates Step 6 with explicit content rules for doc edits: no #N refs, no
@-mentions, no verbatim quoting. Provenance stays in the PR body and
terminal output where it belongs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ninja-shreyash ninja-shreyash changed the title ci: dedupe resolved review threads + add skip-claude-review opt-out label ci: dedupe resolved review threads, add skip-claude-review opt-out, clean up enhance-claude-docs skill Apr 13, 2026
@ninja-shreyash ninja-shreyash changed the title ci: dedupe resolved review threads, add skip-claude-review opt-out, clean up enhance-claude-docs skill ci: enhance claude code review and clean up enhance-claude-docs skill Apr 13, 2026
Previous prompt told the bot to "summarize" without saying when, which
made it post a "No new issues" filler summary on runs where no action
was taken. The current uipath-typescript workflow posts zero plugin
summaries today; this prompt would have changed that behavior.

Now: post a summary ONLY if the run posted a new inline comment or
unresolved a thread. Otherwise stay silent. Preserves the audit-log
value (notifying the author when their thread was unresolved) without
adding noise on no-op pushes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@ninja-shreyash ninja-shreyash merged commit f0703c2 into main Apr 14, 2026
18 of 19 checks passed
@ninja-shreyash ninja-shreyash deleted the feat/claude-review-dedupe-and-optout branch April 14, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants