feat(plugins): implement Sprint 4 commands (#241-#258)
Sprint 4 - Plugin Commands implementation adding 18 new user-facing commands across 8 plugins as part of V5.2.0 Plugin Enhancements. **projman:** - #241: /sprint-diagram - Mermaid visualization of sprint issues **pr-review:** - #242: Confidence threshold config (PR_REVIEW_CONFIDENCE_THRESHOLD) - #243: /pr-diff - Formatted diff with inline review comments **data-platform:** - #244: /data-quality - DataFrame quality checks (nulls, duplicates, outliers) - #245: /lineage-viz - dbt lineage as Mermaid diagrams - #246: /dbt-test - Formatted dbt test runner **viz-platform:** - #247: /chart-export - Export charts to PNG/SVG/PDF via kaleido - #248: /accessibility-check - Color blind validation (WCAG contrast) - #249: /breakpoints - Responsive layout configuration **contract-validator:** - #250: /dependency-graph - Plugin dependency visualization **doc-guardian:** - #251: /changelog-gen - Generate changelog from conventional commits - #252: /doc-coverage - Documentation coverage metrics - #253: /stale-docs - Flag outdated documentation **claude-config-maintainer:** - #254: /config-diff - Track CLAUDE.md changes over time - #255: /config-lint - 31 lint rules for CLAUDE.md best practices **cmdb-assistant:** - #256: /cmdb-topology - Infrastructure topology diagrams - #257: /change-audit - NetBox audit trail queries - #258: /ip-conflicts - Detect IP conflicts and overlaps Closes #241, #242, #243, #244, #245, #246, #247, #248, #249, #250, #251, #252, #253, #254, #255, #256, #257, #258 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ pr-review conducts comprehensive code reviews using specialized agents for secur
|
||||
| `/pr-review <pr#>` | Full multi-agent review |
|
||||
| `/pr-summary <pr#>` | Quick summary without full review |
|
||||
| `/pr-findings <pr#>` | Filter findings by category/confidence |
|
||||
| `/pr-diff <pr#>` | View diff with inline comment annotations |
|
||||
| `/initial-setup` | Full interactive setup wizard |
|
||||
| `/project-init` | Quick project setup (system already configured) |
|
||||
| `/project-sync` | Sync configuration with current git remote |
|
||||
@@ -51,14 +52,38 @@ Requires Gitea MCP server configuration.
|
||||
|
||||
## Configuration
|
||||
|
||||
Environment variables can be set in your project's `.env` file or shell environment.
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `PR_REVIEW_CONFIDENCE_THRESHOLD` | `0.7` | Minimum confidence score (0.0-1.0) for reporting findings. Findings below this threshold are filtered out to reduce noise. |
|
||||
| `PR_REVIEW_AUTO_SUBMIT` | `false` | Automatically submit review to Gitea without confirmation prompt |
|
||||
|
||||
### Example Configuration
|
||||
|
||||
```bash
|
||||
# Minimum confidence to report (default: 0.5)
|
||||
PR_REVIEW_CONFIDENCE_THRESHOLD=0.5
|
||||
# Project .env file
|
||||
|
||||
# Only show high-confidence findings (MEDIUM and HIGH)
|
||||
PR_REVIEW_CONFIDENCE_THRESHOLD=0.7
|
||||
|
||||
# Auto-submit review to Gitea (default: false)
|
||||
PR_REVIEW_AUTO_SUBMIT=false
|
||||
```
|
||||
|
||||
### Confidence Threshold Details
|
||||
|
||||
The confidence threshold filters which findings appear in review output:
|
||||
|
||||
| Threshold | Effect |
|
||||
|-----------|--------|
|
||||
| `0.9` | Only definite issues (HIGH confidence) |
|
||||
| `0.7` | Likely issues and above (MEDIUM+HIGH) - **recommended** |
|
||||
| `0.5` | Include possible concerns (LOW+MEDIUM+HIGH) |
|
||||
| `0.3` | Include speculative findings |
|
||||
|
||||
Lower thresholds show more findings but may include false positives. Higher thresholds reduce noise but may miss some valid concerns.
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Full Review
|
||||
|
||||
@@ -120,10 +120,13 @@ Focus on findings that:
|
||||
|
||||
### Respect Confidence Thresholds
|
||||
|
||||
Never report findings below 0.5 confidence. Be transparent about uncertainty:
|
||||
- 0.9+ → "This is definitely an issue"
|
||||
- 0.7-0.89 → "This is likely an issue"
|
||||
- 0.5-0.69 → "This might be an issue"
|
||||
Filter findings based on `PR_REVIEW_CONFIDENCE_THRESHOLD` (default: 0.7). Be transparent about uncertainty:
|
||||
- 0.9+ → "This is definitely an issue" (HIGH)
|
||||
- 0.7-0.89 → "This is likely an issue" (MEDIUM)
|
||||
- 0.5-0.69 → "This might be an issue" (LOW)
|
||||
- < threshold → Filtered from output
|
||||
|
||||
With the default threshold of 0.7, only MEDIUM and HIGH confidence findings are reported.
|
||||
|
||||
### Avoid Noise
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ This project uses the pr-review plugin for automated code review.
|
||||
| `/pr-review <pr#>` | Full multi-agent review |
|
||||
| `/pr-summary <pr#>` | Quick change summary |
|
||||
| `/pr-findings <pr#>` | Filter review findings |
|
||||
| `/pr-diff <pr#>` | View diff with inline comments |
|
||||
|
||||
### Review Categories
|
||||
|
||||
@@ -26,11 +27,16 @@ Reviews analyze:
|
||||
|
||||
### Confidence Threshold
|
||||
|
||||
Findings below 0.5 confidence are suppressed.
|
||||
Configure via `PR_REVIEW_CONFIDENCE_THRESHOLD` (default: 0.7).
|
||||
|
||||
- HIGH (0.9+): Definite issue
|
||||
- MEDIUM (0.7-0.89): Likely issue
|
||||
- LOW (0.5-0.69): Possible concern
|
||||
| Range | Label | Action |
|
||||
|-------|-------|--------|
|
||||
| 0.9 - 1.0 | HIGH | Must address |
|
||||
| 0.7 - 0.89 | MEDIUM | Should address |
|
||||
| 0.5 - 0.69 | LOW | Consider addressing |
|
||||
| < threshold | (filtered) | Not reported |
|
||||
|
||||
With default threshold of 0.7, only MEDIUM and HIGH findings are shown.
|
||||
|
||||
### Verdict Rules
|
||||
|
||||
|
||||
154
plugins/pr-review/commands/pr-diff.md
Normal file
154
plugins/pr-review/commands/pr-diff.md
Normal file
@@ -0,0 +1,154 @@
|
||||
# /pr-diff - Annotated PR Diff Viewer
|
||||
|
||||
## Purpose
|
||||
|
||||
Display the PR diff with inline annotations from review comments, making it easy to see what feedback has been given alongside the code changes.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/pr-diff <pr-number> [--repo owner/repo] [--context <lines>]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--repo <owner/repo> Override repository (default: from .env)
|
||||
--context <n> Lines of context around changes (default: 3)
|
||||
--no-comments Show diff without comment annotations
|
||||
--file <pattern> Filter to specific files (glob pattern)
|
||||
```
|
||||
|
||||
## Behavior
|
||||
|
||||
### Step 1: Fetch PR Data
|
||||
|
||||
Using Gitea MCP tools:
|
||||
1. `get_pr_diff` - Unified diff of all changes
|
||||
2. `get_pr_comments` - All review comments on the PR
|
||||
|
||||
### Step 2: Parse and Annotate
|
||||
|
||||
Parse the diff and overlay comments at their respective file/line positions:
|
||||
|
||||
```
|
||||
═══════════════════════════════════════════════════
|
||||
PR #123 Diff - Add user authentication
|
||||
═══════════════════════════════════════════════════
|
||||
|
||||
Branch: feat/user-auth → development
|
||||
Files: 12 changed (+234 / -45)
|
||||
|
||||
───────────────────────────────────────────────────
|
||||
src/api/users.ts (+85 / -12)
|
||||
───────────────────────────────────────────────────
|
||||
|
||||
@@ -42,6 +42,15 @@ export async function getUser(id: string) {
|
||||
42 │ const db = getDatabase();
|
||||
43 │
|
||||
44 │- const user = db.query("SELECT * FROM users WHERE id = " + id);
|
||||
│ ┌─────────────────────────────────────────────────────────────
|
||||
│ │ COMMENT by @reviewer (2h ago):
|
||||
│ │ This is a SQL injection vulnerability. Use parameterized
|
||||
│ │ queries instead: `db.query("SELECT * FROM users WHERE id = ?", [id])`
|
||||
│ └─────────────────────────────────────────────────────────────
|
||||
45 │+ const query = "SELECT * FROM users WHERE id = ?";
|
||||
46 │+ const user = db.query(query, [id]);
|
||||
47 │
|
||||
48 │ if (!user) {
|
||||
49 │ throw new NotFoundError("User not found");
|
||||
50 │ }
|
||||
|
||||
@@ -78,3 +87,12 @@ export async function updateUser(id: string, data: UserInput) {
|
||||
87 │+ // Validate input before update
|
||||
88 │+ validateUserInput(data);
|
||||
89 │+
|
||||
90 │+ const result = db.query(
|
||||
91 │+ "UPDATE users SET name = ?, email = ? WHERE id = ?",
|
||||
92 │+ [data.name, data.email, id]
|
||||
93 │+ );
|
||||
│ ┌─────────────────────────────────────────────────────────────
|
||||
│ │ COMMENT by @maintainer (1h ago):
|
||||
│ │ Good use of parameterized query here!
|
||||
│ │
|
||||
│ │ REPLY by @author (30m ago):
|
||||
│ │ Thanks! Applied the same pattern throughout.
|
||||
│ └─────────────────────────────────────────────────────────────
|
||||
|
||||
───────────────────────────────────────────────────
|
||||
src/components/LoginForm.tsx (+65 / -0) [NEW FILE]
|
||||
───────────────────────────────────────────────────
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
1 │+import React, { useState } from 'react';
|
||||
2 │+import { useAuth } from '../context/AuthContext';
|
||||
3 │+
|
||||
4 │+export function LoginForm() {
|
||||
5 │+ const [email, setEmail] = useState('');
|
||||
6 │+ const [password, setPassword] = useState('');
|
||||
7 │+ const { login } = useAuth();
|
||||
|
||||
... (remaining diff content)
|
||||
|
||||
═══════════════════════════════════════════════════
|
||||
Comment Summary: 5 comments, 2 resolved
|
||||
═══════════════════════════════════════════════════
|
||||
```
|
||||
|
||||
### Step 3: Filter by Confidence (Optional)
|
||||
|
||||
If `PR_REVIEW_CONFIDENCE_THRESHOLD` is set, also annotate with high-confidence findings from previous reviews:
|
||||
|
||||
```
|
||||
44 │- const user = db.query("SELECT * FROM users WHERE id = " + id);
|
||||
│ ┌─── REVIEW FINDING (0.95 HIGH) ─────────────────────────────
|
||||
│ │ [SEC-001] SQL Injection Vulnerability
|
||||
│ │ Use parameterized queries to prevent injection attacks.
|
||||
│ └─────────────────────────────────────────────────────────────
|
||||
│ ┌─── COMMENT by @reviewer ────────────────────────────────────
|
||||
│ │ This is a SQL injection vulnerability...
|
||||
│ └─────────────────────────────────────────────────────────────
|
||||
```
|
||||
|
||||
## Output Formats
|
||||
|
||||
### Default (Annotated Diff)
|
||||
|
||||
Full diff with inline comments as shown above.
|
||||
|
||||
### Plain (--no-comments)
|
||||
|
||||
```
|
||||
/pr-diff 123 --no-comments
|
||||
|
||||
# Standard unified diff output without annotations
|
||||
```
|
||||
|
||||
### File Filter (--file)
|
||||
|
||||
```
|
||||
/pr-diff 123 --file "src/api/*"
|
||||
|
||||
# Shows diff only for files matching pattern
|
||||
```
|
||||
|
||||
## Use Cases
|
||||
|
||||
- **Review preparation**: See the full context of changes with existing feedback
|
||||
- **Followup work**: Understand what was commented on and where
|
||||
- **Discussion context**: View threaded conversations alongside the code
|
||||
- **Progress tracking**: See which comments have been resolved
|
||||
|
||||
## Configuration
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `PR_REVIEW_CONFIDENCE_THRESHOLD` | `0.7` | Minimum confidence for showing review findings |
|
||||
|
||||
## Related Commands
|
||||
|
||||
| Command | Purpose |
|
||||
|---------|---------|
|
||||
| `/pr-summary` | Quick overview without diff |
|
||||
| `/pr-review` | Full multi-agent review |
|
||||
| `/pr-findings` | Filter review findings by category |
|
||||
@@ -46,14 +46,16 @@ Collect findings from all agents, each with:
|
||||
|
||||
### Step 4: Filter by Confidence
|
||||
|
||||
Only display findings with confidence >= 0.5:
|
||||
Filter findings based on `PR_REVIEW_CONFIDENCE_THRESHOLD` (default: 0.7):
|
||||
|
||||
| Confidence | Label | Description |
|
||||
|------------|-------|-------------|
|
||||
| 0.9 - 1.0 | HIGH | Definite issue, must address |
|
||||
| 0.7 - 0.89 | MEDIUM | Likely issue, should address |
|
||||
| 0.5 - 0.69 | LOW | Possible concern, consider addressing |
|
||||
| < 0.5 | (suppressed) | Too uncertain to report |
|
||||
| < threshold | (filtered) | Below configured threshold |
|
||||
|
||||
**Note:** With the default threshold of 0.7, only MEDIUM and HIGH confidence findings are shown. Adjust `PR_REVIEW_CONFIDENCE_THRESHOLD` to include more or fewer findings.
|
||||
|
||||
### Step 5: Generate Report
|
||||
|
||||
@@ -135,5 +137,5 @@ Full review report with:
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `PR_REVIEW_CONFIDENCE_THRESHOLD` | `0.5` | Minimum confidence to report |
|
||||
| `PR_REVIEW_CONFIDENCE_THRESHOLD` | `0.7` | Minimum confidence to report (0.0-1.0) |
|
||||
| `PR_REVIEW_AUTO_SUBMIT` | `false` | Auto-submit to Gitea |
|
||||
|
||||
@@ -73,10 +73,12 @@ Base confidence by pattern:
|
||||
|
||||
## Threshold Configuration
|
||||
|
||||
The default threshold is 0.5. This can be adjusted:
|
||||
The default threshold is 0.7 (showing MEDIUM and HIGH confidence findings). This can be adjusted:
|
||||
|
||||
```bash
|
||||
PR_REVIEW_CONFIDENCE_THRESHOLD=0.7 # Only high-confidence
|
||||
PR_REVIEW_CONFIDENCE_THRESHOLD=0.9 # Only definite issues (HIGH)
|
||||
PR_REVIEW_CONFIDENCE_THRESHOLD=0.7 # Likely issues and above (MEDIUM+HIGH) - default
|
||||
PR_REVIEW_CONFIDENCE_THRESHOLD=0.5 # Include possible concerns (LOW+)
|
||||
PR_REVIEW_CONFIDENCE_THRESHOLD=0.3 # Include more speculative
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user