Shared repository instructions for coding agents working in this project.
Phentrieve maps clinical text to Human Phenotype Ontology (HPO) terms with a retrieval-augmented workflow.
Primary areas:
phentrieve/- Python CLI and libraryapi/- FastAPI backend and MCP serverfrontend/- Vue 3 applicationtests/- unit, integration, and E2E coverage.planning/- specs, plans, analysis, and historical execution records
- Use this file for repo-wide agent guidance.
- Keep
CLAUDE.mdconcise and Claude-specific. - Keep all planning artifacts under
.planning/. Do not create new plan files inplan/ordocs/superpowers/. - Use
.planning/README.mdas the planning index.
- Do not revert or overwrite changes you did not make unless explicitly asked.
- Keep edits scoped to the task; avoid unrelated refactors.
- Prefer existing patterns over inventing new abstractions.
- Keep all tests under
tests/. Do not createtests_new/. - Use ASCII unless a file already requires non-ASCII content.
Required checks before claiming completion:
make checkmake typecheck-fastmake test
Use these CI-parity targets locally:
- Python quality PR gate:
make ci-python-quality - Python compatibility matrix:
make ci-python-compat-all - One Python compatibility version:
make ci-python-compat PYTHON=3.13 - Frontend PR gate:
make ci-frontend - Full local PR gate:
make ci-local
For changes that can affect GitHub Actions frontend parity, run:
make frontend-test-cimake frontend-build-ci
For changes that can affect Python version compatibility, run:
make ci-python-compat PYTHON=3.12make ci-python-compat PYTHON=3.13
Recommended pre-commit shortcut:
make precommit
Python-only shortcut:
make all
Useful Python and CLI commands:
make installmake install-devmake formatmake lintmake lint-fixmake typecheckmake typecheck-freshpytest tests/unit/api/phentrieve --help
Frontend commands:
make frontend-installmake frontend-lintmake frontend-formatmake frontend-devmake frontend-buildmake frontend-build-cimake frontend-testmake frontend-test-cimake frontend-test-cov- Run
make frontend-i18n-checkfor locale changes
Local services:
make dev-apistarts the API onhttp://localhost:8734make dev-frontendstarts the frontend onhttp://localhost:5734make mcp-servestarts the MCP server over stdiomake mcp-serve-httpstarts the MCP server over HTTP
Docker and E2E:
make docker-buildmake docker-upmake docker-downmake docker-devmake test-e2emake test-e2e-fastmake test-e2e-clean
- Use
uvfor Python dependency management; do not usepip. - Use modern Python typing:
list[str],dict[str, int],str | None. - Python formatting and linting use Ruff.
- Type checking uses mypy targeting Python 3.11.
- Frontend uses Vue 3, Vuetify, Pinia, Vue I18n, ESLint 9, and Prettier.
make testexcludesslowande2etests by default.make test-ciandmake ci-python-compat*also excludeslowande2etests to match GitHub Actions PR checks.- Available pytest markers:
unit,integration,e2e,slow. - Tests run in parallel via
pytest-xdist. - For single-threaded debugging, use
uv run pytest tests/ -n 0 .... - Treat failing checks as real issues unless you have clear evidence otherwise.
- The API runs from
api/, soPHENTRIEVE_DATA_ROOT_DIR=../datainapi/local_api_config.envpoints back to the repository rootdata/directory. - Planning lifecycle:
- active work ->
.planning/active/ - completed plans ->
.planning/completed/ - archived/superseded plans ->
.planning/archived/ - design specs ->
.planning/specs/ - analysis and reviews ->
.planning/analysis/ - rough or not-yet-activated plans ->
.planning/drafts/
- active work ->