You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get next task from Taskmaster and execute it via Zeroshot
Bash(zeroshot:*), Bash(mcp-cli:*)
--ship | --pr | --attach | task-id
You are the Taskmaster-Zeroshot orchestrator. Your job is to get a task and execute it autonomously.
Your Workflow
Step 1: Get the Task
$ARGUMENTS
If a task ID was provided above, fetch that specific task:
Use mcp-cli call taskmaster-ai/get_task '{"id": "<task-id>", "projectRoot": "."}'
Otherwise, get the next priority task:
Use mcp-cli call taskmaster-ai/next_task '{"projectRoot": "."}'
Step 2: Validate the Task
Check that the task has:
A clear title and description
Implementation details (if complex)
A test strategy (CRITICAL for Zeroshot validators)
If testStrategy is missing or vague, warn the user and suggest expanding the task first.
Step 3: Update Status to In-Progress
Before executing, mark the task as in-progress:
Use mcp-cli call taskmaster-ai/set_task_status '{"id": "<task-id>", "status": "in-progress", "projectRoot": "."}'
Step 4: Build the Zeroshot Prompt
Create a well-structured prompt from the task data:
## Task: [title]
[description]
### Implementation Details
[details field - or summarize if missing]
### Test Strategy
[testStrategy field]
### Acceptance Criteria
- All tests must pass
- Code follows project conventions
- Changes are atomic and well-committed
Step 5: Execute with Zeroshot
Run the task with appropriate flags based on user arguments:
Default: zeroshot "[prompt]" --worktree
With --pr: zeroshot "[prompt]" --worktree --pr
With --ship: zeroshot "[prompt]" --ship
With --attach: zeroshot "[prompt]" --worktree (stay attached)
Use daemon mode (-d) unless --attach was specified.
Step 6: Report Status
After launching Zeroshot:
Report the cluster ID for monitoring
Remind user they can run zeroshot watch to monitor
Remind user to update Taskmaster status when complete:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Return a reminder message if this was a task execution
if "run" in command.lower() or command.strip().startswith("zeroshot \""):
return {
"systemMessage": f"Task execution started. Monitor with `zeroshot watch`. Remember to sync status back to Taskmaster when complete using `/sync-status`."
Run: zeroshot list to see all tracked tasks/clusters.
For any running clusters, show:
Cluster ID
Status (running, stopped, completed, failed)
Associated task (if identifiable from prompt)
Output Format
=== TASKMASTER STATUS ===
Total: X tasks
Pending: X (ready to execute)
In-Progress: X (currently running)
Blocked: X (needs attention)
Done: X (completed)
Next Task: #ID - Title (priority)
=== ZEROSHOT STATUS ===
Active Clusters: X
[cluster-id] - status - "task title snippet..."
=== QUICK ACTIONS ===
- Execute next task: /execute-task
- Execute all tasks: /execute-all
- Monitor running: zeroshot watch
A practical guide for chaining Taskmaster (task planning) with Zeroshot (autonomous execution) in your daily development workflow.
Philosophy: Taskmaster is the "brain" (source of truth for what to do), Zeroshot is the "hands" (executes tasks autonomously).
The Integration Pattern
┌──────────────────────────────────────────────────────────────────┐
│ YOUR WORKFLOW │
├──────────────────────────────────────────────────────────────────┤
│ │
│ 1. PLAN (Taskmaster) 2. EXECUTE (Zeroshot) │
│ ──────────────────── ───────────────────── │
│ • Parse PRD → tasks • Pick task from Taskmaster │
│ • Expand into subtasks • Run autonomously │
│ • Track status & deps • Validators check work │
│ • Prioritize work • Create PR on success │
│ │
│ ↓ task details ↓ │
│ │
│ .taskmaster/tasks.json ──────────► zeroshot "task prompt" │
│ │
│ ↓ status update ↓ │
│ │
│ set_task_status(done) ◄────────── CLUSTER_COMPLETE │
│ │
└──────────────────────────────────────────────────────────────────┘
Workflow Steps
Step 1: Initialize Project with Taskmaster
# In your project directorycd~/workspace/my-project
# Initialize Taskmaster (creates .taskmaster/ directory)
npx task-master-ai init
# Or if using Claude Code, the MCP tools handle this automatically
Step 2: Plan with Taskmaster
Option A: Parse a PRD document
# Via MCP (in Claude Code)# Use: taskmaster-ai/parse_prd with your PRD file# Via CLI
npx task-master-ai parse-prd --input docs/my-feature.md
Option B: Add tasks manually
# Via MCP# Use: taskmaster-ai/add_task# The task should include:# - Clear title# - Detailed description# - Implementation details# - Test strategy (critical for Zeroshot validation!)
Step 3: Review and Expand Tasks
# List all tasks# MCP: taskmaster-ai/get_tasks# Expand complex tasks into subtasks# MCP: taskmaster-ai/expand_task with id and num_subtasks# Check task dependencies# MCP: taskmaster-ai/validate_dependencies
Step 4: Get Next Task for Execution
# MCP: taskmaster-ai/next_task# Returns the highest priority task with all dependencies satisfied# The response includes:# - id, title, description# - details (implementation guidance)# - testStrategy (Zeroshot will use this for validation!)# - subtasks (if any)
Step 5: Execute with Zeroshot
Build the prompt from Taskmaster task:
## Task: [title from Taskmaster][description from Taskmaster]### Implementation Details[details from Taskmaster]### Test Strategy[testStrategy from Taskmaster - CRITICAL for validators]### Acceptance Criteria- All tests pass
- Code follows project conventions
- PR ready for review
Run Zeroshot:
# Basic execution (uses git worktree isolation)
zeroshot "## Task: Implement user auth..." --worktree
# With PR creation
zeroshot "## Task: Implement user auth..." --worktree --pr
# Full automation (auto-merge on success)
zeroshot "## Task: Implement user auth..." --ship
# Background execution (daemon mode)
zeroshot "## Task: Implement user auth..." --worktree --pr -d
Step 6: Monitor Execution
# Real-time TUI dashboard
zeroshot watch
# Check specific task status
zeroshot status <task-id># List all running clusters
zeroshot list
Step 7: Update Taskmaster on Completion
On Success (CLUSTER_COMPLETE):
# MCP: taskmaster-ai/set_task_status# id: "5" (the task ID)# status: "done"
On Failure (CLUSTER_FAILED or validation failure):
# MCP: taskmaster-ai/set_task_status# id: "5"# status: "blocked"# Optionally add notes about what failed# MCP: taskmaster-ai/update_task with notes
Step 8: Resume or Retry
# If Zeroshot crashed or was interrupted
zeroshot resume <cluster-id># If task failed validation, you can:# 1. Fix issues manually and re-run# 2. Update task details in Taskmaster with more guidance# 3. Re-run with adjusted prompt
Practical Shell Workflow
Here's a practical shell script pattern you can use:
#!/bin/bash# zeromaster-workflow.sh - Run next Taskmaster task via Zeroshot
PROJECT_ROOT=$(pwd)# 1. Get next task from Taskmasterecho"Fetching next task from Taskmaster..."
TASK_JSON=$(mcp-cli call taskmaster-ai/next_task "{\"projectRoot\": \"$PROJECT_ROOT\"}")# Check if we got a taskifecho"$TASK_JSON"| grep -q '"id"';then
TASK_ID=$(echo "$TASK_JSON"| jq -r '.id')
TASK_TITLE=$(echo "$TASK_JSON"| jq -r '.title')
TASK_DESC=$(echo "$TASK_JSON"| jq -r '.description')
TASK_DETAILS=$(echo "$TASK_JSON"| jq -r '.details // ""')
TASK_TEST=$(echo "$TASK_JSON"| jq -r '.testStrategy // ""')echo"Found task #$TASK_ID: $TASK_TITLE"# 2. Build Zeroshot prompt
PROMPT="## Task: $TASK_TITLE$TASK_DESC### Implementation Details$TASK_DETAILS### Test Strategy$TASK_TEST### Instructions1. Implement this task following the details above2. Write/update tests as specified3. Ensure all tests pass before completing4. Create atomic, well-messaged commits"# 3. Update Taskmaster status to in-progressecho"Marking task as in-progress..."
mcp-cli call taskmaster-ai/set_task_status "{\"id\": \"$TASK_ID\", \"status\": \"in-progress\", \"projectRoot\": \"$PROJECT_ROOT\"}"# 4. Execute with Zeroshotecho"Executing with Zeroshot..."
zeroshot "$PROMPT" --worktree --pr
# 5. Check result and update Taskmaster# (In practice, you'd poll zeroshot status or check exit code)read -p "Did the task complete successfully? (y/n) " RESULT
if [ "$RESULT"="y" ];then
mcp-cli call taskmaster-ai/set_task_status "{\"id\": \"$TASK_ID\", \"status\": \"done\", \"projectRoot\": \"$PROJECT_ROOT\"}"echo"Task marked as done!"else
mcp-cli call taskmaster-ai/set_task_status "{\"id\": \"$TASK_ID\", \"status\": \"blocked\", \"projectRoot\": \"$PROJECT_ROOT\"}"echo"Task marked as blocked. Review and retry."fielseecho"No pending tasks found!"fi
Key Integration Points
Taskmaster Task → Zeroshot Prompt
The testStrategy field is critical! Zeroshot's validators will use this to verify the implementation:
# Good testStrategy (Zeroshot can validate)testStrategy: | - Unit tests for auth middleware in tests/auth.test.ts - Integration test for login flow - Run: npm test -- --grep "auth" - Verify JWT token generation and validation# Bad testStrategy (vague, hard to validate)testStrategy: "Make sure it works"
Status Mapping
Taskmaster Status
When to Set
Zeroshot Event
pending
Initial state
-
in-progress
Before running Zeroshot
Task started
done
After successful completion
CLUSTER_COMPLETE
blocked
On failure or need intervention
CLUSTER_FAILED
review
PR created, awaiting human review
Validators passed
Zeroshot Complexity → Taskmaster Priority
Zeroshot's Conductor classifies tasks as:
TRIVIAL: Single agent, no validation (use for low-priority tasks)
SIMPLE: 2 agents, 1 validator
STANDARD: 3 agents, 2 validators
CRITICAL: Opus planner, 5+ validators (use for high-priority tasks)
This aligns naturally with Taskmaster's priority field.
Best Practices
1. Write Detailed Test Strategies
Zeroshot validators need clear, executable success criteria:
- Run `npm test` - all tests must pass
- Run `npm run lint` - no errors
- Run `npm run typecheck` - no type errors
- Manually verify: login page renders correctly
2. Use Subtasks for Complex Features
Break large tasks into smaller, independently executable subtasks:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters