Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .agents/plugins/pr-queue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# PR Queue Plugin

Side panel UI (`sidecar://pr-queue/pr_queue/`) showing pending GitHub pull
requests with buttons to launch manual code reviews in isolated Git worktrees.

## Behavior

- Displays open GitHub PRs filtered by review status, author, draft state, age,
or custom search query using the `gh` CLI.
- Fetches on demand without automatic reviews or background polling.
- Clicking a PR review button creates or updates a dedicated Git worktree at the
PR head commit and starts a new conversation running
`.agents/skills/review-code/SKILL.md`.

## Requirements

- Python 3.13 or higher on `PATH`.
- Authenticated `gh` CLI (`gh auth status`) with access to the target repo.
- A local Git clone of the target repo containing an `upstream` (or `origin`)
remote so review worktrees can be created from `refs/pull/<N>/head`.
- Global registration in `~/.gemini/config/plugins/pr-queue` (for example via a
symlink to this directory) so the agent IDE starts `pr-queue/pr_queue`.

## Files

- `plugin.json`: Plugin manifest.
- `rules/AGENTS.md`: Rule surfacing `[📋 PR Queue](sidecar://pr-queue/pr_queue/)`
when `/pr-queue` is requested.
- `skills/pr-queue/SKILL.md`: `/pr-queue` skill instructions.
- `sidecars/pr_queue/BUILD.bazel`: Bazel library and test targets for the
sidecar.
- `sidecars/pr_queue/sidecar.json`: Sidecar registration and UI view config.
- `sidecars/pr_queue/fetch_pr_queue.py`: `gh`-based PR queue fetcher and
filter CLI.
- `sidecars/pr_queue/state_store.py`: Validated config and JSON state storage.
- `sidecars/pr_queue/git_worktree.py`: Git repo detection and PR worktree setup.
- `sidecars/pr_queue/ls_client.py`: Loopback Language Server RPC client.
- `sidecars/pr_queue/server.py`: HTTP backend serving the UI, cached PR queue,
review conversation lookup, and worktree/chat launcher.
- `sidecars/pr_queue/index.html`: Adaptive dark/light side panel frontend.
- `sidecars/pr_queue/fetch_pr_queue_test.py`: Unit tests for `fetch_pr_queue`.
- `sidecars/pr_queue/server_test.py`: Unit tests for `server`, `state_store`,
`git_worktree`, and `ls_client`.
6 changes: 6 additions & 0 deletions .agents/plugins/pr-queue/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "pr-queue",
"displayName": "PR Queue",
"description": "Pending GitHub PR review queue and manual PR code review launcher side panel",
"suggestedPrompts": ["/pr-queue"]
}
8 changes: 8 additions & 0 deletions .agents/plugins/pr-queue/rules/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PR Queue Plugin Rule

- The `pr-queue` UI plugin (`sidecar://pr-queue/pr_queue/`) runs as a background
sidecar in the agent IDE.
- When the user types `/pr-queue` or asks to open the PR Queue plugin, surface
the one-click pill `[📋 PR Queue](sidecar://pr-queue/pr_queue/)`.
- Do not include `[📋 PR Queue](sidecar://pr-queue/pr_queue/)` on unrelated
turns.
83 changes: 83 additions & 0 deletions .agents/plugins/pr-queue/sidecars/pr_queue/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
load("//python:py_library.bzl", "py_library")
load("//python:py_test.bzl", "py_test")
load("//tests/support:support.bzl", "NOT_WINDOWS")

package(default_visibility = ["//visibility:private"])

# Sidecar targets POSIX IDE daemon/worktree conventions; exclude Windows builds.
_SIDECAR_COMPAT = NOT_WINDOWS

py_library(
name = "fetch_pr_queue",
srcs = ["fetch_pr_queue.py"],
imports = ["."],
target_compatible_with = _SIDECAR_COMPAT,
)

py_library(
name = "state_store",
srcs = ["state_store.py"],
imports = ["."],
target_compatible_with = _SIDECAR_COMPAT,
deps = [":fetch_pr_queue"],
)

py_library(
name = "ls_client",
srcs = ["ls_client.py"],
imports = ["."],
target_compatible_with = _SIDECAR_COMPAT,
deps = [
":fetch_pr_queue",
":state_store",
],
)

py_library(
name = "git_worktree",
srcs = ["git_worktree.py"],
imports = ["."],
target_compatible_with = _SIDECAR_COMPAT,
deps = [
":fetch_pr_queue",
":ls_client",
":state_store",
],
)

py_library(
name = "server",
srcs = ["server.py"],
data = ["index.html"],
imports = ["."],
target_compatible_with = _SIDECAR_COMPAT,
deps = [
":fetch_pr_queue",
":git_worktree",
":ls_client",
":state_store",
],
)

py_test(
name = "fetch_pr_queue_test",
size = "small",
srcs = ["fetch_pr_queue_test.py"],
target_compatible_with = _SIDECAR_COMPAT,
deps = [":fetch_pr_queue"],
)

py_test(
name = "server_test",
size = "small",
srcs = ["server_test.py"],
data = ["index.html"],
target_compatible_with = _SIDECAR_COMPAT,
deps = [
":fetch_pr_queue",
":git_worktree",
":ls_client",
":server",
":state_store",
],
)
Loading
Loading