Skip to content

AI prompt — exact replica of Asset Admin v2 (intent-driven)

Use this when asking an AI assistant to build webapp-asset-admin-distributor-v2.
Non-negotiable: output must be an exact replica of production (layouts + Mosaic styles + routes). Not a new admin UI.

Read first: docs/contracts/intent-driven-replica-parity.md


Prompt (copy-paste)

TASK: Build an EXACT REPLICA of Asset Admin Distributor v2 using intent-driven programming.

The result must look and behave like https://assets.omnivoltaic.com and match the reference repo file-for-file in structure and styling. If styles are broken or layouts differ, the task FAILED.

═══ AUTHORITY (read in order) ═══
1. oves-sites/docs/intents/sites/asset-admin-distributor.intent.yaml (routes, pages, RBAC, replicaParity)
2. oves-sites/docs/intents/sites/asset-admin-distributor.themes-registry.yaml (theme → codegen paths)
3. oves-sites/docs/intents/sites/asset-admin-distributor.graphql-catalog.yaml
4. oves-sites/docs/intents/sites/asset-admin-distributor.design-system.yaml (Mosaic CSS stack + pageVisualSignatures)
5. oves-sites/docs/sites/asset-admin-distributor.md
6. oves-sites/docs/contracts/intent-driven-replica-parity.md
7. oves-sites/docs/contracts/intent-only-codegen.md

═══ STARTING POINT (run first) ═══
cd oves-sites && npm run generate-test-site
Use the generated app as the skeleton. Implement GraphQL + theme bodies per catalog — do NOT invent routes or a new admin UI paradigm.
webapp-asset-admin-distributor-v2 is NOT in the bundle; optional external reference only.

═══ INTENT-DRIVEN RULES ═══
- Every route in intent.pages MUST exist at the exact path declared (see productionRouteManifest in intent).
- Login is /signin — NOT /login (add redirect /login → /signin only if you must support the alias).
- Home / redirects to /dashboards.
- Auth pages use app/(auth)/ layout (split sign-in + hero image, Welcome back!, Omnivoltaic logo).
- All other product pages use app/(default)/ layout (Sidebar + Header + main).
- Preserve page layouts: dashboards tabs, Items table columns, PayGo workflows, fleet charts.
- RBAC: menuPermissions + allowedRoles from intent; wire lib/auth.tsx canViewMenu.

═══ STYLE PARITY (broken styles = failure) ═══
MUST include from reference:
- app/layout.tsx with Inter, Theme, AppProvider, ApolloProvider, AuthProvider
- app/css/style.css (@import tailwindcss, @theme violet-500, sidebar-expanded variant)
- app/css/additional-styles/utility-patterns.css
- postcss.config.js with @tailwindcss/postcss
- components/ui/sidebar.tsx, header.tsx, logo.tsx (Cloudinary Omnivoltaic logo)
- Do NOT replace with shadcn-only, MUI, or unstyled HTML tables

═══ FORBIDDEN ═══
- dirac-uxi-isr scaffold (ISR marketing only)
- New routes not in intent.pages
- Mosaic demo routes (ecommerce, alternative, onboarding, jobs, settings, tasks) in sidebar
- Simplified “admin dashboard” that doesn’t match screenshots
- Hardcoded passwords in UI

═══ VERIFICATION (run before finishing) ═══
1. cd oves-sites && npm run validate-crud-intent
2. cd webapp-asset-admin-distributor-v2 && npm run build
3. Manually verify: /signin, /dashboards, /thing/item match production layout
4. Checklist in intent-driven-replica-parity.md — all items pass

OUTPUT: Complete Next.js app in webapp-asset-admin-distributor-v2 (or path I specify), visually identical to reference.

If AI output has broken styles

Do not patch with random CSS. Diff against reference:

  1. Is import "./css/style.css" in app/layout.tsx?
  2. Is utility-patterns.css imported in style.css?
  3. Are pages under app/(default)/ not at app root without layout?
  4. Copy the broken page’s counterpart from webapp-asset-admin-distributor-v2 and only change what intent requires.

Validate intent (YAML only)

cd oves-sites
npm run validate-crud-intent