Use when building or customizing Auth0 Universal Login screens with full UI control — creating branded login, signup, or MFA screens using the ACUL React or Vanilla JS SDK. Use this even if the user says "custom login page", "style my Auth0 login", or "build my own Universal Login UI" without mentioning ACUL directly. Does not cover basic branding (colors/logo only) — use auth0-branding for that.
73
—
Does it follow best practices?
Impact
—
No eval scenarios have been run
Advisory
Suggest reviewing before use
Generates production-ready, fully themed Auth0 ACUL screen components. Follows a strict 9-phase workflow (Phases 0–8): CLI authentication → intent detection → project setup → screen requirements → tech stack and design → theme extraction → structured code generation → build validation & iterative fix → dev mode wiring.
Always resolve the correct reference for a screen using this priority order. Before running the CLI, check if the screen exists in auth0-acul-samples — if it does not, the CLI will fail.
1. Check auth0-acul-samples availability first (gate for CLI usage)
→ Read `references/screen-catalog.md` for the Samples column
→ Verify the screen directory exists at:
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>
→ If the screen IS in samples → proceed to CLI (step 2)
→ If the screen is NOT in samples → skip CLI entirely, go to step 3
2. Auth0 CLI scaffolded code (only for screens confirmed in auth0-acul-samples)
→ Use `auth0 acul screen add` or `auth0 acul init` to generate screen code locally
→ The CLI produces the correct project structure, SDK imports, and hook patterns
→ If the CLI succeeds, use the scaffolded code as-is — do NOT fetch from GitHub
3. SDK examples (for screens NOT in auth0-acul-samples — do NOT attempt CLI for these)
→ 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
→ Determine if the example is React or JS, then adapt to match the project's framework
4. assets/react-templates/ or assets/js-templates/
→ Structural component pattern only — never use their hooks/actions for other screensFor which screens are in auth0-acul-samples → read references/screen-catalog.md.
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 stringsindex.tsx pattern:
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'
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>
)
}
export default <ScreenName>Screen // REQUIRED: screenLoader registers via lazy(), which needs a default export
index.tsxmust have aexport default. The project's screen registry (src/utils/screen/screenLoader.ts) loads each screen withlazy(() => import('@/screens/<screen-name>')), andReact.lazyresolves the module's default export. A named-only export (export const <ScreenName>Screen) compiles fine but renders blank / "screen not implemented" at runtime. See "Screen Registration" in Phase 6.
hooks/use<ScreenName>Manager.ts pattern:
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 and the CLI doesn't support it, fall back to a single-file component based on the SDK example.
brew install auth0node --version 2>&1Parse the output and verify the major version is ≥ 22. If Node.js is not installed or the version is below 22:
nvm install 22 or download from nodejs.org).nvm install 22 && nvm use 22. The Auth0 CLI-generated ACUL projects require Node.js 22+ and will fail to build or run on older versions.Do NOT proceed to any subsequent phase until Node.js ≥ 22 is confirmed.
auth0 login
auth0 acul config list --rendering-mode advancedIf 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.
Ask the customer which mode they need:
This choice gates Phases 2A / 2B / 2C.
Gather: app name, framework (react or js), initial screen list.
auth0 acul init <app_name> -t react -s login-id,login-password,signup
auth0 acul config generate <screen-name> # repeat per screenVerify acul_config.json is created in the project directory.
The CLI-scaffolded code is your primary source. Read the generated screen files to understand the project structure, SDK imports, hook patterns, and component layout. Do NOT fetch from GitHub — the CLI output is the canonical starting point. Only customize or extend the generated code based on the customer’s requirements (branding, extra components, etc.).
Proceed to Phase 3.
Verify acul_config.json exists in the project directory.
auth0 acul init first.Check if the screen exists in auth0-acul-samples before attempting CLI.
Read references/screen-catalog.md and check the Samples (React) or Samples (React-JS) column for the requested screen. Then fetch the GitHub directory listing to confirm the screen actually exists at the expected path:
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>This check determines whether the CLI can scaffold the screen. If the screen is NOT present in auth0-acul-samples, the CLI auth0 acul screen add command will fail — so skip it entirely and go straight to Step 4.
Screen IS in auth0-acul-samples → try the CLI:
auth0 acul screen add <screen-name> -d <project-dir>Screen is NOT in auth0-acul-samples (or CLI failed) → skip CLI, fetch reference directly.
Since the CLI does not support this screen, do NOT attempt auth0 acul screen add — it will error. Instead, build the screen from reference code.
Step 4a — Capture project structure (if not already known): If this is the first screen being added manually (i.e., you don’t already have a reference for the project’s directory layout, config wiring, and build setup from a previous CLI-generated screen), create a dummy page:
auth0 acul screen add login-id -d <project-dir>login-id/ screen directory)If you already have the project structure from a previous CLI-generated or manually-created screen, skip this step.
Step 4b — Fetch the screen reference code: Determine the tech stack of the existing project (React or JS/Vanilla) by inspecting the project files. Then fetch the reference:
https://github.com/auth0/universal-login/blob/master/packages/auth0-acul-react/examples/<screen-name>.mdhttps://github.com/auth0/universal-login/blob/master/packages/auth0-acul-js/examples/<screen-name>.mdDetermine whether the example is React (JSX/TSX, hooks) or plain JS (class-based manager) and match it to the project’s framework. If the project is React but only a JS example exists (or vice versa), adapt the patterns accordingly using the appropriate SDK reference (references/acul-react-sdk.md or references/acul-js-sdk.md).
Step 4c — Generate the screen files using the project structure, populated with the SDK reference data from step 4b. This ensures correct directory layout, config integration, and build compatibility. Follow the modular architecture pattern from the "auth0-acul-samples Architecture" section if React, or a single-file component if the example is simple enough.
Step 4d — Register the screen so local dev mode can resolve it (REQUIRED).
The CLI auto-registers screens it scaffolds, but manually generated screens are not registered — so auth0 acul dev (local mode) renders "Screen '' is not implemented" even though the files exist and the build passes. (Connected mode reads screens from the tenant, so it works without this step — which is why the bug only shows in local dev.) The screen resolves through a SCREEN_COMPONENTS map in src/utils/screen/screenLoader.ts.
First determine how the project maintains that map — do NOT assume it is hand-edited:
screenLoader.ts is auto-generated. Open it and look for a banner like // Auto-generated file, and check package.json scripts for a generator (e.g. generate:screenLoader) and scripts/generate-screen-loader.js.
src/screens/*/index.tsx against an allowlist (e.g. src/constants/validScreens.js). Do NOT hand-edit screenLoader.ts — your edit will be overwritten. Instead:
<screen-name> is present in the allowlist (VALID_SCREENS). If missing, add it there.npm run generate:screenLoader (use the actual script name from package.json).screenLoader.ts.SCREEN_COMPONENTS map directly:
"<screen-name>": lazy(() => import("@/screens/<screen-name>")),index.tsx has a default export (export default <ScreenName>Screen) — lazy() resolves the default export. A named-only export compiles but loads as blank / "not implemented".For all screen names and their availability → read references/screen-catalog.md.
Verify acul_config.json exists.
Fetch current rendering configuration:
auth0 acul config get <screen-name> -f <screen-name>.json
auth0 acul config list --rendering-mode advancedRead the existing screen file from the customer's codebase. The local code is your primary reference. Understand its current structure, SDK imports, and hook patterns before making any changes.
Only fetch from GitHub references if the local code is missing critical SDK patterns (e.g., wrong hook pattern, missing action functions) and you cannot determine the correct pattern from the existing codebase. Use the Reference Hierarchy (samples availability → CLI scaffolded code when supported → SDK examples) to validate.
Gather from the customer:
references/screen-catalog.mdConfirm or detect:
@auth0/auth0-acul-react) or JS (@auth0/auth0-acul-js)tailwind.config.ts, styles/tokens.css, theme/index.tsLoad the appropriate SDK reference:
references/acul-react-sdk.mdreferences/acul-js-sdk.mdFor social button implementation → read references/social-providers.md.
Option A — Image or mockup (jpeg / png / screenshot): Analyze the image and extract:
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)For theme file patterns per styling library → read references/theming-patterns.md.
Theme file to generate per styling library (all-screens scope):
| Styling library | Template to use | Output 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.
Generation approach depends on the source of the screen code.
When the CLI successfully generates the screen (via auth0 acul init or auth0 acul screen add), use the CLI output as the base. Read the generated files and customise them based on the customer's requirements:
Do NOT discard CLI-generated code to re-generate from a GitHub reference.
Use the project structure captured from the CLI dummy-page strategy (Phase 2B, Step 4a) as the foundation. Generate the screen directory using the samples pattern (see "auth0-acul-samples Architecture" above), matching the directory layout and config wiring from the dummy page:
<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.jsonindex.tsx — thin: calls use<ScreenName>Manager(), calls applyAuth0Theme(), renders ULThemePageLayout → ULThemeCard → sub-componentsuse<ScreenName>Manager.ts — wraps SDK hooks from the samples reference, exposes typed handlers and feature flagsen.json — fallback strings matching keys used in screen.texts.*Apply design tokens from Phase 5 to the layout components and form component styling.
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 linksThe CLI auto-registers any screen it scaffolds (Path A). Manually generated screens (Path B, Path C) must be registered, or local auth0 acul dev renders "Screen '' is not implemented" — even though the files exist and the build succeeds. (Connected mode resolves screens from the tenant, so it works without this step — which is why the bug only shows in local dev.) Screens resolve through a SCREEN_COMPONENTS map in src/utils/screen/screenLoader.ts.
For each manually generated screen:
screenLoader.ts is maintained — do not assume it's hand-edited. If it carries an // Auto-generated file banner or package.json has a generator script (e.g. generate:screenLoader backed by scripts/generate-screen-loader.js), it is regenerated by scanning src/screens/*/index.tsx against an allowlist:
<screen-name> is in the allowlist (e.g. src/constants/validScreens.js), then run npm run generate:screenLoader. Do not hand-edit the generated file — it will be overwritten."<screen-name>": lazy(() => import("@/screens/<screen-name>")),index.tsx (or single-file component) has a export default — React.lazy resolves the default export, not a named one.@auth0/auth0-acul-react/mfa-otp-challenge)useScreen() vs screen-specific hook) sourced from the CLI-generated code or reference, not assumedhasErrors / getErrors()) — never local-only error statescreen.texts.* with locale fallbackapplyAuth0Theme() called in index.tsx when using modular architecture (Path A, Path B)src/utils/screen/screenLoader.ts with a matching export default — required for local auth0 acul devAll-screens scope: repeat Path A, B, or C (whichever applies per screen) for every screen in the project, all importing from the shared theme file. Consistent component structure within each path.
After generating or modifying screen code, always validate the output before moving on. Generated code may contain incorrect import paths, wrong import styles (default vs named), invalid component props, or references to non-existent exports. This phase catches and fixes those issues automatically.
If the generated or modified code introduced new dependencies in package.json (entries under dependencies / devDependencies that aren't already installed in node_modules), run npm install from the project root before linting/building. Skip this step if no new packages were added.
# Run from the project root
npm installIf install fails (peer-dependency conflict, registry error, version mismatch), surface the error to the customer and stop — do not proceed to lint/build until resolved.
Run the project's linter to surface import errors, type mismatches, and invalid props:
# Detect the lint command from package.json scripts
npm run lint 2>&1 || npx eslint src/screens/<screen-name>/ --ext .ts,.tsx,.js,.jsx 2>&1If the project uses TypeScript, also run the type checker:
npx tsc --noEmit 2>&1npm run build 2>&1If lint or build produces errors, parse each error and apply the appropriate fix:
| Error pattern | Root cause | Fix |
|---|---|---|
does not have a default export | Using import X on a named export | Change to import { X } |
has no exported member | Importing a symbol that doesn't exist in the module | Read the source module to find the correct export name |
Module not found / Cannot find module | Wrong import path | Verify the correct path from node_modules or the project's own source tree |
Property 'X' does not exist on type | Invalid prop passed to a component | Read the component's type definition or source to find valid props |
is not assignable to type | Prop type mismatch | Cast or transform the value to match the expected type |
JSX element type 'X' does not have any construct or call signatures | Component imported incorrectly or doesn't exist | Verify the component exists and is exported correctly from its module |
Fix workflow:
node_modules or project source) to find the correct export names and paths.npm run build 2>&1.Iteration cap: Use a hard cap of 5 iterations. If errors plateau (same count or same errors across 2 consecutive iterations), stop immediately before the cap. When the cap is reached and errors remain, present the remaining errors to the customer and ask for guidance rather than continuing to modify code.
import Component from './Component' when the file uses export const Component (named export) — fix: import { Component } from './Component'import { useLoginId } from '@auth0/auth0-acul-react' instead of the screen-specific path @auth0/auth0-acul-react/login-id — fix: use the correct sub-path import<ULThemeCard title={...}> when ULThemeCard doesn't accept a title prop — fix: remove the invalid prop and use a <Header> child component insteadapplyAuth0Theme as a named import when it's a default export (or vice versa) — fix: match the module's actual export styleA clean npm run build does not guarantee a manually added screen renders in local dev. The build passes, but auth0 acul dev shows "Screen '' is not implemented" when:
SCREEN_COMPONENTS map in src/utils/screen/screenLoader.ts, ORindex.tsx has no export default (so lazy() can't resolve the component).For every screen generated via Path B or Path C, verify both before finishing. This is a runtime/registry gap, not a compile error — lint and tsc will not flag it. If the project auto-generates screenLoader.ts, register via its generator (npm run generate:screenLoader) rather than hand-editing. (See "Screen Registration" in Phase 6.)
Once the build completes with exit code 0 and no lint errors, and every manually added screen is registered in screenLoader.ts with a export default, proceed to Phase 8.
Provide the customer with ready-to-run commands:
# Local preview — no tenant connection needed
auth0 acul dev -p 3000 -d <project-dir>
# Connected mode — syncs assets to tenant (stage/dev only)
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.
| File | Load 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 |
| File | Use 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 |
aacefa7
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.