@gluecharm-lab/easyspecs-cli 0.0.3

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 (66) hide show
  1. package/dist/main.cjs +19663 -0
  2. package/dist/main.cjs.map +7 -0
  3. package/package.json +27 -0
  4. package/resources/opencode-agents/MERMAID.md +20 -0
  5. package/resources/opencode-agents/README.md +67 -0
  6. package/resources/opencode-agents/agent-ace-curator.md +31 -0
  7. package/resources/opencode-agents/agent-ace-reflector.md +16 -0
  8. package/resources/opencode-agents/agent-ace-trace-recorder.md +33 -0
  9. package/resources/opencode-agents/agent-add-reference-architecture-md.md +22 -0
  10. package/resources/opencode-agents/agent-add-reference-project-md.md +21 -0
  11. package/resources/opencode-agents/agent-classify-unreferenced-file.md +61 -0
  12. package/resources/opencode-agents/agent-list-data-model.md +243 -0
  13. package/resources/opencode-agents/agent-list-entity-fields.md +191 -0
  14. package/resources/opencode-agents/agent-list-experiences.md +252 -0
  15. package/resources/opencode-agents/agent-list-features.md +218 -0
  16. package/resources/opencode-agents/agent-list-scenarios.md +179 -0
  17. package/resources/opencode-agents/agent-list-services.md +208 -0
  18. package/resources/opencode-agents/agent-list-tech-stack.md +176 -0
  19. package/resources/opencode-agents/agent-list-use-cases.md +179 -0
  20. package/resources/opencode-agents/agent-md-architecture.md +139 -0
  21. package/resources/opencode-agents/agent-md-docs-project.md +172 -0
  22. package/resources/opencode-agents/agent-md-entity-detail.md +86 -0
  23. package/resources/opencode-agents/agent-md-feature-detail.md +95 -0
  24. package/resources/opencode-agents/agent-md-field-detail.md +80 -0
  25. package/resources/opencode-agents/agent-md-interaction-detail.md +84 -0
  26. package/resources/opencode-agents/agent-md-method-detail.md +86 -0
  27. package/resources/opencode-agents/agent-md-relationship-detail.md +80 -0
  28. package/resources/opencode-agents/agent-md-scenario-detail.md +92 -0
  29. package/resources/opencode-agents/agent-md-service-detail.md +88 -0
  30. package/resources/opencode-agents/agent-md-tool-detail.md +82 -0
  31. package/resources/opencode-agents/agent-md-use-case-detail.md +165 -0
  32. package/resources/opencode-agents/agent-md-view-detail.md +117 -0
  33. package/resources/opencode-agents/agent-reference-coverage-execution-report.md +28 -0
  34. package/resources/opencode-agents/agent-repo-surface-scan.md +136 -0
  35. package/resources/opencode-agents/agent-resolve-open-question.md +42 -0
  36. package/resources/opencode-agents/agent-review-data-model-list.md +26 -0
  37. package/resources/opencode-agents/agent-review-entity-fields-list.md +26 -0
  38. package/resources/opencode-agents/agent-review-experiences-list.md +72 -0
  39. package/resources/opencode-agents/agent-review-features-list.md +52 -0
  40. package/resources/opencode-agents/agent-review-scenarios-list.md +28 -0
  41. package/resources/opencode-agents/agent-review-services-list.md +26 -0
  42. package/resources/opencode-agents/agent-review-tech-stack-list.md +26 -0
  43. package/resources/opencode-agents/agent-review-use-cases-list.md +28 -0
  44. package/resources/opencode-agents/agent-triage-unreferenced-coordination.md +35 -0
  45. package/resources/schemas/ace/ace-agent-overlay.schema.json +29 -0
  46. package/resources/schemas/ace/ace-curator-delta.schema.json +51 -0
  47. package/resources/schemas/ace/ace-generator-trace.schema.json +134 -0
  48. package/resources/schemas/ace/ace-playbook.schema.json +36 -0
  49. package/resources/schemas/ace/ace-reflector-lessons.schema.json +77 -0
  50. package/resources/schemas/context-lists/coordination-duplicates-report.schema.json +97 -0
  51. package/resources/schemas/context-lists/coverage-reference-validation.schema.json +125 -0
  52. package/resources/schemas/context-lists/data-model-list.schema.json +157 -0
  53. package/resources/schemas/context-lists/entity-fields-list.schema.json +104 -0
  54. package/resources/schemas/context-lists/experiences-list.schema.json +132 -0
  55. package/resources/schemas/context-lists/features-list.schema.json +109 -0
  56. package/resources/schemas/context-lists/repo-surface-scan.schema.json +150 -0
  57. package/resources/schemas/context-lists/scenarios-list.schema.json +107 -0
  58. package/resources/schemas/context-lists/services-list.schema.json +132 -0
  59. package/resources/schemas/context-lists/tech-stack-list.schema.json +108 -0
  60. package/resources/schemas/context-lists/use-cases-list.schema.json +108 -0
  61. package/resources/schemas/context-lists/zero-reference-classifier-record.schema.json +61 -0
  62. package/resources/schemas/context-lists/zero-reference-routing.schema.json +98 -0
  63. package/resources/schemas/context-lists/zero-reference-triage-record.schema.json +57 -0
  64. package/resources/schemas/context-lists/zero-reference-triage.schema.json +69 -0
  65. package/resources/schemas/index-application-context.schema.json +202 -0
  66. package/resources/schemas/srs-impact.schema.json +187 -0
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@gluecharm-lab/easyspecs-cli",
3
+ "version": "0.0.3",
4
+ "description": "EasySpecs headless CLI (analyze, diagnose, macro, upload, auth, ACE)",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://gitlab.com/glue-charm-extended/gluecharm-extended/easyspecs.ai-vsc-extension.git",
12
+ "directory": "packages/cli"
13
+ },
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
17
+ "bin": {
18
+ "easyspecs-cli": "./dist/main.cjs"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "resources"
23
+ ],
24
+ "scripts": {
25
+ "build": "node ../../scripts/build-cli.mjs"
26
+ }
27
+ }
@@ -0,0 +1,20 @@
1
+ # Mermaid target (EasySpecs)
2
+
3
+ Bundled markdown agents that emit **` ```mermaid `** fenced blocks must match what the **EasySpecs web app** uses to render diagrams:
4
+
5
+ | | |
6
+ | --- | --- |
7
+ | **Mermaid** | **11.13** |
8
+ | **Theme** | **neutral** |
9
+
10
+ ## Rules for generated diagrams
11
+
12
+ 1. **Syntax** — Use features supported in **Mermaid 11.x** (this repo tracks **11.13**). Prefer stable diagram types (`flowchart`, `sequenceDiagram`, `classDiagram`, etc.); avoid relying on experimental-only syntax unless documented for 11.13.
13
+
14
+ 2. **Theme** — Put **`%%{init: {'theme':'neutral'}}%%`** as the **first line inside** each `mermaid` fence (immediately after ` ```mermaid `). That aligns output with the product preview and avoids default-theme assumptions.
15
+
16
+ 3. **Semantics** — Do not encode meaning only via theme-dependent colors; use **labels**, **node text**, and **structure** so diagrams stay readable under the neutral palette.
17
+
18
+ 4. **No custom styles** — Do **not** use Mermaid directives whose purpose is **per-element appearance**: no **`style`**, **`classDef`** / **`class`**, **`linkStyle`**, or similar fill/stroke/font overrides. The **only** appearance-related line allowed is the **`%%{init: {'theme':'neutral'}}%%`** directive in rule 2; everything else should be plain diagram syntax (nodes, edges, subgraphs, sequence messages) so rendering stays consistent with the EasySpecs preview.
19
+
20
+ 5. **No `C4Component`** — Do **not** use Mermaid’s **`C4Component`** diagram type (or any diagram that **begins** with **`C4Component`**). **Component-level** views must use **`flowchart`** / **`graph`** / **`sequenceDiagram`** (and clear node labels) instead. The same applies to other built-in **`C4*`** diagram declarations (**`C4Context`**, **`C4Container`**, **`C4Dynamic`**, **`C4Deployment`**, etc.)—do **not** use them; approximate context or containers with **`flowchart`** / **`graph`** if needed.
@@ -0,0 +1,67 @@
1
+ # OpenCode agents (bundled)
2
+
3
+ On analysis / **Materialize agents**:
4
+
5
+ - This folder is copied to **`<analysisCheckout>/.opencode/agents/`** (OpenCode’s project agent directory). **`analysisCheckout`** is the temp path from EasySpecs **workspace storage** (`adHocWorktreePath`, e.g. `…/easyspecs-analysis/<id>`).
6
+ - **`resources/schemas/context-lists/*.schema.json`** is copied to **`<analysisCheckout>/.opencode/schemas/context-lists/`** for **`{{LIST_SCHEMA_REF}}`** (list agents).
7
+ - The materialized **`.opencode/`** tree (agents, schemas, and any other files there) is **EasySpecs/OpenCode tooling**, not the analyzed product codebase. Every bundled **`agent-*.md`** instructs the model to **ignore** **`.opencode/`** for repo discovery and to **never** cite paths under it in **`sourceReferences`**, Evidence index bullets, or equivalent evidence fields.
8
+
9
+ Each **`agent-*.md`** describes **one logical agent role** from SRS-8 §4–§6 (`.gluecharm/docs/srs/srs-8.md` in this repo). They are **human-readable specs** for wiring your OpenCode CLI. Per [OpenCode agents](https://opencode.ai/docs/agents), the **OpenCode agent id** is the **filename without `.md`** (e.g. `agent-md-docs-project.md` → **`opencode run --agent agent-md-docs-project`**). The **`AGENT_ID`** table inside a file (often `ctx-*`) is the SRS logical id, not necessarily the CLI name. EasySpecs Analysis test steps pass **`--agent`** with that stem and attach the filled §3.5 prompt via **`-f`**.
10
+
11
+ ### Mermaid diagrams
12
+
13
+ Agents that produce **` ```mermaid `** blocks must follow **[MERMAID.md](./MERMAID.md)**: target **Mermaid 11.13**, **neutral** theme (first line inside each fence: `%%{init: {'theme':'neutral'}}%%`), **11.x**-compatible syntax, **no** per-element styling (`style`, `classDef`, `linkStyle`, etc.), and **no** built-in **`C4*`** diagram types (including **`C4Component`**—use **`flowchart`** / **`graph`** / **`sequenceDiagram`** instead).
14
+
15
+ **List agents** (`agent-list-*.md`) include YAML **frontmatter** (`description`, **`mode: primary`**) so OpenCode registers them like a full session agent and non-interactive runs are more likely to use **file write** tools instead of chat-only replies.
16
+
17
+ - **List agents** embed the **JSON Schema (Draft 2020-12)** the model must satisfy (kept in sync with the bundled `.schema.json` files). Every **leaf** row in coordination list JSON includes **`sourceReferences`**: a non-empty array (`minItems: 1`) of `{ "path", "startLine", "endLine", "note"? }` — **`path`** must be a **single repo-relative file** (forward slashes, no trailing slash); **never a directory**. Spread evidence across several files as **several** array entries, not one folder path (1-based inclusive line range per entry). **Exception:** **`repo-surface-scan.json`** does not use per-row **`sourceReferences`**; it uses **`uiSourceReferences`** / **`backendSourceReferences`** (or absence reasons) per **`hasUi`** / **`hasBackend`**. Do **not** use any path whose **basename** is `readme.md` in any casing (`README.md`, etc.) inside evidence arrays. Do **not** use paths under **`.opencode/`** there either.
18
+ - **Markdown agents** include an **output template** (headings + **`## Revision`** + **Evidence index**) aligned with **R21**. **`## Revision`** is **append-only**: each pass that changes the body adds at least one bullet describing the delta; it sits **immediately before** **`## Evidence index`**. When the parent coordination JSON row includes **`sourceReferences`**, carry those file+line anchors into the **Evidence index** and extend them with deeper reading as needed (same file-not-folder rule in list JSON).
19
+ - **List agents** (JSON): optional root **`revisionLog`** (array of `{ "summary", "at"? }`) in each coordination schema—**append** an entry on every substantive file write; **never delete** prior entries. See **`## Revision`** in each **`agent-list-*.md`** / **`agent-repo-surface-scan.md`**.
20
+
21
+ ### Markdown agents — Evidence index (references) and non-empty chapters
22
+
23
+ - **`## 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** by policy—the model must not deliver that outcome.
24
+ - **Preferred:** at least one concrete `path:line` or `path:start-end` cite from real implementation paths in the worktree.
25
+ - **If grounding is impossible** after reasonable search: set **`Status: hallucination?`** on its **own line immediately under the document’s top-level `#` title**, **and** still add **at least one** Evidence index bullet describing search effort, partial findings, and that narrative is not implementation-backed. The Evidence index must never be omitted or left without substantive bullets.
26
+ - **Other headings** in the template must not be left empty; if unknown, add a short note under that heading explaining why (Evidence index is **not** exempt—you cannot substitute an empty section with “see above”).
27
+ - **Banned:** never cite a file whose **basename** is `readme.md` in **any** casing (`README.md`, `readme.md`, etc.) in the Evidence index (or as a list-agent `sourceReferences` path). Use source, config, tests, schemas, etc. **Also banned:** any path under **`.opencode/`** (tooling copy, not product source).
28
+
29
+ ## Coordination list (JSON) agents
30
+
31
+ | File | Output (under `.gluecharm/context/`) |
32
+ | ---- | ------------------------------------ |
33
+ | [agent-list-features.md](./agent-list-features.md) | `features-list.json` |
34
+ | [agent-repo-surface-scan.md](./agent-repo-surface-scan.md) | `repo-surface-scan.json` (SRS-20 pre-flight) |
35
+ | [agent-list-experiences.md](./agent-list-experiences.md) | `experiences-list.json` |
36
+ | [agent-list-services.md](./agent-list-services.md) | `services-list.json` |
37
+ | [agent-list-data-model.md](./agent-list-data-model.md) | `data-model-list.json` (entities only; no nested FD/RL) |
38
+ | [agent-list-entity-fields.md](./agent-list-entity-fields.md) | `DM-<nn>-fields-list.json` (per entity) |
39
+ | [agent-list-tech-stack.md](./agent-list-tech-stack.md) | `tech-stack-list.json` |
40
+ | [agent-list-use-cases.md](./agent-list-use-cases.md) | `FE-<nn>-use-cases-list.json` (per feature) |
41
+ | [agent-list-scenarios.md](./agent-list-scenarios.md) | `FE-<nn>_UC-<uu>-scenarios-list.json` (per use case) |
42
+
43
+ ## Markdown detail agents
44
+
45
+ | File | Output pattern |
46
+ | ---- | ---------------- |
47
+ | [agent-md-architecture.md](./agent-md-architecture.md) | `architecture.md` (Mermaid **required**, more diagrams optional) |
48
+ | [agent-md-feature-detail.md](./agent-md-feature-detail.md) | `FE-<nn>-<slug>.md` |
49
+ | [agent-md-use-case-detail.md](./agent-md-use-case-detail.md) | `FE-<nn>_UC-<uu>.md` |
50
+ | [agent-md-scenario-detail.md](./agent-md-scenario-detail.md) | `FE-<nn>_UC-<uu>_SC-<ss>.md` |
51
+ | [agent-md-view-detail.md](./agent-md-view-detail.md) | `XP-<nn>-<slug>.md` |
52
+ | [agent-md-interaction-detail.md](./agent-md-interaction-detail.md) | `XP-<nn>_BH-<ii>-<slug>.md` |
53
+ | [agent-md-service-detail.md](./agent-md-service-detail.md) | `SV-<nn>-<slug>.md` |
54
+ | [agent-md-method-detail.md](./agent-md-method-detail.md) | `SV-<nn>_ME-<mm>-<slug>.md` |
55
+ | [agent-md-entity-detail.md](./agent-md-entity-detail.md) | `DM-<nn>-<slug>.md` |
56
+ | [agent-md-field-detail.md](./agent-md-field-detail.md) | `DM-<nn>_FD-<ff>-<slug>.md` |
57
+ | [agent-md-relationship-detail.md](./agent-md-relationship-detail.md) | `DM-<nn>_RL-<rr>-<slug>.md` |
58
+ | [agent-md-tool-detail.md](./agent-md-tool-detail.md) | `TS-<nn>-<slug>.md` |
59
+ | [agent-md-docs-project.md](./agent-md-docs-project.md) | `.gluecharm/context/project.md` |
60
+
61
+ ## Not an OpenCode agent
62
+
63
+ **`index-application-context.json`** is built **only** by the programmatic assembler (SRS-8 **R8**, **R9**), not by a model.
64
+
65
+ ## Maintainer note
66
+
67
+ The **JSON Schema** blocks inside each **`agent-list-*.md`** must stay identical to the matching file under **`resources/schemas/context-lists/`** (single source of truth for validators and **`{{LIST_SCHEMA_REF}}`**), including shared **`$defs`** for **`sourceReferences`** where present.
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: SRS-35 ACE Curator — read Reflector lessons JSON and emit delta operations JSON (append merge prune) only.
3
+ mode: primary
4
+ ---
5
+
6
+ # ACE Curator
7
+
8
+ **`.opencode/` exclusion:** Treat **`.opencode/`** as injected OpenCode/EasySpecs tooling only. **Do not** use it to infer the analyzed product codebase or cite it as repository evidence in rationale or outputs.
9
+
10
+ You receive paths to **validated** Reflector lessons JSON and read-only excerpts of current playbook + overlay JSON (see attached prompt).
11
+
12
+ Use a **file tool** (**write** or **edit**) to create or overwrite **one** JSON file at the **absolute path** in the prompt (section “Delta file”). Chat-only JSON is **rejected** — the file **must** exist on disk when the run ends.
13
+
14
+ Contents: schema-valid `ace-curator-delta` (`aceSchemaVersion` **1.0.0-draft**): `agentStem`, `sourceLessons`, `operations` with `op` append|merge|prune, `target` learning|overlay, discrete rule ids, `rationale`, `sourceLessonIds`. Do **not** replace the entire playbook in one blob; prefer append and targeted merge/prune.
15
+
16
+ ## From lessons → playbook / overlay (default bias)
17
+
18
+ Read the full **lessons** file. Lessons describe what **worked** or **failed and was fixed** in a real run — they are the main input for **durable** agent context.
19
+
20
+ **Prefer turning learnings into rules or overlay text** when all of the following hold:
21
+
22
+ - The lesson is **not** category **`noise`**.
23
+ - **`confidence`** is **`high`** or **`medium`** (for **`low`**, only promote if the statement is short, testable, and clearly actionable).
24
+ - The lesson is **`confirmedPattern`**, **`nonObviousDecision`**, or **`failureCorrection`** — these are **strong candidates** for one **`target: "learning"`** `append` with a new stable **`ruleId`** and a **`payload.statement`** derived from the lesson (imperative, repo-appropriate).
25
+ - Use **`target: "overlay"`** when the lesson is about **tone, emphasis, “do not” constraints, or prompt-adjacent** guidance better expressed as `instructionAppend`, `emphasisBullets`, or `negativeConstraints` than as a playbook rule.
26
+
27
+ Each operation’s **`sourceLessonIds`** must list the contributing **`lessonId`** values from the lessons JSON. **`rationale`** should say why this rule or overlay change captures what worked.
28
+
29
+ **When `operations` may stay `[]`:** every lesson is **`noise`** or redundant with an **existing** rule/overlay (same intent already present — read full playbook/overlay files if excerpts are truncated), or promoting would **duplicate** without adding clarity.
30
+
31
+ **Do not** emit `append` rules that merely restate generic advice already obvious from the base agent doc; prefer lessons grounded in **this repo’s** trace.
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: SRS-35 ACE Reflector — read a validated trace JSON and emit lessons JSON only (no direct playbook edits).
3
+ mode: primary
4
+ ---
5
+
6
+ # ACE Reflector
7
+
8
+ **`.opencode/` exclusion:** Treat **`.opencode/`** as injected OpenCode/EasySpecs tooling only. **Do not** use it to infer the analyzed product codebase. **Never** cite paths under **`.opencode/`** in lesson **`evidenceRefs`** as if they were product source.
9
+
10
+ You receive the path to a **validated** ACE trace JSON file (see attached prompt). You **do not** edit playbook files, overlays, or primary artefacts.
11
+
12
+ Use a **file tool** (**write** or **edit**) to create or overwrite **one** JSON file at the **absolute path** in the prompt (section “Lessons file”). Chat-only JSON is **rejected** — the file **must** exist on disk when the run ends.
13
+
14
+ Contents: schema-valid `ace-reflector-lessons` (`aceSchemaVersion` **1.0.0-draft**): `sourceTrace`, `lessons` with `lessonId`, `category`, `statement`, `confidence`, `transferability`, `evidenceRefs`. **`lessons` may be `[]`** when the trace yields nothing worth encoding — the file must still be written.
15
+
16
+ Traces nest **`decisions`** under **`reasoningSteps[]`** (each decision applies to its parent step). For `evidenceRefs` with `kind: "decision"`, use a `ref` that ties the lesson to **both** the step and the decision (e.g. `"{stepId}/{decisionId}"` or `stepId` + `decisionId` in a clear convention you use consistently).
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: SRS-35 ACE — emit schema-valid trace JSON in the same OpenCode session as the primary documentation step (follow-up turn only).
3
+ mode: primary
4
+ ---
5
+
6
+ # ACE trace recorder
7
+
8
+ **`.opencode/` exclusion:** Paths under **`.opencode/`** are tooling copies (agents, schemas), not the analyzed product. **Never** put **`.opencode/`** paths in **`evidenceIndex`** as repository evidence; if mirroring the primary artefact’s Evidence index, drop any such paths.
9
+
10
+ You are continuing an **existing** OpenCode session. The primary artefact for this work item **already exists** and passed validation.
11
+
12
+ **Do not** modify the primary artefact unless the user message explicitly requests a trivial typo fix (default: do not touch it).
13
+
14
+ Your only job: use a **file tool** (**write** or **edit**) to create or overwrite **one** JSON file at the **absolute path** in the attached prompt (section “Trace file”). Chat-only JSON is **rejected** by the extension — the file **must** exist on disk when the run ends.
15
+
16
+ The file must match the ACE trace schema (`aceSchemaVersion` **1.0.0-draft**; `additionalProperties: false` on nested objects). Ground every substantive claim in **this session’s** actual prior messages and tool results.
17
+
18
+ **`primaryArtefact` (only these keys):** `relativePath` (path under `.gluecharm/context/`, e.g. `architecture.md`), `artefactKind` (e.g. `coordination-md`), `basename`. **Do not** use `path`, `file`, or `type` instead — schema rejects them.
19
+
20
+ **Required arrays (use `[]` if empty):** `reasoningSteps`, `failuresAndRetries`, `evidenceIndex`. **Do not** put a root-level `decisions` array — the schema rejects it.
21
+
22
+ **`reasoningSteps` items:** `stepId` (string), `phase` (`explore` | `hypothesis` | `draft` | `validate` | `repair` | `finalize`), `summary` (string), and optionally `toolsUsed` (string[]), `backtracked` (boolean), and **`decisions`** — an array of `{ decisionId, topic, choice, rationale }` (optional `alternativesConsidered`) for choices **made in that step only**. Use `decisions: []` or omit `decisions` when a step has no discretionary choices. **Do not** use `step`, `tool_code`, or dump unescaped tool transcripts into strings — that breaks JSON.
23
+
24
+ **`failuresAndRetries`:** `{ failureId, description }[]`. **`evidenceIndex`:** `{ path, role }[]` (mirror the primary markdown’s Evidence index when applicable).
25
+
26
+ ## Trace richness (for Reflector → Curator)
27
+
28
+ The attached EasySpecs prompt includes the **absolute path** to the primary artefact — **read** it if you need exact **## Evidence index** lines or headings. Thin, generic traces produce **no usable lessons** and **no playbook updates**.
29
+
30
+ - Prefer **≥ 3** `reasoningSteps` when the session did real work, spanning **explore → … → finalize**, with concrete **what/why** (paths, tools, validation).
31
+ - Put **decisions** on the **same step** where the choice was made (non-obvious structure, evidence, scope); omit `decisions` or use `[]` on steps with nothing discretionary.
32
+ - Add **failuresAndRetries** for remediation loops (Evidence index empty, open questions, JSON repair, tool/permission issues) and note resolutions when known.
33
+ - Set **toolsUsed** on steps when it clarifies how conclusions were reached.
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: SRS-30 — edit .gluecharm/context/architecture.md to cite an unreferenced implementation file (Evidence index style).
3
+ mode: primary
4
+ ---
5
+
6
+ # Agent: Add reference — architecture.md
7
+
8
+ | Field | Value |
9
+ | ----- | ----- |
10
+ | **AGENT_ID** | `ctx-add-ref-architecture-md` |
11
+ | **SRS-30** | Stage 2 for **routing=architecture** — stakeholder markdown |
12
+
13
+ ## Responsibility
14
+
15
+ **`.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.
16
+
17
+ The attached EasySpecs prompt names a **repo-relative file** and a short **classifier summary**. Edit **`.gluecharm/context/architecture.md`** in the worktree (create minimal headings if the file is missing) so the file is **cited** in a durable way:
18
+
19
+ - Prefer a **`## Evidence index`** or **`## Referenced implementation files`** section with bullets using `path:startLine-endLine` (SRS-16 style).
20
+ - Reserve **architecture.md** for **cross-cutting technical** narrative; **ORM/table mapping units** usually belong under **data_models** routing, not here — if the prompt still asks for architecture, add a minimal citation only when it truly supports the architecture story.
21
+ - Do not remove unrelated content; append or extend the best section.
22
+ - Use **`edit`** so the change is persisted on disk.
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: SRS-30 — edit .gluecharm/context/project.md to cite an unreferenced implementation file (Evidence index style).
3
+ mode: primary
4
+ ---
5
+
6
+ # Agent: Add reference — project.md
7
+
8
+ | Field | Value |
9
+ | ----- | ----- |
10
+ | **AGENT_ID** | `ctx-add-ref-project-md` |
11
+ | **SRS-30** | Stage 2 for **routing=project** — stakeholder markdown |
12
+
13
+ ## Responsibility
14
+
15
+ **`.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.
16
+
17
+ The attached EasySpecs prompt names a **repo-relative file** and a short **classifier summary**. Edit **`.gluecharm/context/project.md`** in the worktree (create minimal headings if the file is missing) so the file is **cited** in a durable way:
18
+
19
+ - Prefer a **`## Evidence index`** or **`## Referenced implementation files`** section with bullets using `path:startLine-endLine` (SRS-16 style).
20
+ - Do not remove unrelated content; append or extend the best section.
21
+ - Use **`edit`** (or equivalent) so the change is persisted on disk.
@@ -0,0 +1,61 @@
1
+ ---
2
+ description: SRS-30 — classify one repo file that has zero context citations; emit zero-reference-classifier-record JSON at the orchestrator-provided absolute path.
3
+ mode: primary
4
+ ---
5
+
6
+ # Agent: Classify unreferenced file
7
+
8
+ | Field | Value |
9
+ | ----- | ----- |
10
+ | **AGENT_ID** | `ctx-classify-unreferenced` |
11
+ | **Display name** | Classify unreferenced file |
12
+ | **SRS-30** | Stage 1 — **top-level routing** for **nonReferencedFiles** |
13
+ | **Output** | Absolute path given in the EasySpecs prompt (**classifier staging JSON**) |
14
+ | **Pattern** | §3.5.2 — single JSON object |
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
+ The prompt names **one** repo-relative file that **SRS-29** reports as never cited from `.gluecharm/context`. Set **fileKind** to **exactly one** of these literals:
21
+
22
+ | `fileKind` | When to use |
23
+ | ---------- | ----------- |
24
+ | `source` | Application/library source (e.g. `.ts`, `.js`, `.py`, `.pas`, `.go`, `.vue`) |
25
+ | `test` | Tests, fixtures used only by tests |
26
+ | `config` | Build/deploy/config (e.g. `package.json`, CI YAML) |
27
+ | `script` | Tooling / one-off scripts |
28
+ | `data` | CSV, TSV, exports, dumps |
29
+ | `documentation` | Standalone prose (`.md`, `.txt`) |
30
+ | `asset_excluded_by_srs29` | Rare: binary/media still listed |
31
+ | `unknown` | None of the above |
32
+
33
+ Then **projectRelationSummary** (1–3 sentences) and **routing** — **exactly one** of:
34
+
35
+ | `routing` | When to use |
36
+ | --------- | ----------- |
37
+ | **`project`** | Product charter, stakeholders, scope, “what we build” — should be cited from **`project.md`**. |
38
+ | **`architecture`** | Cross-cutting **technical** structure (layers, deployment topology, major components) — cite from **`architecture.md`**. **Not** for a single DB table ORM class (see **`data_models`**). |
39
+ | **`feature`** | User-facing capability / epic — triage vs **`features-list.json`** (FE-*). |
40
+ | **`experiences`** | UX flows, journeys, interactions — triage vs **`experiences-list.json`** (XP-* **views**). |
41
+ | **`services`** | Backend services, APIs, integrations — triage vs **`services-list.json`** (SV-*). |
42
+ | **`data_models`** | **ORM / persistence mapping** for domain tables or entities: Delphi `TObject`+`TTable` units, EF entities, Prisma models, repository + table pairs, SQL DDL consumers. Example: a `.pas` unit mapping `[dbo].[ConsumoDia]` → **`data_models`**, **not** `architecture`. |
43
+ | **`no_action`** | Generated noise or out of scope — see **Strict keys** below: **`rationale` is mandatory**. |
44
+
45
+ ## Strict keys (schema-enforced)
46
+
47
+ The root JSON object may use **only** these property names: **`filePath`**, **`fileKind`**, **`projectRelationSummary`**, **`routing`**, and optionally **`rationale`**. The schema sets **`additionalProperties`: false** — any other top-level key (e.g. `reason`, `note`, `explanation`, `justification`) **invalidates** the output.
48
+
49
+ - When **`routing` is `no_action`**, you **must** include **`rationale`**: a non-empty string explaining why no remediation applies. **Omit `rationale`** when `routing` is anything else (`project`, `architecture`, `feature`, …).
50
+ - Use the name **`rationale` exactly** — do not rename it (not `reason`, not `rationaleText`).
51
+
52
+ ## Rules
53
+
54
+ 1. Read the target file and minimal neighbours — do not dump the whole repo.
55
+ 2. **filePath** in JSON must **exactly** match the path given in the prompt (POSIX forward slashes). For **fileKind**, use **`data`** for CSV-like files, not `csv`.
56
+ 3. Write **only** valid JSON to the **Output** path — no markdown fences in the file body.
57
+ 4. Conform to **`zero-reference-classifier-record.schema.json`** in `.opencode/schemas/context-lists/`.
58
+
59
+ ## JSON shape (informative)
60
+
61
+ See bundled **`resources/schemas/context-lists/zero-reference-classifier-record.schema.json`**.
@@ -0,0 +1,243 @@
1
+ ---
2
+ description: SRS-8 coordination JSON — writes data-model-list.json under .gluecharm/context using file tools.
3
+ mode: primary
4
+ ---
5
+
6
+ # Agent: Data model list (coordination JSON)
7
+
8
+ | Field | Value |
9
+ | ----- | ----- |
10
+ | **AGENT_ID** | `ctx-list-data-model` |
11
+ | **Display name** | Data model list |
12
+ | **SRS-8** | §4.6 `data-model-list.json`; §6.5 Data model scope; **R6**, **R13**, **R22** |
13
+ | **Output** | `<worktree>/.gluecharm/context/data-model-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 **entities only** (`DM-*` with **`name`** and **`slug`** for **`DM-<nn>-<slug>.md`**). **Do not** embed **fields** (`FD-*`) or **relationships** (`RL-*`) in this file—they are documented in **`DM-<nn>-<slug>.md`** and optional **`DM-<nn>-fields-list.json`** (one OpenCode run per entity via **ctx-list-entity-fields**). This list is a **lightweight registry** so the model is not overloaded in one JSON pass.
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
+ ## Task (for `{{LIST_TASK_DESCRIPTION}}`)
27
+
28
+ Derive **entity-level** persistent/domain concepts from schema, migrations, ORM models, or types **only where they exist** in the worktree. Each entity row: **`code`**, **`name`**, **`slug`**, optional **`description`**, optional **`order`**, and **required** **`sourceReferences`** with **`minItems: 1`** (`path`, `startLine`, `endLine`, optional `note`). Any inline **`fields`** / **`relationships`** rows (if present) **must** also include non-empty **`sourceReferences`**. **`path`** is always a **single file**, never a folder.
29
+
30
+ ### Discovery and tools (mandatory)
31
+
32
+ 1. **Do not assume paths.** Many repos have **no** `prisma/`, `src/models/`, `src/schemas/`, or `migrations/`. **Never** call **glob** / **list** on a subdirectory until you have confirmed it exists (e.g. list the **repository root** or parent folder first). If a path is missing, **skip it**—tool errors on non-existent paths must **not** stop the task.
33
+ 2. **Always write the output file.** You **must** create **`{{OUTPUT_FILE_ABSOLUTE}}`** with schema-valid JSON before finishing. If there is **no** separate persistence layer (e.g. VS Code extension, static site, pure CLI), emit **`{ "entities": [] }`**. If you find only TypeScript interfaces, JSON Schema files, or SRS context shapes, you may list **minimal** entities grounded in those **existing** files.
34
+ 3. **Order of work:** Map what is present → read evidence files → write JSON (including empty `entities` when appropriate).
35
+
36
+ ### Empty or minimal data model
37
+
38
+ Schema allows **`"entities": []`**. Use that when the codebase has no meaningful persistent domain model to catalogue. Optionally add a short **`description`** on a single placeholder entity only if it reflects real types in repo files—never invent ORM folders.
39
+
40
+ ## JSON Schema (Draft 2020-12)
41
+
42
+ **Bundled file:** `resources/schemas/context-lists/data-model-list.schema.json`
43
+ **Materialized (`{{LIST_SCHEMA_REF}}` example):** `<worktree>/.opencode/schemas/context-lists/data-model-list.schema.json`
44
+
45
+ Emit **only** JSON that validates against this schema:
46
+
47
+ ```json
48
+ {
49
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
50
+ "$id": "https://easyspecs.ai/schemas/context-lists/data-model-list.schema.json",
51
+ "title": "data-model-list",
52
+ "$defs": {
53
+ "sourceReference": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": ["path", "startLine", "endLine"],
57
+ "properties": {
58
+ "path": {
59
+ "type": "string",
60
+ "minLength": 1,
61
+ "pattern": "^[^/]+(/[^/]+)*$",
62
+ "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."
63
+ },
64
+ "startLine": {
65
+ "type": "integer",
66
+ "minimum": 1,
67
+ "description": "1-based inclusive start line."
68
+ },
69
+ "endLine": {
70
+ "type": "integer",
71
+ "minimum": 1,
72
+ "description": "1-based inclusive end line; should be >= startLine."
73
+ },
74
+ "note": {
75
+ "type": "string",
76
+ "description": "Optional short label for this evidence span."
77
+ }
78
+ }
79
+ },
80
+ "sourceReferenceList": {
81
+ "type": "array",
82
+ "description": "Evidence spans: each item references one file + line range, never a folder path.",
83
+ "items": { "$ref": "#/$defs/sourceReference" }
84
+ },
85
+ "embeddedField": {
86
+ "type": "object",
87
+ "additionalProperties": true,
88
+ "required": ["code", "name", "sourceReferences"],
89
+ "description": "Optional inline field row on an entity (legacy); prefer DM-nn-fields-list.json when using per-entity list files.",
90
+ "properties": {
91
+ "code": {
92
+ "type": "string",
93
+ "pattern": "^FD-[0-9]+$"
94
+ },
95
+ "name": { "type": "string", "minLength": 1 },
96
+ "slug": {
97
+ "type": "string",
98
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
99
+ },
100
+ "description": { "type": "string" },
101
+ "order": { "type": "integer" },
102
+ "sourceReferences": {
103
+ "type": "array",
104
+ "minItems": 1,
105
+ "description": "Required: at least one file + line range per inline field row.",
106
+ "items": { "$ref": "#/$defs/sourceReference" }
107
+ }
108
+ }
109
+ },
110
+ "embeddedRelationship": {
111
+ "type": "object",
112
+ "additionalProperties": true,
113
+ "required": ["code", "name", "sourceReferences"],
114
+ "description": "Optional relationship row on an entity (legacy); detail markdown may carry full RL-* specs.",
115
+ "properties": {
116
+ "code": {
117
+ "type": "string",
118
+ "pattern": "^RL-[0-9]+$"
119
+ },
120
+ "name": { "type": "string", "minLength": 1 },
121
+ "description": { "type": "string" },
122
+ "order": { "type": "integer" },
123
+ "sourceReferences": {
124
+ "type": "array",
125
+ "minItems": 1,
126
+ "description": "Required: at least one file + line range per inline relationship row.",
127
+ "items": { "$ref": "#/$defs/sourceReference" }
128
+ }
129
+ }
130
+ }
131
+ },
132
+ "type": "object",
133
+ "additionalProperties": false,
134
+ "required": ["entities"],
135
+ "properties": {
136
+ "kind": {
137
+ "type": "string",
138
+ "const": "easyspecs.data-model-list",
139
+ "description": "Optional coordination document id; when present must be this value."
140
+ },
141
+ "version": {
142
+ "type": "integer",
143
+ "minimum": 1,
144
+ "description": "Optional coordination format version when present."
145
+ },
146
+ "entities": {
147
+ "type": "array",
148
+ "description": "Registry of domain entities (DM-*). Fields and relationships may live in per-entity `DM-nn-fields-list.json` or optionally inline here for compatibility with the index assembler.",
149
+ "items": {
150
+ "type": "object",
151
+ "additionalProperties": false,
152
+ "required": ["code", "name", "slug", "sourceReferences"],
153
+ "properties": {
154
+ "code": {
155
+ "type": "string",
156
+ "pattern": "^DM-[0-9]+$"
157
+ },
158
+ "name": { "type": "string", "minLength": 1 },
159
+ "slug": {
160
+ "type": "string",
161
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
162
+ },
163
+ "description": { "type": "string" },
164
+ "order": { "type": "integer" },
165
+ "sourceReferences": {
166
+ "type": "array",
167
+ "minItems": 1,
168
+ "description": "Required: at least one file + line range per entity row.",
169
+ "items": { "$ref": "#/$defs/sourceReference" }
170
+ },
171
+ "fields": {
172
+ "type": "array",
173
+ "items": { "$ref": "#/$defs/embeddedField" }
174
+ },
175
+ "relationships": {
176
+ "type": "array",
177
+ "items": { "$ref": "#/$defs/embeddedRelationship" }
178
+ }
179
+ }
180
+ }
181
+ },
182
+ "revisionLog": {
183
+ "type": "array",
184
+ "description": "Append-only log of substantive edits; add an entry whenever this pass changes rows, merges, or refines the coordination file.",
185
+ "items": {
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": ["summary"],
189
+ "properties": {
190
+ "at": {
191
+ "type": "string",
192
+ "description": "ISO-8601 timestamp when known."
193
+ },
194
+ "summary": {
195
+ "type": "string",
196
+ "minLength": 1,
197
+ "maxLength": 2000,
198
+ "description": "What was added, changed, or refined in this write."
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+ ```
206
+
207
+ **Example (no ORM — valid minimal output):**
208
+
209
+ ```json
210
+ {
211
+ "entities": [],
212
+ "revisionLog": [{ "summary": "Stub entities array; extend revisionLog on every substantive pass." }]
213
+ }
214
+ ```
215
+
216
+ **Example (with entities — no nested fields/relationships):**
217
+
218
+ ```json
219
+ {
220
+ "entities": [
221
+ {
222
+ "code": "DM-01",
223
+ "name": "User",
224
+ "slug": "user",
225
+ "description": "Core user aggregate",
226
+ "sourceReferences": [
227
+ { "path": "src/models/User.ts", "startLine": 1, "endLine": 80, "note": "entity type" }
228
+ ]
229
+ }
230
+ ],
231
+ "revisionLog": [
232
+ { "summary": "Initial entity registry; extend this array on every substantive merge or refinement pass." }
233
+ ]
234
+ }
235
+ ```
236
+
237
+ ## Barriers
238
+
239
+ After `data-model-list.json` is valid, parallel **`DM-<nn>-<slug>.md`** per entity. **Fields** and **relationships** are authored in entity detail markdown and/or optional **`DM-<nn>-fields-list.json`** / relationships lists per PLAN—not in this coordination file.
240
+
241
+ ## OpenCode wiring
242
+
243
+ §3.5.2. Scope writes to the single output JSON path only.