terra vidhal

Prompt Workbench

AI chats

About

A prompt workbench with a token-based template, generated variable inputs, missing-token shortcuts, example filling, a live rendered preview, word and token counts, copy gating and version saving and loading.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Prompt Workbench to your project and fits it to your theme.

Code

How Prompt Workbench is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import {
  PromptWorkbench,
  type PromptVariable,
  type PromptVersion,
} from "@/components/ui/prompt-workbench";

const TEMPLATE = `You are helping {{audience}}.

Rewrite the release note for {{product}} in a {{tone}} tone.
Keep it under {{length}} words and mention {{feature}}.

Release note:
{{notes}}`;

const VARIABLES: PromptVariable[] = [
  { key: "audience", label: "Audience", example: "a busy operations team" },
  { key: "product", label: "Product", example: "Field Notes" },
  { key: "tone", label: "Tone", example: "clear and friendly" },
  { key: "length", label: "Word limit", example: "80" },
  { key: "feature", label: "Feature", example: "the new saved views" },
  { key: "notes", label: "Raw notes", example: "Saved views keep filters between sessions and can be shared with the team." },
];

const VALUES: Record<string, string> = {
  audience: "a busy operations team",
  product: "Field Notes",
  tone: "clear and friendly",
  length: "80",
  feature: "saved views",
  notes: "Saved views keep filters between sessions and can be shared with the team.",
};

const VERSIONS: PromptVersion[] = [
  {
    id: "v1",
    name: "Release note v1",
    template: TEMPLATE,
    values: { ...VALUES, tone: "formal", length: "120" },
  },
  {
    id: "v2",
    name: "Release note v2",
    template: TEMPLATE,
    values: VALUES,
  },
];

export default function PromptWorkbenchDemo() {
  return (
    <main className="flex min-h-screen w-full items-start justify-center bg-gradient-to-b from-muted/40 via-background to-background px-4 py-8 sm:px-6">
      <PromptWorkbench
        defaultTemplate={TEMPLATE}
        variables={VARIABLES}
        initialValues={VALUES}
        initialVersions={VERSIONS}
        title="Release note prompt"
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Project Timeline

    Project Timeline

    30
  • Kanban Board

    Kanban Board

    20
  • Gravity Stars Background

    Gravity Stars Background

    20
  • Booking Calendar

    Booking Calendar

    18
  • Notification Center

    Notification Center

    16
  • Audio Waveform

    Audio Waveform

    16
  • Kpi Counter

    Kpi Counter

    16
  • Topographic Lines

    Topographic Lines

    16

More in AI chats

View all
  • Agent Chat

    Agent Chat

    21
  • AI Suggestions

    AI Suggestions

    27
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    30
  • AI Actions

    AI Actions

    372
  • Aquarium Prompt

    Aquarium Prompt

    223
  • Message Parts

    Message Parts

    11
  • AI SaaS Workflow Hero

    AI SaaS Workflow Hero

    36
  • AI Chat Composer

    AI Chat Composer

    22

Explore more

Part of PrequelUI Animate — browse the full library on 21st.dev.