---
name: openfront-dealership-custom-dashboard
description: Plan and build a custom Openfront Dealership operator dashboard by explaining the source architecture, interviewing the user, inspecting the current product code and contract, then adapting the built-in client or creating a safe separate client.
---

# Openfront Dealership custom operator dashboard

Use this skill to adapt the built-in Dealership operator dashboard or create a separately deployed client. Start from this product's current source—not E-commerce conventions, screenshots, or another vertical's schema.

## Source orientation to explain first

Before asking implementation questions, briefly tell the user where the current behavior lives:

- Repository: <https://github.com/openshiporg/openfront-dealership>
- Generic Keystone dashboard shell, list/item screens, authentication helpers, and admin client: `features/dashboard`.
- Dealership-specific operator navigation, screens, server actions, projections, and workflows mounted into that shell: `features/platform`.
- Thin route entry points: `app/dashboard`, especially `app/dashboard/(admin)/platform/**`. Navigation lives in `features/platform/lib/navigation.ts`.
- Server contract: `features/keystone/models/**` (71 registered lists in `models/index.ts`), `features/keystone/access.ts`, `features/keystone/tenantRecords.ts` (rooftop scoping), `features/keystone/lifecycle/**` (state machines, audit/outbox), `features/keystone/mutations/**` (custom operations declared in `mutations/index.ts`), and `schema.graphql`.
- Provider adapters: `features/integrations/payment` (stripe, manual), `features/integrations/financing` (operator-recorded only), `features/integrations/inventory-channel`.
- Onboarding: `features/platform/onboarding` (dialog, not a route) calling `ensureDealershipOnboardingRecord` with `lib/seed.json`.

Explain that `features/dashboard` is the reusable Keystone administration layer and `features/platform` is the product-specific operator experience. These directories show how the dashboard works and which server operations it calls.

Current platform slices and routes under `/dashboard/platform`:

- `overview`, `analytics` (read-only, `operationalReport`).
- `vehicles`: `/vehicles`, `/vehicles/[id]`, `/vehicles/acquisitions`, `/vehicles/feed` (intake, acquisitions, stock, recon, merchandising, photos, feed runs).
- `deals`: `/deals`, `/deals/create`, `/deals/[id]` (worksheet, present, accept, lender offer, trade-in, transitions).
- `crm`: `/crm`, `/crm/[id]`, `/crm/tasks`. `customers`: `/customers`, `/customers/[id]`. `test-drives`. `trade-ins`: `/trade-ins`, `/trade-ins/[id]`.
- `finance`: `/finance`, `/finance/applications/[id]`, `/finance/products`, `/finance/cancellations`. `delivery`.
- `payments`: `/payments`, `/payments/[id]`. `accounting`: `/accounting`, `/accounting/[id]`.
- `service`: `/service`, `/service/appointments/[id]`, `/service/orders/[id]`. `parts`: `/parts`, `/parts/[id]`, `/parts/purchase-orders`, `/parts/purchase-orders/[id]`.
- `users`, `organization` (dealer group, rooftops, memberships, roles, retention), `catalog` (makes/models, service packages, lead routing), `reports` (saved reports, runs, audit search, outbox), `api-keys`, `store-settings`.

Key models: DealerGroup and Rooftop (tenancy), memberships, Vehicle and the Inventory* lists, Customer and Lead, TestDrive, TradeIn, Deal and DealApproval, FinancingApplication and the Lender*/Finance* lists, DeliveryCase and WeOweItem, ServiceAppointment, ServiceOrder, RepairOrderLineItem, ServiceLaborOperation, Parts*, Payment*, Accounting*, SavedReport, ReportRun, RetentionPolicy, DomainAuditEvent, DomainOutboxEvent.

Most operational lists are command-only: Keystone create/update is denied and writes go through named mutations such as `intakeInventoryVehicle`, `openLead`, `createDealPencil`, `saveDealWorksheet`, `transitionDeal`, `manageFinanceFundingCase`, `manageDeliveryCase`, `completeDealDelivery`, `openServiceOrder`, `transitionServiceOrder`, `recordPartsMovement`, `managePartsPurchaseOrder`, `createPaymentCheckout`, `manageAccountingBatch`, and `changeDealerMembership`. Each takes an idempotency key and writes an audit and outbox event. Reads for desks come from `inventoryWorkspace`, `crmWorkspace`, `dealDeskWorkspace`, `dealWorkspace`, `financeWorkspace`, `deliveryWorkspace`, `fixedOpsWorkspace`, `accountingWorkspace`, `auditSearch`, and `domainTimeline`.

The current product focus is vehicles, CRM/leads, customers, deals, finance and F&I records, test drives, trade-ins, delivery, service, parts, payments, accounting batches, and reporting. Lender decisions, compliance checks, contracts, and accounting postings are operator-recorded evidence; no external lender, bureau, DMS, or GL is called. This list is orientation, not proof that every flow is safe or complete.

## Then interview the user

After the source orientation, ask one concise set of questions and skip anything already answered:

1. Where is the exact Dealership source checkout, and which revision/deployment is the target?
2. Do they want to adapt the built-in dashboard or create an independently deployed client?
3. What do they dislike about the current experience, what must stay, and what should change?
4. Which operator jobs, screens, actions, roles, approvals, and scope are required?
5. What visual references, interaction direction, responsive targets, and deployment constraints matter?
6. Which non-production host, schema export, test data, and test identities are available?

Restate the brief, inspect the supplied source, identify presentation-only changes versus backend-contract work, and ask for confirmation before broad implementation.

## Required source inspection

Before proposing code:

1. Enumerate the actual app routes for this product.
2. Trace the built-in screen components and every data loader/server action they call.
3. Enumerate GraphQL documents and operation names used by those call sites.
4. Read `schema.graphql`, model access, field access, and custom query/mutation resolvers.
5. Record actor, tenant/store/organization scope, inputs, outputs, lifecycle authority, idempotency, and error states for each required operation.
6. Inspect provider adapters, webhooks, workers, uploads, cookies/tokens, and runtime configuration touched by the requested flow.
7. Produce a capability matrix: verified, presentation-only, needs backend contract, blocked, or absent.

Do not claim the skill already knows a deployed contract. It knows where and how to discover the exact calls. Generated CRUD or a schema-valid document is not proof of safe access.

## Built-in versus separate client

### Adapt the built-in client

- Keep route files thin.
- Put product UI and orchestration in the existing feature slice.
- Reuse current session, transport, design tokens, loading/error states, and named server operations where they are safe.
- Do not duplicate price, availability, lifecycle, payment, clinical/legal, or authorization decisions in components.

### Build a separate client

- Use a trusted, environment-pinned endpoint and checked named operations.
- Keep privileged credentials and opaque capabilities server-side behind a BFF when needed.
- Never expose an arbitrary GraphQL proxy or accept browser-selected fields, operations, relationships, provider IDs, or endpoint URLs.
- Pin the exact schema, generate strict types, runtime-validate JSON/custom scalars, and fail closed when a required contract is absent.
- Test anonymous, wrong-user, wrong-tenant/store/organization, stale, duplicate, timeout, and provider-failure behavior against disposable data.

## Product-specific boundary

Design around vehicles, CRM/leads, customers, deals, finance and F&I records, test drives, trade-ins, delivery, service, parts, payments, accounting, and reporting. Preserve the product's real workflow nouns and authority boundaries. Never rename E-commerce products/orders into this vertical or borrow E-commerce GraphQL roots without validating that they exist and are authorized here.

For consequential actions, require one bounded server projection or command that validates actor, scope, related-record ownership, state transition, transaction/concurrency, idempotency, provider behavior, and audit evidence. If it does not exist, request the backend contract and show the feature as unavailable.

## Handoff

Report:

- built-in or separate mode;
- source path/repository and revision inspected;
- routes and built-in screens reviewed;
- schema hash and named operations used;
- requested changes and what was preserved;
- capability matrix and backend blockers;
- implemented files and tests;
- responsive/accessibility evidence;
- auth, scope, secret, provider, migration, deployment, and rollback notes.

Never present a source path, generated schema, HTTP 200, or attractive empty state as proof that the operator dashboard workflow is operational.
