# Custom Instructions

Write your own AI prompts to control exactly how files are named, with specialized extraction rules and naming templates in RenameClick.

Custom Instructions let you write your own AI prompts to control exactly how files are named. Instead of the default RenameClick prompt that generates descriptive filenames, you can define specific extraction rules for your document types.

## How It Works

1. Open the **Prompt Selector** in the workspace header
2. Click **Create Custom Instructions** to open the prompt editor
3. Write your custom instructions
4. Save — the new prompt is auto-selected immediately
5. Drop files — AI follows your custom instructions instead of the default

## What Custom Instructions Control

Custom instructions **define the filename output only**. They tell the AI what information to extract and how to format the filename.

Categorization still uses the actual file content, not the generated filename. The category decision is independent of your custom prompt.

## When Custom Prompt Is Active

When you select a custom prompt:

- **Format selector** is **disabled** — your prompt controls the final filename structure
- **Output Language selector** is **disabled** — your prompt controls the language
- Both are re-enabled when you switch back to the default RenameClick prompt

This applies in both the Rename Workspace and in Auto Flow row settings.

## Prompt Constraints

| Setting | Default | Range |
| --- | --- | --- |
| Max prompt length | 1,800 characters | 500 — 4,000 (configurable in Local AI Settings) |

## Example: Electricity Bill Extraction

```
You are an information extraction system.

Input: an image or PDF of an electricity bill.
Task: extract the following fields strictly from the document content:
1. Payable until date
2. Total amount due
3. Payer full name (Name Surname)

Rules:
- Use the date labeled "Payable until" or equivalent.
- Convert the date to ISO format YYYY-MM-DD.
- Amount must be numeric with comma as decimal separator (e.g. 317,03).
- If any field is missing or unclear, output "UNKNOWN" for that field.

Output format (single line, exact):
Electricity Bill__YYYY-MM-DD__Amount__Name Surname
```

**Result**: `Electricity Bill__2024-03-15__317,03__John Smith.pdf`

## Example: Medical Report Naming

```
You are a medical document organizer.

Input: a medical report, lab results, or referral.
Task: extract and format as follows:
1. Document type (Lab Results, MRI Report, Referral, Prescription, etc.)
2. Patient name
3. Date of the document

Output format:
DocumentType - PatientName - YYYY-MM-DD
```

**Result**: `Lab Results - John Smith - 2025-01-20.pdf`

## Example: Invoice Processing

```
Extract from this invoice:
1. Vendor/company name
2. Invoice number
3. Invoice date (YYYY-MM-DD format)

Output as: VendorName_INV-Number_Date
If any field is missing, use UNKNOWN.
```

**Result**: `Acme Corp_INV-2024-0847_2024-11-15.pdf`

## Example: Photo Event Naming

```
Describe what is happening in this photo in 3-5 words.
Focus on the main activity or event, not background details.
Use Title Case.
```

**Result**: `Birthday Party Cake Cutting.jpg`

## Best Practices

1. **Be specific about output format** — Tell the AI exactly what format you want. Show an example.
2. **Handle missing data** — Include rules for what to do when information isn't found (e.g., "use UNKNOWN")
3. **Keep it focused** — One clear task per prompt works better than complex multi-step instructions
4. **Test with sample files** — Drop a few representative files to verify results before batch processing
5. **Use separators** — Underscores `_` or hyphens `-` make structured filenames readable

## Custom Instructions + Categorization

You can use custom instructions and categorization together, but be aware:

- The custom prompt controls the **filename** only
- Categorization uses the **actual file content** to decide which folder
- These are independent decisions

For best category accuracy with a specialized prompt, use a two-step workflow:

1. First pass: Rename only (with your custom prompt)
2. Second pass: Categorize only (AI reads file content fresh)

## Auto Flow Integration

Each Auto Flow row can have its own custom prompt:

- Row 1 can use an invoice extraction prompt
- Row 2 can use a medical document prompt
- Row 3 can use the default RenameClick prompt

Configure per-row prompts in the row's settings panel.
