CodeRabbit Full Repo Review

Prompt

Run local CodeRabbit CLI baseline review of current snapshot in one large Git
repository. Merge batches into one Markdown report.

REPOSITORY: <ABSOLUTE PATH>

RULES

  • Baseline audit, not PR or branch-diff review.
  • Synthetic diffs exist only in scratch. Never change, commit, push, or open PR
    from source repository.
  • Build dependency-aware domain batches. Cover all eligible engineering files.
  • Exclude large generated data and editorial content.
  • Report untracked files; send only with consent.
  • Preserve local-to-remote identity. Prefer paid organisation with assigned seat.
  • Any incomplete run writes PARTIAL report.
  1. CONSENT

Before first request, get consent. State: review includes eligible tracked
engineering files; untracked needs separate consent; ignored untracked stays
excluded; --config files count as sent; CodeRabbit filters may exclude paths.

  1. INVENTORY

Set:

REPO="<absolute path>"
cd "$REPO"

Record:

git rev-parse --show-toplevel
git branch --show-current
git rev-parse HEAD
git status --short --branch
git status --porcelain=v1
git remote -v
git branch -vv

Create NUL-safe lists:

AUDIT_DIR="$(mktemp -d)"
trap 'rm -rf -- "$AUDIT_DIR"' EXIT
git ls-files -z > "$AUDIT_DIR/tracked.zlist"
git diff --name-only -z > "$AUDIT_DIR/modified.zlist"
git diff --cached --name-only -z > "$AUDIT_DIR/staged.zlist"
git ls-files --others --exclude-standard -z > "$AUDIT_DIR/untracked.zlist"
git ls-files --others --ignored --exclude-standard -z > "$AUDIT_DIR/ignored.zlist"

Report tracked, staged, unstaged, untracked, ignored counts and paths. Stop
before upload for .env, credentials, keys, certificates, tokens, or dumps;
ask what to include.

  1. REMOTE IDENTITY

Choose remote: upstream remote, origin, sole remote, otherwise ask.

Record:

git remote get-url <REMOTE>
git rev-parse HEAD
UPSTREAM="$(git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}' 2>/dev/null || true)"
if [ -n "$UPSTREAM" ]; then
  echo "upstream: $UPSTREAM"
  git rev-list --left-right --count "$UPSTREAM...HEAD"
else
  echo "upstream: none; ahead/behind: unavailable"
fi

Report branch, HEAD, remote name/URL, upstream, ahead/behind, remote HEAD
presence, mapping confidence, and staged/unstaged/approved-untracked content.

  1. CODERABBIT

Run:

cr --version
cr auth status --agent
cr auth org --agent
cr doctor

Verify plan and seat through CLI, dashboard, or read-only CodeRabbit API.
Choose organisation by repository match, current-user seat, paid plan, then
highest limit. Batch limits: Free/Pro 145; Pro+/Enterprise 290; unknown 145.
Record organisation, plan, seat, verification method.

  1. SNAPSHOT CLASSES

Approved snapshot: current tracked content, staged/unstaged changes, approved
untracked. Ignored files stay excluded.

  • TRACKED: all tracked paths.
  • REVIEW: engineering files sent for review.
  • CONTEXT_ONLY: technical guidance only.
  • EXCLUDED_NOISE: irrelevant generated data/media.
  • STRICT_EXCLUDED: removed from scratch.
  • SUBMITTED, REVIEWED, UNRESOLVED: batch status.
  1. FILTERS

Keep binaries, media, build output, dependencies, generated manifests, dumps,
minified files, model weights, lockfiles, marketing/editorial content, and
translations outside REVIEW. List every exclusion.

JSON: REVIEW package manifests, configuration, schemas, contracts, small
behavioural fixtures. STRICT_EXCLUDED generated/data JSON and JSON over 256
KiB, unless approved.

REVIEW source, migrations, schemas, tests, CI/security config, package
manifests, technical contracts, audited .coderabbit.yaml.

Markdown: CONTEXT_ONLY README.md, AGENTS.md, guidelines,
CONTRIBUTING.md, SECURITY.md, ADRs, architecture, API docs;
STRICT_EXCLUDED blogs, copy, translations, editorial files, content/** unless
approved; REVIEW technical contracts or executable code affecting behaviour.

Scope exclusion omits file from diff but retains scratch context. Strict
exclusion removes it. Scope exclusion cannot block remote/repository-context
access. Use strict exclusion for sensitive, generated, editorial data; remove
original remote if it can expose excluded data. Record path, class, reason.

  1. DEPENDENCY GRAPH

Git inventory and REVIEW define coverage. Graph only plans batches. Use
existing workspace/package boundaries; imports, exports, dependencies,
calls/types; route/service/storage; schema/migration/consumer; source/test;
configuration links; domains; useful Git co-change history. Add no dependency.

Optional Graphify may build local graph/communities, suggest cohorts, find
cross-domain edges, export split audit. It must not change coverage, exclude
files, send data, become required, or replace manifest validation. Without it,
use Git and existing compiler/workspace tools.

  1. BATCHES

Keep together, in order: strongly connected components; APIs/types and
consumers; schemas/migrations and consumers; implementation/tests; endpoints
and client/UI; configuration/modules; remaining same-domain files. Use vertical
slices. Do not split tests without reason, small cycles, or plan limits. If
cluster exceeds limit, split at least harmful edge; record cut, links, limit.

  1. SCRATCH SNAPSHOT

Create scratch repository with current tracked content, approved untracked, no
STRICT_EXCLUDED. Store NUL-safe paths, types, content hashes. Verify scratch
against approved snapshot after exclusions. Keep verified remote for scope
exclusion/paid context; for strict exclusion explain trade-off and remove
original remote if it can expose data.

  1. SYNTHETIC DIFF PER BATCH

For every independent batch:

  • HEAD_TREE: approved final scratch snapshot;
  • BASE_TREE: same snapshot without batch;
  • BASE_TREE..HEAD_TREE: exactly batch.

Create BATCH_BASE with BASE_TREE. Create child BATCH_HEAD with HEAD_TREE.
Check out BATCH_HEAD. Non-batch files stay identical as final local context.
Never build cumulative batch chain.

Validate:

git diff --name-only -z "$BATCH_BASE" "$BATCH_HEAD"

Output must equal batch manifest. On mismatch, skip review and create PARTIAL
report. Keep synthetic refs/commits in scratch. Never push.

  1. BATCH CONTEXT

Create factual batch-context.md: branch, HEAD, remote identity, baseline
purpose, batch paths, relevant CONTEXT_ONLY paths, cross-batch boundaries,
guidelines. Never invent architecture facts. Include:

This is one dependency-aware cohort of a local baseline review of the
current repository snapshot. Files appear as added only because CodeRabbit
requires a Git diff. Do not infer feature intent from this synthetic state.
Review the complete current contents of this cohort. Other eligible
engineering files are present unchanged at their final versions and may be
used as context. Check API, type, schema, security, and behavioural
compatibility. Ignore cosmetic nits unless they hide correctness or
maintenance risk.

Pass only existing relevant files:

cr review \
  --agent \
  --committed \
  --base-commit "$BATCH_BASE" \
  --config AGENTS.md .coderabbit.yaml batch-context.md

12. RUN AND VALIDATE

Run sequentially. Save JSONL, stderr, manifest, context, exit code, timestamps,
attempts. Batch succeeds only with valid JSONL, no terminal error, one
terminal complete, accepted file limit, matching diff.

Check cross-batch interface/consumer, schema/query, backend/frontend,
shared-type/serialisation, security-policy/endpoint links. Add bridge batch
only for specific unresolved risk. Validate findings against final snapshot:
valid, duplicate, not reproducible, human review. Never report synthetic-state
issue as feature diff. Deduplicate by file, lines, normalised problem, severity.

  1. COVERAGE

Before full report, prove: every REVIEW path in completed batch; no silent
omission; every manifest equals diff; batch union equals REVIEW; every
context/exclusion path has reason; every untracked file included/excluded;
scratch equals approved snapshot; findings checked against final state.

Use:

Completed local baseline review of all eligible engineering files in the
current repository snapshot.

14. REPORT

Full:

coderabbit-full-repo-review-YYYY-MM-DD.md

Incomplete:

coderabbit-full-repo-review-YYYY-MM-DD-PARTIAL.md

Never overwrite; add -r2, -r3, and so on. PARTIAL must be in file name,
H1, first content block:

# CodeRabbit full repository baseline review — PARTIAL

> [!WARNING]
> **PARTIAL REPORT — REVIEW IS INCOMPLETE.**
> Completed batches: X/Y.
> Reviewed eligible files: X/Y.
> Unresolved files: N.
> Reason: ...
> CodeRabbit communication started: YES/NO/UNKNOWN.
> Preserved scratch directory: ...

Report: summary; remote mapping; snapshot identity; organisation/plan/seat/proof;
Git/untracked/ignored inventory; classes; graph/batches/cross-batch edges;
coverage; validated/uncertain findings; limits; raw logs. After inventory,
every failure creates PARTIAL report and preserves scratch.

  1. FINAL SOURCE CHECK

Compare source HEAD, branch, status, index, remotes with initial snapshot. They
must stay unchanged. Finally report FULL/PARTIAL, absolute report path,
REVIEWED/REVIEW count, batches/bridge batches, untracked state, exclusions,
plan/seat, branch/HEAD/remote mapping, source-integrity result.