gh-pr-review
GitHub PR review operations via gh CLI. Create pending reviews with line comments, submit reviews (approve/reject/comment). Use when adding PR comments, submitting reviews, or managing GitHub code reviews.
What this skill does
# GitHub PR Review
Create and manage GitHub PR reviews with line-specific comments using the `gh` CLI.
## Quick Start
```bash
# Get PR info for current branch
${SKILL_DIR}/scripts/pr-info.sh
# Create a pending review with line comments
echo '{"pr_number":123,"summary":"Review summary","comments":[{"path":"src/app.ts","line":42,"body":"Fix this issue"}]}' | ${SKILL_DIR}/scripts/create-review.sh
# Submit a pending review
${SKILL_DIR}/scripts/submit-review.sh 123 456789 COMMENT "Please address the comments"
```
## Scripts
### pr-info.sh
Get PR context information.
```bash
# Auto-detect PR from current branch
${SKILL_DIR}/scripts/pr-info.sh
# Get info for specific PR
${SKILL_DIR}/scripts/pr-info.sh 123
```
**Output:**
```json
{
"pr_number": 123,
"repo": "owner/repo",
"url": "https://github.com/owner/repo/pull/123",
"files": ["src/app.ts", "src/utils.ts"]
}
```
### create-review.sh
Create a pending review with line comments. The review is NOT submitted - user must submit manually.
```bash
echo '$JSON' | ${SKILL_DIR}/scripts/create-review.sh
```
**Input JSON:**
```json
{
"pr_number": 123,
"summary": "Overall review summary (optional)",
"comments": [
{
"path": "src/app.ts",
"line": 42,
"body": "**Critical:** Missing null check"
},
{
"path": "src/utils.ts",
"start_line": 15,
"line": 20,
"body": "**Suggestion:** Extract this block to a helper function"
}
]
}
```
**Comment Fields:**
| Field | Required | Description |
|-------|----------|-------------|
| `path` | Yes | Relative file path in the repository |
| `line` | Yes | Line number (end line for multi-line comments) |
| `body` | Yes | Comment text (markdown supported) |
| `side` | No | `RIGHT` (additions/context, default) or `LEFT` (deletions) |
| `start_line` | No | First line for multi-line comments (must be < `line`) |
| `start_side` | No | Side for start_line (defaults to match `side`) |
**Single-line comment:** Use `path`, `line`, `body`
**Multi-line comment:** Add `start_line` (and optionally `start_side`)
**Output:**
```json
{
"review_id": 456789,
"url": "https://github.com/owner/repo/pull/123#pullrequestreview-456789",
"comment_count": 1,
"status": "PENDING"
}
```
### submit-review.sh
Submit a pending review with an event type.
```bash
${SKILL_DIR}/scripts/submit-review.sh <pr_number> <review_id> <event> [body]
```
**Events:**
- `APPROVE` - Approve the PR
- `REQUEST_CHANGES` - Request changes before merge
- `COMMENT` - Leave feedback without approval/rejection
**Example:**
```bash
${SKILL_DIR}/scripts/submit-review.sh 123 456789 REQUEST_CHANGES "Please address the inline comments"
```
## Comment Format
For code review comments, use this format for clarity:
```markdown
**[Severity]:** Brief description
**Why:** Explanation of the issue
**Fix:** Suggested solution or code example
```
Severity levels:
- **Critical** - Must fix before merge
- **Warning** - Should fix
- **Suggestion** - Consider for improvement
## Error Handling
Scripts return JSON errors:
```json
{
"error": true,
"message": "gh CLI not authenticated. Run 'gh auth login' first.",
"code": "AUTH_REQUIRED"
}
```
Error codes:
- `AUTH_REQUIRED` - Run `gh auth login`
- `NO_PR` - No PR found for current branch
- `API_ERROR` - GitHub API error (check message)
- `INVALID_INPUT` - Invalid JSON input
## Workflow Example
1. **Get PR info:**
```bash
PR_INFO=$(${SKILL_DIR}/scripts/pr-info.sh)
```
2. **Review the code** and collect findings
3. **Create pending review:**
```bash
echo '{"pr_number":123,"comments":[...]}' | ${SKILL_DIR}/scripts/create-review.sh
```
4. **User reviews comments on GitHub** and edits if needed
5. **User submits review** via GitHub UI or:
```bash
${SKILL_DIR}/scripts/submit-review.sh 123 $REVIEW_ID COMMENT
```
## Requirements
- `gh` CLI installed and authenticated (`gh auth login`)
- `jq` for JSON processing
- Git repository with GitHub remote
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.