---
name: decomposing-for-hordes
description: Use when turning a TDD into independent tasks that can run in parallel without shared file writes or dependencies
title: decomposing-for-hordes
canonical_url: https://skilld.dev/gh/heffrey/hordev/decomposing-for-hordes
last_updated: 2026-10-07T12:01:30.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install heffrey/hordev/decomposing-for-hordes`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/decomposing-for-hordes`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/heffrey/hordev/decomposing-for-hordes) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/decomposing-for-hordes`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/decomposing-for-hordes --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/decomposing-for-hordes --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Decomposing for Hordes

Cut a TDD into atomic tasks that can run simultaneously. Parallelism fails when two
tasks touch the same thing, or when a task you planned never goes out at all. This
skill teaches what "the same thing" actually means, and how to check the cut was
delivered whole.

## The unit is a write surface, not a file

The obvious rule — "assign every file to one task" — is where this skill used to
stop, and it is why every collision that matters slipped past it. A file is only
the commonest kind of write surface. Enumerate all five before you cut:

**1. Files a task writes.** The easy case. One owner each.

**2. Files a task *creates*, and everything that then matches them.** A task adding
a new toolchain root — a second app, a nested package, anything with its own
`tsconfig`, `eslint` config or lockfile — silently changes every sibling config
whose glob now sweeps it up. The new directory has an owner. *The existing configs
it breaks do not.* Nobody wrote them, so nobody checked them, and the failure
surfaces as dozens of errors in an app nobody touched.

**3. Config and environment files, which are shared state wearing a file's clothes.**
An `.env.local`, a `docker-compose.yml`, a `project.yml`. Two writers here do not
merge badly — one silently replaces the other's working state, and the product keeps
running while showing the wrong thing.

**4. Live external state.** A database, a running dev server, a port, a cloud
project. Two tasks that both run migrations, or both restart a server, or both
`db reset`, are colliding even though they share no file.

**5. Your own hands.** You are a writer. Ownership gets reasoned about
agent-versus-agent, so an orchestrator who assigns a file and then edits it too is
the collision nobody is looking for. If you will touch it during the wave, you own
it and no agent gets it — otherwise the agent reports your edits as mysterious
changes appearing under it, and is right to.

**A near-miss is a collision.** Two writers where one happened to land last is luck,
not isolation. Count it, fix the cut, and log it — especially on a config file,
where the loser's version can replace a working backend with fixtures and nothing
looks broken.

## Independence Test

Two tasks can run in parallel if ALL of these hold:

- **No shared write surface.** All five kinds above, not just files.
- **No ordering dependency.** Task B does not need Task A's output or side effects.
- **Input is complete.** Both have all context inlined in the prompt. They cannot see
  the conversation, your changes, or each other.

## What Stays With You

Decide these before dispatch; every parallel task compiles against them:

- **Schema and data model.** Define once, implement against it in parallel.
- **Interface contracts.** Function signatures, API paths, event shapes.
- **Shared configuration.** Env vars, feature flags, runtime settings.
- **Any config a new task will newly match** (surface 2 above).
- **Anything you intend to edit yourself** (surface 5).
- **Artifact paths and formats.** Shared artifacts — spec files under `.hordev/specs/`,
  TDD files, `.hordev/run-log.md`, assumption entries — are interfaces, not
  incidentals. Fix the canonical path and inline the exact format in every agent
  prompt that reads or writes one. An agent that invents a format for a shared
  artifact was not shown it.

"Locked" means decided, not blessed. There is no approval gate here.

## Resolving a contested surface

**Split it.** Separate concerns into two files, one owner each.

**Sequence just those two.** Everything else stays parallel; those two run in
successive waves.

**Keep it.** It becomes yours, and no agent gets it.

## Task Sizing

- **One clear deliverable.** "Write the API endpoint", not "write backend and frontend".
- **Self-contained.** All context inlined; the agent sees no history.
- **Haiku-sized.** 15–30 minutes for a cheap fast model. Deeper reasoning folds into
  orchestration.

## Waves

When Task B genuinely needs Task A's output, stage rather than serialise:

**Wave 1 (parallel):** A, C, D. **Wave 2 (parallel):** B (uses A), E.

Wait for Wave 1 to land before Wave 2. Waves preserve the parallelism that exists;
falling back to fully sequential throws it away.

## The cut is a checklist, not a description

**Write the task list down, numbered, with owned surfaces — then dispatch off that
list, not off your memory of it.**

This is the failure that hides best. A plan of sixteen tasks dispatched as ten
produces ten green tasks, a building tree, and a passing suite. It looks exactly
like a finished run. Nothing downstream asks "was anything never sent out" —
reconciliation checks what came back.

Two rules:

- Before the first agent goes out, mark every task **dispatched** or **deferred with
  a reason**. "Later" is a reason; silence is not.
- Tasks in a different repository are the ones most likely to evaporate. They cannot
  share the worktree, so they get mentally filed as separate work and never
  re-surface. Give them a wave of their own rather than a footnote.

## Worked Example: settings page + a new admin app

**Orchestrator decides:** `PATCH /users/:id` with `{ timezone, theme }`; columns
`users.timezone`, `users.theme`; and — because task 5 creates a new toolchain root —
the root `tsconfig` and `eslint` excludes, which are **yours**, in Wave 0.

| # | Task | Owns |
|---|---|---|
| 0 | *(you)* | root `tsconfig.json`, `eslint.config.mjs`, the API contract, the schema |
| 1 | Backend route | `src/routes/users.ts` |
| 2 | Settings form | `src/components/SettingsForm.tsx` |
| 3 | Timezone list | `src/utils/timezones.ts` |
| 4 | Theme provider | `src/context/ThemeContext.tsx` |
| 5 | Admin app | `admin/**` — new toolchain root, hence task 0 |

1–5 run at once. Task 2 imports 3 and 4 without modifying them. Task 5 would have
broken 1–4's typecheck if task 0 had not existed.

## Handoff to `dispatching-hordes`

- Run the independence test over all five surface kinds.
- Confirm every planned task is dispatched or deferred with a reason.
- **Set up isolation per `isolating-horde-workspaces` first.** A horde dispatched
  without a worktree is writing to the user's checkout.
- Invoke `dispatching-hordes` in the same turn. Making the cut is the go signal;
  stopping to confirm the wave is an approval gate hordev does not have.

## Log what went wrong

Append an entry to `.hordev/run-log.md` (format in `improving-hordev`) when a
cut turns out wrong: two writers on one surface, a task too large for one agent, a
missed dependency, or a planned task that never went out. Decomposition failures
surface late and are easy to forget by the time they hurt.

## Battle cry

"Swobu." — *as you command*, when the cut is made and no two tasks want the same
surface.

Once, at that moment — not every message, and never two messages running. Full
rules in `using-hordev` § Voice: conversational output only, never in artifacts,
never on bad news.
