acul-screen-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ACUL Screen Generator

ACUL界面生成器

Generates production-ready, fully themed Auth0 ACUL screen components. Follows a strict 8-phase workflow (Phases 0–7): CLI authentication → intent detection → project setup → screen requirements → tech stack and design → theme extraction → structured code generation → dev mode wiring.
生成可用于生产环境、完全主题化的Auth0 ACUL界面组件。遵循严格的8阶段工作流(阶段0–7):CLI认证 → 意图检测 → 项目设置 → 界面需求 → 技术栈与设计 → 主题提取 → 结构化代码生成 → 开发模式配置。

Reference Hierarchy

参考层级

Always resolve the correct reference for a screen using this priority order:
1. auth0-acul-samples  (31 React screens, 3 React-JS screens)
   → Complete modular implementation: index.tsx + components/ + hooks/ + locales/
   → React:    https://github.com/auth0-samples/auth0-acul-samples/tree/main/react/src/screens/<screen-name>
   → React-JS: https://github.com/auth0-samples/auth0-acul-samples/tree/main/react-js/src/screens/<screen-name>

2. SDK examples  (68 React, 71 JS — all screens)
   → Code snippets showing SDK imports, hooks, and action functions
   → React: https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-react/examples/<screen-name>.md
   → JS:    https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-js/examples/<screen-name>.md

3. assets/react-templates/ or assets/js-templates/
   → Structural component pattern only — never use their hooks/actions for other screens
For which screens are in auth0-acul-samples → read
references/screen-catalog.md
.

始终按照以下优先级顺序确定界面的正确参考:
1. auth0-acul-samples  (31个React界面,3个React-JS界面)
   → 完整的模块化实现:index.tsx + components/ + hooks/ + locales/
   → React:    https://github.com/auth0-samples/auth0-acul-samples/tree/main/react/src/screens/<screen-name>
   → React-JS: https://github.com/auth0-samples/auth0-acul-samples/tree/main/react-js/src/screens/<screen-name>

2. SDK示例  (68个React,71个JS — 覆盖所有界面)
   → 展示SDK导入、钩子和操作函数的代码片段
   → React: https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-react/examples/<screen-name>.md
   → JS:    https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-js/examples/<screen-name>.md

3. assets/react-templates/ 或 assets/js-templates/
   → 仅使用结构化组件模式 — 切勿将其钩子/操作用于其他界面
关于auth0-acul-samples中包含哪些界面 → 请阅读
references/screen-catalog.md

auth0-acul-samples Architecture

auth0-acul-samples架构

When a screen is available in auth0-acul-samples, generate code using this modular pattern — not a monolithic component.
Directory structure per screen:
<screen-name>/
├── index.tsx                        thin entry: wires manager hook + applies theme + renders layout
├── components/
│   ├── Header.tsx                   logo, title, subtitle from screen.texts
│   ├── <ScreenName>Form.tsx         form fields, submit, captcha, passkey button
│   ├── Footer.tsx                   signup link, forgot password, back link
│   └── AlternativeLogins.tsx        social login buttons (if screen has social)
├── hooks/
│   └── use<ScreenName>Manager.ts    wraps SDK hooks, exposes clean handlers + feature flags
└── locales/
    └── en.json                      fallback text strings
index.tsx pattern:
tsx
import { ULThemeCard, ULThemePageLayout } from '@/components'
import { applyAuth0Theme } from '@/utils/theme/themeEngine'
import Header from './components/Header'
import <ScreenName>Form from './components/<ScreenName>Form'
import Footer from './components/Footer'
import { use<ScreenName>Manager } from './hooks/use<ScreenName>Manager'

export const <ScreenName>Screen = () => {
  const { sdkInstance, texts, locales } = use<ScreenName>Manager()
  applyAuth0Theme(sdkInstance)
  document.title = texts?.pageTitle ?? locales.pageTitle

  return (
    <ULThemePageLayout>
      <ULThemeCard>
        <Header texts={texts} />
        <AlternativeLogins alignment="top" />    {/* conditional */}
        <<ScreenName>Form />
        <Footer texts={texts} links={links} />
        <AlternativeLogins alignment="bottom" />  {/* conditional */}
      </ULThemeCard>
    </ULThemePageLayout>
  )
}
hooks/use<ScreenName>Manager.ts pattern:
ts
import { useLoginId, useScreen, useTransaction } from '@auth0/auth0-acul-react/<screen-name>'
import { executeSafely } from '@/utils/helpers/executeSafely'
import locales from '../locales/en.json'

export const use<ScreenName>Manager = () => {
  const sdkInstance = useLoginId()       // screen-specific SDK hook
  const screen = useScreen()
  const { alternateConnections } = useTransaction()

  const handleSubmit = async (data) => executeSafely(() => login(data))
  const handleFederatedLogin = async (conn) => executeSafely(() => federatedLogin({ connection: conn }))

  return {
    sdkInstance,
    texts: screen.texts,
    locales,
    alternateConnections,
    handleSubmit,
    handleFederatedLogin,
    isPasskeyEnabled: screen.isPasskeyEnabled,
    isCaptchaAvailable: screen.isCaptchaAvailable,
  }
}
When a screen is not in auth0-acul-samples, fall back to a single-file component based on the SDK example.
当某个界面在auth0-acul-samples中可用时,请使用此模块化模式生成代码 — 而非单体组件。
每个界面的目录结构:
<screen-name>/
├── index.tsx                        轻量入口:关联管理器钩子 + 应用主题 + 渲染布局
├── components/
│   ├── Header.tsx                   来自screen.texts的logo、标题、副标题
│   ├── <ScreenName>Form.tsx         表单字段、提交、验证码、密钥按钮
│   ├── Footer.tsx                   注册链接、忘记密码、返回链接
│   └── AlternativeLogins.tsx        社交登录按钮(如果界面包含社交登录功能)
├── hooks/
│   └── use<ScreenName>Manager.ts    封装SDK钩子,提供简洁的处理器和功能标志
└── locales/
    └── en.json                      备用文本字符串
index.tsx模式:
tsx
import { ULThemeCard, ULThemePageLayout } from '@/components'
import { applyAuth0Theme } from '@/utils/theme/themeEngine'
import Header from './components/Header'
import <ScreenName>Form from './components/<ScreenName>Form'
import Footer from './components/Footer'
import { use<ScreenName>Manager } from './hooks/use<ScreenName>Manager'

export const <ScreenName>Screen = () => {
  const { sdkInstance, texts, locales } = use<ScreenName>Manager()
  applyAuth0Theme(sdkInstance)
  document.title = texts?.pageTitle ?? locales.pageTitle

  return (
    <ULThemePageLayout>
      <ULThemeCard>
        <Header texts={texts} />
        <AlternativeLogins alignment="top" />    {/* 条件渲染 */}
        <<ScreenName>Form />
        <Footer texts={texts} links={links} />
        <AlternativeLogins alignment="bottom" />  {/* 条件渲染 */}
      </ULThemeCard>
    </ULThemePageLayout>
  )
}
hooks/use<ScreenName>Manager.ts模式:
ts
import { useLoginId, useScreen, useTransaction } from '@auth0/auth0-acul-react/<screen-name>'
import { executeSafely } from '@/utils/helpers/executeSafely'
import locales from '../locales/en.json'

export const use<ScreenName>Manager = () => {
  const sdkInstance = useLoginId()       // 界面专属SDK钩子
  const screen = useScreen()
  const { alternateConnections } = useTransaction()

  const handleSubmit = async (data) => executeSafely(() => login(data))
  const handleFederatedLogin = async (conn) => executeSafely(() => federatedLogin({ connection: conn }))

  return {
    sdkInstance,
    texts: screen.texts,
    locales,
    alternateConnections,
    handleSubmit,
    handleFederatedLogin,
    isPasskeyEnabled: screen.isPasskeyEnabled,
    isCaptchaAvailable: screen.isCaptchaAvailable,
  }
}
当界面在auth0-acul-samples中时,退回到基于SDK示例的单文件组件。

Prerequisites

前置条件

  • Auth0 CLI installed:
    brew install auth0
  • Custom domain configured on the Auth0 tenant (hard ACUL requirement)
  • Node.js 18+

  • 已安装Auth0 CLI:
    brew install auth0
  • Auth0租户已配置自定义域名(ACUL的硬性要求)
  • Node.js 18+

Phase 0: CLI Authentication & Tenant Check

阶段0:CLI认证与租户检查

bash
auth0 login
auth0 acul config list --rendering-mode advanced
If
auth0 acul config list
returns an error about custom domain: stop and inform the customer they must configure a custom domain on their tenant before ACUL is available.
For full CLI flag reference → read
references/cli-commands.md
.

bash
auth0 login
auth0 acul config list --rendering-mode advanced
如果
auth0 acul config list
返回关于自定义域名的错误:请停止操作并告知客户,他们必须先在租户上配置自定义域名才能使用ACUL。
如需完整的CLI标志参考 → 请阅读
references/cli-commands.md

Phase 1: Intent Detection

阶段1:意图检测

Ask the customer which mode they need:
  • A) Build from scratch — new project, select screens, full setup
  • B) Add a screen — existing project, add one or more new screens
  • C) Modify a screen — existing project, change an existing screen's code or styling
This choice gates Phases 2A / 2B / 2C.

询问客户需要哪种模式:
  • A) 从零构建 — 新项目,选择界面,完整设置
  • B) 添加界面 — 现有项目,添加一个或多个新界面
  • C) 修改界面 — 现有项目,更改现有界面的代码或样式
此选择将决定后续执行阶段2A / 2B / 2C。

Phase 2A: Scratch — Project Init

阶段2A:从零构建 — 项目初始化

Gather: app name, framework (
react
or
js
), initial screen list.
bash
auth0 acul init <app_name> -t react -s login-id,login-password,signup
auth0 acul config generate <screen-name>    # repeat per screen
Verify
acul_config.json
is created in the project directory. Proceed to Phase 3.

收集信息:应用名称、框架(
react
js
)、初始界面列表。
bash
auth0 acul init <app_name> -t react -s login-id,login-password,signup
auth0 acul config generate <screen-name>    # 每个界面重复执行
验证项目目录中已创建
acul_config.json
。继续执行阶段3。

Phase 2B: Add Screen — CLI + Reference Fetch

阶段2B:添加界面 — CLI + 参考获取

  1. Verify
    acul_config.json
    exists in the project directory.
    • If missing → stop. Instruct customer to run
      auth0 acul init
      first.
  2. Run:
    bash
    auth0 acul screen add <screen-name> -d <project-dir>
    If CLI errors or screen is not recognised → continue to step 3.
  3. Always resolve the reference using the hierarchy (regardless of CLI success or failure):
    Step 3a — Check auth0-acul-samples first:
    • Read
      references/screen-catalog.md
      to check if the screen has a
      in the Samples column
    • If yes → fetch the screen directory from:
      • React:
        https://github.com/auth0-samples/auth0-acul-samples/tree/main/react/src/screens/<screen-name>
      • React-JS:
        https://github.com/auth0-samples/auth0-acul-samples/tree/main/react-js/src/screens/<screen-name>
    • Fetch
      index.tsx
      and the
      hooks/use<ScreenName>Manager.ts
      file to understand the full implementation
    • Use the samples architecture (modular: index + components + hooks + locales)
    Step 3b — If not in samples, fetch SDK example:
    • React:
      https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-react/examples/<screen-name>.md
    • JS:
      https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-js/examples/<screen-name>.md
    • Parse for: exact import path, hook pattern (generic vs screen-specific), action functions and payload shapes
    • Use a single-file component (no modular split needed)
    This step is mandatory. The 68+ ACUL screens use fundamentally different hook patterns — wrong pattern = broken code.
    For all screen names and which are in samples → read
    references/screen-catalog.md
    .

  1. 验证项目目录中存在
    acul_config.json
    • 如果缺失 → 停止操作。指导客户先运行
      auth0 acul init
  2. 运行:
    bash
    auth0 acul screen add <screen-name> -d <project-dir>
    如果CLI报错或界面未被识别 → 继续执行步骤3。
  3. 始终按照层级确定参考(无论CLI操作成功与否):
    步骤3a — 优先检查auth0-acul-samples:
    • 阅读
      references/screen-catalog.md
      ,查看该界面在Samples列是否标记为
    • 如果是 → 从以下地址获取界面目录:
      • React:
        https://github.com/auth0-samples/auth0-acul-samples/tree/main/react/src/screens/<screen-name>
      • React-JS:
        https://github.com/auth0-samples/auth0-acul-samples/tree/main/react-js/src/screens/<screen-name>
    • 获取
      index.tsx
      hooks/use<ScreenName>Manager.ts
      文件以理解完整实现
    • 使用示例架构(模块化:入口 + 组件 + 钩子 + 本地化)
    步骤3b — 如果不在示例中,获取SDK示例:
    • React:
      https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-react/examples/<screen-name>.md
    • JS:
      https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-js/examples/<screen-name>.md
    • 解析内容:准确的导入路径、钩子模式(通用型 vs 界面专属型)、操作函数和负载结构
    • 使用单文件组件(无需模块化拆分)
    此步骤为必填项。68+个ACUL界面使用完全不同的钩子模式 — 错误的模式会导致代码失效。
    如需查看所有界面名称及哪些在示例中 → 请阅读
    references/screen-catalog.md

Phase 2C: Modify Screen — Fetch Current State

阶段2C:修改界面 — 获取当前状态

  1. Verify
    acul_config.json
    exists.
  2. Fetch current rendering configuration:
    bash
    auth0 acul config get <screen-name> -f <screen-name>.json
    auth0 acul config list --rendering-mode advanced
  3. Read the existing screen file from the customer's codebase.
  4. Always resolve the reference using the same hierarchy as Phase 2B (samples first, SDK example second). Even when modifying an existing file, the reference confirms whether the current code uses the correct hook pattern, action functions, and component structure before making changes.

  1. 验证
    acul_config.json
    存在。
  2. 获取当前渲染配置:
    bash
    auth0 acul config get <screen-name> -f <screen-name>.json
    auth0 acul config list --rendering-mode advanced
  3. 读取客户代码库中的现有界面文件。
  4. 始终使用与阶段2B相同的层级确定参考(优先示例,其次SDK示例)。即使修改现有文件,参考也能确认当前代码是否使用了正确的钩子模式、操作函数和组件结构,再进行更改。

Phase 3: Screen Requirements

阶段3:界面需求

Gather from the customer:
  • Screen type — for full list of available screens → read
    references/screen-catalog.md
  • Components needed:
    • Social providers: Google, GitHub, Apple, Microsoft, Facebook
    • Form fields: email, username, phone, password, confirm-password
    • MFA type (if applicable): OTP, SMS, push, WebAuthn
    • Optional extras: captcha, passkey button, remember-me, terms checkbox
  • For modify mode: what specifically to change (layout, colors, add/remove a component)

从客户处收集以下信息:
  • 界面类型 — 所有可用界面列表 → 请阅读
    references/screen-catalog.md
  • 所需组件:
    • 社交提供商:Google、GitHub、Apple、Microsoft、Facebook
    • 表单字段:邮箱、用户名、手机号、密码、确认密码
    • MFA类型(如适用):OTP、短信、推送、WebAuthn
    • 可选附加功能:验证码、密钥按钮、记住我、条款复选框
  • 修改模式下: 具体修改内容(布局、颜色、添加/移除组件)

Phase 4: Tech Stack Detection

阶段4:技术栈检测

Confirm or detect:
  • Framework: React (
    @auth0/auth0-acul-react
    ) or JS (
    @auth0/auth0-acul-js
    )
  • Styling library: Tailwind CSS / CSS Modules / styled-components / plain CSS
  • Existing theme file? Check for
    tailwind.config.ts
    ,
    styles/tokens.css
    ,
    theme/index.ts
Load the appropriate SDK reference:
  • React → read
    references/acul-react-sdk.md
  • JS → read
    references/acul-js-sdk.md
For social button implementation → read
references/social-providers.md
.

确认或检测:
  • 框架: React(
    @auth0/auth0-acul-react
    )或JS(
    @auth0/auth0-acul-js
  • 样式库: Tailwind CSS / CSS Modules / styled-components / 纯CSS
  • 是否存在现有主题文件? 检查是否有
    tailwind.config.ts
    styles/tokens.css
    theme/index.ts
加载对应的SDK参考:
  • React → 阅读
    references/acul-react-sdk.md
  • JS → 阅读
    references/acul-js-sdk.md
如需社交按钮实现相关内容 → 请阅读
references/social-providers.md

Phase 5: Theme Extraction & Scope

阶段5:主题提取与范围

Design input — detect which the customer has provided:

设计输入 — 检测客户提供的内容:

Option A — Image or mockup (jpeg / png / screenshot): Analyze the image and extract:
  • Primary, secondary, accent colors (as hex)
  • Background and card/surface colors
  • Font family and weights
  • Border radius style (sharp / slight / rounded / pill)
  • Spacing rhythm (compact / normal / spacious)
  • Layout type: centered card / full-bleed / split-panel / floating card
Option B — Brand colors only (no image): Derive the full token set from the provided hex values:
primary        → button bg, links, focus ring
primary-hover  → primary darkened ~10%
primary-text   → white if primary is dark, else #111827
background     → page background
surface        → card/panel background
text-primary   → headings (#111827 light / #F1F5F9 dark)
text-secondary → labels, placeholders
border         → input borders
error          → #EF4444 (unless specified)
success        → #22C55E (unless specified)
选项A — 图片或原型图(jpeg / png / 截图): 分析图片并提取:
  • 主色、辅助色、强调色(十六进制格式)
  • 背景色和卡片/表面色
  • 字体族和字重
  • 边框圆角样式(尖锐 / 轻微圆角 / 圆角 / 胶囊型)
  • 间距节奏(紧凑 / 常规 / 宽松)
  • 布局类型:居中卡片 / 全屏 / 分栏 / 悬浮卡片
选项B — 仅品牌颜色(无图片): 从提供的十六进制值推导完整的令牌集:
primary        → 按钮背景、链接、焦点环
primary-hover  → 主色加深约10%
primary-text   → 如果主色为深色则为白色,否则为#111827
background     → 页面背景
surface        → 卡片/面板背景
text-primary   → 标题色(浅色模式#111827 / 深色模式#F1F5F9)
text-secondary → 标签、占位符色
border         → 输入框边框色
error          → #EF4444(除非指定其他颜色)
success        → #22C55E(除非指定其他颜色)

Theme scope — ask the customer:

主题范围 — 询问客户:

  • Single screen: apply tokens inline to just this component's styles
  • All screens: generate a shared theme file first, then apply consistently across every screen
For theme file patterns per styling library → read
references/theming-patterns.md
.
Theme file to generate per styling library (all-screens scope):
Styling libraryTemplate to useOutput file
Tailwind
assets/theme-templates/tailwind.config.ts
tailwind.config.ts
CSS Modules
assets/theme-templates/tokens.css
styles/tokens.css
styled-components
assets/theme-templates/theme-provider.ts
theme/index.ts
Plain CSS
assets/theme-templates/globals.css
styles/globals.css
Replace all
{{TOKEN}}
placeholders with extracted token values.

  • 单个界面: 将令牌内联应用于仅该组件的样式
  • 所有界面: 先生成共享主题文件,然后一致应用于每个界面
如需各样式库的主题文件模式 → 请阅读
references/theming-patterns.md
针对所有界面范围,各样式库需生成的主题文件:
样式库使用的模板输出文件
Tailwind
assets/theme-templates/tailwind.config.ts
tailwind.config.ts
CSS Modules
assets/theme-templates/tokens.css
styles/tokens.css
styled-components
assets/theme-templates/theme-provider.ts
theme/index.ts
纯CSS
assets/theme-templates/globals.css
styles/globals.css
将所有
{{TOKEN}}
占位符替换为提取的令牌值。

Phase 6: Structured Code Generation

阶段6:结构化代码生成

Generation approach depends on whether the screen is in auth0-acul-samples.
生成方式取决于界面是否在auth0-acul-samples中。

Path A — Screen is in auth0-acul-samples (modular architecture)

路径A — 界面在auth0-acul-samples中(模块化架构)

Generate the full directory structure using the samples pattern (see "auth0-acul-samples Architecture" above):
<screen-name>/
├── index.tsx
├── components/
│   ├── Header.tsx
│   ├── <ScreenName>Form.tsx
│   ├── Footer.tsx
│   └── AlternativeLogins.tsx       (only if screen has social login)
├── hooks/
│   └── use<ScreenName>Manager.ts
└── locales/
    └── en.json
  • index.tsx
    — thin: calls
    use<ScreenName>Manager()
    , calls
    applyAuth0Theme()
    , renders
    ULThemePageLayout
    ULThemeCard
    → sub-components
  • use<ScreenName>Manager.ts
    — wraps SDK hooks from the samples reference, exposes typed handlers and feature flags
  • Form component — uses react-hook-form, reads from manager hook, no direct SDK calls
  • Header/Footer — stateless, receive texts as props
  • en.json
    — fallback strings matching keys used in
    screen.texts.*
Apply design tokens from Phase 5 to the layout components and form component styling.
使用示例模式生成完整的目录结构(见上方“auth0-acul-samples架构”):
<screen-name>/
├── index.tsx
├── components/
│   ├── Header.tsx
│   ├── <ScreenName>Form.tsx
│   ├── Footer.tsx
│   └── AlternativeLogins.tsx      (仅当界面包含社交登录时)
├── hooks/
│   └── use<ScreenName>Manager.ts
└── locales/
    └── en.json
  • index.tsx
    — 轻量:调用
    use<ScreenName>Manager()
    applyAuth0Theme()
    ,渲染
    ULThemePageLayout
    ULThemeCard
    → 子组件
  • use<ScreenName>Manager.ts
    — 封装示例参考中的SDK钩子,提供类型化处理器和功能标志
  • 表单组件 — 使用react-hook-form,从管理器钩子读取数据,无直接SDK调用
  • Header/Footer — 无状态,接收文本作为props
  • en.json
    — 与
    screen.texts.*
    中使用的键匹配的备用字符串
将阶段5中的设计令牌应用于布局组件和表单组件的样式。

Path B — Screen is NOT in auth0-acul-samples (single-file component)

路径B — 界面不在auth0-acul-samples中(单文件组件)

Generate a single
<screen-name>.tsx
(React) or
<screen-name>.js
(JS) using the structure from
assets/react-templates/
or
assets/js-templates/
as a pattern, with hooks and actions sourced entirely from the SDK example fetched in Phase 2.
JSX structure order:
Outer layout wrapper → Card/panel → Logo slot → Title (screen.texts) →
Error banner (conditional) → Form fields → Captcha (conditional) →
Submit button → Passkey button (conditional) → Social divider + buttons
(conditional on alternateConnections) → Footer links
使用
assets/react-templates/
assets/js-templates/
中的结构作为模板,生成单个
<screen-name>.tsx
(React)或
<screen-name>.js
(JS)文件,钩子和操作完全来自阶段2中获取的SDK示例。
JSX结构顺序:
外层布局容器 → 卡片/面板 → Logo插槽 → 标题(screen.texts)→
错误提示条(条件渲染)→ 表单字段 → 验证码(条件渲染)→
提交按钮 → 密钥按钮(条件渲染)→ 社交分隔线 + 按钮
(根据alternateConnections条件渲染)→ 页脚链接

Validation before outputting any code

输出代码前的验证

  • SDK import path exactly matches the screen name (e.g.,
    @auth0/auth0-acul-react/mfa-otp-challenge
    )
  • Hook pattern (generic
    useScreen()
    vs screen-specific hook) sourced from the reference, not assumed
  • Action function names and payload shapes sourced from the reference
  • Error state uses SDK source (
    hasErrors
    /
    getErrors()
    ) — never local-only error state
  • No hardcoded UI strings — use
    screen.texts.*
    with locale fallback
  • applyAuth0Theme()
    called in index.tsx for Path A screens
All-screens scope: repeat Path A or Path B (whichever applies per screen) for every screen in the project, all importing from the shared theme file. Consistent component structure within each path.

  • SDK导入路径与界面名称完全匹配(例如:
    @auth0/auth0-acul-react/mfa-otp-challenge
  • 钩子模式(通用
    useScreen()
    vs 界面专属钩子)来自参考,而非假设
  • 操作函数名称和负载结构来自参考
  • 错误状态使用SDK源(
    hasErrors
    /
    getErrors()
    )— 绝不使用仅本地的错误状态
  • 无硬编码UI字符串 — 使用
    screen.texts.*
    并带有本地化备用
  • 路径A的界面在index.tsx中调用
    applyAuth0Theme()
所有界面范围: 对项目中的每个界面重复路径A或路径B(根据适用情况),所有界面均导入共享主题文件。每个路径内的组件结构保持一致。

Phase 7: Dev Mode Wiring

阶段7:开发模式配置

Provide the customer with ready-to-run commands:
bash
undefined
为客户提供可直接运行的命令:
bash
undefined

Local preview — no tenant connection needed

本地预览 — 无需连接租户

auth0 acul dev -p 3000 -d <project-dir>
auth0 acul dev -p 3000 -d <project-dir>

Connected mode — syncs assets to tenant (stage/dev only)

连接模式 — 将资源同步到租户(仅用于 staging/开发环境)

auth0 acul dev --connected -s <screen-name> -d <project-dir>

⚠️ Always include this warning when connected mode is suggested:
> Connected mode updates your Auth0 tenant in real time. Only use this on a stage or development tenant — never on production.

---
auth0 acul dev --connected -s <screen-name> -d <project-dir>

⚠️ 当建议使用连接模式时,务必包含以下警告:
> 连接模式会实时更新您的Auth0租户。仅在 staging 或开发租户上使用 — 切勿在生产环境中使用。

---

Reference Files

参考文件

FileLoad when
references/acul-react-sdk.md
Framework is React
references/acul-js-sdk.md
Framework is JS / Vanilla
references/screen-catalog.md
Selecting screen type or triggering CLI fallback
references/social-providers.md
Social login buttons are needed
references/theming-patterns.md
Generating or applying a shared theme file
references/cli-commands.md
Need full CLI flag details
文件加载时机
references/acul-react-sdk.md
框架为React时
references/acul-js-sdk.md
框架为JS / Vanilla时
references/screen-catalog.md
选择界面类型或触发CLI退用时
references/social-providers.md
需要社交登录按钮时
references/theming-patterns.md
生成或应用共享主题文件时
references/cli-commands.md
需要完整CLI标志详情时

Asset Templates

资源模板

FileUse when
assets/theme-templates/tailwind.config.ts
Tailwind, all-screens scope
assets/theme-templates/tokens.css
CSS Modules, all-screens scope
assets/theme-templates/theme-provider.ts
styled-components
assets/theme-templates/globals.css
Plain CSS, all-screens scope
assets/react-templates/<screen>.tsx
React component boilerplate base
assets/js-templates/<screen>.js
JS component boilerplate base
文件使用时机
assets/theme-templates/tailwind.config.ts
Tailwind,所有界面范围
assets/theme-templates/tokens.css
CSS Modules,所有界面范围
assets/theme-templates/theme-provider.ts
styled-components时
assets/theme-templates/globals.css
纯CSS,所有界面范围
assets/react-templates/<screen>.tsx
React组件模板基础
assets/js-templates/<screen>.js
JS组件模板基础