|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- Core agent logic lives in `src/react_agent/` (`graph.py` orchestrates the ReAct loop); shared utilities reside in `src/common/`. |
| 5 | +- Shared Pydantic schemas should inherit from `src/common/basemodel.AgentBaseModel`; keep the base class in that module so `src/common/models/` stays focused on provider integrations. |
| 6 | +- Packaging metadata and templates are exported via `langgraph/templates/react_agent`; add new modules under `src/` and expose them through `__init__.py` as needed. |
| 7 | +- Tests are split into `tests/unit_tests/`, `tests/integration_tests/`, and `tests/e2e_tests/`; evaluation harnesses live in `tests/evaluations/` with scenario scripts. |
| 8 | +- Static assets such as screenshots or fixtures belong in `static/` or the relevant `tests/cassettes/` folder. |
| 9 | + |
| 10 | +## Build, Test, and Development Commands |
| 11 | +- Install all deps with `uv sync --dev`; activate env through `uv run ...` or the generated `.venv`. |
| 12 | +- Launch the local graph runtime with `make dev` (headless) or `make dev_ui` (opens LangGraph Studio). |
| 13 | +- Run targeted suites via `make test_unit`, `make test_integration`, `make test_e2e`, or `make test_all`; watch mode is available through `make test_watch_*` targets. |
| 14 | +- Execute evaluation scenarios through `make eval_graph`, `make eval_multiturn`, or persona/model-specific targets like `make eval_graph_qwen`. |
| 15 | + |
| 16 | +## Coding Style & Naming Conventions |
| 17 | +- Python 3.11+ with 4-space indentation; favor type annotations and Google-style docstrings (enforced by Ruff + pydocstyle). |
| 18 | +- Run `make lint` before committing; it invokes Ruff formatting/isort checks and strict MyPy over `src/`. |
| 19 | +- Use snake_case for modules and functions, PascalCase for classes, and uppercase ENV names; keep public tool IDs descriptive (e.g., `search_tool`). |
| 20 | + |
| 21 | +## Testing Guidelines |
| 22 | +- Write tests with `pytest`; mirror implementation folders (e.g., `tests/unit_tests/common/` for `src/common/`). |
| 23 | +- Prefer deterministic fixtures and reuse cassette data in `tests/cassettes/` for external calls. |
| 24 | +- For new behaviors add unit coverage first, then integration/e2e if the agent flow changes; verify locally with the nearest `make test_*` target. |
| 25 | + |
| 26 | +## Commit & Pull Request Guidelines |
| 27 | +- Follow the existing conventional-emoji prefix style (`📚 docs:`, `♻️ refactor:`); keep the summary imperative and under 72 chars. |
| 28 | +- Reference issues in the body (`Fixes #123`) and note evaluation/test results. |
| 29 | +- PRs should explain the change, list verification commands, and attach screenshots or trace links when UI or agent output changes. |
| 30 | + |
| 31 | +## Security & Configuration Tips |
| 32 | +- Keep secrets in `.env` only; never commit API keys. Update `.env.example` when adding new configuration knobs. |
| 33 | +- Document any external service requirements (SiliconFlow, Tavily, OpenAI) and ensure fallback behaviors when keys are absent. |
0 commit comments