# Agent: Feature detail (markdown)

| Field | Value |
| ----- | ----- |
| **AGENT_ID** | `ctx-md-feature-detail` |
| **Display name** | Feature detail |
| **SRS-8** | §4.3 `FE-<nn>-<slug>.md`; §6.2 (parallel after `features-list.json`); **R7**, **AC5**, **R21** |
| **Output** | `<worktree>/.easyspecs/context/FE-<nn>-<slug>.md` |
| **Input (coordination)** | `<worktree>/.easyspecs/context/features-list.json` (repo-relative: `.easyspecs/context/features-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.

**Functional and technical** documentation for **one feature** whose **`code`** and **`slug`** come from **`.easyspecs/context/features-list.json`**. Feeds human-readable depth; structure for the index comes from JSON lists. That row **must** include **`sourceReferences`** (`minItems: 1`); mirror **all** row **`sourceReferences`** into **Evidence index**, then **expand** per **Reference coverage expansion (SRS-127)** (do not stop after the first cite). In list JSON, **`sourceReferences[].path`** is always a **file**, never a folder.

**Spine context:** Non-trivial features **typically** map to **multiple** use cases in **`FE-<nn>-use-cases-list.json`**. In **Summary** or **Scope**, avoid implying this feature is a single monolithic journey when the codebase supports several; you may briefly point readers at sibling UCs by code/name when helpful.

**Coordination JSON** lives **only** under **`.easyspecs/context/`**, not the worktree root. Read that path first; if missing, **glob** `.easyspecs/context/**/features-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 feature **{{FE_CODE}}** (name/slug from list): scope, behaviour, main dependencies, entry points, and links to code. Ground all claims in the worktree.

## 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

Write **exactly** the content for **`{{OUTPUT_FILE_ABSOLUTE}}`**. Basename **must** be **`{{OUTPUT_BASENAME}}`** (e.g. `FE-01-user-auth.md`). **R21:** mirror substantive claims under **Evidence index** with file+line cites or labelled inference.

```markdown
# Feature {{FE_CODE}} — <name from features-list>

**Slug:** <slug>  
**Output file:** {{OUTPUT_BASENAME}}

## Summary

## Scope

<!-- In / out of scope for this feature. -->

## Functional behaviour

<!-- User-visible capabilities; cite UI/routes/handlers. -->

## Technical design

<!-- Modules, services, data touched; cite implementation. -->

## Entry points

<!-- Routes, CLI, jobs, public APIs; cite definitions. -->

## Dependencies

<!-- Other features, libs, external APIs; cite manifests and imports. -->

## Open questions

## Revision

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

- <!-- e.g. Initial draft: scope and behaviour from implementation reads. -->

## 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. File + line citations for substantive statements; **`{{OUTPUT_BASENAME}}`** must match §4.3.

## Prerequisites

Valid **`.easyspecs/context/features-list.json`** with this feature row.

## Harness wiring

§3.5.1. One markdown file per invocation; orchestration sets output path from FE code and slug.
