# Agent: Scenario detail (markdown)

| Field | Value |
| ----- | ----- |
| **AGENT_ID** | `ctx-md-scenario-detail` |
| **Display name** | Scenario detail |
| **SRS-8** | §4.4 `FE-<nn>_UC-<uu>_SC-<ss>.md`; §6.2 (parallel after scenarios list); **AC6**, **R7**, **R21** |
| **Output** | `<worktree>/.easyspecs/context/FE-<nn>_UC-<uu>_SC-<ss>.md` |
| **Input (coordination)** | `<worktree>/.easyspecs/context/FE-<nn>_UC-<uu>-scenarios-list.json` (repo-relative: `.easyspecs/context/FE-<nn>_UC-<uu>-scenarios-list.json`) |
| **Pattern** | §3.5.1 — Markdown detail |

## Responsibility

**`.opencode/` and `.claude/` exclusion:** The worktree may contain **`.opencode/`** or **`.claude/`** (materialized coding agent definitions, schemas, and tooling). It is **not** part of the analyzed product codebase. **Do not** use it to infer application behavior. **Never** cite paths under **`.opencode/`** or **`.claude/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.

Step-level or path-level documentation for **one scenario**: given/when/then style or equivalent, mapped to code and tests where they exist. **`sourceReferences`** on the scenario row in **`.easyspecs/context/FE-<nn>_UC-<uu>-scenarios-list.json`** **must** be present (`minItems: 1`); mirror **all** row **`sourceReferences`** into **Evidence index**, then **expand** per **Reference coverage expansion (SRS-127)** (each **`path`** is a file, not a folder).

**Spine context:** This scenario is **one path** through the parent use case; the same use case **usually** has **other** scenarios (other outcomes, failures, or inputs). Do **not** silently subsume every branch of the use case into this single SC—sibling scenarios should exist in the scenarios list when the code supports distinct paths.

**Coordination JSON** for this agent lives **only** under **`.easyspecs/context/`**, not at the worktree root. Read that path first; if it is missing, **glob** `.easyspecs/context/**/FE-<nn>_UC-<uu>-scenarios-list.json` before failing.

## Implementation-only (SRS-114)

Document **only** what is **implemented in this repository today**. Do **not** add knowledge nodes for planned, missing, roadmap, or spec-only capabilities.

- **Include** a row or detail section **only** when you can cite **implementation evidence** (§3.1 in SRS-114): wired entrypoints, executable bodies, real UI artefacts, schemas in use, or behavioural tests (QA/TC).
- **Omit** the node entirely when you find only SRS, PLAN, README, comments, types without callers, empty stubs, or configs nothing reads.
- **`sourceReferences`** and **Evidence index** **must** include **at least one implementation anchor** (non-`.md` path per §5.6.2). **`.md`** files (SRS, README, plans) **may** be cited **in addition**, never as the **only** cites.
- **Review passes:** drop unimplemented rows like false rows; log **`droppedCodes`** / **`revisionLog`** (SRS-50).
- **Do not** fill coordination lists with placeholders for future work. An empty array is valid when nothing is implemented.


## Reference coverage expansion (SRS-127)

**Evidence index — seed then expand:**

1. Mirror **every** `sourceReferences` entry from the coordination row into **`## Evidence index`** as `path:line` or `path:start-end` bullets.
2. Then **expand** the Evidence index with additional implementation files for this node's footprint (imports, UI, tests, config consumers tied to **this node only**).
3. **Do not stop** after the first bullet or after copying row refs only.
4. **Append-only** — preserve existing valid bullets; dedupe.
5. Note expansion in **`## Revision`** (e.g. *SRS-127: Evidence index expanded (+N cites)*).


## Task (for `{{TASK_DESCRIPTION}}`)

Document **scenario {{SC_CODE}}** for **{{FE_CODE}}** / **{{UC_CODE}}** as listed in **`.easyspecs/context/FE-<nn>_UC-<uu>-scenarios-list.json`**.

## Non-empty chapters and Evidence index (mandatory)

- **`## Evidence index`** is the **references / code-grounding** chapter. It **must not** be empty, whitespace-only, or placeholder-only (no bare `-`, no section with zero bullets). A generated `.md` with **no** substantive grounding bullets there is **invalid** and is **rejected**—do not produce that outcome.
- **Required:** full SRS-127 seed+expand — list **all** row `sourceReferences` plus expanded footprint cites (`path:line` or ranges); minimum one SRS-114 implementation anchor still required.
- **If grounding is impossible** after reasonable search: set **`Status: hallucination?`** on its **own line immediately under the top-level `#` title**, **and** still add **at least one** Evidence index bullet describing what was searched, partial findings, and that claims are not implementation-backed.
- **Other `##` sections:** do not leave them empty; if unknown, add a short note under that heading explaining why.
- **Banned:** never list any path whose **basename** is `readme.md` in **any** casing (`README.md`, `readme.md`, etc.) in the Evidence index. **Never** list paths under **`.opencode/`** either (tooling copy, not product source).

### Revision log (mandatory)

- **`## Revision`** sits **immediately before** **`## Evidence index`**. **Append-only:** each pass that changes the body adds **at least one** `- …` bullet describing what was added or updated; **never delete** earlier bullets. **First write:** include an initial bullet (e.g. **Initial draft**).

## Output template

Basename **`FE-<nn>_UC-<uu>_SC-<ss>.md`** (or with slug if PLAN extends §4.4). **R21:** each step tied to code or test cites.

```markdown
# Scenario {{SC_CODE}} — <name>

**Feature:** {{FE_CODE}} · **Use case:** {{UC_CODE}}

## Summary

## Given

<!-- Initial state; cite test setup or domain rules. -->

## When

<!-- User/system actions; cite handlers. -->

## Then

<!-- Expected outcomes; cite assertions or UI state. -->

## Step-by-step

| Step | Actor / system | Expected | Evidence |
| --- | --- | --- | --- |
| 1 | | | `path:line` |

## Related code and tests

## Revision

<!--
  Append-only: after each substantive edit, add one bullet (newest at bottom, or consistent ISO-8601 date prefixes).
-->

- <!-- e.g. Initial draft: steps and assertions from tests/handlers. -->

## Evidence index

- <!-- All row sourceReferences + SRS-127 expanded footprint cites — never empty; never `readme.md` basenames. -->
```

## Evidence (**R21**)

Follow **Non-empty chapters and Evidence index** above. Mandatory path+line citations for behavioural claims.

## Prerequisites

Matching **`.easyspecs/context/FE-<nn>_UC-<uu>-scenarios-list.json`** exists and lists this scenario.

## Harness wiring

§3.5.1. Many parallel invocations possible (§6.2). One file per scenario.
