adamwolfe2 turns document review into an API

A new endpoint lets other software hand Mike a document and get back a structured review - no human in the loop.

contract-reviewintegration

adamwolfe2 has stood up an independent backend for their fork and bolted on a small but pointed addition: a review endpoint that accepts a document link and returns a summary, the key clauses, identified risks, and a recommendation - all as structured data. The caller isn't a person clicking through a chat window; it's another piece of software, authenticated with a shared token rather than a user login.

The intended client is a separate service the fork owner is building alongside Mike. The underlying work is familiar - Mike already pulls text out of PDFs and Word documents and runs it past a language model - but packaging it as a standalone API means any other tool in the stack can request a review without going through the chat interface.

So what For legal-tech teams building internal toolchains, this is an instructive pattern: review-as-a-service, callable from intake forms, matter-management systems, or document repositories.

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 adamwolfe2/mike-amcollective, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
cb876234 feat: add Fly deploy config, /review endpoint, and Supabase S3 support adamwolfe2 2026-04-30 ↗ GitHub
commit body
- Dockerfile: Node 22-slim + LibreOffice apt (mirrors nixpacks.toml config)
- fly.toml: mike-backend-amcollective, shared-cpu-1x @ 512MB, region iad
- routes/review.ts: POST /review - stateless doc review via Claude Haiku
  Fetches URL, extracts text (pdfjs/mammoth, same pattern as chatTools.ts),
  returns {summary, key_clauses, risks, recommendation} JSON
- middleware/serviceAuth.ts: timing-safe Bearer token auth (MIKE_SERVICE_TOKEN)
- index.ts: register /review route
- lib/storage.ts: R2_REGION env var instead of hardcoded 'auto'
  Set R2_REGION=us-east-1 for Supabase Storage S3, omit for Cloudflare R2

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-90.md from inside the repo you want the changes in.

⬇ Download capture-thread-90.md