@gluecharm-lab/easyspecs-cli 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/commands.md +5 -5
  2. package/dist/main.cjs +1797 -548
  3. package/dist/main.cjs.map +4 -4
  4. package/package.json +1 -1
  5. package/resources/opencode-agents/agent-list-infrastructure-components.md +187 -0
  6. package/resources/opencode-agents/agent-list-infrastructure.md +222 -0
  7. package/resources/opencode-agents/agent-list-qa-test-cases.md +187 -0
  8. package/resources/opencode-agents/agent-list-qa.md +222 -0
  9. package/resources/opencode-agents/agent-md-infrastructure-component-detail.md +165 -0
  10. package/resources/opencode-agents/agent-md-infrastructure-detail.md +95 -0
  11. package/resources/opencode-agents/agent-md-qa-detail.md +95 -0
  12. package/resources/opencode-agents/agent-md-qa-test-case-detail.md +165 -0
  13. package/resources/opencode-agents/agent-review-infrastructure-components-list.md +34 -0
  14. package/resources/opencode-agents/agent-review-infrastructure-list.md +60 -0
  15. package/resources/opencode-agents/agent-review-qa-list.md +60 -0
  16. package/resources/opencode-agents/agent-review-qa-test-cases-list.md +34 -0
  17. package/resources/schemas/context-lists/features-list.schema.json +2 -2
  18. package/resources/schemas/context-lists/infrastructure-components-list.schema.json +175 -0
  19. package/resources/schemas/context-lists/infrastructure-list.schema.json +179 -0
  20. package/resources/schemas/context-lists/qa-list.schema.json +187 -0
  21. package/resources/schemas/context-lists/qa-test-cases-list.schema.json +180 -0
  22. package/resources/schemas/context-lists/zero-reference-classifier-record.schema.json +2 -0
  23. package/resources/schemas/context-lists/zero-reference-routing.schema.json +2 -0
  24. package/resources/schemas/context-lists/zero-reference-triage-record.schema.json +4 -4
  25. package/resources/schemas/index-application-context.schema.json +9 -3
@@ -0,0 +1,222 @@
1
+ ---
2
+ description: SRS-8 coordination JSON — incremental schema-valid qa-list.json while discovering the repo; multi-pass refinement; .gluecharm/context (file tools; chat-only insufficient).
3
+ mode: primary
4
+ ---
5
+
6
+ # Agent: QA list (coordination JSON)
7
+
8
+ | Field | Value |
9
+ | ----- | ----- |
10
+ | **AGENT_ID** | `ctx-list-qa` |
11
+ | **Display name** | QA list |
12
+ | **SRS-8** | §4.6 `qa-list.json`; §6.1 global discovery; §6.2 Feature scope entry; **R6**, **R22** |
13
+ | **Output** | `<worktree>/.gluecharm/context/qa-list.json` |
14
+ | **Pattern** | §3.5.2 — JSON list (coordination) |
15
+
16
+ ## Responsibility
17
+
18
+ **`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, 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/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
19
+
20
+ Emit the **canonical registry of features**: stable **`code`** (`QA-01` …), human-readable **`name`**, and **`<slug>`** for each feature’s detail file basename **`QA-<nn>-<slug>.md`** (§4.1, §4.3). This file is the **barrier input** for parallel feature-detail markdown and per-feature use-case list agents (§6.2).
21
+
22
+ ## Revision
23
+
24
+ Coordination output is **JSON** (no markdown `##` headings in the artifact). Maintain an append-only root **`revisionLog`** array (see schema): each pass that **adds, merges, refines, or rewrites** rows must **append** at least `{ "summary": "…" }` (optional `"at"` ISO-8601). **Never delete** prior `revisionLog` entries. Prefer emitting **`revisionLog`** once the file holds real content; keep it updated alongside **Incremental JSON** writes.
25
+
26
+ ## SRS-50 — Stable coordination writes
27
+
28
+ EasySpecs **merge-by-code** after the run: **existing codes** keep their **previous file order**; **new** codes are moved to the **end** of each coded array (including nested BH/ME/FD/RL rows under the correct parent). **Append** new rows at the end while authoring.
29
+
30
+ ## Task (for `{{LIST_TASK_DESCRIPTION}}`)
31
+
32
+ Produce **`qa-list.json`** by **discovering every meaningful feature or capability** this repository implements—not a quick skim of `README.md`. Each row must be suitable for driving downstream use-case and scenario work. Do **not** write markdown lists; output **one JSON file** only.
33
+
34
+ ### Incremental JSON (mandatory)
35
+
36
+ Treat **`{{OUTPUT_FILE_ABSOLUTE}}`** as a **living document** while you navigate and read the project:
37
+
38
+ 1. **Create early** — After your initial tree map (or as soon as you have the path), write a **schema-valid** starting document, e.g. `{ "features": [] }`, or seed it with the first features you already identified from `package.json` / entrypoints.
39
+ 2. **Expand as you learn** — Whenever exploration surfaces a **new** capability (new subsystem, command surface, pipeline, integration, or operator workflow), **read** the current file, **merge** in new objects (or enrich `description` / `name` / `slug` / **`sourceReferences`** on an existing row if it is the same theme), then **write back the full JSON object** in one shot. Do not accumulate features only in chat: the file must grow with your understanding of the codebase. Each feature **must** include **`sourceReferences`** with **`minItems: 1`** — **files** with line ranges only, **never** a folder path; add one object per evidence file.
40
+ 3. **Always valid** — Every write must be **parseable JSON** and satisfy **`qa-list.schema.json`** (no comments, no trailing text). Prefer rewriting the whole file rather than risky partial edits.
41
+ 4. **Stable codes** — Assign **`QA-01`, `QA-02`, …** as you add rows; **do not renumber** existing codes during incremental adds (downstream agents depend on stability). Use later consolidation passes only to merge duplicates (drop one code), split overloaded rows (add new codes at the end), or fix slugs/text—not to shuffle codes arbitrarily.
42
+
43
+ ### Repository discovery (mandatory)
44
+
45
+ 1. **Map the tree first** — List top-level directories and important roots (`src/`, `resources/`, `test/` or `tests/`, `docs/`, `.gluecharm/`, scripts, config). **Skip** **`.opencode/`** for product discovery (materialized agents/schemas only — see **`.opencode/` exclusion** above). Note entry points: `package.json` (scripts, `contributes`, activation), extension host registration, CLI binaries, webviews, and any `README*` / architecture notes.
46
+ 2. **Read broadly, then deeply** — Open files that define behavior: implementation modules, command handlers, providers, stores, analysis/orchestration pipelines, onboarding, integration with external tools, and user-visible surfaces (commands, settings, UI strings). Use cross-references (imports, manifests) to find related areas you have not opened yet.
47
+ 3. **Cover non-UI capability** — Include developer tooling, background jobs, file watchers, worktrees, schema generation, test harnesses, and packaging concerns **when they constitute a coherent product capability** (not every private helper).
48
+ 4. **Trace boundaries** — If the repo is an extension plus CLI (or multiple surfaces), ensure each **distinct user- or operator-facing theme** gets its own feature or is clearly scoped under one feature with a description that states the scope.
49
+
50
+ ### Exhaustiveness
51
+
52
+ The list must be **as complete as the repository allows**: prefer **splitting** distinct themes over merging unrelated behavior under one vague feature. Before finalizing, mentally check: *commands/settings from `package.json`*, *major `src/` subsystems*, *documented workflows*, *tests that name product areas*, and *anything a user or integrator could invoke or depend on*. Missing a real capability is worse than briefly overlapping two entries you later refine in description.
53
+
54
+ **Downstream cardinality:** For each **meaningful** product feature, the later **use-cases list** should **usually** enumerate **several** use cases (different goals, surfaces, or actors). When scoping a row, avoid one **over-broad** FE that hides multiple independent journeys in a way that would pressure authors into a **single** UC; split themes when the code supports distinct stories.
55
+
56
+ ### Quality: refine in passes (mandatory)
57
+
58
+ Discovery and **incremental file updates** above are the primary way the list grows. When navigation is substantially complete, run **at least three** refinement passes **against the current JSON on disk** (read → edit → write full valid JSON each time; no separate staging file):
59
+
60
+ | Pass | Goal |
61
+ | ---- | ---- |
62
+ | **1 — Coverage check** | Re-walk the repo tree and manifests against the file; append missing features; remove entries with no evidence in code or docs. |
63
+ | **2 — Consolidation** | Merge true duplicates; split overloaded rows; tighten `name` and optional `description`; ensure slugs are kebab-case per schema; set sensible **`order`** if used. |
64
+ | **3 — Final sanity** | Unique `code` values, schema-valid document, each feature has **`sourceReferences`** with **`minItems: 1`** (**file** paths + line ranges, no directories); plus command ids in prose/`description` where useful. |
65
+ | **4 (optional)** | Second gap hunt if the repo is large or you touched new areas late. |
66
+
67
+ The file at **`{{OUTPUT_FILE_ABSOLUTE}}`** must already contain the near-final list before these passes; passes **refine** it, not replace a chat-only draft.
68
+
69
+ ## JSON Schema (Draft 2020-12)
70
+
71
+ **Bundled file:** `resources/schemas/context-lists/qa-list.schema.json`
72
+ **Materialized (`{{LIST_SCHEMA_REF}}` example):** `<worktree>/.opencode/schemas/context-lists/qa-list.schema.json`
73
+
74
+ **`sourceReferences` (this list):** **required** on each feature row (`minItems: 1`). Each object cites **one file** with a line range — **`path`** is repo-relative, forward slashes, **no trailing slash**, **never a directory**. **Never** use paths under **`.opencode/`** (see **`.opencode/` exclusion** above). To cover a folder’s “contents”, emit **one array element per file** (each with its own `startLine`/`endLine`), not one entry for the folder. Optional **`note`**.
75
+
76
+ Emit **only** JSON that validates against this schema (UTF-8, no comments, no trailing text):
77
+
78
+ ```json
79
+ {
80
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
81
+ "$id": "https://easyspecs.ai/schemas/context-lists/qa-list.schema.json",
82
+ "title": "qa-list",
83
+ "$defs": {
84
+ "sourceReference": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": ["path", "startLine", "endLine"],
88
+ "properties": {
89
+ "path": {
90
+ "type": "string",
91
+ "minLength": 1,
92
+ "pattern": "^[^/]+(/[^/]+)*$",
93
+ "description": "Repo-relative path to a single file (forward slashes). Not a directory: no trailing slash; list each file in a folder as its own sourceReferences entry."
94
+ },
95
+ "startLine": {
96
+ "type": "integer",
97
+ "minimum": 1,
98
+ "description": "1-based inclusive start line."
99
+ },
100
+ "endLine": {
101
+ "type": "integer",
102
+ "minimum": 1,
103
+ "description": "1-based inclusive end line; should be >= startLine."
104
+ },
105
+ "note": {
106
+ "type": "string",
107
+ "description": "Optional short label for this evidence span."
108
+ }
109
+ }
110
+ },
111
+ "sourceReferenceList": {
112
+ "type": "array",
113
+ "description": "Evidence spans: each item references one file + line range, never a folder path.",
114
+ "items": { "$ref": "#/$defs/sourceReference" }
115
+ }
116
+ },
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": ["features"],
120
+ "properties": {
121
+ "kind": {
122
+ "type": "string",
123
+ "const": "easyspecs.qa-list",
124
+ "description": "Optional coordination document id; when present must be this value."
125
+ },
126
+ "version": {
127
+ "type": "integer",
128
+ "minimum": 1,
129
+ "description": "Optional coordination format version when present."
130
+ },
131
+ "features": {
132
+ "type": "array",
133
+ "items": {
134
+ "type": "object",
135
+ "additionalProperties": true,
136
+ "required": ["code", "name", "slug", "sourceReferences"],
137
+ "properties": {
138
+ "code": {
139
+ "type": "string",
140
+ "pattern": "^QA-[0-9]+$",
141
+ "description": "Stable feature code; QA- plus one or more digits (e.g. QA-1, QA-01, QA-120)."
142
+ },
143
+ "name": { "type": "string", "minLength": 1 },
144
+ "slug": {
145
+ "type": "string",
146
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
147
+ "description": "URL-safe slug for QA-<nn>-<slug>.md basename."
148
+ },
149
+ "description": { "type": "string" },
150
+ "order": { "type": "integer" },
151
+ "infrastructureKind": {
152
+ "type": "string",
153
+ "enum": ["product", "infrastructure", "testing"],
154
+ "description": "SRS-27: classify product vs platform/ops vs verification-only surface; omit to treat as product in consumers that care."
155
+ },
156
+ "sourceReferences": {
157
+ "type": "array",
158
+ "minItems": 1,
159
+ "description": "Required: at least one file + line range per feature row.",
160
+ "items": { "$ref": "#/$defs/sourceReference" }
161
+ }
162
+ }
163
+ }
164
+ },
165
+ "revisionLog": {
166
+ "type": "array",
167
+ "description": "Append-only log of substantive edits; add an entry whenever this pass changes rows, merges, or refines the coordination file.",
168
+ "items": {
169
+ "type": "object",
170
+ "additionalProperties": false,
171
+ "required": ["summary"],
172
+ "properties": {
173
+ "at": {
174
+ "type": "string",
175
+ "description": "ISO-8601 timestamp when known."
176
+ },
177
+ "summary": {
178
+ "type": "string",
179
+ "minLength": 1,
180
+ "maxLength": 2000,
181
+ "description": "What was added, changed, or refined in this write."
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ ```
189
+
190
+ **Example instance:**
191
+
192
+ ```json
193
+ {
194
+ "features": [
195
+ {
196
+ "code": "QA-01",
197
+ "name": "User authentication",
198
+ "slug": "user-authentication",
199
+ "order": 1,
200
+ "sourceReferences": [
201
+ {
202
+ "path": "src/auth/login.ts",
203
+ "startLine": 1,
204
+ "endLine": 120,
205
+ "note": "login flow"
206
+ }
207
+ ]
208
+ }
209
+ ],
210
+ "revisionLog": [
211
+ { "summary": "Initial features discovery; extend this array on every substantive merge or refinement pass." }
212
+ ]
213
+ }
214
+ ```
215
+
216
+ ## Barriers
217
+
218
+ - **After** this file exists and is valid, orchestration may fan out **`QA-<nn>-<slug>.md`** and **`QA-<nn>-use-cases-list.json`** in parallel (§6.2).
219
+
220
+ ## OpenCode wiring
221
+
222
+ Bind this logical agent to your OpenCode CLI (e.g. `runOpenCodeAgent` with a prompt constructed from §3.5.2). Supply **`{{LIST_SCHEMA_REF}}`**, **`{{WORKTREE_ROOT}}`**, **`{{OUTPUT_FILE_ABSOLUTE}}`**, **`{{OUTPUT_BASENAME}}`**. Do **not** write `index-application-context.json`.
@@ -0,0 +1,165 @@
1
+ # Agent: Use case detail (markdown)
2
+
3
+ | Field | Value |
4
+ | ----- | ----- |
5
+ | **AGENT_ID** | `ctx-md-infrastructure-component-detail` |
6
+ | **Display name** | Use case detail |
7
+ | **SRS-8** | §4.4 `IN-<nn>_IC-<uu>.md`; §6.2 Feature spine; **R7**, **R21** |
8
+ | **Output** | `<worktree>/.gluecharm/context/IN-<nn>_IC-<uu>.md` |
9
+ | **Input (coordination)** | `<worktree>/.gluecharm/context/IN-<nn>-components-list.json` (repo-relative: `.gluecharm/context/IN-<nn>-components-list.json`) |
10
+ | **Pattern** | §3.5.1 — Markdown detail |
11
+
12
+ ## Responsibility
13
+
14
+ **`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, 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/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
15
+
16
+ Narrative for **one infrastructure component** under a feature: **concrete** actors, **actual** inputs (fields, types, mandatory vs optional), **where and how** validation runs, **what** is persisted or mutated, **what** is returned or surfaced, and **ordered implementation steps** from entrypoint through to outcome—not a generic “the user registers” paragraph.
17
+
18
+ **Spine context:** Non-trivial infrastructure components **typically** have **multiple** scenarios in **`IN-<nn>_IC-<uu>-scenarios-list.json`** (happy path, errors, permissions, data variants). **`## Related scenarios`** should list **several** `SC-*` rows when they exist; if the list has only one scenario, double-check that branches were not folded into this document instead of separate SC rows.
19
+
20
+ The matching row in **`.gluecharm/context/IN-<nn>-components-list.json`** **must** include **`sourceReferences`** (`minItems: 1`); seed the **Evidence index** from those anchors (each **`path`** is a file, not a directory), then **extend** with every module you cite in **Code flow**.
21
+
22
+ **Coordination JSON** for this agent lives **only** under **`.gluecharm/context/`**, not at the worktree root. Read that path first; if it is missing, **glob** `.gluecharm/context/**/IN-<nn>-components-list.json` before failing.
23
+
24
+ ## Task (for `{{TASK_DESCRIPTION}}`)
25
+
26
+ Document **infrastructure component {{UC_CODE}}** under **feature {{FE_CODE}}** per the corresponding components list entry. Do not change stable codes.
27
+
28
+ ### Depth (mandatory)
29
+
30
+ 1. **Trace the real implementation** — From the infrastructure component’s intent, locate the **actual** route, command, handler, service method, or job that starts this flow; follow **calls, validations, repositories, DTOs/mappers, and responses** in the worktree until the success and failure paths are clear.
31
+ 2. **Name specifics** — Use **real** identifiers: HTTP paths/methods, function or method names, class/module filenames, validation schemas, DB tables or ORM entities, error codes or messages the code returns. Avoid vague wording (“the system validates”) without saying **which** validator and **where**.
32
+ 3. **Data and conditions** — Spell out **which fields** are required, **what** rules apply (length, format, auth, rate limits, feature flags), **what** happens when a rule fails (HTTP status, exception type, user-visible message if encoded), and **what** data shape is stored or emitted on success.
33
+ 4. **Code flow** — Write **`## Code flow`** as an **implementation-order** pipeline: e.g. entrypoint → auth/authorization check → input binding/parsing → per-field or schema validation → business rules → persistence transaction → side effects (events, emails) → response mapping. **Each step** must reference **concrete** code locations (you will mirror those in **Evidence index**).
34
+ 5. **Mermaid** — Under **`## Code flow`**, add **at least one** fenced **`mermaid`** block when the implementation has **two or more** meaningful stages (validation, persistence, external call, etc.). Follow **[MERMAID.md](./MERMAID.md)**: **Mermaid 11.13**, **neutral** theme (`%%{init: {'theme':'neutral'}}%%` as first line inside the fence). Use **`flowchart`** or **`sequenceDiagram`** with nodes/actors labeled to match **real** modules or functions (not “Frontend” / “Backend” placeholders unless the repo truly has no finer structure). Skip Mermaid only if the flow is a single trivial call **and** you state why in one line.
35
+
36
+ ### Evidence vs Code flow (mandatory)
37
+
38
+ - **Entry point alone is insufficient.** The **Evidence index** must cite **implementation** for: the **primary entrypoint**, **validation** (schema, guards, domain checks), **core business logic** touched by this infrastructure component, **persistence** (save/update/query), and **response / error mapping**—each with `path:line` or `path:start-end` (or tight ranges), aligned with the steps in **`## Code flow`**.
39
+ - Prefer **one Evidence bullet per major Code flow stage** (or a small table in **Code flow** with a matching Evidence bullet list)—readers must see **which files** justify **which** part of the narrative.
40
+ - Do **not** cite only the outer controller/route if all substantive logic lives in services, validators, or repositories; those **must** appear too.
41
+
42
+ ## Non-empty chapters and Evidence index (mandatory)
43
+
44
+ - **`## 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.
45
+ - **Preferred:** concrete `path:line` or `path:start-end` cites from the worktree (implementation, config, tests, schemas—not README-style narrative files).
46
+ - **`## Code flow`** must not be a generic checklist; it must reflect **this** infrastructure component’s **actual** call chain and data path. If a section is thin after search, say what is missing and cite the closest evidence.
47
+ - **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.
48
+ - **Other `##` sections:** do not leave them empty; if unknown, add a short note under that heading explaining why.
49
+ - **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).
50
+
51
+ ### Revision log (mandatory)
52
+
53
+ - **`## 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**).
54
+
55
+ ## Output template
56
+
57
+ Basename e.g. **`IN-<nn>_IC-<uu>.md`** (optional slug per PLAN). **R21:** cite behaviour and rules; **Code flow** and **Evidence index** must stay consistent.
58
+
59
+ ```markdown
60
+ # Use case {{UC_CODE}} — <name> (Feature {{FE_CODE}})
61
+
62
+ ## Summary
63
+
64
+ <!-- One tight paragraph: goal, primary actor, success outcome — no generic filler. -->
65
+
66
+ ## Actors and stakeholders
67
+
68
+ ## Preconditions
69
+
70
+ <!-- What must be true before this infrastructure component can start (auth, state, feature flags) — cite checks in code if present. -->
71
+
72
+ ## Data inputs and validation
73
+
74
+ <!--
75
+ Concrete inputs for THIS infrastructure component:
76
+ - Field or parameter names, mandatory vs optional, types.
77
+ - Validation rules (schema, decorators, manual checks) and where they run.
78
+ - Failure behaviour (status codes, errors) with code cites in Evidence.
79
+ -->
80
+
81
+ ## Main flow (user- or operator-visible)
82
+
83
+ <!--
84
+ Short numbered steps from the actor’s perspective (can mirror Code flow at a higher level).
85
+ Each step should be traceable to ## Code flow.
86
+ -->
87
+
88
+ ## Code flow
89
+
90
+ <!--
91
+ IMPLEMENTATION ORDER — not marketing prose. Numbered steps:
92
+ - What runs (function/handler/method), in which file.
93
+ - What data moves (DTO, entity, query).
94
+ - Branching: validation failure → which path; success → next step.
95
+
96
+ When 2+ stages: add a ### heading, then open a fenced block with language tag mermaid (flowchart TD or sequenceDiagram)
97
+ whose node/participant labels match real modules or symbols from the repo.
98
+ -->
99
+
100
+ ### <!-- e.g. Request path (implementation) -->
101
+
102
+ <!-- Numbered list: 1. … 2. … each tied to files named in Evidence index. -->
103
+
104
+ ### <!-- Mermaid — required when flow has 2+ stages -->
105
+
106
+ <!--
107
+ ```mermaid
108
+ %%{init: {'theme':'neutral'}}%%
109
+ flowchart TD
110
+ ...
111
+ ```
112
+ or sequenceDiagram with real handler/service/repository names (see MERMAID.md).
113
+ -->
114
+
115
+ ## Alternate flows
116
+
117
+ ## Postconditions
118
+
119
+ ## Errors and edge cases
120
+
121
+ <!-- Map error paths to code (guards, catch blocks, HTTP errors) — cite in Evidence. -->
122
+
123
+ ## Technical mapping
124
+
125
+ <!--
126
+ Optional: cross-cutting helpers, shared validators, infra (queue, cache) if not fully covered above.
127
+ Do not duplicate ## Code flow; add only extra touchpoints.
128
+ -->
129
+
130
+ ## Related scenarios
131
+
132
+ <!-- List SC-* from scenarios list when known. -->
133
+
134
+ ## Revision
135
+
136
+ <!--
137
+ Append-only: after each substantive edit, add one bullet (newest at bottom, or consistent ISO-8601 date prefixes).
138
+ -->
139
+
140
+ - <!-- e.g. Initial draft: data inputs, code flow, and Evidence tied to handlers and services. -->
141
+
142
+ ## Evidence index
143
+
144
+ <!--
145
+ Multiple substantive bullets — at minimum: entrypoint, validation, core logic, persistence/IO, response/errors.
146
+ Each bullet should map to a stage in ## Code flow. Never only the route file if logic lives elsewhere.
147
+ -->
148
+
149
+ - <!-- `path:line` — entrypoint -->
150
+ - <!-- `path:start-end` — validation -->
151
+ - <!-- `path:start-end` — persistence / domain logic -->
152
+ - <!-- `path:start-end` — response or error mapping -->
153
+ ```
154
+
155
+ ## Evidence (**R21**)
156
+
157
+ Follow **Non-empty chapters and Evidence index** and **Evidence vs Code flow** above. Citations required per §3.5.1. Basename must match §4.4 composite pattern.
158
+
159
+ ## Prerequisites
160
+
161
+ **`.gluecharm/context/IN-<nn>-components-list.json`** includes this infrastructure component.
162
+
163
+ ## OpenCode wiring
164
+
165
+ §3.5.1; orchestration supplies FE/UC codes and exact **`{{OUTPUT_FILE_ABSOLUTE}}`**.
@@ -0,0 +1,95 @@
1
+ # Agent: Feature detail (markdown)
2
+
3
+ | Field | Value |
4
+ | ----- | ----- |
5
+ | **AGENT_ID** | `ctx-md-infrastructure-detail` |
6
+ | **Display name** | Feature detail |
7
+ | **SRS-8** | §4.3 `IN-<nn>-<slug>.md`; §6.2 (parallel after `infrastructure-list.json`); **R7**, **AC5**, **R21** |
8
+ | **Output** | `<worktree>/.gluecharm/context/IN-<nn>-<slug>.md` |
9
+ | **Input (coordination)** | `<worktree>/.gluecharm/context/infrastructure-list.json` (repo-relative: `.gluecharm/context/infrastructure-list.json`) |
10
+ | **Pattern** | §3.5.1 — Markdown detail |
11
+
12
+ ## Responsibility
13
+
14
+ **`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, 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/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
15
+
16
+ **Functional and technical** documentation for **one feature** whose **`code`** and **`slug`** come from **`.gluecharm/context/infrastructure-list.json`**. Feeds human-readable depth; structure for the index comes from JSON lists. That row **must** include **`sourceReferences`** (`minItems: 1`); seed the **Evidence index** with those path+line ranges (then add more from deeper reading). In list JSON, **`sourceReferences[].path`** is always a **file**, never a folder.
17
+
18
+ **Spine context:** Non-trivial features **typically** map to **multiple** use cases in **`IN-<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.
19
+
20
+ **Coordination JSON** lives **only** under **`.gluecharm/context/`**, not the worktree root. Read that path first; if missing, **glob** `.gluecharm/context/**/infrastructure-list.json` before failing.
21
+
22
+ ## Task (for `{{TASK_DESCRIPTION}}`)
23
+
24
+ Document feature **{{FE_CODE}}** (name/slug from list): scope, behaviour, main dependencies, entry points, and links to code. Ground all claims in the worktree.
25
+
26
+ ## Non-empty chapters and Evidence index (mandatory)
27
+
28
+ - **`## 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.
29
+ - **Preferred:** at least one concrete `path:line` or `path:start-end` cite from the worktree (implementation, config, tests, schemas—not README-style narrative files).
30
+ - **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.
31
+ - **Other `##` sections:** do not leave them empty; if unknown, add a short note under that heading explaining why.
32
+ - **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).
33
+
34
+ ### Revision log (mandatory)
35
+
36
+ - **`## 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**).
37
+
38
+ ## Output template
39
+
40
+ Write **exactly** the content for **`{{OUTPUT_FILE_ABSOLUTE}}`**. Basename **must** be **`{{OUTPUT_BASENAME}}`** (e.g. `IN-01-user-auth.md`). **R21:** mirror substantive claims under **Evidence index** with file+line cites or labelled inference.
41
+
42
+ ```markdown
43
+ # Feature {{FE_CODE}} — <name from infrastructure-list>
44
+
45
+ **Slug:** <slug>
46
+ **Output file:** {{OUTPUT_BASENAME}}
47
+
48
+ ## Summary
49
+
50
+ ## Scope
51
+
52
+ <!-- In / out of scope for this feature. -->
53
+
54
+ ## Functional behaviour
55
+
56
+ <!-- User-visible capabilities; cite UI/routes/handlers. -->
57
+
58
+ ## Technical design
59
+
60
+ <!-- Modules, services, data touched; cite implementation. -->
61
+
62
+ ## Entry points
63
+
64
+ <!-- Routes, CLI, jobs, public APIs; cite definitions. -->
65
+
66
+ ## Dependencies
67
+
68
+ <!-- Other features, libs, external APIs; cite manifests and imports. -->
69
+
70
+ ## Open questions
71
+
72
+ ## Revision
73
+
74
+ <!--
75
+ Append-only: after each substantive edit, add one bullet (newest at bottom, or consistent ISO-8601 date prefixes).
76
+ -->
77
+
78
+ - <!-- e.g. Initial draft: scope and behaviour from implementation reads. -->
79
+
80
+ ## Evidence index
81
+
82
+ - <!-- At least one substantive bullet: `path:line` or honest grounding note per Non-empty chapters — never empty; never `readme.md` basenames. -->
83
+ ```
84
+
85
+ ## Evidence (**R21**)
86
+
87
+ Follow **Non-empty chapters and Evidence index** above. File + line citations for substantive statements; **`{{OUTPUT_BASENAME}}`** must match §4.3.
88
+
89
+ ## Prerequisites
90
+
91
+ Valid **`.gluecharm/context/infrastructure-list.json`** with this feature row.
92
+
93
+ ## OpenCode wiring
94
+
95
+ §3.5.1. One markdown file per invocation; orchestration sets output path from FE code and slug.
@@ -0,0 +1,95 @@
1
+ # Agent: Feature detail (markdown)
2
+
3
+ | Field | Value |
4
+ | ----- | ----- |
5
+ | **AGENT_ID** | `ctx-md-qa-detail` |
6
+ | **Display name** | Feature detail |
7
+ | **SRS-8** | §4.3 `QA-<nn>-<slug>.md`; §6.2 (parallel after `qa-list.json`); **R7**, **AC5**, **R21** |
8
+ | **Output** | `<worktree>/.gluecharm/context/QA-<nn>-<slug>.md` |
9
+ | **Input (coordination)** | `<worktree>/.gluecharm/context/qa-list.json` (repo-relative: `.gluecharm/context/qa-list.json`) |
10
+ | **Pattern** | §3.5.1 — Markdown detail |
11
+
12
+ ## Responsibility
13
+
14
+ **`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, 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/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
15
+
16
+ **Functional and technical** documentation for **one feature** whose **`code`** and **`slug`** come from **`.gluecharm/context/qa-list.json`**. Feeds human-readable depth; structure for the index comes from JSON lists. That row **must** include **`sourceReferences`** (`minItems: 1`); seed the **Evidence index** with those path+line ranges (then add more from deeper reading). In list JSON, **`sourceReferences[].path`** is always a **file**, never a folder.
17
+
18
+ **Spine context:** Non-trivial features **typically** map to **multiple** use cases in **`QA-<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.
19
+
20
+ **Coordination JSON** lives **only** under **`.gluecharm/context/`**, not the worktree root. Read that path first; if missing, **glob** `.gluecharm/context/**/qa-list.json` before failing.
21
+
22
+ ## Task (for `{{TASK_DESCRIPTION}}`)
23
+
24
+ Document feature **{{FE_CODE}}** (name/slug from list): scope, behaviour, main dependencies, entry points, and links to code. Ground all claims in the worktree.
25
+
26
+ ## Non-empty chapters and Evidence index (mandatory)
27
+
28
+ - **`## 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.
29
+ - **Preferred:** at least one concrete `path:line` or `path:start-end` cite from the worktree (implementation, config, tests, schemas—not README-style narrative files).
30
+ - **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.
31
+ - **Other `##` sections:** do not leave them empty; if unknown, add a short note under that heading explaining why.
32
+ - **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).
33
+
34
+ ### Revision log (mandatory)
35
+
36
+ - **`## 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**).
37
+
38
+ ## Output template
39
+
40
+ Write **exactly** the content for **`{{OUTPUT_FILE_ABSOLUTE}}`**. Basename **must** be **`{{OUTPUT_BASENAME}}`** (e.g. `QA-01-user-auth.md`). **R21:** mirror substantive claims under **Evidence index** with file+line cites or labelled inference.
41
+
42
+ ```markdown
43
+ # Feature {{FE_CODE}} — <name from qa-list>
44
+
45
+ **Slug:** <slug>
46
+ **Output file:** {{OUTPUT_BASENAME}}
47
+
48
+ ## Summary
49
+
50
+ ## Scope
51
+
52
+ <!-- In / out of scope for this feature. -->
53
+
54
+ ## Functional behaviour
55
+
56
+ <!-- User-visible capabilities; cite UI/routes/handlers. -->
57
+
58
+ ## Technical design
59
+
60
+ <!-- Modules, services, data touched; cite implementation. -->
61
+
62
+ ## Entry points
63
+
64
+ <!-- Routes, CLI, jobs, public APIs; cite definitions. -->
65
+
66
+ ## Dependencies
67
+
68
+ <!-- Other features, libs, external APIs; cite manifests and imports. -->
69
+
70
+ ## Open questions
71
+
72
+ ## Revision
73
+
74
+ <!--
75
+ Append-only: after each substantive edit, add one bullet (newest at bottom, or consistent ISO-8601 date prefixes).
76
+ -->
77
+
78
+ - <!-- e.g. Initial draft: scope and behaviour from implementation reads. -->
79
+
80
+ ## Evidence index
81
+
82
+ - <!-- At least one substantive bullet: `path:line` or honest grounding note per Non-empty chapters — never empty; never `readme.md` basenames. -->
83
+ ```
84
+
85
+ ## Evidence (**R21**)
86
+
87
+ Follow **Non-empty chapters and Evidence index** above. File + line citations for substantive statements; **`{{OUTPUT_BASENAME}}`** must match §4.3.
88
+
89
+ ## Prerequisites
90
+
91
+ Valid **`.gluecharm/context/qa-list.json`** with this feature row.
92
+
93
+ ## OpenCode wiring
94
+
95
+ §3.5.1. One markdown file per invocation; orchestration sets output path from FE code and slug.