Dashboard Prompt Editor — visual template management with version history

2026-03-22

dashboardprompts

What We Built

A full prompt management page in the BrainstormRouter dashboard. Six integrated sections: searchable prompt list with quick actions, monospace template editor with {{variable}} detection and token estimation, version history timeline with load/promote controls, environment deployment management (dev/staging/prod), A/B test configuration with split slider, and a test playground that auto-generates variable input forms from template analysis.

Why It Matters

Prompt engineering in production requires more than a text file. Teams need version control, safe environment promotion, A/B testing, and a playground to test changes before deploying. This dashboard puts all of that in one place — no CLI, no API calls, just click and edit.

How It Works

Navigate to Prompts in the AI Gateway sidebar section. The list view shows all templates with version, environment, and A/B status. Click any prompt to open the detail view with:

  • Editor: Edit template text, see character/token count and detected variables in real time
  • Version History: Timeline of all versions with Load (restore to editor) and Promote (advance environment) buttons
  • A/B Testing: Select two versions, set split percentage, start/stop tests
  • Test Playground: Auto-generated form fields for each {{variable}}, run test to see rendered output

Auth bridge endpoints (/auth/prompts/*) provide JWT-authenticated access using the same Supabase session as the rest of the dashboard.

Lockstep Checklist

  • [x] API Routes: src/api/routes/auth.ts — 10 bridge endpoints
  • [x] TS SDK: packages/sdk-ts/src/resources/dashboard-prompts.ts
  • [x] Python SDK: packages/sdk-py/src/brainstormrouter/resources/dashboard_prompts.py
  • [x] Dashboard: site/dashboard/src/pages/prompts.ts + router + nav
  • [x] Tests: site/dashboard/src/__tests__/prompts-logic.test.ts