Skip to content

Commit 9cae8fd

Browse files
committed
perform-forge-review: Add AI-driven forge review skill
Add a skill for AI-assisted code review workflow on GitHub, GitLab, or Forgejo. The key design principle is human oversight: the AI builds review comments in a local JSONL file which the human can inspect and edit before submission. Reviews are submitted as pending/draft, allowing final edits in the forge UI. Includes scripts/reviewtool, a Python 3 CLI with no external dependencies that handles checkout, comment building, and submission to various forges. Migrated from bootc-dev/infra PR #64. Assisted-by: OpenCode (Claude Sonnet 4) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 76c8e31 commit 9cae8fd

2 files changed

Lines changed: 632 additions & 0 deletions

File tree

perform-forge-review/SKILL.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: perform-forge-review
3+
description: Create AI-assisted code reviews on GitHub, GitLab, or Forgejo. Use when asked to review a PR/MR, analyze code changes, or provide review feedback.
4+
---
5+
6+
# Perform Forge Review
7+
8+
Create code reviews on GitHub, GitLab, or Forgejo with human oversight.
9+
10+
## Workflow
11+
12+
Use `scripts/reviewtool` for all operations. It requires Python 3 with no
13+
external dependencies.
14+
15+
### 1. Check out the PR
16+
17+
```bash
18+
scripts/reviewtool checkout 123
19+
```
20+
21+
This checks out the PR branch and shows the diff. For GitLab/Forgejo, set
22+
the appropriate environment variables first.
23+
24+
### 2. Review the code
25+
26+
Read the files, understand the changes. Use `git diff` and `git log` as needed.
27+
28+
### 3. Build comments
29+
30+
Start a review, then add comments:
31+
32+
```bash
33+
scripts/reviewtool start --pr 123 --body "Assisted-by: OpenCode (Claude Sonnet 4)
34+
35+
AI-generated review. Comments prefixed with AI: are unedited."
36+
37+
scripts/reviewtool add --pr 123 \
38+
--file src/lib.rs --line 42 --match "fn process_data" \
39+
--body "AI: *Important*: Missing error handling"
40+
```
41+
42+
The `--match` flag validates the line content to prevent misplaced comments.
43+
44+
### 4. Submit
45+
46+
```bash
47+
scripts/reviewtool submit --pr 123
48+
```
49+
50+
The review is created as pending/draft. The human reviews in the forge UI
51+
and submits when satisfied.
52+
53+
## Comment conventions
54+
55+
**Prefixes:**
56+
- `AI: ` — unedited AI output
57+
- `@ai: ` — human question for AI to process
58+
- No prefix — human reviewed/edited
59+
60+
**Priority markers:**
61+
- `*Important*:` — must resolve before merge
62+
- (none) — normal suggestion
63+
- `(low)` — minor nit
64+
65+
## Review body
66+
67+
Do not summarize the PR changes. The body should contain:
68+
- Attribution (required)
69+
- Concerns not tied to specific lines (optional)
70+
71+
Avoid positive-only inline comments — they create noise.

0 commit comments

Comments
 (0)