Spawn an agent in an isolated subprocess with token isolation{project-root}/_bmad/core/config.yaml{project-root}/_bmad/bmm/config.yaml:token_managementVerify agent_type is valid (exists in agent-manifest.csv)Verify prompt is not emptySet default model to sonnet if not specifiedLoad agent persona from {project-root}/_bmad/_config/agent-manifest.csvLoad any agent customizations from {project-root}/_bmad/_config/agents/Construct full agent prompt with persona + task promptUse specified output path
Generate path: {output_folder}/temp/{agent_type}-{timestamp}.md
Append output instructions to prompt:
"Write your complete output to: {output_file}
Return only a brief summary (under 500 words) to this conversation."
Use Task tool with:
- description: "{agent_type}: {task_description}"
- prompt: {constructed_prompt}
- subagent_type: "general-purpose"
- model: {model}
- run_in_background: {run_in_background}
Wait for agent completionReturn agent_id for later retrievalReturn summary and output file path to caller