3.5 KiB
3.5 KiB
Repository Guidelines
Project Structure & Module Organization
app/holds core logic, configuration, and tools (e.g.,app/tool/meetspot_recommender.pyand the in-progressdesign_tokens.py). Treat it as the authoritative source for business rules.api/index.pywires FastAPI, middleware, and routers;web_server.pybootstraps the same app locally or in production.- Presentation assets live in
templates/(Jinja UI),static/(CSS, icons), andpublic/(standalone marketing pages); generated HTML drops underworkspace/js_src/and should be commit-free. - Configuration samples sit in
config/, docs indocs/, and regression or SEO tooling intests/plus futuretools/automation scripts.
Build, Test, and Development Commands
pip install -r requirements.txt(orconda env update -f environment-dev.yml) installs Python 3.11 dependencies.python web_server.pystarts the full stack with auto env detection;uvicorn api.index:app --reloadis preferred while iterating.npm run dev/npm startproxy to the same Python entry point for platforms that expect Node scripts.pytest tests/ -vruns the suite;pytest --cov=app tests/enforces coverage;python tests/test_seo.py http://127.0.0.1:8000performs the SEO audit once the server is live.- Quality gates:
black .,ruff check ., andmypy app/must be clean before opening a PR.
Coding Style & Naming Conventions
- Python: 4-space indent, type hints everywhere,
snake_casefor functions,PascalCasefor classes, andSCREAMING_SNAKE_CASEfor constants. Keep functions under ~50 lines and prefer dataclasses for structured payloads. - HTML/CSS: prefer BEM-like class names (
meetspot-header__title), declare shared colors via the upcomingstatic/css/design-tokens.css, and keep inline styles limited to offline-only HTML inworkspace/js_src/. - Logging flows through
app/logger.py; use structured messages (logger.info("geo_center_calculated", extra={...})) so log parsing stays reliable.
Testing Guidelines
- Place new tests in
tests/usingtest_<feature>.pynaming; target fixtures that hit both FastAPI routes and tool-layer helpers. - Maintain ≥80% coverage for the
app/package; add focused tests when touching caching, concurrency, or SEO logic. - Integration checks: run
python tests/test_seo.py <base_url>against a live server and capture JSON output in the PR for visibility. - Planned accessibility tooling (
tests/test_accessibility.py) will be part of CI—mirror its structure for any lint-like tests you add.
Commit & Pull Request Guidelines
- Follow Conventional Commits (
feat:,fix:,ci:,docs:) as seen ingit log; keep scopes small (e.g.,feat(tokens): add WCAG palette). - Reference related issues in the first line of the PR description, include a summary of user impact, and attach screenshots/GIFs for UI work.
- List the commands/tests you ran, note any config changes (e.g.,
config/config.toml), and mention follow-up tasks when applicable. - Avoid committing generated artifacts from
workspace/or credentials inconfig/config.toml; add new secrets to.envor deployment config.
Configuration & Architecture Notes
- Keep
config/config.toml.exampleupdated when introducing new settings, and never hardcode API keys—read them viaapp.config. - The design-token and accessibility architecture is tracked in
.claude/specs/improve-ui-ux-color-scheme/02-system-architecture.md; align contributions with that spec and document deviations in your PR.