tender-copilot
CLAUDE.md0 starsChanged 2 months agoMITView on GitHub
Context for Claude Code. Read this before making changes. Tender Copilot reads an Indian government tender (GeM, CPPP, state portals): the main bid PDF plus attachments (PDF / CSV / XLSX). It produces a report for ONE firm: deadline status, how the bid works, every eligibility criterion checked against the firm's profile, red flags and documents to upload. - Business model: an admin-run bid desk first (an admin reviews every report before release), then firms self-serve. - The engine (copilot/)…
- Installs packages
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 66
keep the "no null" convention ("" or 0 for missing values).
- Distinctive: line 67
keep the structured-output schemas small (they are split into TenderOverview, BidFacts and TenderRequirements because one big schema was …
- Very specific: line 69
update samples/fixtures/*.json and the tests in the same change.
- Very specific: line 72
Every criterion keeps a verbatim source_quote and page.
- Distinctive: line 82
no real firm data in the repo or in tests.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md: Tender Copilot
Context for Claude Code. Read this before making changes.
What this is
Tender Copilot reads an Indian government tender (GeM, CPPP, state portals): the main bid PDF plus attachments (PDF / CSV / XLSX). It produces a report for ONE firm: deadline status, how the bid works, every eligibility criterion checked against the firm's profile, red flags and documents to upload.
- Business model: an admin-run bid desk first (an admin reviews every report before release), then firms self-serve.
- The engine (
copilot/) works and has been tested on 7 real GeM bids. It is the source of truth for tender logic. - The full architecture doc is in Claude Docs: "Tender Copilot: Architecture and Tech Stack". This file summarises it.
Current layout (before the monorepo move)
copilot/ engine: pdf_reader, extractor, grounding, deadlines, matcher, report, schema, llm
cli.py python cli.py <bid.pdf> [attachments...] --profile <firm.yaml> [--mock samples/fixtures]
app.py old Streamlit demo (to be replaced by apps/web)
firm_profile.*.yaml example firm profiles
samples/ fictional sample tender + mock fixtures for offline tests
tests/ pytest, offline (MockLLM), no API key neededTarget architecture
packages/copilot/ the engine, moved unchanged
apps/api/ FastAPI: auth (Supabase JWT), uploads, enqueue jobs, serve reports
apps/worker/ claims jobs from Postgres (FOR UPDATE SKIP LOCKED): analyse_bid, match_firm, export_pdf
apps/web/ Next.js (App Router, TypeScript, Tailwind, shadcn/ui): admin console + firm portal
supabase/migrations SQL schema + row-level security
evals/golden/ the 7 tested bids + expected checksKey design: a bid's analysis (extract + ground + deadline) is firm-independent and cached per bid and
file hash in bid_analyses. A report = one firm profile version matched against one analysis.
Core tables: firms, users, memberships, firm_profiles (versioned JSONB), firm_documents, bids, bid_files, bid_analyses, reports (draft / in_review / released), report_feedback, jobs, llm_runs, audit_log.
Stack: Supabase (Postgres, Auth with phone OTP, Storage) in ap-south-1. Vercel for web; Railway or Render for the API and worker. Anthropic API (model from the ANTHROPIC_MODEL env var). Sentry. Resend email. Razorpay and WhatsApp come later.
Commands (Windows PowerShell)
.\.venv\Scripts\Activate.ps1 # Set-ExecutionPolicy -Scope Process Bypass if blocked
pip install -r requirements.txt
python -m pytest -q # offline tests, must pass before any commit
python cli.py samples\sample_tender.pdf --profile firm_profile.example.yaml --mock samples\fixtures
python cli.py tenders\<bid>.pdf tenders\<attachment> --profile firm_profile.hyd.yaml # real API callRules
- Tender logic lives only in the engine. The API and web never re-implement eligibility rules; they call the engine and display its output.
- Schema changes in
copilot/schema.pymust:- keep the "no null" convention ("" or 0 for missing values);
- keep the structured-output schemas small (they are split into TenderOverview, BidFacts and TenderRequirements because one big schema was rejected as too complex);
- update
samples/fixtures/*.jsonand the tests in the same change.
- Facts that can be computed in code (dates, days left, verdict guardrails) are computed in code,
not by the model. See
deadlines.pyand the guardrails inmatcher.py. - Every criterion keeps a verbatim
source_quoteand page. Grounding marks unverified quotes; never remove that check. - Prompt changes: run the golden set (
evals/golden/, once it exists) and compare caught items before and after. Don't merge a change that drops caught items. - Payable items (EMD, ePBG, CMC bank guarantee) are never "not_met" only because a reseller cannot claim an exemption.
- Security:
- row-level security on every firm-owned table;
- storage paths
firm/<firm_id>/...in private buckets with signed URLs; - API keys never reach the browser;
- no real firm data in the repo or in tests.
- Reports stay in
draft/in_reviewuntil an admin releases them (MVP). - Small commits, one feature per branch, plan mode before large changes.
Known engine behaviour worth keeping
- GeM bilingual PDFs: Hindi glyphs are stripped by
clean_text(25-37% fewer characters). - Auto-extension can keep a "closed" bid open.
deadline_statusreports the latest possible end date. - Make in India: the consequence of a missing OEM local-content certificate differs per bid
(
bid_rejectedvsloses_preference). Read it from each bid's wording. - MSE relaxation may cover experience only, not turnover. Read it from the numbered clauses, not the label.
- "Possible spec error" flags rely on model knowledge and can be wrong. Show them as possible, never as certain.
First tasks (in order)
- Move to the monorepo layout above; keep
cli.pyworking; all tests green. - Supabase migrations: tables, RLS policies, storage buckets.
- FastAPI: upload bid -> create jobs; worker runs analyse_bid + match_firm and stores the results.
- Next.js admin: firm list and profile form, bid upload, report view with edit and release.
- Firm portal: OTP login, view released reports, edit profile (creates a new version).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

