ai-review
Skill0 starsChanged 6 months agoMITView on GitHub
This skill should be used when the user asks to "review a PR", "code review", "AI review", "check the pull request", or asks about automated review via OpenRouter or Gemma. Also activates when setting up GitHub Actions for PR review.
- Reads credentials
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Add .github/workflows/ai-review.yml to your repo (also available in this plugin repo):
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI PR Review Skill
Automated pull request review using OpenRouter free models.
How It Works
- GitHub Action triggers on every PR open or sync
- Gets the PR diff via
gh pr diff(truncated at 8000 chars) - Sends to OpenRouter (primary: Gemma 3 27B Free, fallback: Mistral 7B Free) for analysis
- Posts structured review as PR comment (Summary / Issues / Suggestions)
Models
| Role | Model ID | Notes |
| Primary | google/gemma-3-27b-it:free | Best quality, try first |
| Fallback | mistralai/mistral-7b-instruct:free | Used if primary is at capacity |
Both models are free-tier on OpenRouter. If both are unavailable, the workflow exits with a clear error message.
Setup
Requirements
OPENROUTER_API_KEYin~/.claude/secrets/secrets.envGH_TOKENorGITHUB_TOKENwith PR write permissionsghCLI installed
GitHub Action Setup
Add .github/workflows/ai-review.yml to your repo (also available in this plugin repo):
name: AI Code Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Validate API key
run: |
if [ -z "$OPENROUTER_API_KEY" ]; then
echo "::error::OPENROUTER_API_KEY secret is not set."
exit 1
fi
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
- name: Get PR diff
id: diff
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_DIFF=$(gh pr diff ${{ github.event.pull_request.number }} 2>/dev/null || echo "")
if [ -z "$PR_DIFF" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
exit 0
fi
PR_DIFF_TRUNCATED="${PR_DIFF:0:8000}"
{ echo "diff<<EOF_DIFF"; echo "$PR_DIFF_TRUNCATED"; echo "EOF_DIFF"; } >> "$GITHUB_OUTPUT"
echo "skip=false" >> "$GITHUB_OUTPUT"
- name: AI Review via OpenRouter
if: steps.diff.outputs.skip == 'false'
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_DIFF: ${{ steps.diff.outputs.diff }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
PRIMARY_MODEL="google/gemma-3-27b-it:free"
FALLBACK_MODEL="mistralai/mistral-7b-instruct:free"
PROMPT="Review PR #${PR_NUMBER}: ${PR_TITLE}\n\nDiff:\n${PR_DIFF}\n\nProvide:\n## Summary\n## Issues\n## Suggestions"
for MODEL in "$PRIMARY_MODEL" "$FALLBACK_MODEL"; do
PAYLOAD=$(python3 -c "
import json,sys
print(json.dumps({'model':'$MODEL','messages':[{'role':'user','content':sys.stdin.read()}],'max_tokens':1024}))" <<< "$PROMPT")
RESPONSE=$(curl -s -w "\n%{http_code}" \
-X POST https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
BODY=$(echo "$RESPONSE" | head -n -1)
if [ "$HTTP_CODE" = "200" ]; then
REVIEW=$(echo "$BODY" | python3 -c "import json,sys; print(json.load(sys.stdin)['choices'][0]['message']['content'])")
gh pr comment "$PR_NUMBER" --body "## 🤖 AI Code Review\n\n${REVIEW}\n\n---\n_Powered by ccplugin-ai-review · Free via OpenRouter_"
exit 0
fi
echo "Model $MODEL returned HTTP $HTTP_CODE, trying next..."
done
echo "::error::All OpenRouter models unavailable."
exit 1Cost
$0 — uses OpenRouter free tier (Gemma 3 27B Free, Mistral 7B Free fallback).
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- PaddlePaddle/Paddle★ 24ksame name
- dgilford/ai-science-toolkit★ 80same name
- tingyulu/MyR2D2★ 18same name
- eins78/agent-skills★ 2same name
- SanHsien/agent-astromech★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use pickup.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
HermeticOrmusSkillpickup
Read a HANDOFF.md and restore session context. The entry ritual -- the opposite of /handoff. Use at the start of a new session after a handoff, machine switch, or context clear.
Also in 3 projects that use this
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

