| name | pr-review |
| description | Reviews pull requests for the ClinIQ healthcare platform (ELUSOC 2026). Performs structured code review covering correctness, security (HIPAA/RLS), React/TypeScript best practices, Tailwind consistency, and PR hygiene. Drafts a review comment for maintainer approval before posting. Use when user says "review pr", "review pull request", "check pr", "pr feedback", "check this PR", "is my PR ready", "feedback on PR", "review #N", "look at this contribution", or provides a PR number or GitHub PR URL for the ClinIQ repository.
|
Core Rules
- Draft before posting. Never post a review directly.
Always show the full review to the maintainer and wait for
explicit confirmation before running
gh pr review.
- Read the full file, not just the diff. Diffs are misleading
without surrounding context.
- Tone is constructive, not critical. Contributors are students
making their first open source contributions. Every review must
include genuine positive observations alongside issues.
- Check CONTRIBUTING.md compliance. ELUSOC PRs must follow
the contribution guidelines.
- Security findings are always BLOCKERs. Healthcare data —
no exceptions.
Workflow
Step 1 — Gather PR context
gh pr view <PR_NUMBER> \
--repo akshay0611/ClinIQ \
--json title,body,state,additions,deletions,changedFiles,\
baseRefName,headRefName,url,author,labels,reviewDecision
gh pr diff <PR_NUMBER> --repo akshay0611/ClinIQ
gh pr checks <PR_NUMBER> --repo akshay0611/ClinIQ
gh api repos/akshay0611/ClinIQ/pulls/<PR_NUMBER>/reviews
Step 2 — Read changed files in full
gh pr view <PR_NUMBER> --repo akshay0611/ClinIQ \
--json files --jq '.files[].path'
Read every changed file completely — not just the diff lines.
Step 3 — Check CONTRIBUTING.md compliance
gh api repos/akshay0611/ClinIQ/contents/CONTRIBUTING.md \
--jq '.content' | base64 -d
Check:
Step 4 — Review checklist
Flag issues by severity:
- BLOCKER — Must fix before merge (bugs, security, data loss)
- WARNING — Should fix, not a hard gate
- NIT — Minor suggestion, completely optional
A. PR Hygiene
B. Correctness
C. Security & Healthcare Data
ClinIQ handles health information. These are non-negotiable.
D. React & TypeScript
E. Tailwind & UI Consistency
F. Error Handling & UX
G. Accessibility
Step 5 — Draft the review
Structure:
## Review: <PR Title>
<1-2 sentences on overall quality and verdict. Be specific and honest.>
### What looks great ✅
<Genuine specific observations — not generic praise.
Call out good patterns, clean code, thoughtful implementation.
Every review must have this section.>
### Blockers 🚫 (must fix before merge)
- **`file.ts:line`** — <issue and why it blocks>
### Suggestions 💡 (should fix)
- **`file.ts:line`** — <issue and suggested fix>
### Nits 🔧 (optional)
- **`file.ts:line`** — <minor suggestion>
### Verdict
<APPROVE | REQUEST_CHANGES | COMMENT>
<If REQUEST_CHANGES: end with an encouraging note that the
contributor is close and the feedback is to help them improve,
not a rejection.>
Step 6 — ⛔ PAUSE — Confirm before posting
Do NOT run gh pr review yet.
Show the full drafted review and ask:
"Here is the draft review for PR #N. Does this look correct?
Reply 'approve', 'request-changes', or 'comment-only' to post it,
or tell me what to change."
Wait for explicit instruction.
Step 7 — Post the review (only after confirmation)
cat > /tmp/cliniq-review.md << 'EOF'
<confirmed review body>
EOF
gh pr review <PR_NUMBER> --repo akshay0611/ClinIQ \
--approve --body-file /tmp/cliniq-review.md
gh pr review <PR_NUMBER> --repo akshay0611/ClinIQ \
--request-changes --body-file /tmp/cliniq-review.md
gh pr review <PR_NUMBER> --repo akshay0611/ClinIQ \
--comment --body-file /tmp/cliniq-review.md
ClinIQ-Specific Patterns
New code must follow these established patterns:
| Pattern | File |
|---|
| Auth gating | src/components/common/ProtectedRoute.tsx |
| Supabase client | src/services/supabaseClient.ts — never create a second instance |
| Auth state | useAuth() from src/context/AuthContext.tsx |
| Theme | useTheme() from src/context/ThemeContext.tsx |
| Routing | react-router-dom v6 — Routes/Route in App.tsx |
| Lazy pages | React.lazy() + Suspense in App.tsx |
| Icons | lucide-react only |
| Animations | framer-motion |
| Toasts | react-hot-toast |
| Forms | react-hook-form for complex forms |
| Local storage | src/services/LocalStorageService.ts |
| AI integration | src/services/GeminiSymptomService.ts |
| Types | src/types/index.ts |
Security Red Flags (Instant BLOCKER)
- API keys or secrets in source
console.log of health data, tokens, or emails
- Missing auth check on a route accessing user data
- Raw
localStorage for sensitive data
dangerouslySetInnerHTML without sanitization
- Supabase queries without
user.id filter
- Gemini API call without error handling for missing key
Healthcare Review Notes
- Medical disclaimers required on any health information feature
- AI outputs must be labeled informational, not diagnostic
- User consent required before processing health data
- Data minimization — collect only what the feature needs
- Never log symptoms, diagnoses, or health records anywhere
Tone Guidelines for ELUSOC Contributors
These are student contributors making open source contributions,
possibly for the first time. Review tone matters:
- Always start with what they did well — be specific, not generic
- Frame issues as "this could be improved" not "this is wrong"
- For BLOCKERs, explain why it matters, not just that it's wrong
- End REQUEST_CHANGES reviews with encouragement
- Never comment on code style unless it violates a project pattern
- A good review teaches — include a brief explanation or example
for every BLOCKER and WARNING