This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Dify is an open-source platform for developing LLM applications with an intuitive interface combining agentic AI workflows, RAG pipelines, agent capabilities, and model management.
The codebase consists of:
/api): Python Flask application with Domain-Driven Design architecture/web): Next.js 15 application with TypeScript and React 19/docker): Containerized deployment configurationsAll Python commands must be prefixed with uv run --project api:
# Start development servers
./dev/start-api # Start API server
./dev/start-worker # Start Celery worker
# Run tests
uv run --project api pytest # Run all tests
uv run --project api pytest tests/unit_tests/ # Unit tests only
uv run --project api pytest tests/integration_tests/ # Integration tests
# Code quality
./dev/reformat # Run all formatters and linters
uv run --project api ruff check --fix ./ # Fix linting issues
uv run --project api ruff format ./ # Format code
uv run --project api mypy . # Type checking
cd web
pnpm lint # Run ESLint
pnpm eslint-fix # Fix ESLint issues
pnpm test # Run Jest tests
pytest for all backend testsAny types unless absolutely necessary__repr__, __str__) appropriatelyany typeuv run --project api <command>./dev/reformat before committing backend changes/api/controllers//api/services/__init__.py/api/tests/