2.1 KiB
2.1 KiB
name: prompt
description: Optimize a prompt using templates and execute with specialized skills
argument-hint: [--template=] [--code|--refactor|--review|--test|--docs|--documentation|--extract|--compare|--comparison|--custom] [--plan] [--return-only]
allowed-tools: [Task, TodoWrite, Bash(~/.claude/plugins/marketplaces/claude-experiments/meta-prompt/commands/scripts/prompt-handler.sh:*)]
Execute tasks using optimized prompts with domain-specific skills.
{$TASK_DESCRIPTION}
Process
-
Call handler with the task:
~/.claude/plugins/marketplaces/claude-experiments/meta-prompt/commands/scripts/prompt-handler.sh "{$TASK_DESCRIPTION}" -
Parse XML response from handler:
- Extract
<todos>and call TodoWrite with the todo items - Extract
<task_tool>for subagent parameters - Check
<next_action>and<final_action>for flow control
- Extract
-
Update TodoWrite from
<todos>: Parse each<todo status="..." content="..." activeForm="..."/>and call TodoWrite with the array.Example transformation:
<todos> <todo status="in_progress" content="Optimize prompt" activeForm="Optimizing prompt"/> <todo status="pending" content="Execute task" activeForm="Executing task"/> </todos>Becomes TodoWrite input:
[ {"status": "in_progress", "content": "Optimize prompt", "activeForm": "Optimizing prompt"}, {"status": "pending", "content": "Execute task", "activeForm": "Executing task"} ] -
Execute based on
<next_action>:- If spawning subagent: Use Task tool with
<subagent_type>,<description>,<prompt> - Pass subagent XML results back to handler via
<next_handler_call> - If
<final_action>present: execute that action instead of looping
- If spawning subagent: Use Task tool with
-
Handle
<final_action>values:present_results: Display the task execution results to the userpresent_optimized_prompt: Display the optimized prompt to the user (for --return-only mode)
-
Loop until
<next_action>done</next_action> -
Present results to user when complete.