review-gate
HARD GATE before PR creation - verifies review artifact exists in issue comments, all findings addressed or tracked, blocks PR creation if requirements not met
What this skill does
# Review Gate
## Overview
Hard compliance gate that BLOCKS PR creation until review requirements are satisfied.
**Core principle:** No PR without proof of review. No exceptions.
**This is enforced by hooks.** Even if you attempt to skip this skill, the `PreToolUse` hook on `gh pr create` will block the action.
## Gate Requirements
ALL must be satisfied to create a PR:
```
┌──────────────────────────────────────────────────────────────────────────┐
│ REVIEW GATE │
├──────────────────────────────────────────────────────────────────────────┤
│ [ ] Review artifact posted to issue (<!-- REVIEW:START --> format) │
│ [ ] Review status is COMPLETE (not BLOCKED or IN_PROGRESS) │
│ [ ] Unaddressed findings = 0 │
│ [ ] All deferred findings have tracking issues (linked in artifact) │
│ [ ] Security review complete (if security-sensitive code changed) │
├──────────────────────────────────────────────────────────────────────────┤
│ ALL SATISFIED → PR CREATION ALLOWED │
│ ANY MISSING → PR CREATION BLOCKED │
└──────────────────────────────────────────────────────────────────────────┘
```
## Verification Process
### Step 1: Check Review Artifact Exists
```bash
# Query issue comments for review artifact
ISSUE_NUMBER=123
REPO=$(gh repo view --json nameWithOwner --jq '.nameWithOwner')
REVIEW_EXISTS=$(gh api "/repos/$REPO/issues/$ISSUE_NUMBER/comments" \
--jq '[.[] | select(.body | contains("<!-- REVIEW:START -->"))] | length')
if [ "$REVIEW_EXISTS" -eq 0 ]; then
echo "BLOCKED: No review artifact found"
fi
```
### Step 2: Parse Review Status
Extract from the latest review artifact:
```bash
# Get latest review comment
REVIEW_BODY=$(gh api "/repos/$REPO/issues/$ISSUE_NUMBER/comments" \
--jq '[.[] | select(.body | contains("<!-- REVIEW:START -->"))] | last | .body')
# Check status
if echo "$REVIEW_BODY" | grep -q "Review Status.*COMPLETE"; then
echo "Review status: COMPLETE"
elif echo "$REVIEW_BODY" | grep -q "Review Status.*BLOCKED"; then
echo "BLOCKED: Review status is BLOCKED_ON_DEPENDENCIES"
fi
```
### Step 3: Verify No Unaddressed Findings
```bash
# Extract unaddressed count
UNADDRESSED=$(echo "$REVIEW_BODY" | grep -oP 'Unaddressed[:\s|]+\K\d+' | head -1)
if [ "$UNADDRESSED" != "0" ]; then
echo "BLOCKED: $UNADDRESSED unaddressed findings"
fi
```
### Step 4: Verify Deferred Findings Have Tracking Issues
For each deferred finding, verify a tracking issue exists and is linked:
```bash
# Each deferred finding must have format: | Finding | ... | #NNN | ...
DEFERRED_WITHOUT_ISSUE=$(echo "$REVIEW_BODY" | grep -i "DEFERRED" | grep -cv "#[0-9]" || echo "0")
if [ "$DEFERRED_WITHOUT_ISSUE" -gt 0 ]; then
echo "BLOCKED: $DEFERRED_WITHOUT_ISSUE deferred findings without tracking issues"
fi
```
### Step 5: Security Review (Conditional)
If files matching security-sensitive patterns were changed:
```bash
# Check if security-sensitive files changed
SECURITY_FILES=$(git diff --name-only HEAD~1 | grep -E '(auth|security|middleware|api|password|token|secret)')
if [ -n "$SECURITY_FILES" ]; then
# Verify security review section exists in artifact
if ! echo "$REVIEW_BODY" | grep -q "Security-Sensitive.*YES"; then
echo "BLOCKED: Security-sensitive files changed but no security review"
fi
fi
```
## Review Artifact Format
The review artifact MUST follow this exact format for machine parsing:
```markdown
<!-- REVIEW:START -->
## Code Review Complete
| Property | Value |
|----------|-------|
| Worker | `[WORKER_ID]` |
| Issue | #[ISSUE_NUMBER] |
| Scope | [MINOR|MAJOR] |
| Security-Sensitive | [YES|NO] |
| Reviewed | [ISO_TIMESTAMP] |
### Criteria Results
| # | Criterion | Status | Findings |
|---|-----------|--------|----------|
| 1 | Blindspots | [✅ PASS|✅ FIXED|⚠️ DEFERRED] | [N] |
| 2 | Clarity | [✅ PASS|✅ FIXED|⚠️ DEFERRED] | [N] |
| 3 | Maintainability | [✅ PASS|✅ FIXED|⚠️ DEFERRED] | [N] |
| 4 | Security | [✅ PASS|✅ FIXED|⚠️ DEFERRED|N/A] | [N] |
| 5 | Performance | [✅ PASS|✅ FIXED|⚠️ DEFERRED] | [N] |
| 6 | Documentation | [✅ PASS|✅ FIXED|⚠️ DEFERRED] | [N] |
| 7 | Style | [✅ PASS|✅ FIXED|⚠️ DEFERRED] | [N] |
### Findings Fixed in This PR
| # | Severity | Finding | Resolution |
|---|----------|---------|------------|
| 1 | [SEVERITY] | [DESCRIPTION] | [HOW_FIXED] |
### Findings Deferred (With Tracking Issues)
| # | Severity | Finding | Tracking Issue | Justification |
|---|----------|---------|----------------|---------------|
| 1 | [SEVERITY] | [DESCRIPTION] | #[ISSUE] | [WHY] |
### Summary
| Category | Count |
|----------|-------|
| Fixed in PR | [N] |
| Deferred (with tracking) | [N] |
| Unaddressed | 0 |
**Review Status:** [✅ COMPLETE|⏸️ BLOCKED_ON_DEPENDENCIES]
<!-- REVIEW:END -->
```
## Blocked Scenarios
### Missing Review Artifact
```
REVIEW GATE BLOCKED
Reason: No review artifact found in issue #123
Required Action:
1. Perform comprehensive-review
2. Post review artifact to issue #123 using standard format
3. Address all findings or create tracking issues
4. Retry PR creation
Hint: Use the code-reviewer subagent to perform review.
```
### Unaddressed Findings
```
REVIEW GATE BLOCKED
Reason: 3 unaddressed findings in review artifact
Required Action:
1. Fix the unaddressed findings, OR
2. Create tracking issues and update artifact with links
3. Ensure "Unaddressed: 0" in artifact summary
4. Retry PR creation
```
### Missing Security Review
```
REVIEW GATE BLOCKED
Reason: Security-sensitive files changed without security review
Files detected:
- src/auth/login.ts
- src/middleware/authenticate.ts
Required Action:
1. Invoke security-reviewer subagent
2. Update review artifact with "Security-Sensitive: YES"
3. Document security review findings
4. Retry PR creation
```
## Checklist
Before attempting PR creation:
- [ ] `comprehensive-review` skill completed
- [ ] Review artifact posted to issue (exact format)
- [ ] All findings either FIXED or DEFERRED
- [ ] All DEFERRED findings have tracking issues created
- [ ] Tracking issue numbers in artifact
- [ ] Security review if security-sensitive files changed
- [ ] "Unaddressed: 0" in summary
- [ ] "Review Status: COMPLETE"
## Integration
This skill is enforced by:
- `PreToolUse` hook on `Bash` (filters `gh pr create`)
This skill is called after:
- `comprehensive-review`
- `apply-all-findings`
- `security-review` (if applicable)
This skill precedes:
- `pr-creation`
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.