| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 2 | 2 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 1 | 3 | 3 | 14% |
What each file covers
Sections
0 shared · 2 only in A · 2 only in B- − Frontend Workflow
- − Package Contracts
- + @langgenius/dify-ui
- + Component Authoring Rules
Commands
neither file has anySection tags
1 shared · 3 only in A · 3 only in B- − test
- − testing-strategy
- − agent-behaviour
- + security
- + ui
- + do-not
- code-style
Line diff
langgenius/dify · web/AGENTS.md
@@ −1 @@
1## Frontend Workflow
2
3- Read `docs/test.md` only for frontend test work and `docs/lint.md` only when running or changing static checks.
4- Use the repo-local `how-to-write-component` skill when implementation requires component ownership, state, data-flow, effect, or interaction-boundary decisions. Do not load it for test-only, copy-only, or styling-only changes.
5- Use `frontend-code-review` only for explicit frontend review or audit requests, including test reviews. Use `frontend-testing` when writing or changing Vitest or React Testing Library tests.
6
7## Package Contracts
8
9- User-facing strings must use `web/i18n/en-US/` keys. When adding or renaming a key, update every supported locale with the correct localized value.
10- For new backend calls and migrated surfaces, use generated `consoleQuery` / `consoleClient` APIs from `@/service/client`. Do not add handwritten REST helpers or DTO mirrors, mock-backed app state, or direct edits to generated contracts.
11- Prefer `@langgenius/dify-ui/*` primitives, data attributes, and design tokens. Preserve a visible focus indicator on the final focusable element.
12- Follow `docs/overlay.md` for overlay selection and migration. Migrate a legacy overlay only when the current behavior change actually involves that overlay boundary.
13- For custom SVG icons, follow `../packages/iconify-collections/README.md`; do not add generated React icons under `app/components/base/icons/src/`.
14- `docs/test.md` is the single source of truth for frontend automated-test policy. Skills may route and execute that policy but must not redefine it.
15
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
@@ −1 +1 @@
1−## Frontend Workflow
1+# @langgenius/dify-ui
22
3−- Read `docs/test.md` only for frontend test work and `docs/lint.md` only when running or changing static checks.
4−- Use the repo-local `how-to-write-component` skill when implementation requires component ownership, state, data-flow, effect, or interaction-boundary decisions. Do not load it for test-only, copy-only, or styling-only changes.
5−- Use `frontend-code-review` only for explicit frontend review or audit requests, including test reviews. Use `frontend-testing` when writing or changing Vitest or React Testing Library tests.
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.
64
7−## Package Contracts
5+## Component Authoring Rules
86
9−- User-facing strings must use `web/i18n/en-US/` keys. When adding or renaming a key, update every supported locale with the correct localized value.
10−- For new backend calls and migrated surfaces, use generated `consoleQuery` / `consoleClient` APIs from `@/service/client`. Do not add handwritten REST helpers or DTO mirrors, mock-backed app state, or direct edits to generated contracts.
11−- Prefer `@langgenius/dify-ui/*` primitives, data attributes, and design tokens. Preserve a visible focus indicator on the final focusable element.
12−- Follow `docs/overlay.md` for overlay selection and migration. Migrate a legacy overlay only when the current behavior change actually involves that overlay boundary.
13−- For custom SVG icons, follow `../packages/iconify-collections/README.md`; do not add generated React icons under `app/components/base/icons/src/`.
14−- `docs/test.md` is the single source of truth for frontend automated-test policy. Skills may route and execute that policy but must not redefine it.
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+
16+Use 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
1532
