[Back to table of contents](./README.md)

# 06. Handling work split into multiple Tasks (general cycle - medium/large)

## When to use this flow

If any of the following applies, `ywc-plan` routes to this path.

- The change is hard to fit into a single reviewable PR (multiple screens, multiple APIs, multiple subsystems)
- It includes a DB migration (always this path regardless of scale - Safety Invariant)
- It introduces a new Library/Framework (also always this path)

## Overall flow

```
ywc-plan -> ywc-spec-ready -> ywc-task-generator -> ywc-sequential-executor --review or ywc-parallel-executor --review
```

| Step | Skill | Role |
|---|---|---|
| 1 | `ywc-plan` | Analyze the request and create a `docs/ywc-plans/<slug>.md` spec |
| 2 | `ywc-spec-ready` | Automatically repeat `ywc-plan --update-spec` and `ywc-spec-validate` until the spec is `DONE` |
| 3 | `ywc-task-generator` | Decompose the `DONE` spec into dependency-safe Tasks (`tasks/<phase>-<sequence>-<slug>/`) |
| 4 | `ywc-sequential-executor` or `ywc-parallel-executor` | Actually implement Tasks -> PR -> Merge |

**How to choose Sequential vs Parallel**

| Situation | Choice |
|---|---|
| Task order matters, or Tasks depend on one another's outputs | `ywc-sequential-executor` |
| Tasks are independent and grouped into parallelizable waves in `dependency-graph.md` | `ywc-parallel-executor` (isolated with Git Worktrees) |

## Task IDs and collaborator initials

`ywc-task-generator` prefixes task IDs with the collaborator's initials, so several people can generate tasks without number collisions. The old ID `000001-010-db-create-user-table` becomes `yk-000001-010-db-create-user-table`, and the task directory has the same name. Older unprefixed IDs stay valid, are never renumbered, and can coexist with prefixed ones.

- Initials are 2–4 lowercase letters or digits. Numbering is per initials: each person's counter continues from their own highest phase.
- Pass `--initials yk` explicitly, or let the skill resolve them:
  - Claude Code: `--initials` → a `## Task Initials` section in the project `CLAUDE.md` → derived from `git config user.email` / `user.name` and confirmed once (then cached in `CLAUDE.md`). If nothing resolves, the skill falls back to old unprefixed numbering.
  - Codex: `--initials` → project `.codex/ywc.json` → user `~/.codex/ywc.json` → derived and confirmed once (saved via `ywc-setup`). In non-interactive runs with nothing saved, it stops with `NEEDS_CONTEXT` and asks for `--initials`.
- `--mode human|llm` (alias `--granularity`) sets task size. `human` sizes tasks for a person's review of roughly one hour; `llm` sizes them larger, for an agent. If you omit the flag, the skill always asks; it never picks silently.
- Before generating, if `tasks/dependency-graph.md` is longer than 300 lines, the skill compacts it automatically: fully completed phases collapse to a one-line "done" heading. The executors do the same after each task. Nothing for you to write.

## Example run

```
ywc-plan Users need a settings screen and API to turn notification types on/off individually. Support email/push/in-app, 3 channels
```

```
ywc-spec-ready --spec docs/ywc-plans/notification-settings.md
```

```
ywc-task-generator --lang ko
```

The execution commands after this have many options, so they are covered on a separate page: [18. Executor / Code-gen Prompt patterns](./13-executor-and-codegen-patterns.md). The simplest starting point is:

```
ywc-sequential-executor --review
```

If you omit the task, it automatically finds the next executable Task from `dependency-graph.md`.

## Always include `--review`

Both executors use the `--review` flag to automatically run `/ywc-impl-review` before PR creation/merge for each Task. Running without this flag is equivalent to completely skipping the review step in the small cycle from [05](./04-general-cycle-small.md). There is no good reason to omit it. (If a Task has `Criticality: critical`, review is forced regardless of the flag.)

## When you get blocked at each step

| Situation | Action |
|---|---|
| `ywc-spec-ready` reaches the iteration limit | A fundamental spec issue is preventing automatic convergence - read the partial report and edit the spec directly |
| `ywc-task-generator` tries to create 20 or more Tasks | This signals that the spec itself is too large - consider splitting the spec first |
| A dependency is not completed during Task execution | The executor stops automatically and reports which Task must precede the current one |

---

[Previous: 05. Handling a small change (general cycle - small)](./04-general-cycle-small.md) · [Next: 07. Finish automatically from one goal (ywc-agentic)](./06-agentic-autonomous-loop.md)
