Skip to content

Prompt library

Prompt library

What this area does

The admin prompt library is the management surface for prompt catalog content. It is distinct from the user-facing prompt generator: this area is designed for administrators to inspect, upload, edit, and version prompt records.

The route is mounted behind the admin shell and is reachable at /prompt-library from the main app and /admin/prompt-library from the admin layout navigation.

Primary implementation

The main implementation lives in src/admin/availble_prompts/:

  • PromptLibrary.jsx
  • PromptEditPanel.jsx
  • PromptVersionPanel.jsx
  • components/PromptTable.jsx
  • components/PromptFormDrawer.jsx
  • components/PromptCreateForm.jsx
  • components/PromptUploadDrawer.jsx
  • components/PromptViewDrawer.jsx
  • components/DeleteConfirmationDialog.jsx
  • hooks/usePromptLibrary.js / .jsx
  • clipboard.js

Service coupling

This page uses the prompt-related API services rather than a local data store. The two important backends are:

  • the bulk-upload prompt lane, and
  • the v1 prompt lane used by the main application prompt lifecycle.

If a prompt-library change affects the public prompt lifecycle, the request shape should be revalidated against tests/contract/promptService.test.js.

Responsibilities

  • browse prompt records in a table,
  • create and edit prompt entries,
  • upload prompts in bulk,
  • view prompt details and versions,
  • delete prompts with confirmation,
  • copy prompt text or metadata into the clipboard.

Invariants

  • Admin prompt management should not silently change the user-facing prompt generator contract.
  • Upload, edit, and version actions should preserve the prompt identity that the admin library uses.
  • Deletion should always be confirmation-gated because prompt records are shared operational data.

Evidence-backed tests

The prompt-service contract test suite is the canonical backend proof. For the UI chrome and navigation around the admin shell, pair this page with the admin overview and the nav tests in the component suites.