Customizable AI prompts for all backend AI operations with file-based storage and template rendering.
- Prompt Service (
server/services/promptService.js): Template loading, variable substitution, stage configuration - Prompt Routes (
server/routes/prompts.js): REST API endpoints - Prompt Page (
client/src/pages/PromptManager.jsx): Stages, Variables, Elements tabs with live preview
- Prompt Stages: Define different prompts for different AI tasks (detection, analysis, etc.)
- Variables: Reusable content blocks (personas, formats, constraints)
- Per-Stage Provider Config: Each stage can use different AI providers/models
- Web UI: Edit prompts, variables, and preview rendered output
- Template Syntax:
{{variable}},{{#condition}}...{{/condition}}, arrays
./data/prompts/
├── stages/ # Individual prompt templates (.md files)
│ ├── app-detection.md
│ ├── code-analysis.md
│ └── ...
├── variables.json # Reusable prompt variables
└── stage-config.json # Stage metadata and provider config
Templates use Mustache-like syntax:
{{variable}}- Simple variable substitution{{#condition}}...{{/condition}}- Conditional blocks{{#array}}...{{/array}}- Array iteration
| Route | Description |
|---|---|
| GET /api/prompts | List all prompt stages — { stages, systemStages }, where systemStages is the CURATED key list from server/lib/promptSystemStages.js that the client badges SYSTEM and filters on. It is NOT the delete-protected set, which is wider (see below) |
| GET /api/prompts/:stage | Get stage template |
| PUT /api/prompts/:stage | Update stage/template |
| GET /api/prompts/:stage/usage | Delete-safety report — { isSystemStage, usedBy, referencedBy, canDelete, warning }. isSystemStage/usedBy come from the curated table; referencedBy lists the server/ sources that name the stage, from the generated server/lib/promptStageCallSites.generated.json; canDelete is false for either (#3335) |
| DELETE /api/prompts/:stage | Delete a stage. Returns 400 SYSTEM_STAGE_PROTECTED without ?force=true when the stage is curated OR referenced by source |
| POST /api/prompts/:stage/preview | Preview compiled prompt |
| GET /api/prompts/variables | List all variables |
| PUT /api/prompts/variables/:key | Update variable |
| POST /api/prompts/variables | Create variable |
| DELETE /api/prompts/variables/:key | Delete variable |
/prompts- Prompt Manager with tabs for Stages, Variables, Elements- Live preview with test variables
- Insert variable references
- Chief of Staff - Uses prompts for agent briefings
- Memory System - Uses prompts for memory evaluation