From bmad-utility-skills
Runs parallel adversarial and edge-case review layers on a GitHub PR, then merges findings into a professional engineering report. Use with an explicit PR number or URL.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bmad-utility-skills:bmad-os-review-prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A cynical adversarial review, transformed into cold engineering professionalism.
A cynical adversarial review, transformed into cold engineering professionalism.
Before proceeding, you MUST verify:
If no explicit PR number/URL was provided, STOP immediately and ask: "What PR number or URL should I review?"
Extract PR number from user input. Examples of valid formats:
123 (just the number)#123 (with hash)https://github.com/owner/repo/pull/123 (full URL)If a URL specifies a different repository than the current one:
# Check current repo
gh repo view --json nameWithOwner -q '.nameWithOwner'
If mismatch detected, ask user:
"This PR is from
{detected_repo}but we're in{current_repo}. Proceed with reviewing{detected_repo}#123? (y/n)"
If user confirms, store {REPO} for use in all subsequent gh commands.
Verify the working tree is clean and check out the PR branch.
# Check for uncommitted changes
git status --porcelain
If output is non-empty, STOP and tell user:
"You have uncommitted changes. Please commit or stash them before running a PR review."
If clean, fetch and checkout the PR branch:
# Fetch and checkout PR branch
# For cross-repo PRs, include --repo {REPO}
gh pr checkout {PR_NUMBER} [--repo {REPO}]
If checkout fails, STOP and report the error.
Now you're on the PR branch with full access to all files as they exist in the PR.
# For cross-repo PRs, include --repo {REPO}
gh pr view {PR_NUMBER} [--repo {REPO}] --json additions,deletions,changedFiles -q '{"additions": .additions, "deletions": .deletions, "files": .changedFiles}'
Size thresholds:
| Metric | Warning Threshold |
|---|---|
| Files changed | > 50 |
| Lines changed | > 5000 |
If thresholds exceeded, ask user:
"This PR has {X} files and {Y} line changes. That's large.
[f] Focus - Pick specific files or directories to review [p] Proceed - Review everything (may be slow/expensive) [a] Abort - Stop here"
# For cross-repo PRs, include --repo {REPO}
gh pr diff {PR_NUMBER} [--repo {REPO}] --name-only | grep -E '\.(png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|pdf|zip|tar|gz|bin|exe|dll|so|dylib)$' || echo "No binary files detected"
Store list of binary files to skip. Note them in final output.
Launch steps 1.1 and 1.2 as parallel subagents. Both receive the same PR diff and run concurrently. Wait for both to complete before proceeding to step 1.3.
Spawn a subagent with the following prompt. Pass the full PR diff as context.
INTERNAL PERSONA - Never post this directly:
Task: You are a cynical, jaded code reviewer with zero patience for sloppy work. This PR was submitted by a clueless weasel and you expect to find problems. Find at least five issues to fix or improve in it. Number them. Be skeptical of everything.
Output format:
### [NUMBER]. [FINDING TITLE] [likely]
**Severity:** [EMOJI] [LEVEL]
[DESCRIPTION - be specific, include file:line references]
Severity scale:
| Level | Emoji | Meaning |
|---|---|---|
| Critical | 🔴 | Security issue, data loss risk, or broken functionality |
| Moderate | 🟡 | Bug, performance issue, or significant code smell |
| Minor | 🟢 | Style, naming, minor improvement opportunity |
Likely tag:
[likely] to findings with high confidence, e.g. with direct evidenceSpawn a subagent that invokes the bmad-review-edge-case-hunter skill. Pass the full PR diff as the content input. Omit also_consider unless the user specified extra focus areas.
The skill returns a JSON array of objects, each with: location, trigger_condition, guard_snippet, potential_consequence.
Map each JSON finding to the standard finding format:
### [NUMBER]. [trigger_condition] [likely]
**Severity:** [INFERRED_EMOJI] [INFERRED_LEVEL]
**`[location]`** — [trigger_condition]. [potential_consequence].
**Suggested fix:**
```
[guard_snippet]
```
Severity inference rules for edge case findings:
Add [likely] to all edge case findings — they are derived from mechanical path tracing, so confidence is inherently high.
If the edge case hunter returns zero findings or halts, note it internally and proceed — step 1.1 findings still stand.
Combine the findings from step 1.1 (adversarial) and step 1.2 (edge case hunter) into a single list.
Deduplication rules:
guard_snippet)After dedup, renumber all findings sequentially and sort by severity (Critical → Moderate → Minor).
Tag each finding with its source:
[Adversarial] — from step 1.1 only[Edge Case] — from step 1.2 only[Both] — flagged by both layers (deduped)Transform the merged findings into cold engineering professionalism.
Transformation rules:
Output format after transformation:
## PR Review: #{PR_NUMBER}
**Title:** {PR_TITLE}
**Author:** @{AUTHOR}
**Branch:** {HEAD} → {BASE}
**Review layers:** Adversarial + Edge Case Hunter
---
### Findings
[TRANSFORMED FINDINGS HERE — each tagged with source]
---
### Summary
**Critical:** {COUNT} | **Moderate:** {COUNT} | **Minor:** {COUNT}
**Sources:** {ADVERSARIAL_COUNT} adversarial | {EDGE_CASE_COUNT} edge case | {BOTH_COUNT} both
[BINARY_FILES_NOTE if any]
---
_Review generated by Raven's Verdict. LLM-produced analysis - findings may be incorrect or lack context. Verify before acting._
Display the complete transformed review to the user.
══════════════════════════════════════════════════════
PREVIEW - This will be posted to PR #{PR_NUMBER}
══════════════════════════════════════════════════════
[FULL REVIEW CONTENT]
══════════════════════════════════════════════════════
Ask user for explicit confirmation:
Ready to post this review to PR #{PR_NUMBER}?
[y] Yes - Post as comment [n] No - Abort, do not post [e] Edit - Let me modify before posting [s] Save only - Save locally, don't post
Write review to a temp file, then post:
gh pr comment {PR_NUMBER} [--repo {REPO}] --body-file {path}Do NOT use heredocs or echo - Markdown code blocks will break shell parsing. Use your file writing tool instead.
If auth fails or post fails:
Display error prominently:
⚠️ FAILED TO POST REVIEW
Error: {ERROR_MESSAGE}
Keep the temp file and tell the user where it is, so they can post manually with:
gh pr comment {PR_NUMBER} [--repo {REPO}] --body-file {path}
If save only (s):
Keep the temp file and inform user of location.
npx claudepluginhub bmad-code-org/bmad-utility-skills --plugin bmad-utility-skillsCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.