Skip to main content

Prompts

Elftia provides a comprehensive prompt management system for creating reusable prompt templates. It supports dynamic variable placeholder filling, chained prompt sequential execution, category and tag organization, quick insertion in chat, and AI-driven prompt optimization.

Use Cases

  • Create commonly used prompt templates to avoid typing the same thing repeatedly
  • Use variables to make a single template adapt to different input parameters
  • Chain multiple prompts into a pipeline to automate multi-step tasks
  • Use // in chat to quickly insert favorited prompts
  • Use the AI optimizer to improve the quality of your prompt wording
  • Organize large numbers of prompts by category and tag

Prompt Templates

A prompt template is a reusable text fragment that can contain variable placeholders filled in dynamically at use time.

Creating a Prompt

Steps

  1. Open the Prompt library (from the sidebar or navigation menu)
  2. Click the New Prompt button
  3. Fill in the basic information:
FieldDescriptionRequired
NameThe prompt's nameYes
DescriptionExplanation of the prompt's purposeNo
ContentThe prompt body (supports variable syntax)Yes
CategoryThe category it belongs to (see category management below)No
IconDisplay iconNo
ColorDisplay colorNo
FavoriteWhether to mark as favoriteNo
  1. (Optional) Add variable definitions
  2. Save

Variable Support

You can use {{variable_name}} syntax in the prompt content to define placeholders. When using the prompt, the system pops up a form for you to fill in variable values.

Variable Syntax

Please review the following {{language}} code:

{{code}}

Please focus on: {{focus_areas}}

Variable Types

TypeIDDescriptionBest For
TexttextSingle-line text inputShort parameter values
NumbernumberNumber input with optional min and maxQuantities, temperatures, and other numeric parameters
SelectselectDropdown; choose from predefined optionsParameters with fixed choices
TextareatextareaMulti-line text inputLonger text content such as code snippets

Variable Definition Fields

FieldDescriptionRequired
Name (name)Variable identifier (corresponds to {{name}})Yes
Label (label)Display label for the variableYes
Type (type)Variable typeYes
Default value (defaultValue)Pre-filled default valueNo
Placeholder (placeholder)Placeholder text for the inputNo
Required (required)Whether the variable is requiredNo
Options (options)Option list for select typeRequired for select
Min (min)Minimum value for number typeNo
Max (max)Maximum value for number typeNo

Variable Usage Example

Template content:

Please write a {{function_type}} in {{language}}:

Requirements:
{{requirement}}

Requirements:
- Code style: {{style}}
- Comment language: {{comment_lang}}

Variable definitions:

Variable nameLabelTypeOptions/Default
languageProgramming LanguageselectPython, JavaScript, TypeScript, Go, Rust
function_typeFeature TypetextDefault: "function"
requirementRequirement Descriptiontextarea
styleCode StyleselectConcise, Detailed, Enterprise
comment_langComment LanguageselectChinese, English, Japanese

When used, the system pops up a form; after filling it in, variables are automatically replaced to generate the final prompt.

Prompt Chains

A prompt chain links multiple prompt templates into an execution pipeline, sending them to the AI in sequence to automate multi-step tasks.

Creating a Prompt Chain

Steps

  1. Switch to the Chains tab in the prompt library
  2. Click the New Chain button
  3. Fill in the chain's basic information (name, description, etc.)
  4. Add steps: select the prompt templates you want to link from the library
  5. Configure execution parameters for each step
  6. Save

Chain Step Configuration

ParameterDescriptionDefault
Prompt (promptId)Select the prompt template to executeRequired
Sort order (sortOrder)Execution orderAuto-increment
Delay (delay)Wait time before sending (milliseconds)0
Wait for response (waitForResponse)Whether to wait for the AI reply before executing the next stepYes
Require confirm (requireConfirm)Whether user confirmation is required before executingNo

Execution Flow

Step 1 → (wait for reply) → Step 2 → (wait for reply) → Step 3 → ... → Done

If a step has requireConfirm set, the system pauses before executing that step and waits for you to confirm before continuing.

Use Case Examples

Code review chain:

  1. Step 1: Analyze code structure
  2. Step 2: Check for security issues
  3. Step 3: Performance optimization suggestions
  4. Step 4: Generate review report

Content creation chain:

  1. Step 1: Generate outline
  2. Step 2: Expand each section
  3. Step 3: Polish and proofread
  4. Step 4: Generate summary

Quick Insertion (// Trigger)

Typing // in the chat input box lets you quickly insert a prompt without leaving the conversation.

Steps

  1. Type // in the chat input box
  2. The quick insertion menu appears with three sections:
    • Favorites — prompts marked as favorites
    • Recently used — prompts used recently
    • Chains — available prompt chains
  3. Click to select a prompt
  4. If the prompt contains variables, a variable fill-in form pops up
  5. After filling in variables, the final content is inserted into the input box

Behavior Notes

  • The quick insertion menu is sorted by frequency of use and favorite status
  • Selecting a prompt chain executes the steps sequentially per the chain's configuration

Category Management

Use categories to organize large numbers of prompts, with support for hierarchical structures.

Steps

  1. Manage categories in the left panel of the prompt library
  2. Click + to create a new category
  3. Fill in the category information:
FieldDescription
NameCategory name
DescriptionCategory description (optional)
Parent categoryParent category (optional; supports nesting)
IconCategory icon (optional)
ColorCategory color (optional)
  1. Click a category to filter and show only prompts in that category

Category Operations

  • Create — create a new category
  • Edit — modify category information
  • Delete — delete a category (prompts under the category are not deleted; they become uncategorized)
  • Drag to reorder — adjust the display order of categories

Usage Tracking

The system automatically records the usage count of each prompt and prompt chain.

FieldDescription
Usage count (usageCount)Cumulative number of uses
Created at (createdAt)Creation timestamp
Updated at (updatedAt)Last modification timestamp

Usage count helps you understand which prompts are used most frequently and also influences the sort order in the quick insertion menu.

Prompt Optimizer

Elftia includes an AI-powered prompt optimizer that analyzes and improves the quality of your prompts.

How to Use

  1. In the prompt editor, click the Optimize button
  2. The system sends your prompt to AI for analysis
  3. AI returns an optimized version, including:
    • Optimized content — the improved prompt text
    • Suggestions — explanation of the optimization
    • Changes — what specifically was modified
  4. You can choose to accept the optimized result or keep the original

Optimization Parameters

ParameterDescription
Original content (content)The prompt text to optimize
Context (context)Description of the prompt's use case (optional; helps AI optimize more precisely)
Language (language)Target language for optimization (optional)

Prompt Library Views

The prompt library provides multiple ways to browse and filter:

ViewDescription
List viewPrompts organized by category
SearchSearch by name and description
Favorites filterShow only favorited prompts
Category filterShow only prompts in a specific category
Built-in filterShow only system built-in prompts

FAQ

ProblemSolution
Variable was not replacedConfirm the variable syntax is correct ({{name}} double curly braces) and the variable name matches the definition
Quick insertion menu does not appearEnsure // is typed at the beginning of the input box or after a space
Prompt chain interruptedCheck that each step's prompt still exists; deleted prompts cause the chain to break
Optimizer is not respondingConfirm a valid LLM provider and API Key are configured
Imported prompt category is missingCategory information may not be included in the import data; manually re-categorize
Usage count is inaccurateUsage count is automatically incremented on quick insert and manual use
  • Chat — use // in conversations to quickly insert prompts
  • Agent — Agents can use prompt templates
  • Roleplay — system prompts in character settings