This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sunbird AI API — a FastAPI application providing African language AI services (speech-to-text, translation, text-to-speech, language identification) deployed on Google Cloud Run with a PostgreSQL backend.
Supported languages: Acholi (ach), Ateso (teo), English (eng), Luganda (lug), Lugbara (lgg), Runyankole (nyn). Translation is always to/from English.
SECRET_KEY
DATABASE_URL
RUNPOD_API_KEY
REDIS_URL
RUNPOD_ENDPOINT
AUDIO_CONTENT_BUCKET_NAME
VERIFY_TOKEN # WhatsApp webhook verification
See app/core/config.py for the full list of optional variables (OAuth, Firebase, email, GCP).
Every new feature, bug fix, or improvement — backend or frontend — must meet these criteria before being considered complete:
- Tests: Write tests for the new/changed behavior. Run
pytest app/tests/ -v(backend) or verify frontend builds withnpm run buildinfrontend/. All tests must pass. - Linting: Run
make lint-check(backend) andnpm run lintinfrontend/. Fix all issues before committing. - Security audit (frontend): Run
npm auditinfrontend/after adding or updating any JS dependency. Flag any high/critical vulnerabilities and resolve them before proceeding. Do not ignore security warnings.
When making code changes (new features, refactors, improvements):
- Clarify first — Before planning or implementing, ask clarifying questions about the request. Probe for missing details: edge cases, expected behavior, affected endpoints/pages, backward compatibility, and scope boundaries. Do not assume — surface ambiguity early so nothing is missed.
- Propose second — After clarifications are resolved, present a summary of the planned changes: which files will be modified/created, what the approach is, and any trade-offs. Wait for approval before writing code.
- Review after implementation — After implementing, present a summary of what changed and suggest any further improvements (performance, readability, security). Only apply improvement suggestions after explicit approval.
- No silent changes — Do not make changes beyond what was discussed and approved. If you discover something that should be fixed along the way, flag it separately rather than bundling it in.
Always use Context7 MCP to fetch up-to-date library documentation when adding new features or working with libraries/frameworks (e.g., FastAPI, SQLAlchemy, Pydantic, Alembic). Do not rely solely on training data — library APIs change between versions.
@.claude/rules/commands.md @.claude/rules/architecture.md @.claude/rules/database.md @.claude/rules/routers.md @.claude/rules/testing.md @.claude/rules/frontend.md