@gtheys/pi-review

Pi extension — /review, /sonarqube, and /pr-quality commands powered by GitHub and SonarCloud

Packages

Package details

extension

Install @gtheys/pi-review from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@gtheys/pi-review
Package
@gtheys/pi-review
Version
0.2.0
Published
Jul 30, 2026
Downloads
125/mo · 26/wk
Author
gtheys
License
MIT
Types
extension
Size
109.8 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./review/review.ts",
    "./sonarqube/sonarqube.ts",
    "./pr-quality/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-review

Pi extension providing code-review commands powered by GitHub and SonarCloud.

Extensions

Entry Description
review/review.ts /review — agent-driven code review
sonarqube/sonarqube.ts /sonarqube — SonarCloud coverage and quality analysis
pr-quality/index.ts /pr-quality — combined PR thread triage + SonarCloud

/review

Agent-driven code review. Supports multiple targets:

/review                     — pick mode interactively
/review pr <number>         — review a specific PR

Modes: uncommitted changes, base branch diff, specific commit, pull request, folder diff, or custom instructions.

When reviewing a pull request, if tuicr and herdr are on PATH and the session is running inside Herdr (HERDR_ENV=1), /review also opens a tuicr pr <n> TUI in a Herdr pane on the right, and asks the agent to add its findings into that session via tuicr review add (see the tuicr skill).


/sonarqube

Fetches SonarCloud coverage metrics and quality issues for a PR, generates a sonarqube-report.md in the repo root, then sends the report to the agent.

Prerequisites

Requirement How to set up
SONARQUBE_TOKEN export SONARQUBE_TOKEN=<token> from https://sonarcloud.io/account/security
SonarCloud project sonar-project.properties with sonar.projectKey and sonar.organization, or SONAR_PROJECT_KEY + SONAR_ORGANIZATION env vars

Usage

/sonarqube                             — auto-detect PR from current branch
/sonarqube 283                         — explicit PR number
/sonarqube 283 --severity=BLOCKER,CRITICAL
/sonarqube 283 --types=BUG,VULNERABILITY
/sonarqube 283 --files=src/auth/*

/pr-quality

Combined command: CI guard → GitHub unresolved threads + SonarCloud data (fetched in parallel) → structured agent prompt.

Prerequisites

Same as /sonarqube above, plus gh CLI authenticated (gh auth login).

Usage

/pr-quality          — auto-detect PR from current branch
/pr-quality 283      — explicit PR number

What it does

  1. CI guard — exits early if any check is QUEUED or IN_PROGRESS.
  2. Parallel fetch — GitHub GraphQL (unresolved review threads) + SonarCloud (coverage + issues).
  3. Agent prompt — three tasks:
Task What the agent does
A — Triage comments Classifies threads VALID/INVALID, auto-resolves INVALID via GitHub GraphQL
B — SonarCloud issues Addresses issues in severity order (BLOCKER → CRITICAL → MAJOR)
C — Action plan Writes pr-quality-plan.md with checkbox lists