RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Diff/langgenius-dify-packages-dify-ui-agents ↔ langgenius-dify-e2e-agents

Comparison

A · AGENTS.md · langgenius/difyB · AGENTS.md · langgenius/dify
What each file covers, counted
DimensionSharedOnly in AOnly in BOverlap
Sections0260%
Commands00100%
Section tags13314%

What each file covers

Sections

0 shared · 2 only in A · 6 only in B
  • − @langgenius/dify-ui
  • − Component Authoring Rules
  • + E2E
  • + Commands
  • + Runtime Ownership
  • + Tags And External Runtime
  • + Browser, API, And Contract Boundaries
  • + Seeds, Cleanup, And Diagnostics

Commands

0 shared · 0 only in A · 10 only in B
  • + pnpm install
  • + pnpm -C e2e e2e:install
  • + pnpm -C e2e e2e
  • + pnpm -C e2e e2e:full
  • + pnpm -C e2e e2e -- --tags @smoke
  • + pnpm -C e2e e2e:headed -- --tags @smoke
  • + pnpm -C e2e seed -- --profile <prepared|external-runtime|post-merge>
  • + pnpm -C e2e e2e:reset
  • + pnpm -C e2e e2e:middleware:up
  • + pnpm -C e2e e2e:middleware:down

Section tags

1 shared · 3 only in A · 3 only in B
  • − security
  • − ui
  • − do-not
  • + setup
  • + testing-strategy
  • + api
  •   code-style

Line diff

+61 added−25 removed7 unchanged10.3% identical
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 · e2e/AGENTS.md
@@ +1 @@
1# E2E
2 
3This package contains Dify's repository-level Cucumber scenarios with Playwright as the browser layer. This file owns current package architecture, runtime, session and tag semantics, seed, protocol, and cleanup contracts. The repo-local `e2e-cucumber-playwright` skill owns authoring and review methodology; feature-specific facts belong in the nearest feature `AGENTS.md`.
4 
5## Commands
6 
7Run commands from the repository root. Install dependencies and browsers once with `pnpm install` and `pnpm -C e2e e2e:install`. Run only one local `pnpm -C e2e e2e*` process at a time because runners share ports, auth state, and log paths.
 
 
 
 
 
 
 
8 
9- Existing initialized instance: `pnpm -C e2e e2e`
10- Reset, initialize, and run deterministic scenarios: `pnpm -C e2e e2e:full`
11- Prepare and run scenarios backed by shared fixtures: `E2E_START_AGENT_BACKEND=1 pnpm -C e2e e2e:prepared`
12- Tagged subset: `pnpm -C e2e e2e -- --tags @smoke`
13- Headed debugging: `pnpm -C e2e e2e:headed -- --tags @smoke`
14- Prepare and run external runtime scenarios: `E2E_START_AGENT_BACKEND=1 pnpm -C e2e e2e:external`
15- Seed against existing middleware without running Cucumber: `pnpm -C e2e seed -- --profile <prepared|external-runtime|post-merge>`
16- Reset persisted E2E state: `pnpm -C e2e e2e:reset`
17- Middleware lifecycle: `pnpm -C e2e e2e:middleware:up` and `pnpm -C e2e e2e:middleware:down`
18- Scoped static checks: `vp check e2e`
19 
20The runner reuses `web/.next/BUILD_ID` when present. Set `E2E_FORCE_WEB_BUILD=1` to force a frontend rebuild. Use `E2E_BROWSER=webkit` for focused cross-browser runs and `E2E_SLOW_MO=500` with a headed command for local action debugging.
 
 
 
 
 
21 
22## Runtime Ownership
23 
24- `scripts/setup.ts` owns reset, middleware, backend, and frontend startup.
25- `scripts/run-cucumber.ts` is the only E2E runtime orchestrator. It owns service lifetime, optional seed execution, Cucumber invocation, and teardown.
26- `scripts/seed-runner.ts` owns fixture creation and verification against an already-running runtime; it never starts services.
27- `support/web-server.ts` owns frontend reuse, readiness, and shutdown.
28- `features/support/hooks.ts` owns shared auth bootstrap, scenario lifecycle, and diagnostics.
29- `features/support/world.ts` owns `DifyWorld`, the per-scenario behavior `BrowserContext`, and its authenticated setup and cleanup client. Browser and API identities remain separate so unauthenticated and logout journeys cannot invalidate fixture ownership.
30- Cross-actor scenarios keep each actor in a separate `BrowserContext` and typed `DifyWorld` state so diagnostics and cleanup cover every actor.
31- `features/step-definitions/` contains capability-oriented glue; `common/` is reserved for genuinely cross-capability steps.
32- Step definitions that access World state use `async function (this: DifyWorld, ...)`; arrow functions cannot receive Cucumber's bound World instance.
33 
34An uninitialized instance is installed and authenticated lazily; an initialized instance signs in and reuses authenticated state. Full runs prove reset and bootstrap during setup rather than through a Gherkin scenario. Cucumber's exit status is the behavior gate, and the runner also requires at least one `testCaseStarted` message so an empty tag selection cannot pass. Do not replace this gate with scenario-count baselines or skipped-scenario allowlists.
35 
36## Tags And External Runtime
37 
38- Default scenarios use shared authenticated storage state. `@unauthenticated` creates a clean context; `@authenticated` is an intent and selection tag only.
39- `@prepared` requires the prepared fixtures; the post-merge seed profile includes them.
40- `@external-model` and `@external-tool` identify scenarios that call real external runtimes. Deterministic commands exclude these tags; external commands are opt-in.
41- `@microphone` uses the checked-in fake audio fixture and an isolated Chromium context.
42- `@browser-smoke` runs focused keyboard and navigation coverage in Chromium and WebKit CI lanes.
43- Feature-owned services use their own tags. Agent v2 runtime scenarios use `@agent-backend-runtime` and require the explicit runtime-availability step. Set `E2E_START_AGENT_BACKEND=1` to start it locally, or provide `E2E_AGENT_BACKEND_URL` / `AGENT_BACKEND_BASE_URL`.
44 
45Seed and Cucumber must share one runtime lifecycle. Combined commands own reset, middleware, services, seed, Cucumber, and teardown; CI must not reproduce that lifecycle in workflow YAML. `E2E_START_AGENT_BACKEND=1` starts a managed local backend before the API; it is mutually exclusive with an explicit Agent backend URL.
46 
47Do not overload runtime tags to imply unrelated services or silently skip behavior when a required fixture is missing.
48 
49## Browser, API, And Contract Boundaries
50 
51The action under test belongs to the browser. APIs may prepare fixtures, poll persistence, and clean up; they do not replace the user's `When` action. Prefer a user-observable browser result unless persisted backend state is the contract under test.
52 
53For ordinary Console JSON and representable multipart operations, use the scenario- or process-owned generated oRPC client with request and response validation enabled. Call generated operations directly. Do not add handwritten endpoint URLs, duplicate DTOs or schemas, response casts, one-to-one forwarding wrappers, mutable cross-scenario clients, or TanStack Query caching.
54 
55Keep helpers only when they own fixture construction, multi-operation orchestration, cleanup registries, invariants, eventual-consistency polling, narrowed test views, or a protocol adapter. SSE, binary downloads, redirect-only flows, external services, and infrastructure readiness may use centralized adapters under their real owner.
56 
57Validation failures are contract failures. Trace them to the backend schema owner, update `api/controllers/API_SCHEMA_GUIDE.md` contracts when required, regenerate `@dify/contracts`, and keep the scenario aligned with the product's real state owner. Do not disable validation or add fallback schemas to make E2E pass.
58 
59## Seeds, Cleanup, And Diagnostics
60 
61- Generate disposable resource names through `support/naming.ts` with an `E2E` prefix.
62- Keep deterministic upload material in `fixtures/test-materials/` and resolve it through `support/test-materials.ts`.
63- Seed scripts own shared long-lived fixtures; scenarios own disposable resources they create and must register cleanup.
64- Use typed `DifyWorld` cleanup fields for known resource types and `registerCleanup(...)` for additional lifecycle owners. Registered callbacks run LIFO after typed cleanup queues.
65- Remove child and referencing resources before owners. Attach cleanup failures to the report instead of swallowing them.
66 
67Failures produce screenshots and HTML captures under `cucumber-report/artifacts/`; the HTML and Cucumber Messages reports live under `cucumber-report/`. Backend and frontend startup logs live under `.logs/`. Additional CI lanes preserve their own report and log directories.
68 
@@ −1 +1 @@
1−# @langgenius/dify-ui
1+# E2E
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+This package contains Dify's repository-level Cucumber scenarios with Playwright as the browser layer. This file owns current package architecture, runtime, session and tag semantics, seed, protocol, and cleanup contracts. The repo-local `e2e-cucumber-playwright` skill owns authoring and review methodology; feature-specific facts belong in the nearest feature `AGENTS.md`.
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 commands from the repository root. Install dependencies and browsers once with `pnpm install` and `pnpm -C e2e e2e:install`. Run only one local `pnpm -C e2e e2e*` process at a time because runners share ports, auth state, and log paths.
158  
16−Use the README sections as the detailed owners:
9+- Existing initialized instance: `pnpm -C e2e e2e`
10+- Reset, initialize, and run deterministic scenarios: `pnpm -C e2e e2e:full`
11+- Prepare and run scenarios backed by shared fixtures: `E2E_START_AGENT_BACKEND=1 pnpm -C e2e e2e:prepared`
12+- Tagged subset: `pnpm -C e2e e2e -- --tags @smoke`
13+- Headed debugging: `pnpm -C e2e e2e:headed -- --tags @smoke`
14+- Prepare and run external runtime scenarios: `E2E_START_AGENT_BACKEND=1 pnpm -C e2e e2e:external`
15+- Seed against existing middleware without running Cucumber: `pnpm -C e2e seed -- --profile <prepared|external-runtime|post-merge>`
16+- Reset persisted E2E state: `pnpm -C e2e e2e:reset`
17+- Middleware lifecycle: `pnpm -C e2e e2e:middleware:up` and `pnpm -C e2e e2e:middleware:down`
18+- Scoped static checks: `vp check e2e`
1719  
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]
20+The runner reuses `web/.next/BUILD_ID` when present. Set `E2E_FORCE_WEB_BUILD=1` to force a frontend rebuild. Use `E2E_BROWSER=webkit` for focused cross-browser runs and `E2E_SLOW_MO=500` with a headed command for local action debugging.
2421  
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
22+## Runtime Ownership
23+ 
24+- `scripts/setup.ts` owns reset, middleware, backend, and frontend startup.
25+- `scripts/run-cucumber.ts` is the only E2E runtime orchestrator. It owns service lifetime, optional seed execution, Cucumber invocation, and teardown.
26+- `scripts/seed-runner.ts` owns fixture creation and verification against an already-running runtime; it never starts services.
27+- `support/web-server.ts` owns frontend reuse, readiness, and shutdown.
28+- `features/support/hooks.ts` owns shared auth bootstrap, scenario lifecycle, and diagnostics.
29+- `features/support/world.ts` owns `DifyWorld`, the per-scenario behavior `BrowserContext`, and its authenticated setup and cleanup client. Browser and API identities remain separate so unauthenticated and logout journeys cannot invalidate fixture ownership.
30+- Cross-actor scenarios keep each actor in a separate `BrowserContext` and typed `DifyWorld` state so diagnostics and cleanup cover every actor.
31+- `features/step-definitions/` contains capability-oriented glue; `common/` is reserved for genuinely cross-capability steps.
32+- Step definitions that access World state use `async function (this: DifyWorld, ...)`; arrow functions cannot receive Cucumber's bound World instance.
33+ 
34+An uninitialized instance is installed and authenticated lazily; an initialized instance signs in and reuses authenticated state. Full runs prove reset and bootstrap during setup rather than through a Gherkin scenario. Cucumber's exit status is the behavior gate, and the runner also requires at least one `testCaseStarted` message so an empty tag selection cannot pass. Do not replace this gate with scenario-count baselines or skipped-scenario allowlists.
35+ 
36+## Tags And External Runtime
37+ 
38+- Default scenarios use shared authenticated storage state. `@unauthenticated` creates a clean context; `@authenticated` is an intent and selection tag only.
39+- `@prepared` requires the prepared fixtures; the post-merge seed profile includes them.
40+- `@external-model` and `@external-tool` identify scenarios that call real external runtimes. Deterministic commands exclude these tags; external commands are opt-in.
41+- `@microphone` uses the checked-in fake audio fixture and an isolated Chromium context.
42+- `@browser-smoke` runs focused keyboard and navigation coverage in Chromium and WebKit CI lanes.
43+- Feature-owned services use their own tags. Agent v2 runtime scenarios use `@agent-backend-runtime` and require the explicit runtime-availability step. Set `E2E_START_AGENT_BACKEND=1` to start it locally, or provide `E2E_AGENT_BACKEND_URL` / `AGENT_BACKEND_BASE_URL`.
44+ 
45+Seed and Cucumber must share one runtime lifecycle. Combined commands own reset, middleware, services, seed, Cucumber, and teardown; CI must not reproduce that lifecycle in workflow YAML. `E2E_START_AGENT_BACKEND=1` starts a managed local backend before the API; it is mutually exclusive with an explicit Agent backend URL.
46+ 
47+Do not overload runtime tags to imply unrelated services or silently skip behavior when a required fixture is missing.
48+ 
49+## Browser, API, And Contract Boundaries
50+ 
51+The action under test belongs to the browser. APIs may prepare fixtures, poll persistence, and clean up; they do not replace the user's `When` action. Prefer a user-observable browser result unless persisted backend state is the contract under test.
52+ 
53+For ordinary Console JSON and representable multipart operations, use the scenario- or process-owned generated oRPC client with request and response validation enabled. Call generated operations directly. Do not add handwritten endpoint URLs, duplicate DTOs or schemas, response casts, one-to-one forwarding wrappers, mutable cross-scenario clients, or TanStack Query caching.
54+ 
55+Keep helpers only when they own fixture construction, multi-operation orchestration, cleanup registries, invariants, eventual-consistency polling, narrowed test views, or a protocol adapter. SSE, binary downloads, redirect-only flows, external services, and infrastructure readiness may use centralized adapters under their real owner.
56+ 
57+Validation failures are contract failures. Trace them to the backend schema owner, update `api/controllers/API_SCHEMA_GUIDE.md` contracts when required, regenerate `@dify/contracts`, and keep the scenario aligned with the product's real state owner. Do not disable validation or add fallback schemas to make E2E pass.
58+ 
59+## Seeds, Cleanup, And Diagnostics
60+ 
61+- Generate disposable resource names through `support/naming.ts` with an `E2E` prefix.
62+- Keep deterministic upload material in `fixtures/test-materials/` and resolve it through `support/test-materials.ts`.
63+- Seed scripts own shared long-lived fixtures; scenarios own disposable resources they create and must register cleanup.
64+- Use typed `DifyWorld` cleanup fields for known resource types and `registerCleanup(...)` for additional lifecycle owners. Registered callbacks run LIFO after typed cleanup queues.
65+- Remove child and referencing resources before owners. Attach cleanup failures to the report instead of swallowing them.
66+ 
67+Failures produce screenshots and HTML captures under `cucumber-report/artifacts/`; the HTML and Cucumber Messages reports live under `cucumber-report/`. Backend and frontend startup logs live under `.logs/`. Additional CI lanes preserve their own report and log directories.
3268  
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack