| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 2 | 3 | 0% |
| Commands | 0 | 0 | 5 | 0% |
| Section tags | 0 | 4 | 2 | 0% |
What each file covers
Sections
0 shared · 2 only in A · 3 only in B- − @langgenius/dify-ui
- − Component Authoring Rules
- + API Agent Guide
- + Commands
- + Architecture And Boundaries
Commands
0 shared · 0 only in A · 5 only in B- + make lint
- + make type-check
- + make test
- + make test TARGET_TESTS=./api/tests/<path>
- + uv run --project api
Section tags
0 shared · 4 only in A · 2 only in B- − code-style
- − security
- − ui
- − do-not
- + api
- + agent-behaviour
Line diff
langgenius/dify · packages/dify-ui/AGENTS.md
@@ −1 @@
1# @langgenius/dify-ui
2
3This package owns shared design tokens, CSS-first Tailwind styles, the `cn()` utility, and headless primitives consumed by `web/`. Read only the matching topic in [`README.md`] for public imports, forms, typed values, pickers, overlays, tokens, or tests.
4
5## Component Authoring Rules
6
7- Build primitives from `@base-ui/react`, `cva`, and `cn`.
8- Use relative cross-component imports inside the package and subpath exports such as `@langgenius/dify-ui/button` from consumers. Add a matching `package.json#exports` entry for each public primitive.
9- Keep one primitive per `src/<name>/` folder with optional colocated stories and tests.
10- Do not import from `web/` or depend on Next.js, i18n, application state, or data-fetching libraries.
11- Preserve upstream Base UI anatomy and generic value contracts. Use discriminated unions when one prop changes the valid shape of related props; do not flatten those relationships or hard-code selectable values to `string`.
12- Export shared public types from the owning component subpath.
13- Prefer Base UI data attributes and CSS variables for visual states; do not mirror primitive state in React solely to add classes.
14- When a Base UI API or selector contract is unclear, read the current official documentation and local `@base-ui/react` type declarations before coding.
15
16Use the README sections as the detailed owners:
17
18- [Imports and public boundaries]
19- [Typed value contracts]
20- [Search and picker selection]
21- [Tailwind and Figma radius mapping]
22- [Overlay and portal contracts]
23- [Development and test boundaries]
24
25[Development and test boundaries]: README.md#development
26[Imports and public boundaries]: README.md#imports
27[Overlay and portal contracts]: README.md#overlay--portal-contract
28[Search and picker selection]: README.md#search-and-picker-selection
29[Tailwind and Figma radius mapping]: README.md#tailwind-css-v4-integration
30[Typed value contracts]: README.md#typed-value-contracts
31[`README.md`]: README.md
32
langgenius/dify · api/AGENTS.md
@@ +1 @@
1# API Agent Guide
2
3Read surrounding module, class, and function docstrings plus non-obvious comments before changing backend behavior. They are local contracts; update them only when their owned behavior changes, and keep them aligned with the current code.
4
5## Commands
6
7Run backend checks from the repository root:
8
9- Format and lint: `make lint`
10- Type check: `make type-check`
11- Unit tests: `make test`
12- Targeted tests: `make test TARGET_TESTS=./api/tests/<path>`
13
14Run direct Python commands through `uv run --project api`. Docker-backed integration suites are normally CI-owned. Do not start long-running services as part of routine agent work.
15
16## Architecture And Boundaries
17
18- Keep transport parsing and serialization in controllers, orchestration in services, and domain policy in `core/` or its domain owner. Keep `libs/` business-agnostic and reuse existing owners before adding abstractions.
19- Before changing controller schemas, generated API contracts, or `SystemFeatureModel`, read `controllers/API_SCHEMA_GUIDE.md`. Treat `/system-features` as a minimal unauthenticated bootstrap allowlist, not a general configuration registry.
20- Scope tenant-owned reads and writes by the complete owner chain, and propagate `tenant_id` across every affected layer. Reconstruct trusted internal references from validated database state after payload or async boundaries.
21- Keep write transactions explicit and bounded. Do not perform external I/O inside an open transaction unless a documented consistency contract requires it.
22- Read configuration through `configs.dify_config`, access storage through `extensions.ext_storage.storage`, and route outbound HTTP through the existing SSRF-safe owner in `core.helper.ssrf_proxy`.
23- Use Pydantic v2 for request and response models. Reuse domain-specific exceptions and translate them at the controller boundary.
24- Use existing Celery task and queue owners for asynchronous work; do not route unrelated jobs through workflow-specific services.
25- Celery tasks that may be retried or redelivered must keep side effects idempotent and log affected resource identifiers.
26
@@ −1 +1 @@
1−# @langgenius/dify-ui
1+# API Agent Guide
22
3−This package owns shared design tokens, CSS-first Tailwind styles, the `cn()` utility, and headless primitives consumed by `web/`. Read only the matching topic in [`README.md`] for public imports, forms, typed values, pickers, overlays, tokens, or tests.
3+Read surrounding module, class, and function docstrings plus non-obvious comments before changing backend behavior. They are local contracts; update them only when their owned behavior changes, and keep them aligned with the current code.
44
5−## Component Authoring Rules
5+## Commands
66
7−- Build primitives from `@base-ui/react`, `cva`, and `cn`.
8−- Use relative cross-component imports inside the package and subpath exports such as `@langgenius/dify-ui/button` from consumers. Add a matching `package.json#exports` entry for each public primitive.
9−- Keep one primitive per `src/<name>/` folder with optional colocated stories and tests.
10−- Do not import from `web/` or depend on Next.js, i18n, application state, or data-fetching libraries.
11−- Preserve upstream Base UI anatomy and generic value contracts. Use discriminated unions when one prop changes the valid shape of related props; do not flatten those relationships or hard-code selectable values to `string`.
12−- Export shared public types from the owning component subpath.
13−- Prefer Base UI data attributes and CSS variables for visual states; do not mirror primitive state in React solely to add classes.
14−- When a Base UI API or selector contract is unclear, read the current official documentation and local `@base-ui/react` type declarations before coding.
7+Run backend checks from the repository root:
158
16−Use the README sections as the detailed owners:
9+- Format and lint: `make lint`
10+- Type check: `make type-check`
11+- Unit tests: `make test`
12+- Targeted tests: `make test TARGET_TESTS=./api/tests/<path>`
1713
18−- [Imports and public boundaries]
19−- [Typed value contracts]
20−- [Search and picker selection]
21−- [Tailwind and Figma radius mapping]
22−- [Overlay and portal contracts]
23−- [Development and test boundaries]
14+Run direct Python commands through `uv run --project api`. Docker-backed integration suites are normally CI-owned. Do not start long-running services as part of routine agent work.
2415
25−[Development and test boundaries]: README.md#development
26−[Imports and public boundaries]: README.md#imports
27−[Overlay and portal contracts]: README.md#overlay--portal-contract
28−[Search and picker selection]: README.md#search-and-picker-selection
29−[Tailwind and Figma radius mapping]: README.md#tailwind-css-v4-integration
30−[Typed value contracts]: README.md#typed-value-contracts
31−[`README.md`]: README.md
16+## Architecture And Boundaries
17+
18+- Keep transport parsing and serialization in controllers, orchestration in services, and domain policy in `core/` or its domain owner. Keep `libs/` business-agnostic and reuse existing owners before adding abstractions.
19+- Before changing controller schemas, generated API contracts, or `SystemFeatureModel`, read `controllers/API_SCHEMA_GUIDE.md`. Treat `/system-features` as a minimal unauthenticated bootstrap allowlist, not a general configuration registry.
20+- Scope tenant-owned reads and writes by the complete owner chain, and propagate `tenant_id` across every affected layer. Reconstruct trusted internal references from validated database state after payload or async boundaries.
21+- Keep write transactions explicit and bounded. Do not perform external I/O inside an open transaction unless a documented consistency contract requires it.
22+- Read configuration through `configs.dify_config`, access storage through `extensions.ext_storage.storage`, and route outbound HTTP through the existing SSRF-safe owner in `core.helper.ssrf_proxy`.
23+- Use Pydantic v2 for request and response models. Reuse domain-specific exceptions and translate them at the controller boundary.
24+- Use existing Celery task and queue owners for asynchronous work; do not route unrelated jobs through workflow-specific services.
25+- Celery tasks that may be retried or redelivered must keep side effects idempotent and log affected resource identifiers.
3226
