app/main.pycontains the FastAPI service, tool implementations, and API routes.tests/test_app.pyholds the pytest suite for health, root, and/agentbehavior.Dockerfileanddocker-compose.ymldefine the container and local stack setup.requirements.txtlists runtime dependencies;requirements-dev.txtadds test and lint tools.pyproject.tomlstores Ruff and pytest configuration.
python -m venv .venv && source .venv/bin/activatecreates an isolated environment.pip install -r requirements-dev.txtinstalls runtime, pytest, httpx, and Ruff.uvicorn app.main:app --reloadruns the API locally with live reload.pytest -vruns the test suite.ruff check app testschecks formatting and import/style issues.docker compose up --buildstarts the app and Redis for the full local stack.
- Use 4-space indentation and keep code compatible with Python 3.11.
- Follow Ruff rules already enabled in
pyproject.toml:E,F, andI. - Keep lines under 100 characters when practical.
- Use
snake_casefor functions, variables, and test names; use descriptive names for tools and API fields. - Prefer small, explicit helper functions in
app/main.pyover hidden logic.
- Add tests under
tests/with names that matchtest_*.py. - Use
pytestandfastapi.testclient.TestClientfor API-level checks. - Cover both success and failure paths for new tools or endpoints.
- Keep tests deterministic; mock or avoid external services unless the repo already provides a mock.
- The git history is minimal, so there is no strict established commit convention yet.
- Use short, imperative commit messages such as
feat: add weather toolortest: cover bad input. - PRs should include a clear summary, testing notes, and screenshots only when UI or docs output changes.
- Link related issues when available and call out any container, CI, or API contract changes.
- Do not commit secrets or host-specific values.
- Use environment variables such as
PORTandREDIS_URLfor runtime configuration. - Keep the
/healthendpoint stable because it is used by container and deployment checks.