Skip to main content
vibld

Template

Mantlepeak

An AI analyst inside a BI tool. Users ask a question in natural language; the agent explains its reasoning, picks an explore, metric, dimension and filters, and produces a chart that opens beside the conversation where it can be refined, switched to a table or saved to a dashboard.

AI data-analyst chat with side-by-side chart artifact · App screen: chat · Small tools and apps · full-stack app (auth + DB)

A mock-up of the screen, drawn from its layout, palette and typefaces. A build follows the full prompt below.

Start from this screenRead the build prompt

Typefaces

The catalog's own faces. A screen composed into a template is drawn in that template's typefaces.

  • InterHeadings: Inter 600, 18px for artifact title; 16px 600 answer headings
  • InterBody: Inter 400, 15px/1.5 in chat (dense), 16px in composer; chips 14px; axis 12px

Patterns

  • dark global top bar with create / browse / metrics / ask
  • split view: chat left, generated artifact right
  • agent selector with share, minimise and settings
  • collapsible reasoning and 'how this was built' steps
  • artifact link card inside the answer
  • follow-up suggestion chips with arrow
  • chart panel with fields/filters summary and viz-type toolbar
  • command-K search in top bar

States it is designed for

  • empty chat with example questions
  • agent reasoning (streaming status)
  • query running (chart skeleton)
  • chart ready
  • field not available (agent explains limitation)
  • query error with retry and SQL details for admins
  • no data for filters
  • artifact saved to dashboard toast
  • permission denied for an explore

Who it is for

  • business analysts
  • operators and founders without SQL
  • data team members triaging requests

Layout

  1. Top bar (dark): logo, New, Browse, Metrics, Ask AI; centred search with shortcut; right: settings, notifications, help, AI activity with count badge, organisation switcher, avatar
  2. Left rail (40px): panel toggle and new chat
  3. Chat panel (~450px): header with agent avatar and name dropdown, share, Minimise, Settings; thread; suggestion chips; composer with send
  4. Artifact panel (flex): title, description, check/overflow/close; legend; line chart; footer '2 fields, 1 filter' disclosure; viz-type icon toolbar (table, bar, horizontal bar, line, area, scatter, funnel)
  5. Below 1100px artifact opens as a full-screen sheet; below 640px top bar collapses into menu

Palette

Smart, analytical, approachable. Dark chrome frames a bright workspace; a single violet data hue ties chat and chart together.

  • topbar#18181b
  • on-topbar#f4f4f5
  • canvas#ffffff
  • subtle#f7f8fa
  • text#18181b
  • muted#5f5d70
  • border#e4e4ec
  • series#6e56cf
  • chip-bg#f1f0f6
  • badge#d92d20
  • focus#6e56cf

Every checked pair, measured again

SampleWhereRatioNeeds
Aatop bar text on dark16.12:14.5:1
Aabody text on white17.72:14.5:1
Aamuted reasoning text on white6.39:14.5:1
Aachip text on chip fill15.64:14.5:1
violet series on white5.39:13:1
violet focus ring on white5.39:13:1
Aabadge white text4.83:14.5:1
Aatext on subtle panel16.67:14.5:1

As vibld’s tokens

The palette on the fifteen colour tokens vibld styles a project with, each text colour on the fill it is read on. Marked tokens are solved from the palette, because no swatch held that role at 4.5:1.

  • background
  • card
  • muted
  • primary
  • secondary
  • accent
  • destructive *

Type scale

Display
Inter 600, 18px for artifact title; 16px 600 answer headings
Body
Inter 400, 15px/1.5 in chat (dense), 16px in composer; chips 14px; axis 12px

Similar to the observed neo-grotesk.

Spacing and imagery

Medium density; 4px base; chat padding 16px; answer blocks 12px gap; chips 28px tall; radius 10px panels and cards, 999px chips, 16px composer; hairline divider between panels; no shadows except popovers.

Line/bar charts in one violet hue; small agent avatar; line icons.

Components

  • dark top navigation
  • global search
  • agent selector
  • chat thread
  • reasoning disclosure
  • build-steps disclosure
  • artifact link card
  • feedback and tools row
  • suggestion chips
  • composer
  • chart artifact panel
  • fields and filters summary
  • viz-type toolbar
  • save to dashboard

Interactions

  • Artifact card in the answer opens/focuses the chart panel
  • Viz toolbar switches chart type instantly; table view available
  • Suggestion chip sends as a new prompt
  • Reasoning and build steps expand inline
  • Minimise collapses the chat to the rail leaving the chart full width
  • Hover on chart shows tooltip with date and value

Data

  • Explore{id, name, fields jsonb}
  • Thread{id, user_id, agent_id, title}
  • Message{id, thread_id, role, content_md, reasoning, steps jsonb, artifact_id}
  • Artifact{id, thread_id, title, description, query jsonb (explore, metrics, dimensions, filters, sort), viz (line|bar|table|area|scatter|funnel)}

Guardrails

Experience

  • Show exactly which explore, metric, dimension and filters the chart used
  • Say plainly when a requested breakdown is not possible
  • Keep the chart editable (type, fields) without re-asking
  • Offer 2-3 specific follow-ups as chips
  • Keep chat and chart in sync (same title)
  • Resolve relative dates to absolute ones in the explanation

Accessibility

  • Chart has an accessible summary and table toggle
  • Viz toolbar is a toolbar with named toggle buttons
  • Chat is a log; artifact panel is a labelled region
  • Notification badge has an accessible count
  • Chips are buttons with full text
  • Violet focus ring 2px on light surfaces, light ring on dark top bar

Security

  • Queries executed server-side with the user's data permissions (row-level and explore-level)
  • Generated queries built from a validated AST, never raw string SQL from the model
  • Model secrets server-side; rate-limit questions per user
  • Sanitise markdown output
  • Audit log of executed queries

Build prompt

The baseline every prompt in the catalog assumes, then this design’s own ten sections, from goal to guardrails.

The baseline
### How to use these prompts
Paste an entry's build prompt into your coding agent as the first message. Each prompt names its own stack, tokens and acceptance criteria; the rules below apply to all of them and can be prepended once per project.

### Engineering baseline
- TypeScript strict mode, no `any`, small typed components, feature folders, and one source of truth for design tokens (CSS variables consumed by Tailwind).
- Validate every input with a shared zod schema on the client and again on the server or edge function. Never trust client-side checks alone.
- Show loading, empty and error states for every async view. Surface errors in plain language with a retry, and log details to the console in development only.
- Keep secrets out of the bundle. Only publishable keys (for example a Supabase anon key) belong in client code; service-role keys, API keys and webhooks live in server or edge-function environment variables.

### Data and auth baseline (full-stack entries)
- Enable Row Level Security on every table before inserting data. Default-deny, then add owner-scoped policies (`auth.uid() = user_id`) and explicit role checks for admin views.
- Store roles in a separate table checked by a security-definer function, never in a user-editable profile field.
- Upload files to private storage buckets with size and MIME limits, and serve them through signed URLs.
- Rate-limit public endpoints (forms, auth, AI calls) and add a honeypot field or captcha to anonymous forms.
- Take payments through a hosted checkout and verify webhooks by signature. Never handle raw card data.

### Accessibility and UX baseline
- Target WCAG 2.2 AA: 4.5:1 contrast for normal text and 3:1 for large text, input borders, focus rings and meaningful icons or chart lines. Every palette in this catalog lists its verified pairs; re-check with a contrast tool after any colour change.
- Keep body text at 16px or larger with 1.5 line height, nothing below 12px, no light weights under 24px, and uppercase only for short labels.
- Give every interactive element a visible focus ring, full keyboard support, semantic landmarks, labelled form fields, and alt text on meaningful images.
- Respect `prefers-reduced-motion` for every animation. Give drag-and-drop and carousels keyboard and button alternatives.
- Build mobile-first and test at 375px, 768px and 1280px.

### Content guardrails
- Use original copy, fictional sample data and placeholder or licensed imagery. Do not reuse another product's name, logo, screenshots or marketing text.
- Label demo testimonials and metrics as samples. Collect the minimum personal data the feature needs.

### SaaS screen baseline
- Design every screen for its full set of states: first-run empty, loading skeleton, partial data, error with retry, permission-denied, and success feedback. Each entry lists the states its screen needs.
- Keep destructive actions (delete, revoke, downgrade, remove member) behind a confirmation that names the object, and prefer undo over a second dialog where the action is reversible.
- Enforce authorisation on the server for every action a screen exposes. Hiding a button is not access control; check the role again in the API or RLS policy.
- Never show secrets (API keys, tokens) in full after creation. Show them once, then mask them, and offer rotate and revoke.
- Keep the app shell (navigation, workspace switcher, account menu) consistent across screens, and preserve filters, sort and scroll position when the user navigates back.
### Goal
Build **Mantlepeak**, the AI analyst view of a BI tool. A user asks 'show revenue trend for the last 30 days'; the agent explains its choices (explore, metric, time dimension, filter, sort, chart type), notes limitations, and opens the resulting chart beside the chat where it can be switched to other visualisations or saved.

### Stack
React 18 + TypeScript + Vite, Tailwind CSS, shadcn/ui (Command, DropdownMenu, Collapsible, ToggleGroup, Sheet, Toast), lucide-react, Recharts, react-markdown, TanStack Query, zod. Supabase Auth and Postgres for threads and artifacts; an Edge Function calls a hosted model API and a query service.

### Pages & layout
1. **Shell**: dark top bar (New, Browse, Metrics, Ask AI; search 'Search Birchway Goods...' with Cmd K; icons; org switcher; avatar).
2. **/ai/threads/:id** (this screen): chat panel (agent 'Sales analyst', share, Minimise, Settings; user bubble; 'Reasoning' disclosure; 'Build steps (4)'; answer heading 'Here is your daily revenue line' with bullet list of explore/metric/dimension/filter/sort/type; limitation sentence; follow-up bullets; artifact card; feedback row with model label 'Model: default'; chips; composer). Artifact panel: 'Daily revenue, past month', description, legend, violet line chart, footer '2 fields, 1 filter', viz toolbar.
3. Responsive: artifact as sheet under 1100px.

### Design system
- Colors: `--topbar: #18181b`, `--on-topbar: #f4f4f5`, `--canvas: #ffffff`, `--subtle: #f7f8fa`, `--text: #18181b`, `--muted: #5f5d70`, `--border: #e4e4ec`, `--series: #6e56cf`, `--chip-bg: #f1f0f6`, `--badge: #d92d20`, `--focus: #6e56cf`.
- Fonts: Inter (similar to observed). Titles 18px/600; chat 15px/1.5 dense; composer 16px; chips 14px; axis 12px.
- Spacing: 4px base; 16px panel padding.
- Radius: panels 10px; chips full; composer 16px.
- Shadows: popovers only.
- Motion: 150ms disclosures; chart draw 300ms, off with reduced motion.

### Components & interactions
`TopNav` (NavButtons, GlobalSearch, IconButtons with badge, OrgSwitcher), `ChatPanel` (AgentSelect, HeaderActions, Thread, ReasoningDisclosure, BuildSteps, ArtifactCard, FeedbackRow, SuggestionChips, Composer), `ArtifactPanel` (header actions, Legend, Chart, FieldsFiltersSummary, VizToolbar, SaveToDashboard).

### Data & state
Tables per data model. The model returns a structured query spec validated by zod against the explore's fields; the query service executes it. Mock explore 'Orders' with metric Revenue and 30 days of spiky daily values between 0 and 62,000.

### Accessibility
Chart summary: 'Daily revenue, 16 June to 15 July, peak 62,000 on 8 July'. Table toggle available. Toolbar semantics with aria-pressed. Chips and artifact card are buttons. Top bar colours verified.
Verified contrast: top bar text on dark: #f4f4f5 on #18181b = 16.12:1; body text on white: #18181b on #ffffff = 17.72:1; muted reasoning text on white: #5f5d70 on #ffffff = 6.39:1; chip text on chip fill: #18181b on #f1f0f6 = 15.64:1; violet series on white: #6e56cf on #ffffff = 5.39:1; violet focus ring on white: #6e56cf on #ffffff = 5.39:1; badge white text: #ffffff on #d92d20 = 4.83:1; text on subtle panel: #18181b on #f7f8fa = 16.67:1.

### Security
RLS on threads, messages, artifacts per user (shared threads via explicit share table). Query execution applies the user's explore permissions. No raw SQL from the model; the spec is compiled server-side. Rate-limit and audit queries. Secrets server-only.

### Performance & SEO
Lazy-load Recharts and the artifact panel. Cache query results by spec hash for 5 minutes. Noindex.

### Guardrails
- Invented organisation, explores and figures
- Never fabricate fields that do not exist
- Explain limitations explicitly
- Typed code, errors surfaced
- Acceptance criteria: (1) asking a question yields an explained chart in the side panel; (2) viz toolbar switches type and table view; (3) unsupported breakdowns are declined with reason; (4) RLS/explore permissions enforced; (5) sheet layout at 390px.

Open the builderAll templatesThis palette on its own