Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

AGENTS.md 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # AGENTS.md
  2. ## Project Overview
  3. 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.
  4. The codebase is split into:
  5. - **Backend API** (`/api`): Python Flask application organized with Domain-Driven Design
  6. - **Frontend Web** (`/web`): Next.js 15 application using TypeScript and React 19
  7. - **Docker deployment** (`/docker`): Containerized deployment configurations
  8. ## Backend Workflow
  9. - Run backend CLI commands through `uv run --project api <command>`.
  10. - Backend QA gate requires passing `make lint`, `make type-check`, and `uv run --project api --dev dev/pytest/pytest_unit_tests.sh` before review.
  11. - Use Makefile targets for linting and formatting; `make lint` and `make type-check` cover the required checks.
  12. - Integration tests are CI-only and are not expected to run in the local environment.
  13. ## Frontend Workflow
  14. ```bash
  15. cd web
  16. pnpm lint
  17. pnpm lint:fix
  18. pnpm test
  19. ```
  20. ## Testing & Quality Practices
  21. - Follow TDD: red → green → refactor.
  22. - Use `pytest` for backend tests with Arrange-Act-Assert structure.
  23. - Enforce strong typing; avoid `Any` and prefer explicit type annotations.
  24. - Write self-documenting code; only add comments that explain intent.
  25. ## Language Style
  26. - **Python**: Keep type hints on functions and attributes, and implement relevant special methods (e.g., `__repr__`, `__str__`).
  27. - **TypeScript**: Use the strict config, lean on ESLint + Prettier workflows, and avoid `any` types.
  28. ## General Practices
  29. - Prefer editing existing files; add new documentation only when requested.
  30. - Inject dependencies through constructors and preserve clean architecture boundaries.
  31. - Handle errors with domain-specific exceptions at the correct layer.
  32. ## Project Conventions
  33. - Backend architecture adheres to DDD and Clean Architecture principles.
  34. - Async work runs through Celery with Redis as the broker.
  35. - Frontend user-facing strings must use `web/i18n/en-US/`; avoid hardcoded text.