Skip to content

Add PR review monitoring and auto-session creation#38

Merged
dhilgaertner merged 7 commits intomainfrom
feature/crow-33-pr-review-monitoring
Apr 7, 2026
Merged

Add PR review monitoring and auto-session creation#38
dhilgaertner merged 7 commits intomainfrom
feature/crow-33-pr-review-monitoring

Conversation

@dhilgaertner
Copy link
Copy Markdown
Contributor

@dhilgaertner dhilgaertner commented Apr 4, 2026

Summary

  • Poll GitHub for incoming PR review requests and display them in a new Reviews sidebar tab
  • One-click "Start Review" clones the repo, creates a review session, and launches Claude Code with the /review-pr skill
  • Auto-detect new review requests with macOS notifications and unseen badge counts
  • Auto-complete review sessions when the linked PR is merged or closed

Changes

New files:

  • ReviewRequest.swift — model for incoming PR review requests
  • ReviewBoardView.swift — review board UI (main view, rows, sidebar widget)
  • skills/review-pr/SKILL.md — Claude Code skill for performing code reviews

Modified (11 files):

  • Enums.swift — added SessionKind (.work / .review)
  • Session.swift — added kind field with backward-compatible decoding
  • AppState.swift — review state, closures, computed properties, unseen badge
  • NotificationEvent.swift — added reviewRequested case
  • IssueTracker.swiftfetchReviewRequests(), delta detection, auto-complete
  • SessionService.swiftcreateReviewSession() with repo cloning, review-aware cleanup
  • Scaffolder.swift — deploys review-pr skill, creates crow-reviews directory
  • NotificationManager.swift — review request notification method
  • AppDelegate.swift — wired onStartReview and notification callbacks
  • SessionListView.swift — review board sidebar row + "Reviews" section
  • MainContentView.swift — routes review board tab
  • settings.json — added gh search/review/clone permissions

Test plan

  • Build: make build compiles cleanly
  • Reviews tab appears in sidebar between Tickets and Manager
  • Polling fetches review requests (check console for [IssueTracker] logs)
  • "Start Review" clones repo into crow-reviews/, creates session, launches Claude Code
  • /review-pr skill reads diff, presents review, waits for approval before submitting
  • New review requests trigger macOS notification
  • Deleting a review session cleans up the clone directory
  • Review session auto-completes when PR is merged/closed

Closes #33

🤖 Generated with Claude Code

@dhilgaertner dhilgaertner force-pushed the feature/crow-33-pr-review-monitoring branch 4 times, most recently from 5df174b to 03bf432 Compare April 5, 2026 21:14
@dhilgaertner dhilgaertner requested a review from dgershman as a code owner April 5, 2026 21:14
@dhilgaertner dhilgaertner force-pushed the feature/crow-33-pr-review-monitoring branch 2 times, most recently from 250fc5e to e5e99ce Compare April 7, 2026 04:02
dhilgaertner and others added 7 commits April 7, 2026 14:02
Detect incoming GitHub PR review requests and display them in a new
Reviews sidebar tab. Users can click "Start Review" to clone the repo,
create a dedicated review session, and launch Claude Code with the
/review-pr skill for automated code review with human approval gate.

Phase 1 — Manual trigger:
- ReviewRequest model and SessionKind enum (.work/.review)
- IssueTracker polls `gh search prs --review-requested @me` every 60s
- ReviewBoardView with sidebar widget and review row list
- SessionService.createReviewSession() clones into crow-reviews/
- /review-pr skill reads diff, analyzes, posts review via gh CLI
- Auto-complete review sessions when PR merges/closes
- Clone cleanup on session deletion

Phase 2 — Automatic detection:
- Delta detection for new review requests between poll cycles
- macOS notifications via reviewRequested NotificationEvent
- Unseen badge count on sidebar review widget

Closes #33

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add --sort updated to gh search and sort parsed results by date
descending so stale review requests sink to the bottom. Display
relative timestamps (e.g., "3 days ago") in each review row.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… fields

gh search prs only supports a subset of JSON fields (no headRefName
or baseRefName). The command was failing silently due to try?, so no
review requests were ever returned. Fix by fetching the basic list
with valid fields, then enriching each result with branch info via
gh pr view which does support those fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the skill from skills/review-pr/ to skills/crow-review-pr/ so
it's bundled and deployed by the Crow app via the Scaffolder, matching
the crow-workspace pattern. Update all references: Scaffolder paths,
bundled resource names, launch command, and SKILL.md activation/examples.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The /crow-review-pr skill wasn't found because Claude Code runs in
the clone directory, not the devRoot. Fix by:

1. Copying the crow-review-pr SKILL.md into the clone's
   .claude/skills/ during createReviewSession()
2. Copying settings.json into the clone's .claude/ for permissions
3. Writing a .crow-review-prompt.md file with the review instructions
4. Launching claude with the prompt file content instead of invoking
   the skill directly (which requires the skill to be in scope)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The review prompt should just invoke the skill with the PR URL — the
skill already has the full review workflow, so duplicating instructions
in the prompt was redundant and would drift out of sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rewrite the skill to match the proven ~/.claude/skills/review-pr/
structure: checkout PR, gather info, security + code quality review,
run static analysis, auto-submit with approve/request-changes/comment
based on findings. Removes the manual approval gate and verbose
analysis categories in favor of the tighter Red/Yellow/Green format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dhilgaertner dhilgaertner force-pushed the feature/crow-33-pr-review-monitoring branch from 64d3041 to 9502ec1 Compare April 7, 2026 19:03
@dhilgaertner dhilgaertner merged commit b89aa71 into main Apr 7, 2026
1 check passed
@dhilgaertner dhilgaertner deleted the feature/crow-33-pr-review-monitoring branch April 7, 2026 19:05
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.

Auto-detect GitHub PR review requests and launch Claude Code review sessions

1 participant