# Feature: Choosing the approach (free-text tasks without an analysis document)

**When**: Phase 1, after codebase exploration (Step 3) and before the
analysis document (Step 4), when all of these hold:

- `state.inputType === "free-text"`;
- no analysis document is behind the run: no `/multi-agent:analysis` output
  linked in `state.contextLinks[]`, and Step 4 would not reuse a cached one;
- `prefs.global.approachChoice.enabled` is not `false` (default on).

A Jira or GitHub item carries a stated intent and an analysis document is a
decided design; both skip this step.

## 1. Write the alternatives

From what Step 3 found, write `<worktree>/.pipeline/approaches.json`: two or
three approaches that would each satisfy the task, each with a `title`, a
one-sentence `summary`, `pros[]`, `cons[]`, the `modules[]` it touches and an
`estFiles` count, plus the `recommended` id. Real alternatives differ in
where the change lives or what it costs later (a new module against an
extension, a migration against an adapter), not in naming.

When exploration found one sensible way only (a config value, a one-line
guard), write `{"skip": {"reason": "..."}}` instead and say why. Never invent
a weaker option to reach two.

```bash
node $HOME/.claude/scripts/approach-choice.mjs check --file "$WORKTREE/.pipeline/approaches.json"
```

Exit 1 lists what is missing; fix and run again. Exit 2 is the skip: log
`Phase 1: approach choice - skipped (<reason>)` and go on to Step 4.

## 2. Choose

**Attended**: `approach-choice.mjs options --file ...` prints the options,
recommended first. Ask one `AskUserQuestion` per `$HOME/.claude/multi-agent-refs/picker-contract.md` (`header` "Approach"; question,
labels and descriptions in `outputLanguage`), then record the pick:

```bash
node $HOME/.claude/scripts/approach-choice.mjs choose \
  --file "$WORKTREE/.pipeline/approaches.json" --pick <id> --state "$STATE_FILE"
```

**Autopilot**: no question. The run takes the recommended approach and
writes why, from the evidence of Step 3 (files, callers, existing patterns):

```bash
node $HOME/.claude/scripts/approach-choice.mjs choose --file ... \
  --pick <recommended id> --why "<evidence for it>" --state "$STATE_FILE"
```

The script refuses any other pick unattended, requires `--why`, and adds the
choice to `decisions[]`, so the PR body and the Phase 5 report show it.

## 3. Downstream

`state.approachChoice` is the design input of Step 4 and Step 6: the analysis
document and the task graph build the chosen approach only. The plan critic's
cheaper-alternative lens starts from `rejected[]` and their cons rather than
inventing new ones.
