forthepeople
CLAUDE.md312 starsChanged 7 months agoMITView on GitHub
Rules and pointers only. No counts, prices, dates or "current state" here — those drift. For what the platform looks like today read docs/BLUEPRINT-UNIFIED.md (the overview), CHANGELOG.md (what shipped, when) and docs/ARCHITECTURE.md (how it fits together).
- Reads credentials
- Commits and pushes
We split this CLAUDE.md into the rules it gives an agent
20 rules. About 0 are common, 7 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 31
Prefer existing tables or Redis keys over new columns when a fix allows it.
- Very specific: line 34
All AI calls go through callAI() / callAIJSON() in src/lib/ai-provider.ts.
- Distinctive: line 47
NEVER use "scraper/scraping/scraped" in citizen-facing text.
- Very specific: line 48
NEVER hardcode district data or counts — use the DB and getTotalActiveDistrictCount() from src/lib/constants/districts.ts.
- Distinctive: line 50
NEVER store budget values in crores — always whole rupees.
- Distinctive: line 51
NEVER fabricate data when a source fails: write nothing, show the empty state.
- Very specific: line 52
NEVER use ioredis on Vercel — @upstash/redis (REST) only.
- Very specific: line 53
NEVER use middleware.ts — Next.js 16 uses src/proxy.ts.
- Very specific: line 54
NEVER deploy with npx vercel --prod — deploys happen via git push origin main.
- Very specific: line 55
NEVER run npm audit fix. Bump versions deliberately, one at a time.
- Very specific: line 56
NEVER commit .env.local or any real secret.
- Very specific: line 57
NEVER hard-code citizen-facing text — every new string ships in en + hi + kn (src/dictionaries/<locale>/page_<name>.json, then node …
- Distinctive: line 61
Every dataset shows its own date.
- Very specific: line 64
Never add a famous personality unless they were born in that district (bornInDistrict).
- Very specific: line 66
Add take: N to findMany on high-cardinality tables (schools, elections, news).
- Distinctive: line 69
No government emblems or seals.
- Very specific: line 82
Add a dated line to CHANGELOG.md (Unreleased section until pushed).
- Very specific: line 83
Update docs/ARCHITECTURE.md only if structure changed (not for data edits).
- Very specific: line 84
Keep .env.example in sync with any new process.env.* read.
- Distinctive: line 85
Commit with a conventional message.
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 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 — ForThePeople.in Project Instructions
Rules and pointers only. No counts, prices, dates or "current state" here —
those drift. For what the platform looks like today read
docs/BLUEPRINT-UNIFIED.md (the overview), CHANGELOG.md (what shipped, when)
and docs/ARCHITECTURE.md (how it fits together).
Project
ForThePeople.in — free, open-source citizen transparency platform for Indian districts. Built by Jayanth M B. Next.js App Router + TypeScript + Tailwind v4 + Prisma + Neon PostgreSQL + Upstash Redis, hosted on Vercel.
Read first
docs/BLUEPRINT-UNIFIED.md— the one-page overview: vision, who it is for, modules, design, data honesty rules, crons, languages.docs/ARCHITECTURE.md— routes, crons, data flow, auth, AI, where state lives.- For any UI work:
docs/DESIGN-SYSTEM.md(v5.1 "Warm Calm"),docs/LAYOUT.md,docs/MODULE-MAP.md,docs/I18N.md. CHANGELOG.md— the top "Unreleased" entry is the live work-in-progress..env.example— the ONLY list of environment variables the code reads.- Module-specific docs in
docs/only when the task touches that module.docs/archive/is history only — never follow it.
Database schema changes (CRITICAL)
The build runs prisma generate && next build and NEVER mutates the database.
Any schema change must be applied manually against prod Neon BEFORE the code
that depends on it is pushed:
- Edit
prisma/schema.prisma. npm run db:pushagainst prod Neon.- Then commit + push the dependent code. Prefer existing tables or Redis keys over new columns when a fix allows it.
AI cost rules (CRITICAL)
- All AI calls go through
callAI()/callAIJSON()insrc/lib/ai-provider.ts. news-analysispurpose → Tier-1 chain: free models first (Jev Router, free Gemma), paid backstop last. Classification is pick-a-category + extract-a-few-fields.insightpurpose → Tier-2 low-cost paid model. CallhasDataChanged()first and skip when nothing is new.fact-check→ Claude Sonnet, manual trigger only.- Paid fallback only when
AI_PAID_FALLBACK=1. Model IDs (and their known expiry dates) live only insrc/lib/ai-models.ts; never hard-code a model name elsewhere — the model list is the one thing that changes often. - News pipeline: keyword classifier first; call AI only when the keyword pass returns "news"/null or the article lands in an actionable module.
Key rules
- NEVER use "scraper/scraping/scraped" in citizen-facing text.
- NEVER hardcode district data or counts — use the DB and
getTotalActiveDistrictCount()fromsrc/lib/constants/districts.ts. - NEVER store budget values in crores — always whole rupees.
- NEVER fabricate data when a source fails: write nothing, show the empty state.
- NEVER use ioredis on Vercel —
@upstash/redis(REST) only. - NEVER use middleware.ts — Next.js 16 uses
src/proxy.ts. - NEVER deploy with
npx vercel --prod— deploys happen viagit push origin main. - NEVER run
npm audit fix. Bump versions deliberately, one at a time. - NEVER commit
.env.localor any real secret; never print secret values. - NEVER hard-code citizen-facing text — every new string ships in en + hi + kn
(
src/dictionaries/<locale>/page_<name>.json, thennode scripts/gen-i18n-namespaces.mjs). - Emoji only as module identity (sidebar item, module chip, overview tile); tokens
and hue variables only, no hex in components (
docs/DESIGN-SYSTEM.md). - Every dataset shows its own date; old data says how old in words; undated data says "date not published by the source". Sources are "government portals and other reputed sources" — never claim "official only".
- Never add a famous personality unless they were born in that district (
bornInDistrict). NewsItemhastitle(notheadline);ElectionResultis one row per constituency (the winner).- Add
take: NtofindManyon high-cardinality tables (schools, elections, news). - recharts Tooltip
formatter: take(v)and cast withNumber(v); never type it(v: number). - Header/sidebar nav keeps
overflow: visible(hidden clips the dropdowns). - No government emblems or seals; news is headline + summary + link only; at most one request every 2–3 s per source domain.
- Admin auth: signed, expiring, Redis-revocable sessions in
src/lib/admin-auth.ts;requireAdmin()is the single gate for every admin route, page and action. - Cron auth:
Authorization: Bearer <CRON_SECRET>(what Vercel Cron sends).
Quality gates (all must pass before a push)
npm run lint→ 0 errors (React-Compiler rules are warnings; burn them down).npx tsc --noEmit→ 0 errors.npm test→ vitest, pure helpers only, no DB.npm run buildneeds a reachable DB (CI uses a throwaway Postgres).
After every task
- Add a dated line to
CHANGELOG.md(Unreleased section until pushed). - Update
docs/ARCHITECTURE.mdonly if structure changed (not for data edits). - Keep
.env.examplein sync with any newprocess.env.*read. - Commit with a conventional message. Push only when the owner says so.
Where things are
docs/BLUEPRINT-UNIFIED.md— overview (section 16 is the full doc index).docs/ARCHITECTURE.md— structure.docs/RUNBOOKS/— crons, AI models, admin auth.docs/DESIGN-SYSTEM.md,docs/LAYOUT.md,docs/MODULE-MAP.md,docs/I18N.md— UI and text.docs/DISTRICT-EXPANSION-SKILL.md,docs/AI-NEWS-INTELLIGENCE-SKILL.md,docs/INDIAN-DISTRICT-HIERARCHY-SKILL.md,docs/SCALING-CHECKLIST.md— task guides.docs/BUG-TRACKER.md,docs/LIVE-STATE.md— history.docs/archive/— frozen documents (the March–June blueprint, old skills, completed prompts); do not follow.scripts/— reusable ops scripts;scripts/archive/— provenance only, never run.- Private vault (owner only): accounts, grants, cost ledger, runbooks with secret NAMES only.
In this repositoryOne other file it gives its agents.
- public/llms.txtllms.txt
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

