Custom Prompt Template Guide

Create powerful, multi-step custom prompts using our intuitive YML template system. Define variables, structure input steps, and generate consistent outputs.

File Location

Create your custom prompt template files within your project directory at the following path:

WORKSPACE_DIR/.betteraicode/custom_prompts/your_template_name.yml
Template Structure Example

Here is an example of a multi-step prompt template for feature development:


title: Feature Development
category: feature-development
format: xml

# Define the steps for user input
steps:
  # Step 1 (contains multiple options/fields)
  - options:
      - title: Requirements
        description: Detailed requirements for the feature
        input_type: multi_line
        section_name: requirements
        required: false
        step_number: 1 # Determines the order this field appears in the step
      - title: Constraints
        description: Any constraints or limitations
        input_type: multi_line
        section_name: constraints
        required: false
        step_number: 4 # This field appears later within the same step

  # Step 2 (contains multiple options/fields)
  - options:
      - title: Summary
        description: Brief summary of the feature
        input_type: single_line
        section_name: summary
        required: true
        default: "here is the default value for the summary"
        step_number: 2 # Appears early in this step
      - title: Is PRD
        description: Check if this is a Product Requirements Document
        input_type: yes_no
        section_name: is_prd
        # Optional: Content to include if 'yes' is selected
        section_content: This is a Product Requirements Document (PRD).
        required: true
        step_number: 3 # Appears later in this step
Key Fields Explained
  • title: (String) The display name of the entire prompt template.
  • category: (String) A category slug used for organization (e.g., \`feature-development\`, \`code-review\`).
  • format: (String) Specifies the output format expected or used by the prompt (e.g., \`xml\`, \`markdown\`).
  • steps: (List) Defines the sequence of input steps presented to the user. Each item in the list represents a step.
  • options: (List, within \`steps\`) Contains the individual input fields within a single step.
  • title: (String, within \`options\`) The label displayed to the user for this input field.
  • description: (String, within \`options\`) Explanatory text shown below the title to guide the user.
  • input_type: (String, within \`options\`) Determines the type of input field presented:
    • single_line: A standard text input field.
    • multi_line: A larger text area for longer input.
    • yes_no: A simple yes/no selection (e.g., checkbox or radio buttons).
  • section_name: (String, within \`options\`) A unique identifier (variable name) for this field's content. This name might be used internally or when constructing the final output.
  • section_content: (String, Optional, within \`options\`) Specific text to be included in the output *only* if this option is selected or activated (particularly useful for \`yes_no\` types).
  • required: (Boolean, within \`options\`) Whether the user must provide input for this field (\`true\` or \`false\`).
  • default: (String, Optional, within \`options\`) A default value pre-filled in the input field.
  • step_number: (Integer, within \`options\`) Controls the display order of fields *within* the same step (lower numbers appear first). Fields from different steps are ordered based on their position in the \`steps\` list.
Usage

When you select a custom prompt, the system reads the corresponding YML file and presents the input fields defined in the steps and options sections, ordered correctly.

Based on your input and the template's structure (including any section_content for selected options), the final prompt context is constructed and processed.

Ensure your YML is correctly formatted and placed in the specified directory.

© Better AI Code 2025. All rights reserved.

BETTER AI CODE