<< All versions
Skill v1.0.1
currentAutomated scan100/100driangle/taskmd/divide-and-conquer
+4 new
──Details
PublishedAugust 24, 2026 at 05:25 AM
Content Hashsha256:958a88ac2a1f170b...
Git SHAc2725592705f
Bump Typepatch
──Files
Files (1 file, 6.8 KB)
SKILL.md6.8 KBactive
SKILL.md · 95 lines · 6.8 KB
version: "1.0.1" name: divide-and-conquer description: Pick up a task and execute it using subagents to parallelize independent workstreams. Use when the user wants to work on a task with maximum concurrency. allowed-tools: Bash, Read, Glob, Grep, Write, Edit, Task, Agent, EnterPlanMode
Divide and Conquer
Pick up a task and execute it by splitting the work into independent workstreams. Each workstream runs in its own subagent, in its own git worktree, on its own branch — subagents never touch the primary repo checkout. Parallelize only workstreams whose scopes don't overlap; serialize the rest.
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
- Read the task file with the
Readtool to get the full description, subtasks,touchesscopes, 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-- worklogs are opt-in, so skip this step unless the key is explicitly set totrue - 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
- Determine the base branch:
- Default to the current local branch:
git rev-parse --abbrev-ref HEAD - Use a different base only if the user explicitly asked for one
- All subagent branches are created off this base
- Plan workstreams and partition by scope:
- Use
EnterPlanModeto design the overall approach - In the plan, include a reference to the original task ID and task file path
- Break the task into candidate workstreams — pieces of work that could proceed independently. Examples:
- Implementation code vs. tests vs. documentation
- Changes to separate packages or modules
- Backend changes vs. frontend changes
- Assign scopes to each workstream: list the abstract scopes (from the task's
touchesfield and thescopesmap in.taskmd.yaml) plus the concrete file areas each workstream will modify. Resolve scope→path mappings withtaskmd context <ID>when helpful. - Detect overlap: build a scope→workstream map. Two workstreams that share a scope (or otherwise write the same files) must not run in parallel — they would produce merge conflicts.
- Group into batches:
- Workstreams with disjoint scopes go in the same parallel batch.
- Overlapping workstreams are serialized: pick an order, and have the later one branch off the earlier one's completed branch (not the base) so it builds on that work conflict-free.
- If the task is simple enough that a single workstream covers it, just do it directly (skip to step 9)
- Launch subagents — one worktree + branch each:
- Use the
Agenttool withisolation: "worktree"for every subagent that modifies files, so each gets an isolated worktree - Launch all subagents in a parallel batch in a single message so they run concurrently; run serialized (overlapping) workstreams in later messages, after their predecessor finishes
- Give each subagent a self-contained prompt that includes:
- Exactly what to do, with relevant file paths and context
- Its assigned branch name (e.g.
dnc/<task-id>/<workstream-slug>) and its base branch (the task base, or a predecessor's branch for serialized work) - These non-negotiable rules for the subagent:
- "Work only inside your own worktree (your cwd). Do not read-modify-write,
cdinto, or otherwise touch the primary repo checkout at any other path." - "First run
git checkout -b <assigned-branch> <base-branch>so all your commits land on your branch." - "When done, commit your work to your branch with a clear message, then run all verification steps relevant to your changes (build, tests, lint — e.g.
make check) and fix anything that fails before committing the fix." - "Report back: your branch name, final commit SHA, a summary of what changed, and the verification results (pass/fail with details)."
- Wait, then collect results:
- Wait for all subagents in the batch to complete before moving on
- Review each subagent's reported branch, commits, and verification status for correctness
- If a subagent failed or its verification did not pass, handle it directly (inspect its branch, fix, re-verify) rather than blindly re-launching
- Check off subtasks (
- [x]) in the task file as they are completed - Append worklog entries for key decisions, blockers, and completed workstreams
- Write a final worklog entry summarizing what was done, which workstreams ran in parallel vs. serialized, the branches produced, decisions made, and any open items
- Ask the user how to finish — do not auto-commit to the base branch:
- Present a short summary: each workstream, its branch, commit SHA, and verification status
- Ask the user whether they want you to integrate the work now (merge the workstream branches into the base branch and mark the task done) or leave the branches in place for them to review and commit themselves
- Only if the user asks you to integrate:
- Merge each workstream branch into the base branch, resolving any conflicts, and run the full verification suite on the integrated result
- Then mark the task done per
.taskmd.yamlworkflow: - Solo workflow (default):
taskmd set <ID> --status completed --verify(the--verifyflag runs the task's verification checks first; if it fails, fix and retry) - PR-review workflow: open a PR, then
taskmd set <ID> --status in-review --add-pr <PR-URL>and stop - If the user prefers to handle it themselves, leave the branches untouched and stop — do not merge or change task status
Worklog Format
Each worklog entry uses a timestamp heading followed by free-form notes:
markdown
## 2026-02-15T10:30:00ZStarted divide-and-conquer execution of the search feature task.Base branch: `main`.**Workstreams (scope-partitioned):**Parallel batch (disjoint scopes):1.Core search implementation — scope `cli/search` — branch `dnc/077/core` (worktree)2.Documentation updates — scope `docs` — branch `dnc/077/docs` (worktree)Serialized (shares `cli/search` with #1):3.Search test suite — branch `dnc/077/tests`, based off `dnc/077/core`**Results:**-[x] All subagents committed to their branches; verification passed on each-Branches ready for integration; awaiting user decision on merge**Decisions:** Used full-text search with SQLite rather than Elasticsearch.