divide-and-conquer
Divide and Conquer
Pick up a task and execute it by splitting the work into independent workstreams that run in parallel via subagents.
Instructions
The user's query is in $ARGUMENTS (a task ID like 077 or a task name/keyword).
- Look up the task: Run
taskmd get $ARGUMENTSto find the task- If not found, run
taskmd listto show available tasks and ask the user which one they meant
- If not found, run
- Read the task file with the
Readtool to get the full description, subtasks, and acceptance criteria - Mark the task as in-progress: Run
taskmd set <ID> --status in-progress - Start a worklog entry (if worklogs are enabled):
- Check
.taskmd.yamlforworklogs: true-- only create worklogs if explicitly enabled - If enabled, find or create the worklog file at
tasks/<group>/.worklogs/<ID>.md(ortasks/.worklogs/<ID>.mdfor root tasks) - Append a timestamped entry noting your approach and initial findings
- Check
- Plan and identify workstreams:
- Use
EnterPlanModeto design the overall approach - In the plan, include a reference to the original task ID and task file path
- Analyze the task and break it into independent workstreams — pieces of work that can proceed in parallel without depending on each other's output
- Examples of independent workstreams:
- Implementation code vs. tests vs. documentation
- Changes to separate packages or modules
- Backend changes vs. frontend changes
- If the task is simple enough that parallelization adds no benefit, just do it directly (skip to step 7)
- Use
- Launch subagents in parallel:
- Use the
Agenttool to launch one subagent per independent workstream - Give each subagent a clear, self-contained prompt describing exactly what to do, including relevant file paths and context
- Launch all independent subagents in a single message so they run concurrently
- Use
isolation: "worktree"for subagents that modify files, to avoid conflicts - Wait for all subagents to complete
- Use the
- Coordinate and integrate:
- Review all subagent results for correctness
- If subagents ran in worktrees, merge their changes (review diffs, resolve any conflicts)
- If any subagent failed, handle the failure directly rather than re-launching
- Run tests and linting to verify the integrated result
- Check off subtasks (
- [x]) in the task file as they are completed - Append worklog entries when you make key decisions, hit blockers, or complete significant subtasks
- Write a final worklog entry summarizing what was done, which workstreams ran in parallel, decisions made, and any open items
- Mark the task as done:
- Check
.taskmd.yamlforworkflow: pr-review-- if set, use the PR-review workflow below - Solo workflow (default): Run
taskmd set <ID> --status completed --verify- The
--verifyflag will run any verification checks defined in the task before applying the status change - If verification fails, fix the issues and try again
- The
- PR-review workflow: Open a PR, then run
taskmd set <ID> --status in-review --add-pr <PR-URL>and stop
- Check
Worklog Format
Each worklog entry uses a timestamp heading followed by free-form notes:
## 2026-02-15T10:30:00Z
Started divide-and-conquer execution of the search feature task.
**Workstreams identified:**
1. Core search implementation (subagent — worktree)
2. Test suite (subagent — worktree)
3. Documentation updates (subagent)
**Completed:**
- [x] All subagents finished successfully
- [x] Merged worktree changes
- [x] Tests passing after integration
**Decisions:** Used full-text search with SQLite rather than Elasticsearch.
More from driangle/taskmd
complete-task
Mark a task as completed. Use when the user wants to mark a task as done or complete.
25do-task
Look up a task by ID or name and start working on it. Use when the user wants to pick up and execute a task.
24add-task
Create a new task file following the taskmd specification. Use when the user wants to add a new task to the project.
22import-todos
Discover TODO/FIXME comments in the codebase and convert selected ones into task files. Use when the user wants to turn code TODOs into tracked tasks.
22next-task
Get the next recommended task to work on. Use when the user asks what to work on next or needs a task assignment.
21get-task
Get details of a specific task by ID or name. Use when the user wants to view or look up a task.
20