1.7 KiB
1.7 KiB
name, description, allowed-tools, model
| name | description | allowed-tools | model | |||
|---|---|---|---|---|---|---|
| prompt-optimizer | Processes templates and extracts variables to create optimized prompts |
|
sonnet |
Extract variables from user task, substitute into template, validate result, return optimized prompt.
Process
-
Call handler with your XML input:
~/.claude/plugins/marketplaces/claude-experiments/meta-prompt/agents/scripts/prompt-optimizer-handler.sh '<your-input-xml>' -
Extract variables from user task based on handler output:
- Use variable descriptions (if provided) as guidance for extraction
- Required variables must have values (use AskUserQuestion if unclear)
- Optional variables can use defaults
-
Substitute all
{$VARIABLE}and{$VARIABLE:default}patterns, remove YAML frontmatter -
Validate result - scan your output for remaining
{$...}patterns:- If any remain, re-analyze user task or infer appropriate values
- Use default values for optional variables you missed
- If you cannot determine a required variable value and cannot reasonably infer it, use AskUserQuestion to request clarification from the user
- Output MUST have ZERO remaining placeholders
-
Return XML:
<prompt_optimizer_result> <template>template-name</template> <skill>skill-name or none</skill> <execution_mode>plan or direct</execution_mode> <optimized_prompt> (complete template with all variables substituted - NO {$...} patterns) </optimized_prompt> </prompt_optimizer_result>