|
| 1 | +--- |
| 2 | +name: review-pr |
| 3 | +description: Run admin review on an OB1 pull request. Covers what CI can't — security deep scan, mission fit, naming consistency, and generates admin summary, Discord draft, and post-merge task list. Takes PR number as argument (e.g., "review PR 21"). |
| 4 | +--- |
| 5 | + |
| 6 | +# OB1 PR Review — Admin Skill |
| 7 | + |
| 8 | +Run the human-judgment layer of PR review on OB1. CI handles the mechanical checks (11 rules, scope, links, post-merge reminders). This skill handles everything CI can't automate. |
| 9 | + |
| 10 | +## Input |
| 11 | + |
| 12 | +PR number from the user. Fetch details with `gh pr view <number>` and `gh pr diff <number>`. Checkout the branch with `gh pr checkout <number>` to inspect files. Return to the original branch when done. |
| 13 | + |
| 14 | +## Step 1: CI Status |
| 15 | + |
| 16 | +Run `gh pr checks <number>` to see automated review results. Report: |
| 17 | +- Passed: move on to admin checks |
| 18 | +- Failed: note which rules failed — contributor must fix before admin review matters |
| 19 | +- Pending: note it, proceed with admin checks anyway |
| 20 | + |
| 21 | +Also check if the CI bot posted a "Post-Merge Tasks" section — those are the doc coverage gaps CI detected. Pull them into Section F below. |
| 22 | + |
| 23 | +## Step 2: Security Deep Scan |
| 24 | + |
| 25 | +CI only does basic credential pattern matching. Scan deeper: |
| 26 | + |
| 27 | +- **Secrets beyond CI's patterns** — tokens in comments, base64-encoded values, connection strings, private keys |
| 28 | +- **External URLs** — anything besides github.com, discord.gg, or relative doc links. Where does this code phone home? |
| 29 | +- **Dangerous operations** — `rm -rf`, `chmod`, `sudo`, `eval()`, `exec()`, `system()`, `subprocess`, `os.system` |
| 30 | +- **Prompt injection** in skill/prompt files — `ignore previous`, `disregard`, `you are now`, `jailbreak`, `bypass` |
| 31 | +- **Personal data** — email addresses, phone numbers, real names that aren't the author's |
| 32 | +- **Data exfiltration** — `webhook`, `ngrok`, `requestbin`, `pipedream`, `discord.com/api/webhooks` |
| 33 | +- **Supply chain** — does it install packages? from where? pinned versions? |
| 34 | + |
| 35 | +## Step 3: Mission Fit |
| 36 | + |
| 37 | +Assess against OB1's core: "One brain, all your AI tools." |
| 38 | + |
| 39 | +- Does this add a capture, retrieval, or processing capability for Open Brain? |
| 40 | +- Does it complement existing contributions? Check `recipes/`, `schemas/`, etc. for overlap. |
| 41 | +- Does it respect the upstream boundary (no core `thoughts` table or MCP server modifications)? |
| 42 | +- Does it require paid services with no free-tier alternative? |
| 43 | +- Is the difficulty rating accurate? |
| 44 | +- If in a curated category (`extensions/`, `primitives/`), flag that maintainer approval is required regardless. |
| 45 | + |
| 46 | +## Step 4: Naming & Consistency |
| 47 | + |
| 48 | +- Folder name vs `metadata.json` name — do they match? |
| 49 | +- Filenames referenced in README vs actual files — any mismatches? (This is the #1 bug CI can't catch reliably.) |
| 50 | +- Consistent naming throughout — no mixed references like "brain-dump-processor" in README but "panning-for-gold" on disk. |
| 51 | + |
| 52 | +## Step 5: PR Description Quality |
| 53 | + |
| 54 | +Per CONTRIBUTING.md, must include: what it does, what it requires, confirmation of testing. CI can check if sections exist but not if they're meaningful. Assess quality. |
| 55 | + |
| 56 | +## Output |
| 57 | + |
| 58 | +### A: Review Checklist |
| 59 | + |
| 60 | +| Check | Status | Notes | |
| 61 | +|-------|--------|-------| |
| 62 | +| CI status | | | |
| 63 | +| Security | | | |
| 64 | +| Mission fit | | | |
| 65 | +| Naming consistency | | | |
| 66 | +| PR description | | | |
| 67 | + |
| 68 | +### B: Verdict |
| 69 | + |
| 70 | +- **Approve** — all clear |
| 71 | +- **Approve with required changes** — minor fixes needed, list them |
| 72 | +- **Request changes** — significant issues, list with explanations |
| 73 | +- **Reject** — doesn't fit OB1, duplicates work, or security concerns |
| 74 | + |
| 75 | +### C: Admin Summary (Shareable) |
| 76 | + |
| 77 | +Formatted for copy-pasting to other admins in Discord or DMs: |
| 78 | + |
| 79 | +``` |
| 80 | +PR #<number>: <title> |
| 81 | +Author: @<github> (first-time / returning contributor) |
| 82 | +Category: <recipes/schemas/etc.> |
| 83 | +What it does: <one sentence> |
| 84 | +CI: <passed/failed> |
| 85 | +Admin review: <verdict> |
| 86 | +Changes needed: <list or "none"> |
| 87 | +Post-merge: <task count> items |
| 88 | +Link: <PR URL> |
| 89 | +``` |
| 90 | + |
| 91 | +### D: Discord Draft |
| 92 | + |
| 93 | +For `#show-and-tell` after merge. Welcoming tone, specific about the contribution, encouraging. Include PR link and contributor's GitHub handle. |
| 94 | + |
| 95 | +### E: Post-Merge Task List |
| 96 | + |
| 97 | +Assemble from CI's "Post-Merge Tasks" section plus anything else identified: |
| 98 | + |
| 99 | +``` |
| 100 | +- [ ] Update <category>/README.md index |
| 101 | +- [ ] Update root README.md (if needed) |
| 102 | +- [ ] Add contributor to CONTRIBUTORS.md (if first contribution) |
| 103 | +- [ ] Post Discord message |
| 104 | +- [ ] <other follow-ups> |
| 105 | +``` |
| 106 | + |
| 107 | +### F: PR Comment Draft |
| 108 | + |
| 109 | +Compose the review to post on the PR: |
| 110 | +- Reference CI status (don't repeat — just "CI passed" or "CI flagged X") |
| 111 | +- Security scan result |
| 112 | +- Admin findings (required changes, suggestions) |
| 113 | +- Welcoming close linking to Discord: https://discord.gg/Cgh9WJEkeG |
| 114 | + |
| 115 | +**Ask the user before posting:** "Ready to post this review?" Then run `gh pr review <number> --comment --body "..."`. |
| 116 | + |
| 117 | +## Notes |
| 118 | + |
| 119 | +- This skill does NOT re-run CI checks. It reads CI results and adds the judgment layer. |
| 120 | +- Any admin using Claude Code in the OB1 repo has this skill. The outputs (admin summary, PR comment) are designed to be shared with admins who don't use Claude Code. |
| 121 | +- Return to original branch after review: `git checkout <branch>` |
0 commit comments