prompt.ts
tools/TaskListTool/prompt.ts
50
Lines
2066
Bytes
2
Exports
1
Imports
10
Keywords
What this is
This page documents one file from the repository and includes its full source so you can read it without leaving the docs site.
Beginner explanation
This file is part of the tool layer, which means it describes actions the system can perform for the user or model.
How it is used
Start from the exports list and related files. Those are the easiest clues for where this file fits into the system.
Expert explanation
Architecturally, this file intersects with tool-system. It contains 50 lines, 1 detected imports, and 2 detected exports.
Important relationships
- tools/TaskListTool/TaskListTool.ts
- tools/TaskListTool/constants.ts
- buddy/prompt.ts
- services/compact/prompt.ts
- tools/AgentTool/prompt.ts
- tools/AskUserQuestionTool/prompt.ts
- tools/BashTool/prompt.ts
- tools/BriefTool/prompt.ts
- tools/ConfigTool/prompt.ts
- tools/EnterPlanModeTool/prompt.ts
- tools/EnterWorktreeTool/prompt.ts
- tools/ExitPlanModeTool/prompt.ts
Detected exports
DESCRIPTIONgetPrompt
Keywords
taskstaskavailablelistisagentswarmsenabledwhenownerdescriptiontaskgettaskupdate
Detected imports
../../utils/agentSwarmsEnabled.js
Source notes
This page embeds the full file contents. Small or leaf files are still indexed honestly instead of being over-explained.
Full source
import { isAgentSwarmsEnabled } from '../../utils/agentSwarmsEnabled.js'
export const DESCRIPTION = 'List all tasks in the task list'
export function getPrompt(): string {
const teammateUseCase = isAgentSwarmsEnabled()
? `- Before assigning tasks to teammates, to see what's available
`
: ''
const idDescription = isAgentSwarmsEnabled()
? '- **id**: Task identifier (use with TaskGet, TaskUpdate)'
: '- **id**: Task identifier (use with TaskGet, TaskUpdate)'
const teammateWorkflow = isAgentSwarmsEnabled()
? `
## Teammate Workflow
When working as a teammate:
1. After completing your current task, call TaskList to find available work
2. Look for tasks with status 'pending', no owner, and empty blockedBy
3. **Prefer tasks in ID order** (lowest ID first) when multiple tasks are available, as earlier tasks often set up context for later ones
4. Claim an available task using TaskUpdate (set \`owner\` to your name), or wait for leader assignment
5. If blocked, focus on unblocking tasks or notify the team lead
`
: ''
return `Use this tool to list all tasks in the task list.
## When to Use This Tool
- To see what tasks are available to work on (status: 'pending', no owner, not blocked)
- To check overall progress on the project
- To find tasks that are blocked and need dependencies resolved
${teammateUseCase}- After completing a task, to check for newly unblocked work or claim the next available task
- **Prefer working on tasks in ID order** (lowest ID first) when multiple tasks are available, as earlier tasks often set up context for later ones
## Output
Returns a summary of each task:
${idDescription}
- **subject**: Brief description of the task
- **status**: 'pending', 'in_progress', or 'completed'
- **owner**: Agent ID if assigned, empty if available
- **blockedBy**: List of open task IDs that must be resolved first (tasks with blockedBy cannot be claimed until dependencies resolve)
Use TaskGet with a specific task ID to view full details including description and comments.
${teammateWorkflow}`
}