AGENTS.md•2.26 kB
# Repository Guidelines
## Project Structure & Module Organization
- **app/**: FastMCP server package (settings, OCC client mixins, tool modules). Entry point is `app/server.py`.
- **docs/**: OCC OpenAPI specs (`api-docs*.json`).
- **tests/**: Pytest suite, including `integration_utils.py` helpers and live/integration flows.
- Root assets: `Dockerfile`, `docker-compose.yml`, `pyproject.toml`, `.env.example`, `README.md`, `TODO.md`.
## Build, Test, and Development Commands
- `uv sync`: Install/lock dependencies into `.venv` (pyproject-managed).
- `python -m app.server`: Start FastMCP server in stdio mode.
- `fastmcp serve app/server.py --sse :8080`: Run SSE transport on port 8080.
- `pytest -q`: Execute test suite (unit + live smoke/integration).
- `ruff check`: Lint the codebase.
## Environment & Configuration
- Copy `.env.example` to `.env`; tune `OCC_BASE_URL`, timeouts, or Accept header as needed.
- Default flows use the public OCC tenant and the `apparel-uk` base site (allows anonymous cart ops).
- Integration tests require outbound HTTP access; skip or adjust when running in restricted environments.
## Coding Style & Naming Conventions
- Python 3.13, Pydantic v2, httpx async client. Use four-space indentation.
- Module-level mixins live under `app/occ_client/`; tools under `app/tools/` with `register` helpers.
- Prefer snake_case for files/functions, PascalCase for classes, UPPER_CASE for constants.
- Run `ruff check` before committing to ensure style/lint compliance.
## Testing Guidelines
- Framework: Pytest (`tests/`). Live integration tests hit public OCC endpoints (network required).
- Test files use `test_*.py` naming; async tests decorated with `@pytest.mark.asyncio`.
- Use `structured(...)` helper from `tests/integration_utils.py` to access tool results.
- Default base site for flows is `apparel-uk`; integration utilities auto-skip unsupported operations.
## Commit & Pull Request Guidelines
- Follow conventional, descriptive commit messages (verb phrase, e.g., "Add cart lifecycles").
- Ensure commits pass lint and tests; include links to relevant issues in PR descriptions.
- PR checklist: summarize changes, highlight new tools/endpoints, note integration test impact, mention deployment implications if any.