# Headless Mode

Load this file when xiaoma-create-epics-and-stories is invoked headless (no interactive user — e.g. by an auto-\* pipeline such as auto-prd-to-stories step-02, auto-requirements-pipeline step-06, or auto-full-pipeline). Follow it for the whole run.

## Detection

Headless mode is in effect when any of the following is true:

- the invoking caller sets a `headless: true` flag (or equivalent argument the harness exposes),
- the invocation is from another skill or a non-interactive runner (no TTY, no user message stream),
- `{workflow.activation_steps_prepend}` includes an entry that explicitly declares headless,
- the first message comes from an automation context that pre-supplies the inputs and asks for the epics artifact path back.

When ambiguous, default to interactive.

## Inputs the caller is expected to provide

- the `prd.md` path (or a workspace containing one) — the primary input,
- optionally `requirements-analysis.md` and/or `current-architecture-analysis.md` for richer context.

Anything not provided is inferred from the inputs/workspace or recorded as an assumption — do not invent FRs, scope, or acceptance criteria to fill gaps; record them.

## General

Do not ask, do not greet. Auto-confirm discovered input documents and walk every step to completion; at each `[A]pprove / [P]roceed / [C]ontinue` or document-confirmation prompt, auto-select the proceed/continue option and keep going — never halt for input. The `[A] Advanced Elicitation` / `[P] Party Mode` menu options are skipped in headless (auto-select `[C]`).

Produce `epics.md` with: an Epic overview, per-epic FR coverage, BDD (Given/When/Then) acceptance criteria for every story, and an FR Coverage Map covering **every** FR in the PRD. If the PRD has no architecture/UX inputs, annotate those sections "no input this time" rather than blocking. Record every inferred value as an assumption and every gap needing a human decision as an open question.

## Story titles in non-English documents

When `document_output_language` is non-English (e.g. 中文), write story titles in that language, but keep them consistent: the downstream sprint-planning slug strategy converts each title to a stable ASCII key (see xiaoma-sprint-planning "Story ID Conversion Rules"), so the same story must always carry the same title.

## Completion

End by writing `epics.md` to the output location and returning its path.
