optimize_prompt
Refines rough prompt drafts with a local LLM to produce structured, cost-effective prompts for paid APIs.
Instructions
Optimizes a rough prompt draft using a local LLM before sending it to a paid API
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto | No | Master switch for all automatic enhancement passes: Chain-of-Thought injection, anti-hallucination guardrails, intent classification, and lint auto-repair. The legacy auto_cot/auto_guardrails/auto_intent/auto_repair booleans are still accepted and override this per pass. | |
| draft | Yes | The raw draft idea | |
| model | No | Override for the model | |
| engine | No | The underlying LLM engine to use | |
| context | No | Optional background/domain context (project description, glossary, relevant facts) to help the model correctly interpret domain-specific terms in the draft | |
| verbosity | No | How much detail to return alongside the optimized prompt: 'quiet' = prompt only, 'explain' = plus a 1-line summary of what the critic pass changed, 'verbose' = plus token stats and a critic-pass diff. The legacy explain/show_stats/show_diff booleans are still accepted and override this. | quiet |
| brainstorm | No | When true, instructs the target model to generate multiple personas/perspectives for open-ended brainstorming | |
| session_id | No | Optional ID to maintain conversation state. Provide a unique string. When making tweaks to a previously generated prompt, pass the same session_id. | |
| interactive | No | When true, instructs the calling assistant to pause and ask for user approval before answering the optimized prompt. Defaults to true to allow iteration. | |
| auto_context | No | Automatically scan the local project (package.json, git) for context to append to the prompt. | |
| target_model | No | The target API/format this prompt will be sent to | generic |