| 1 | export function getPrompt(): string { |
| 2 | return ` |
| 3 | # TeamCreate |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | Use this tool proactively whenever: |
| 8 | - The user explicitly asks to use a team, swarm, or group of agents |
| 9 | - The user mentions wanting agents to work together, coordinate, or collaborate |
| 10 | - A task is complex enough that it would benefit from parallel work by multiple agents (e.g., building a full-stack feature with frontend and backend work, refactoring a codebase while keeping tests passing, implementing a multi-step project with research, planning, and coding phases) |
| 11 | |
| 12 | When in doubt about whether a task warrants a team, prefer spawning a team. |
| 13 | |
| 14 | ## Choosing Agent Types for Teammates |
| 15 | |
| 16 | When spawning teammates via the Agent tool, choose the \`subagent_type\` based on what tools the agent needs for its task. Each agent type has a different set of available tools — match the agent to the work: |
| 17 | |
| 18 | - **Read-only agents** (e.g., Explore, Plan) cannot edit or write files. Only assign them research, search, or planning tasks. Never assign them implementation work. |
| 19 | - **Full-capability agents** (e.g., general-purpose) have access to all tools including file editing, writing, and bash. Use these for tasks that require making changes. |
| 20 | - **Custom agents** defined in \`.claude/agents/\` may have their own tool restrictions. Check their descriptions to understand what they can and cannot do. |
| 21 | |
| 22 | Always review the agent type descriptions and their available tools listed in the Agent tool prompt before selecting a \`subagent_type\` for a teammate. |
| 23 | |
| 24 | Create a new team to coordinate multiple agents working on a project. Teams have a 1:1 correspondence with task lists (Team = TaskList). |
| 25 | |
| 26 | \`\`\` |
| 27 | { |
| 28 | "team_name": "my-project", |
| 29 | "description": "Working on feature X" |
| 30 | } |
| 31 | \`\`\` |
| 32 | |
| 33 | This creates: |
| 34 | - A team file at \`~/.claude/teams/{team-name}/config.json\` |
| 35 | - A corresponding task list directory at \`~/.claude/tasks/{team-name}/\` |
| 36 | |
| 37 | ## Team Workflow |
| 38 | |
| 39 | 1. **Create a team** with TeamCreate - this creates both the team and its task list |
| 40 | 2. **Create tasks** using the Task tools (TaskCreate, TaskList, etc.) - they automatically use the team's task list |
| 41 | 3. **Spawn teammates** using the Agent tool with \`team_name\` and \`name\` parameters to create teammates that join the team |
| 42 | 4. **Assign tasks** using TaskUpdate with \`owner\` to give tasks to idle teammates |
| 43 | 5. **Teammates work on assigned tasks** and mark them completed via TaskUpdate |
| 44 | 6. **Teammates go idle between turns** - after each turn, teammates automatically go idle and send a notification. IMPORTANT: Be patient with idle teammates! Don't comment on their idleness until it actually impacts your work. |
| 45 | 7. **Shutdown your team** - when the task is completed, gracefully shut down your teammates via SendMessage with \`message: {type: "shutdown_request"}\`. |
| 46 | |
| 47 | ## Task Ownership |
| 48 | |
| 49 | Tasks are assigned using TaskUpdate with the \`owner\` parameter. Any agent can set or change task ownership via TaskUpdate. |
| 50 | |
| 51 | ## Automatic Message Delivery |
| 52 | |
| 53 | **IMPORTANT**: Messages from teammates are automatically delivered to you. You do NOT need to manually check your inbox. |
| 54 | |
| 55 | When you spawn teammates: |
| 56 | - They will send you messages when they complete tasks or need help |
| 57 | - These messages appear automatically as new conversation turns (like user messages) |
| 58 | - If you're busy (mid-turn), messages are queued and delivered when your turn ends |
| 59 | - The UI shows a brief notification with the sender's name when messages are waiting |
| 60 | |