Sovereign 8s.is mirror of 8b-is/prwatch
  • Swift 98.5%
  • Makefile 1.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Peter Lodri ef4a0c3bf1
Some checks failed
CI / Generate & Validate Project (push) Has been cancelled
CI / Unit Tests (macOS 26) (push) Has been cancelled
CI / Build CLI (push) Has been cancelled
feat(claude): security reviewer persona, comments, file contents in XML prompt
Prompt now fetches in parallel before copying to clipboard:
- PR diff (15k char cap)
- All commits
- Issue/discussion comments
- Formal reviews (Approve / Changes Requested with bodies)
- Inline diff line comments (up to 30)
- Changed files manifest (status + additions/deletions)
- Full file contents for up to 12 changed files (security-relevant
  extensions prioritised: rb/py/js/ts/java/swift/go/sql/sh/yml/json)
  — each file capped at 8 000 chars

ContextBuilder.ReviewContext: new struct holding all context
XML structure:
  <review_request>   security persona + Instructure context + output format
  <pull_request>     metadata, labels
  <jira_ticket>      enriched Jira details
  <commits>          commit list with sha+url
  <description>      PR body
  <formal_reviews>   Approve/Changes Requested with bodies
  <inline_comments>  per-file/line reviewer feedback
  <discussion_comments> conversation timeline
  <changed_files>    manifest with change counts
  <file_contents>    full source of touched files
  <diff>             unified diff

Security focus areas: FERPA compliance, multi-tenant isolation,
injection, auth bypass, IDOR, sensitive data, rate limiting.
2026-04-18 05:01:04 +02:00
.github chore: disable changelog CI (was causing merge conflicts), clean CHANGELOG 2026-04-17 18:31:04 +02:00
docs docs: add Claude Code skill section to CONFLUENCE.md 2026-04-17 17:00:20 +02:00
PRWatch feat(claude): security reviewer persona, comments, file contents in XML prompt 2026-04-18 05:01:04 +02:00
PRWatch.xcodeproj feat(claude): security reviewer persona, comments, file contents in XML prompt 2026-04-18 05:01:04 +02:00
PRWatchCLI refactor(claude): enrich review context with commits + Jira, SSO-based auth 2026-04-17 18:44:04 +02:00
PRWatchTests chore(release): v1.3.0 2026-04-17 16:44:28 +02:00
PRWatchWidget Initial commit: PRWatch macOS menu bar app 2026-04-16 21:22:27 +02:00
Shared feat(claude): security reviewer persona, comments, file contents in XML prompt 2026-04-18 05:01:04 +02:00
.editorconfig chore(release): v1.1.0 2026-04-17 15:43:41 +02:00
.gitignore chore: ignore coverage profraw files 2026-04-17 15:52:12 +02:00
CHANGELOG.md chore: disable changelog CI (was causing merge conflicts), clean CHANGELOG 2026-04-17 18:31:04 +02:00
cliff.toml ci(changelog): remove GitHub remote lookup from git-cliff 2026-04-17 16:49:06 +02:00
default.profraw feat: CLI install from app (Settings → General) 2026-04-17 15:52:06 +02:00
Makefile fix: remove CLI from app bundle to prevent macOS 26 signature rejection 2026-04-17 15:59:04 +02:00
Procfile ci: add GitHub Actions, changelog, release automation 2026-04-16 22:11:17 +02:00
project.yml chore(release): v1.3.0 2026-04-17 16:44:28 +02:00
README.md chore(release): v1.2.0 2026-04-17 16:06:29 +02:00

PRWatch

A native macOS menu bar app and CLI for monitoring GitHub pull requests — with Jira integration, a Claude Code session launcher, a review gamification quest, and local SQLite history.

Built with Swift 6 / SwiftUI, targeting macOS 26 (Liquid Glass).


Features

Feature Details
🔀 PR monitoring GitHub GraphQL, real-time status: reviews, CI, mergeable state
🔗 Jira integration Live ticket summaries, status, priority inline in each PR row; assigned tickets section below PR list
✦ Claude Code launcher Writes CLAUDE.md + PR diff, opens iTerm2/Terminal for code review
🦕 Review Quest Gamified PR reviewing: streaks, XP, animated dino progress
📊 Stats & History 7-day health trend chart (Swift Charts), SQLite auto-saved snapshot history
🗓 SQLite history pr_snapshots + stats_snapshots tables, auto-saved every poll; query via prwatch history CLI
📋 Slack templates Copy per-PR or bulk Slack messages with customisable {jira_key} variables (Stepper fixed)
📤 Export Markdown / JSON / CSV reports with historical trend data
🌙 Appearance Dark / Light / Automatic toggle (Settings → General)
💬 Last comment preview Author, time, and body snippet shown inline in each PR row
🔭 Mine / All toggle Header toggle; status bar shows "5 mine · 2✓"
⌨️ CLI Full prwatch CLI with --json output, agent-friendly --help (QUICK START + JSON field docs)

Requirements

Tool Version
macOS 26.0+
Xcode 26+
xcodegen 2.42+
GitHub PAT repo scope + SSO authorised for your org

Local dev setup

# 1. Clone
git clone https://github.com/peterlodri-sec/prwatch.git
cd prwatch

# 2. Install xcodegen (if not already)
brew install xcodegen

# 3. Generate the Xcode project
xcodegen generate

# 4. Open in Xcode
open PRWatch.xcodeproj

# 5. Set signing team
#    Select the PRWatch target → Signing & Capabilities → Team → your Apple ID
#    Repeat for PRWatchWidget
#    (Free personal team works — no paid developer account needed)

# 6. Build & run
#    Press ⌘R — PRWatch appears in the menu bar

First-time configuration

  1. Click the ⎇ icon in the menu bar → ⚙️ Settings
  2. GitHub tab → paste a Personal Access Token → Validate
  3. Jira tab → Base URL (https://company.atlassian.net), email, API token → Validate
  4. Repos tab → confirm instructure/mc-mothership is listed (add more with owner/repo)
  5. Hit ↺ in the header to refresh

SwiftUI skills

This project uses swiftui-skills — Apple-authored SwiftUI guidance extracted from Xcode 26 — to keep the UI idiomatic and reduce hallucinations when using AI assistance.

Install once on any machine with Xcode 26:

curl -fsSL https://raw.githubusercontent.com/ameyalambat128/swiftui-skills/main/src/scripts/install.sh -o /tmp/swiftui-install.sh
bash /tmp/swiftui-install.sh --docs-path \
  "/Applications/Xcode.app/Contents/PlugIns/IDEIntelligenceChat.framework/Versions/A/Resources/AdditionalDocumentation"

The skill is installed to ~/.claude/skills/swiftui-skills/ and is automatically available to Claude Code sessions in this repo.


Tests

# Run all 71 unit tests (unsigned, fast)
make test

# Or via xcodebuild directly
xcodebuild test \
  -project PRWatch.xcodeproj \
  -scheme PRWatch \
  CODE_SIGNING_ALLOWED=NO \
  ENABLE_TESTABILITY=YES

Test coverage:

Suite Tests What's covered
PullRequestTests 12 isReadyToMerge, QA label, needsRebase, age description
JiraServiceTests 8 Ticket extraction from title/branch/body, edge cases
GitHubServiceTests 2 GraphQL enum mapping, unknown value fallback
PRStatsTests 13 Health score bounds, counts, oldest/most-commented
ContextBuilderTests 10 Markdown sections, Jira, labels, body truncation
QuestStateTests 12 Completion, fraction, XP, level titles
SlackMessageServiceTests 14 Template variables, default template, nil-Jira fallback, bulk render
Total 71 7 suites

CLI

CLI Install from the app: Settings → General → CLI Tool section. Requires the PRWatchCLI target to be built first (included automatically when using ⌘B or make release). The binary is placed as a sibling to .app in the bundle's parent directory to preserve the app's code signature.

# Build and install the CLI
make install-cli          # copies to /usr/local/bin/prwatch

# Auth
prwatch auth github --token ghp_…
prwatch auth jira --url https://company.atlassian.net --email me@co.com --token xxx
prwatch auth status

# List PRs
prwatch prs               # table output
prwatch prs --json        # machine-readable
prwatch prs --mine        # only your PRs
prwatch prs --ready       # only merge-ready

# Single PR
prwatch pr 6707 --repo instructure/mc-mothership

# Stats
prwatch stats
prwatch stats --json | jq '.health_score'

# Claude Code context
prwatch context 6707 --print           # dump to stdout
prwatch context 6707 --copy            # copy to clipboard
prwatch context 6707                   # write CLAUDE.md + open claude

# Historical data (reads local SQLite)
prwatch history trend                  # 7-day health chart
prwatch history trend --json           # JSON for automation
prwatch history pr 6707 --repo instructure/mc-mothership

See prwatch --help and prwatch <command> --help for full flag documentation and agent/pipeline tips.


CI / GitHub Actions

Three workflows in .github/workflows/:

Workflow Trigger Runs on
ci.yml push / PR to main macos-15 (generate + CLI build) + [self-hosted, macOS, Xcode-26] (full tests)
release.yml push v* tag [self-hosted, macOS, Xcode-26] — tests → DMG → GitHub Release
changelog.yml push to main ubuntu-latest — updates unreleased section of CHANGELOG.md

Self-hosted runner (required for full CI)

The app uses macOS 26 APIs (glassEffect(), Swift 6) not available on GitHub-hosted runners.

make setup-runner   # prints step-by-step setup instructions

Register your Mac at github.com/peterlodri-sec/prwatch/settings/actions/runners with labels macOS,Xcode-26.

Releasing

make changelog                  # update CHANGELOG.md
make ship VERSION=1.2.0         # test → DMG → tag → push → CI publishes release (current: v1.2.0)

Changelog format follows Conventional Commits (feat:, fix:, perf:, etc.) and is generated by git-cliff.


Repo

Source: https://github.com/peterlodri-sec/prwatch (private)
Full docs: docs/CONFLUENCE.md
License: MIT