Tips & Tricks (अपडेट: 2/6/2026)

Teams के लिए Claude Code Code Review Checklist

Teams के लिए Claude Code code review checklist: risk, security, tests, PR template और CI guard.

Teams के लिए Claude Code Code Review Checklist

“Review this PR” काफी नहीं है

Claude Code को सिर्फ “review this PR” कहने पर feedback मिलता है, लेकिन वह अक्सर generic होता है।

Team review में पहले यह साफ होना चाहिए कि क्या टूट सकता है, कौन सा data touch हुआ है, tests की evidence क्या है, और merge से पहले कौन सा risk block होना चाहिए।

इस article में copy-paste योग्य review checklist, Claude Code review prompt, GitHub PR template और GitHub Actions CI guard दिया गया है।

Claude Code human reviewer का replacement नहीं है। यह omissions कम करने और team review standard को consistent बनाने का tool है। Official references के लिए Claude Code काcode review setup, Claude Code GitHub Actions docs, GitHub केPR templates, protected branches, Actions workflows देखें। Security review के लिएOWASP Secure Code Review Cheat Sheet अच्छा आधार है।

Risk-based review क्या है

Risk-based review का मतलब है कि हर PR को एक ही weight से review न करें। Text change, CSS spacing, payment webhook और database migration का impact अलग है। अगर हर PR पर heavy process होगा तो small change slow हो जाएगा। अगर हर PR light होगा तो dangerous change निकल जाएगा।

RiskExampleRequired review
LowCopy, simple CSS, docs, harmless log text1 reviewer, summary, screenshot या diff explanation
MediumForms, UI state, search, API response, read-only data access1 reviewer, test evidence, Claude Code review
HighAuth, authorization, billing, personal data, migration, delete, webhook2 reviewers, rollback plan, required CI, security/privacy review

Migration यानी database की structure या data shape बदलना। Code revert करना आसान हो सकता है, लेकिन deleted column, overwritten records या failed backfill recover करना मुश्किल है। इसलिए migration में पहला सवाल है: “अगर deploy fail हुआ तो वापस कैसे आएंगे?”

Claude Code को risk level जरूर दें। Vague prompt style comments देता है। “High risk: billing webhook and customer email changed” जैसा prompt signature validation, idempotency, retry, privacy logs और tests पर बेहतर focus कराता है।

Masa के practical notes में सबसे common problem थी abstract words: quality, security, maintainability. ये headings के लिए ठीक हैं, लेकिन review questions के लिए कमजोर हैं। Good PR template files, data type, risk reason, test evidence और rollback steps मांगता है।

Copy-paste Review Checklist

इसे .github/review-checklist.md, team wiki या CLAUDE.md में रखें। Items concrete हैं ताकि human reviewer और Claude Code facts check कर सकें।

# Code Review Checklist

## 0. PR scope
- [ ] This PR has one clear purpose.
- [ ] Changed files match the stated purpose.
- [ ] Generated or AI-written files are marked in the PR description.
- [ ] No unrelated formatting, dependency, or config changes are mixed in.

## 1. Risk level
- [ ] Risk level is marked as low, medium, or high.
- [ ] High-risk PRs have two human reviewers.
- [ ] High-risk PRs include rollback or recovery steps.

## 2. Security and privacy
- [ ] User input is validated on the server side.
- [ ] Authorization is checked near the data access point.
- [ ] Secrets are not printed, committed, or sent to Claude prompts.
- [ ] Logs do not include email, tokens, addresses, payment IDs, or private content.
- [ ] OWASP-relevant risks such as injection, XSS, broken access control, and SSRF were considered.

## 3. Tests
- [ ] Unit or integration tests cover the changed behavior.
- [ ] Regression tests cover the bug that motivated the PR.
- [ ] Manual verification steps are written with actual result, not "works locally".
- [ ] Snapshot changes are explained.

## 4. Performance
- [ ] New loops, queries, and network calls are bounded.
- [ ] N+1 queries were checked.
- [ ] Large lists, images, and bundles have a budget.
- [ ] Metrics or before/after evidence are attached for performance-sensitive changes.

## 5. Accessibility
- [ ] Keyboard operation works for interactive UI.
- [ ] Focus order and visible focus state are preserved.
- [ ] Form fields have labels and errors that screen readers can understand.
- [ ] Color contrast and reduced-motion behavior are checked where relevant.

## 6. Migration and data risk
- [ ] Migration is backward compatible during rollout.
- [ ] Destructive changes have backup or recovery steps.
- [ ] Old and new app versions can run during deployment.
- [ ] Data cleanup jobs are idempotent.

## 7. AI-generated diff hygiene
- [ ] AI-generated code was read by a human before approval.
- [ ] The diff does not remove tests, monitoring, analytics, or CTA links by accident.
- [ ] New dependencies are justified.
- [ ] Comments do not claim verification that was not actually done.

“Security considered” कमजोर है। “Logs में email, token, address, payment ID या private content नहीं है” checkable है। “Accessibility ok” कमजोर है। “Keyboard works, focus visible है, labels और errors screen reader के लिए समझने योग्य हैं” reviewable है।

Claude Code Review Prompt

Prompt में role, context, risk और rule दें: पहले findings, code rewrite नहीं। Review और implementation मिल जाने पर diff बड़ा हो जाता है और team को पता नहीं चलता कि कौन सा fix सच में accepted है।

You are reviewing a pull request for a production team.

Goal:
- Find concrete risks before merge.
- Prioritize correctness, security/privacy, tests, performance, accessibility, migration/data risk, and AI-generated diff hygiene.
- Do not rewrite code yet. Produce review findings first.

Context:
- Risk level: <low | medium | high>
- Business area: <auth | billing | content | search | admin | analytics | other>
- Sensitive data touched: <none | email | payment | address | health | private content | other>
- Rollout plan: <flag | migration | immediate deploy | other>

Review method:
1. Read the PR summary and changed files.
2. List the top risks by severity.
3. For each finding, include file, line or function, why it matters, and a minimal fix.
4. Separate "must fix before merge" from "follow-up".
5. Check whether tests prove the changed behavior.
6. Check whether any AI-generated code, dependency, config, or formatting change is unrelated to the PR goal.

Output format:
- Findings first, ordered by severity.
- Then missing evidence.
- Then questions for the author.
- Then a short merge recommendation: block, approve with fixes, or approve.

यहcodebase navigation औरtesting strategy के साथ अच्छा काम करता है। Review से पहले Claude Code से पूछें कि PR किस domain को touch करता है। इससे review सिर्फ naming और formatting तक सीमित नहीं रहता।

GitHub PR Template

.github/pull_request_template.md रखने पर GitHub PR body prefill करता है। Goal paperwork नहीं, बल्कि reviewers, Claude Code और branch protection के लिए evidence एक जगह रखना है।

## Summary
- TODO

## Risk
Risk level: low | medium | high

Risk reasons:
- Data touched:
- Users affected:
- Rollout:

## Review focus
- [ ] Correctness
- [ ] Security/privacy
- [ ] Tests
- [ ] Performance
- [ ] Accessibility
- [ ] Migration/data risk
- [ ] AI-generated diff hygiene

## Test evidence
- Automated:
- Manual:
- Not tested because:

## Security and privacy notes
- Secrets changed: no | yes
- Personal data in logs: no | yes
- Authorization boundary changed: no | yes

## Migration / rollback
- Migration included: no | yes
- Backward compatible: no | yes | not applicable
- Rollback plan:

## Claude Code review prompt
Paste this into Claude Code after the PR is ready:

Review this PR as risk level "<low|medium|high>".
Focus on correctness, security/privacy, tests, performance, accessibility, migration/data risk, and AI-generated diff hygiene.
Return findings first with file/function references and minimal fixes.

सिर्फ checkboxes वाला template न बनाएं। लोग जल्दी mechanical tick करने लगते हैं। Risk reasons, Test evidence, Rollback plan जैसे fields evidence मांगते हैं और CI guard से check किए जा सकते हैं।

GitHub Actions CI Guard

यह workflow और Node script PR body और changed files देखते हैं। यह code correctness prove नहीं करता, लेकिन reviewer के समय से पहले missing risk level, missing tests और missing rollback रोक सकता है।

name: PR review guard

on:
  pull_request:
    types: [opened, edited, synchronize, reopened, ready_for_review]

permissions:
  contents: read
  pull-requests: read

jobs:
  review-guard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: actions/setup-node@v4
        with:
          node-version: "20"

      - name: Check PR review evidence
        run: node scripts/pr-review-guard.mjs
        env:
          BASE_SHA: ${{ github.event.pull_request.base.sha }}
          HEAD_SHA: ${{ github.event.pull_request.head.sha }}
import { execSync } from "node:child_process";
import { readFileSync } from "node:fs";

const eventPath = process.env.GITHUB_EVENT_PATH;
if (!eventPath) throw new Error("GITHUB_EVENT_PATH is missing.");

const event = JSON.parse(readFileSync(eventPath, "utf8"));
const pr = event.pull_request;
const body = pr?.body ?? "";
const base = process.env.BASE_SHA ?? pr?.base?.sha;
const head = process.env.HEAD_SHA ?? pr?.head?.sha;

function safeRef(value, name) {
  if (!value || !/^[a-f0-9]{40}$/i.test(value)) throw new Error(`${name} must be a full git SHA.`);
  return value;
}

const changedFiles = execSync(`git diff --name-only ${safeRef(base, "BASE_SHA")} ${safeRef(head, "HEAD_SHA")}`, {
  encoding: "utf8",
}).split(/\r?\n/).filter(Boolean);

const hasRisk = /Risk level:\s*(low|medium|high)/i.test(body);
const hasTests = /## Test evidence[\s\S]*(Automated|Manual):\s*\S/i.test(body);
const hasRollback = /Rollback plan:\s*\S/i.test(body);
const highRisk = /Risk level:\s*high/i.test(body);
const migrationChanged = changedFiles.some((file) => /migrations?|schema|prisma|drizzle/i.test(file));
const sensitiveChanged = changedFiles.some((file) => /auth|session|permission|billing|payment|webhook/i.test(file));
const failures = [];

if (!hasRisk) failures.push("Add Risk level.");
if (!hasTests) failures.push("Add automated or manual test evidence.");
if ((highRisk || migrationChanged) && !hasRollback) failures.push("Add rollback plan.");
if (sensitiveChanged && !/Security and privacy notes/i.test(body)) failures.push("Add security/privacy notes.");

if (failures.length) {
  console.error("PR review guard failed:");
  for (const failure of failures) console.error(`- ${failure}`);
  process.exit(1);
}

console.log("PR review guard passed.");

पहले advisory mode में चलाएं। फिर high-risk और migrations के लिए protected branches पर required check बनाएं। Low-risk PRs को हल्का रखें ताकि process sustainable रहे।

Security, privacy, tests, performance, accessibility

Security review को input, authorization, output, logs और external calls में बांटें। Server-side validation है या नहीं? Authorization data access के पास है या सिर्फ UI में? Output XSS बना सकता है? Logs में private data है? Webhook या external URL SSRF या signature bypass बना सकता है?

Privacy secrets से बड़ी चीज है। Email, payment ID, address, inquiry message, analytics ID और private content भी sensitive हो सकते हैं। Real API key, customer email, contract या payment ID prompt में paste न करें। Values mask करें और Claude Code को structure दें।

Tests में claim नहीं, evidence चाहिए। “Works locally” evidence नहीं है। Good PR बताता है कौन सा automated test चला, कौन सा manual flow check हुआ और actual result क्या था।

Performance में unbounded loop, N+1 query, repeated network calls, bundle growth, heavy images और expensive client rendering देखें। Simple before/after number भी review quality बढ़ाता है।

Accessibility screenshot से नहीं होती। Keyboard operation, focus order, visible focus, labels, error messages, modal focus trap और reduced motion check करें। Claude Code generated UI दिखने में clean हो सकता है, लेकिन ये details miss कर सकता है।

Practical use cases

पहला case auth और admin screens है। User list, role change और audit logs API या data layer पर protected होने चाहिए। Authorization, personal data logs, audit trail और unauthorized access tests देखें।

दूसरा case billing और webhooks है। Payment webhook में signature validation, idempotency, retries, duplicate event safety, cancellation handling और privacy-safe logs जरूरी हैं।

तीसरा case database migration है। New column भी production तोड़ सकता है अगर old और new app versions साथ चल रहे हों। Defaults, not null, index, backfill, rollback और expand-contract sequence देखें।

चौथा case AI-generated UI diff है। Claude Code जब page, form, modal या table बनाता है, CTA delete, analytics event rename, accessibility gap, unexplained snapshot और dependency addition छिप सकते हैं।

पांचवां case revenue content site है। Article, product page या lead form review में conversion path भी देखें। अगरproducts link, free PDF form या consultation tracking टूटता है, page render होने के बाद भी business bug है।

Pitfalls, CTA और result

पहला pitfall है Claude Code findings को बिना verify किए मान लेना। AI plausible बात कर सकता है। हर finding को diff, tests, official docs या reproduction से मिलाएं।

दूसरा pitfall है review और implementation मिलाना। पहले findings लें, must-fix decide करें, फिर code change करें। PR readable रहता है।

तीसरा pitfall है unrelated AI cleanup। Formatting, dependencies, config और deleted tests बड़े diff में छिप सकते हैं। Prompt में unrelated changes list करने को कहें।

चौथा pitfall है data rollback को code revert समझना। Revert deleted data वापस नहीं लाता। High-risk migration को backup, recovery SQL, feature flag या staged plan चाहिए।

Review revenue भी protect करता है: billing, product pages, free PDF, Gumroad, analytics और consultation CTA system का हिस्सा हैं। Practice के लिएfree checklist से शुरू करें। Reusable prompts, templates, CLAUDE.md और CI guard के लिएproducts देखें। Real repo rollout के लिएtraining and consultation बेहतर है।

मैंने इस format को तीन छोटे scenarios पर लगाया: Next.js UI change, database migration और Claude Code-generated UI diff। सबसे ज्यादा मदद Risk level और Rollback plan को PR body में force करने से मिली। ज्यादा checkboxes से कम फायदा हुआ; short evidence ज्यादा उपयोगी रही।

Summary

Claude Code code review checklist सिर्फ prompt नहीं है। यह risk classification, PR evidence, human review, CI और protected branches को जोड़ने वाला team workflow है।

छोटे से शुरू करें: PR template जोड़ें, guard को advisory mode में चलाएं, फिर high-risk changes के लिए required बनाएं। इसेAI pair programming औरCLAUDE.md best practices के साथ मिलाकर review standard repository में रखें।

#Claude Code #code review #pull request #security #automation
मुफ़्त

मुफ़्त PDF: Claude Code cheatsheet

Email डालें और commands, review habits तथा safe workflow वाली एक-page PDF पाएँ.

हम आपका data सुरक्षित रखते हैं और spam नहीं भेजते.

Masa

लेखक के बारे में

Masa

Claude Code workflow और team adoption पर काम करने वाला engineer.