Toda a documentação
Usar o workspace

AskCodi Prompts

A user guide for AskCodi's Prompt stacking, covering the creation of prompts, configuration of prompts, stacking of prompts and usage of prompts.

What Are Prompts?

Prompts are reusable text templates with variable placeholders. Instead of typing the same instructions repeatedly, you create a prompt once and reuse it everywhere.

The prompt library lets you create reusable AI prompts with dynamic variables. Prompts can be private (only you can see) or public (shared with the community).

Example Prompt:

You are a {{language}} expert. Help me {{task}} with best practices
for {{project_type}} projects. Focus on {{priority}} and provide
code examples.

Variables Detected:

  • {{language}} - Programming language
  • {{task}} - What you need help with
  • {{project_type}} - Type of project
  • {{priority}} - What to prioritize

When you use this prompt, you fill in the variables and the AI receives the complete, customized instruction.

Creating Prompts

From the Prompts Page

  1. Navigate to Prompts in the left sidebar
  2. Click "Create Prompt" button
  3. Fill in the form:
    • Name: Short identifier (e.g., "Code Review Helper")
    • Description: What this prompt does
    • Content: The actual prompt text with {{variables}}
    • Tags: Categories for organization (optional)
    • Visibility: Private or Public
  4. Click Save

Variable Auto-Detection

As you type content with {{variable}} syntax, the system automatically:

  • Extracts all unique variable names
  • Displays them below the content field
  • Stores them in the database

You don't manually specify variables—they're detected automatically.

From the Chat Sidebar

  1. Click the floating arrow to open the right sidebar
  2. Expand the "Prompts" section
  3. Click "Create Prompt" inline
  4. Same form as above, but stays in the sidebar
  5. Newly created prompts appear immediately

Using Prompts

Single Prompt Usage

  1. Open the right sidebar in chat
  2. Find your prompt in the top 5 list
  3. Click "Add to Stack" button
  4. If the prompt has variables, a dialog appears:
    • Shows all variables from the prompt
    • Input fields for each variable value
    • Save button to confirm
  5. Prompt added to active stack
  6. Send your next message—prompt is included as system message

Prompt Stack System

The prompt stack lets you combine multiple prompts for complex instructions.

Adding to Stack

  • Prompts stack in order (first added is #1, second is #2, etc.)
  • Each prompt can have independent variable mappings
  • Active stack shows in the sidebar with order indicators

Reordering Prompts

  • Drag and drop prompts to change order
  • Order determines sequence sent to AI
  • Visual indicators show #1, #2, #3 positions

Toggling Active/Inactive

  • Click the toggle switch on any stacked prompt
  • Inactive prompts stay in stack but aren't sent to AI
  • Useful for temporarily disabling prompts without removing

Removing from Stack

  • Click the remove button (X icon)
  • Prompt removed from stack immediately
  • Returns to available prompts list

Variable Mapping

  • Click "Edit Variables" on any stacked prompt
  • Update variable values without removing from stack
  • Changes apply to next message

Prompt Stack Behavior

Before Conversation Exists (Draft Stack)

You can prepare prompts before starting a conversation:

  • Add prompts to the draft stack
  • Configure variables
  • Reorder as needed
  • No "No active conversation" errors

When you send your first message:

  1. Conversation is created
  2. Draft stack transfers to conversation
  3. Draft stack clears automatically
  4. Prompts persist with the conversation

During Conversation (Conversation Stack)

Once a conversation exists:

  • Stack is saved to the database
  • Persists across sessions
  • Syncs across devices
  • Updates in real-time

How Prompts Are Sent

When you send a message with an active stack:

  1. System fetches full prompt data (if not already loaded)
  2. Replaces variables with your mapped values
  3. Creates system messages for each active prompt (in order)
  4. Sends: [Prompt 1 system message] → [Prompt 2 system message] → [Your conversation history] → [Your new message]
  5. AI receives complete context

Searching and Filtering Prompts

Search Bar

The search box filters prompts in real-time:

  • Searches prompt names
  • Searches descriptions
  • Searches content (full text)
  • Searches tags

Type "Python" and see all prompts related to Python, regardless of where the word appears.

Sort Options

Two sort modes available:

  • Newest: Recently created prompts first (default)
  • Most Used: Highest usage count first

Usage count increments every time you use a prompt in a message.

Tag Filtering

Click any tag to filter by that tag. Tags are dynamic—the filter shows all tags from your prompts. Click "All" to clear the filter.

Refresh Button

Click the refresh icon to manually reload prompts:

  • Fetches your latest private prompts
  • Fetches latest public prompts
  • Updates the display
  • Shows loading spinner during fetch

Prompts load automatically when you open chat, but refresh is available for manual sync.

Public vs Private Prompts

Private Prompts

  • Only you can see them
  • Full CRUD operations (Create, Read, Update, Delete)
  • Counted in "My Prompts" section
  • Cannot be shared with others
  • Stored with your user ID

Public Prompts

  • Visible to all users
  • Managed by service role (admins)
  • Read-only for regular users
  • Can be used by anyone
  • Optional content hiding (can_read_prompt flag)

Content Visibility

Public prompts can hide their content:

  • can_read_prompt = true: Everyone sees full content
  • can_read_prompt = false: Only name/description visible

This allows sharing prompt concepts without revealing implementation details.

Pro Tips

Tip 1: Use Prompt Stacking for Complex Tasks

Instead of writing long prompts, break them into multiple specialized prompts:

  • Prompt 1: Role definition ("You are a Python expert")
  • Prompt 2: Output format ("Always provide code examples")
  • Prompt 3: Specific task ("Review this code for security issues")

Stack them in order and get consistent, high-quality results.

Tip 2: Search Prompts by Content, Not Just Name

The search bar searches full prompt content. If you remember a phrase from a prompt but forgot its name, just search the phrase.

Tip 3: Use Tags Strategically

Tag prompts by:

  • Language: python, javascript, sql
  • Task: review, debug, optimize
  • Domain: backend, frontend, data

This makes finding the right prompt instant.

Tip 4: Toggle Prompts Instead of Removing

If you're not sure if you need a prompt, toggle it inactive instead of removing it. Easy to reactivate later without re-adding and mapping variables.

Tip 5: Build a Personal Library

Create prompts for your most common tasks:

  • Code review checklists
  • Bug investigation workflows
  • Documentation templates
  • Refactoring guidelines

Over time, you'll build a powerful library of reusable AI instructions.

Tip 6: Use Variables for Flexibility

Add {{variables}} to make prompts adaptable:

  • {{language}} for different programming languages
  • {{framework}} for different frameworks
  • {{context}} for different project contexts

One prompt becomes many use cases.

Falta algo ou está errado neste guia? Fale connosco