Contract review shell added as a guided frontend wrapper over existing chat

foolish-bandit built a two-step contract review flow at `/review` without touching any backend routes. Upload or select a contract, see what Gary will check, kick off the review - then land in the existing chat thread. The review prompt is baked into the frontend bundle.

contract-reviewchat-ui

The new frontend/src/app/(pages)/review/page.tsx (434 lines) handles the full flow. Step 1 is document selection: the user picks from existing documents via FileDirectory or uploads a new one via uploadStandaloneDocument, which is the same endpoint the rest of the app uses. Selecting a document advances to Step 2. Uploading also advances automatically on success.

Step 2 shows a checklist of eleven review topics - parties, important dates, governing law, payment terms, termination, indemnity, confidentiality, assignment, dispute resolution, unusual or risky clauses, missing clauses - plus a citation expectation and a disclaimer that Gary's answers are not legal advice. Clicking "Start review" constructs a MikeMessage with the hardcoded REVIEW_PROMPT string and the selected document as a file attachment, passes it to handleNewChat, and redirects to /assistant/chat/{newChatId}. The review then runs as a normal chat thread.

foolish-bandit spelled out what this doesn't do: no persisted review object, single-document only, no sidebar entry, no separate failure mode beyond the existing chat error handling. The only way in is the home action card, which was repointed from the tabular review route to this shell. The tabular review remains reachable from the sidebar.

Type checking is clean. The local build's Google Fonts failure is pre-existing.

So what Worth a look if you want a structured on-ramp for contract review without building parallel backend infrastructure. The review prompt (`REVIEW_PROMPT` constant in `page.tsx`) is the easily-tunable part if your use case wants different review topics. The single-document constraint and no-persistence design are deliberate simplifications, not gaps.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from foolish-bandit/gary, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
16c7bffd Add /review contract review shell Claude 2026-05-07 ↗ GitHub
commit body
Builds a frontend-only Contract Review flow that reuses the existing
upload, document picker, and assistant chat plumbing - no new backend
routes.

- New route at /review with a 3-step lawyer-friendly UI:
    1. Choose contract (existing FileDirectory single-select +
       upload via uploadStandaloneDocument)
    2. Confirm review (selected doc, what Gary will look for,
       citation expectation, "answers are not legal advice")
    3. Review key terms (handed off to the assistant chat)
- Start Review builds a MikeMessage with a fixed review prompt and
  the chosen document, then reuses useAssistantChat.handleNewChat
  + router.push("/assistant/chat/{id}"), the same path used by
  the Gary-mode home InitialView. The new chat page auto-sends
  the prefilled message and streams the cited response.
- Updates the Gary-mode "Review Contract" card to point at /review
  instead of /tabular-reviews. /tabular-reviews is unchanged and
  still reachable from the sidebar.

No backend changes, no API contract changes, no auth/billing/teams,
no new providers. License unchanged.

https://claude.ai/code/session_019pRkhcGDRKQWHjzAnV5yCL

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-272.md from inside the repo you want the changes in.

⬇ Download capture-thread-272.md