@jaimevalasek/aioson 1.30.2 → 1.33.1

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 (49) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +19 -6
  3. package/docs/en/5-reference/cli-reference.md +1 -1
  4. package/docs/pt/5-referencia/comandos-cli.md +1 -1
  5. package/docs/pt/5-referencia/harness-retro.md +2 -1
  6. package/package.json +1 -1
  7. package/src/cli.js +38 -21
  8. package/src/commands/classify.js +389 -327
  9. package/src/commands/harness-retro-promote.js +387 -0
  10. package/src/commands/prototype-check.js +163 -0
  11. package/src/commands/verify-implementation.js +428 -0
  12. package/src/commands/workflow-next.js +222 -9
  13. package/src/constants.js +2 -0
  14. package/src/lib/retro/retro-render.js +10 -1
  15. package/src/lib/retro/retro-sources.js +45 -27
  16. package/src/lib/retro/verification-reports.js +230 -0
  17. package/src/runtime-store.js +13 -9
  18. package/src/verification/evidence-bundle.js +251 -0
  19. package/src/verification/ledger-store.js +221 -0
  20. package/src/verification/path-policy.js +74 -0
  21. package/src/verification/policy-engine.js +95 -0
  22. package/src/verification/prompt-package.js +314 -0
  23. package/src/verification/redaction.js +77 -0
  24. package/src/verification/report-parser.js +132 -0
  25. package/src/verification/report-store.js +97 -0
  26. package/src/verification/result.js +16 -0
  27. package/src/verification/runners/index.js +319 -0
  28. package/src/verification/runtime-telemetry.js +144 -0
  29. package/src/verification/schema.js +276 -0
  30. package/src/verification/source-discovery.js +153 -0
  31. package/template/.aioson/agents/analyst.md +9 -6
  32. package/template/.aioson/agents/briefing-refiner.md +22 -0
  33. package/template/.aioson/agents/briefing.md +69 -12
  34. package/template/.aioson/agents/design-hybrid-forge.md +18 -14
  35. package/template/.aioson/agents/dev.md +23 -10
  36. package/template/.aioson/agents/deyvin.md +3 -2
  37. package/template/.aioson/agents/product.md +15 -11
  38. package/template/.aioson/agents/qa.md +13 -4
  39. package/template/.aioson/agents/scope-check.md +19 -5
  40. package/template/.aioson/agents/sheldon.md +4 -3
  41. package/template/.aioson/agents/ux-ui.md +3 -2
  42. package/template/.aioson/docs/feature-expansion-taxonomy.md +31 -3
  43. package/template/.aioson/docs/prototype-contract.md +81 -0
  44. package/template/.aioson/skills/process/briefing-expansion-scout/SKILL.md +25 -3
  45. package/template/.aioson/skills/process/design-hybrid-forge/SKILL.md +5 -3
  46. package/template/.aioson/skills/process/design-hybrid-forge/references/external-source-ingestion.md +89 -0
  47. package/template/.aioson/skills/process/product-scope-expansion/SKILL.md +29 -2
  48. package/template/.aioson/skills/process/prototype-forge/SKILL.md +92 -0
  49. package/template/.aioson/skills/process/sheldon-expansion-audit/SKILL.md +23 -2
@@ -73,6 +73,18 @@ If the user declines application, leave `briefings.md` unchanged and record skip
73
73
 
74
74
  If feedback contains unresolved blocking items, do not hand off as ready for `@product`. The next action is to resolve blockers or rerun refinement.
75
75
 
76
+ ### Generate prototype (optional visual refinement)
77
+
78
+ Use this when the user asks to see the solution visually, or when a rich-surface briefing (workspaces, boards, cards, pipelines, CRM/Kanban, dashboards, admin/management surfaces, repeated-use CRUD) would benefit from validating screens and interactions before the PRD. It is optional and user-invoked — never block the briefing path on it.
79
+
80
+ 1. Resolve the briefing slug and read `briefings.md` plus the operational surface map (`solution-options.md` / `expansion-scout.md`, falling back to the surface map in `.aioson/docs/feature-expansion-taxonomy.md`).
81
+ 2. Read `design_skill` from `.aioson/context/project.context.md`. If it is blank for a `site`/`web_app`, ask which installed design skill to use before building — do not auto-pick one.
82
+ 3. Load `.aioson/skills/process/prototype-forge/SKILL.md` and follow its build contract.
83
+ 4. Write `.aioson/briefings/{slug}/prototype.html` and `.aioson/briefings/{slug}/prototype-manifest.md`.
84
+ 5. Tell the user the prototype is **mock-only** (refresh resets, no backend) and that it is a `draft` until @product/@sheldon freeze scope, at which point it is re-synced and locked as the development reference.
85
+
86
+ The prototype never edits `briefings.md` and never becomes canonical feedback; structured JSON from the review flow remains the only source of applied changes.
87
+
76
88
  ## Review HTML contract
77
89
 
78
90
  `review.html` must be static, local, and self-contained:
@@ -94,6 +106,7 @@ If feedback contains unresolved blocking items, do not hand off as ready for `@p
94
106
  - Never approve a briefing automatically.
95
107
  - Never route directly to `@product` while blocking items remain unresolved.
96
108
  - Never treat edited HTML or DOM state as canonical feedback.
109
+ - Never treat `prototype.html` as the briefing source of truth or as applied feedback; it is a visual reference only.
97
110
  - Never write refinement JSON into `.aioson/context/`.
98
111
  - Never refine a briefing with `prd_generated` set unless the user explicitly chooses a new PRD/enrichment route outside this agent.
99
112
  - Never drop mandatory briefing sections.
@@ -110,6 +123,13 @@ Review generation writes:
110
123
  .aioson/briefings/{slug}/expansion-scout.md # only when expansion scout is triggered
111
124
  ```
112
125
 
126
+ Prototype generation (optional) writes:
127
+
128
+ ```text
129
+ .aioson/briefings/{slug}/prototype.html
130
+ .aioson/briefings/{slug}/prototype-manifest.md
131
+ ```
132
+
113
133
  Confirmed application updates:
114
134
 
115
135
  ```text
@@ -123,6 +143,8 @@ Confirmed application updates:
123
143
  - If review was generated: user opens `review.html`, saves/exports feedback, then reactivates `@briefing-refiner`.
124
144
  - If changes were applied and no blockers remain: user runs `aioson briefing:approve . --slug={slug}`, then activates `@product`.
125
145
  - If blockers remain: user resolves them in the review and reactivates `@briefing-refiner`.
146
+ - If a prototype was generated: user opens `prototype.html` to validate screens/interactions, requests visual changes if needed, then proceeds to `@product` — the PRD references the prototype, and it is locked as the development reference once scope is frozen.
147
+ - **Rich-surface recommendation (non-blocking):** if the briefing has a rich operational surface (workspaces, boards, cards, pipelines, CRM/Kanban, dashboards, admin/management, repeated-use CRUD) and no prototype exists yet, recommend running `@briefing-refiner` prototype mode before `@product` — it surfaces missing management screens and broken interactions before the PRD. The deterministic trigger is `aioson classify . --feature={slug}` reporting `recommend_prototype: true` (rich operational surface detected, EN or pt-BR); surface that to the user as the reason. Recommend only; never block the route to `@product`.
126
148
 
127
149
  ## Observability
128
150
 
@@ -14,15 +14,15 @@ Evaluate this immediately after reading this file and before loading any other c
14
14
  If the user only activates `@briefing` (or points at this file) without naming a plan file, briefing slug, or concrete briefing task:
15
15
 
16
16
  1. When the CLI is available, run `aioson context:select . --agent=briefing --mode=planning --task="agent activation without concrete task" --paths=""`.
17
- 2. Load only: `.aioson/context/project.context.md` (for `interaction_language` and framing), the YAML frontmatter of `.aioson/briefings/config.md` (registry list), and a filename listing of `plans/` (names only — do not read file contents).
17
+ 2. Load only: `.aioson/context/project.context.md` (for `interaction_language` and framing), the YAML frontmatter of `.aioson/briefings/config.md` (registry list), and a filename listing of `plans/` (names only — do not read file contents).
18
18
  3. Present the Activation protocol menu (existing briefings, plan selection, or the conversational-mode offer) and stop.
19
19
 
20
20
  Do NOT load on activation: `plans/*.md` contents, `prd*.md`, `.aioson/context/done/MANIFEST.md`, `.aioson/rules/`, `.aioson/docs/`, design docs, bootstrap files, dossiers, `briefing-craft.md`, `web-research-cache.md`, `hardening-lane.md`, or any process skill. Each of those loads later, only at the step that needs it, after the user picks a lane.
21
21
 
22
22
  ## Context loading modes
23
23
 
24
- Before concrete `context:select`, run discovery: `aioson context:search . --query="<task>" --agent=briefing --mode=<mode> --task="<task>" --paths="<paths>" --json 2>/dev/null || true`. Hits are hints only.
25
-
24
+ Before concrete `context:select`, run discovery: `aioson context:search . --query="<task>" --agent=briefing --mode=<mode> --task="<task>" --paths="<paths>" --json 2>/dev/null || true`. Hits are hints only.
25
+
26
26
  Use explicit modes instead of eager-loading rules, docs, memories, and design docs.
27
27
 
28
28
  - **PLANNING** — inspect source lists, briefing registry, frontmatter, memory summaries, cache indexes, and `context:select`; do not load full rule/doc folders.
@@ -97,7 +97,7 @@ After the user selects which plans to use:
97
97
 
98
98
  **1. Read selected plans**
99
99
  - Read each selected `plans/*.md` file fully.
100
- - Read `.aioson/context/project.context.md` for project context.
100
+ - Read `.aioson/context/project.context.md` for project context.
101
101
  - Scan `.aioson/context/` for existing PRDs (`prd*.md`) — load titles/summaries only to avoid duplicating committed work.
102
102
  - Also read `.aioson/context/done/MANIFEST.md` if present — it lists delivered (archived) features so you can dedupe against completed work without globbing the archive. Do NOT load the archived files themselves unless the user explicitly requests history.
103
103
 
@@ -108,6 +108,8 @@ Apply enrichment:
108
108
  - Check `researchs/` before web search. Load `.aioson/skills/static/web-research-cache.md` only when an external claim, product pattern, market assumption, technology decision, or time-sensitive convention needs validation.
109
109
  - Use web search only for stale/missing evidence that can change the briefing's risks, options, or open questions.
110
110
  - Load `.aioson/skills/process/aioson-spec-driven/references/hardening-lane.md` only before classifying gaps or deciding whether the idea is hardenable.
111
+ - Load `.aioson/skills/process/briefing-expansion-scout/SKILL.md` when the idea has a rich operational surface: workspaces, boards, cards, pipelines, CRM/Kanban behavior, collaboration, admin/management surfaces, repeated-use CRUD, dashboards, editors/builders, automation, templates, or media output. For these ideas, write `.aioson/briefings/{slug}/expansion-scout.md` before the briefing is considered complete enough for product.
112
+ - Run **Horizontal solution exploration** (see below) when the goal admits more than one viable solution shape, or whenever the idea has a rich operational surface. Write `.aioson/briefings/{slug}/solution-options.md` before proposing the slug — breadth is the point; no option is approved here, @product chooses later.
111
113
  - Identify gaps: what is missing in the plans to make a safe decision.
112
114
  - Map risks: what could go wrong with the proposed approach.
113
115
 
@@ -138,7 +140,7 @@ aioson dossier:add-finding . --slug={slug} --agent=briefing --section="Agent Tra
138
140
 
139
141
  Treat every briefing conversation as a short decision loop:
140
142
 
141
- - Before asking, mine the evidence already in hand first: `.aioson/context/project.context.md`, selected `plans/`, and the files chosen by `context:select` — do not open `.aioson/rules/`, docs, design docs, bootstrap memory, dossiers, or handoffs wholesale to hunt for answers.
143
+ - Before asking, mine the evidence already in hand first: `.aioson/context/project.context.md`, selected `plans/`, and the files chosen by `context:select` — do not open `.aioson/rules/`, docs, design docs, bootstrap memory, dossiers, or handoffs wholesale to hunt for answers.
142
144
  - Prefer the `context:select --mode=planning` result over broad folder loading.
143
145
  - If the answer is in source plans, selected context, code/search artifacts, memory summaries, or fresh/cached web sources, use that evidence instead of asking.
144
146
  - Do not ask shallow questions that can be answered from those files or from existing configuration.
@@ -191,6 +193,22 @@ Schema shape:
191
193
  }
192
194
  ```
193
195
 
196
+ ### Horizontal solution exploration
197
+
198
+ Default to breadth before committing to one direction. A briefing that explores a single solution shape hands @product a narrow, often incomplete frame — the most common cause of thin PRDs and broken first builds.
199
+
200
+ Run this when the goal admits more than one viable solution shape, or whenever the idea has a rich operational surface (workspaces, boards, cards, pipelines, CRM/Kanban, dashboards, editors/builders, automation, admin/management surfaces, repeated-use CRUD).
201
+
202
+ **Exception — single fixed solution.** If the user has already committed to one specific solution AND its operational surface is complete (every Core object names its create/list/edit/archive/restore and management surface), do not force the 3-5 fan-out. Capture any meaningfully different alternative you weighed as a one-paragraph `Alternatives considered` note in the briefing and proceed. Use the full fan-out only when the direction is genuinely open or the operational surface still has gaps — completeness is never waived, only the breadth of options.
203
+
204
+ 1. Generate 3-5 candidate solution shapes — meaningfully different approaches, not cosmetic variants.
205
+ 2. For each shape, attach its **Operational Surface** using the Operational Surface Map in `.aioson/docs/feature-expansion-taxonomy.md`: the Core objects and the minimum management surfaces the shape must always include to be usable (where each object is created, listed/selected, edited, archived/restored, and the first-use empty state). A shape is not described until its Core objects can be *managed*, not just named.
206
+ 3. Classify each shape: value, risk, effort, and completeness. Mark the recommended shape and say why.
207
+ 4. Ground breadth in evidence: check `researchs/` first, stay within the session web-query budget, cite market/competitor sources in `## Sources`, and save findings to `researchs/{slug}/summary.md` for @product and @sheldon.
208
+ 5. Write `.aioson/briefings/{slug}/solution-options.md` (format in **Output contract**) and reference it from `## Proposed solution` and **Additional files** in `briefings.md`.
209
+
210
+ This stays exploratory: do not approve a shape, do not turn it into PRD scope, and do not collapse the options back into one — keep them visible so @product chooses with the trade-offs in hand.
211
+
194
212
  ## Mode: Conversational (no plans)
195
213
 
196
214
  When `plans/` is empty or the user wants to plan via conversation:
@@ -212,6 +230,8 @@ If the user describes a feature (settings page, dashboard, file upload), probe f
212
230
  **C — Proposed solution**
213
231
  > "What direction are you considering? Multiple is fine — this is not a commitment yet, just hypotheses."
214
232
 
233
+ When the user offers (or the goal admits) more than one viable direction, or the surface is rich, run **Horizontal solution exploration** and write `solution-options.md` — capture the shapes side by side with their operational surfaces instead of narrowing to one too early.
234
+
215
235
  **D — Risks (Cagan's four + risk of inaction)**
216
236
  Cover four risk lenses: **Value** (will users want it?), **Usability** (can they figure it out?), **Feasibility** (can we build it?), **Viability** (legal, ethics, P&L, brand, support burden). Then capture the cost of inaction. Ask only for lenses not already answered by evidence.
217
237
 
@@ -230,11 +250,13 @@ After the 5 topics, sweep all unresolved items. Each numbered question must be t
230
250
 
231
251
  **Quality gate before writing:** if more than 3 open questions remain unclassified or vague, do another conversation pass instead of writing the briefing — it's not ready.
232
252
 
233
- **Load `.aioson/docs/briefing/briefing-craft.md`** when: an existing briefing reads as PM-handover-ready (it shouldn't yet), the conversation produces feature-shaped problems instead of JTBD-shaped ones, the briefing has > 3 unanswered open questions, a Theme is complex enough to warrant partitioning, or you need the switch-interview script for real-user JTBD framing. The doc has strong-vs-weak markers, Opportunity Solution Tree structure, full Cagan four-risks framing, and a switch-interview script.
234
-
235
- **Load `.aioson/skills/process/briefing-expansion-scout/SKILL.md`** when the user asks whether an idea is worth pursuing, the briefing is too thin for team discussion, or the idea has a rich surface (workflow, collaboration, editor/builder, generator, dashboard, automation, templates, media output). Write `.aioson/briefings/{slug}/expansion-scout.md`; keep it exploratory and do not turn it into PRD scope.
236
-
237
- ## Mode: Continue / modify existing briefing
253
+ If the idea has a rich operational surface and no expansion scout / operational surface map was produced, load `.aioson/skills/process/briefing-expansion-scout/SKILL.md` now and write the scout first. Do not let a Trello/Kanban/CRM/workspace-like briefing advance with only generic nouns like "boards", "cards", or "workspaces"; the briefing must at least flag where those objects are created, edited, archived, selected, and what first-use empty states exist.
254
+
255
+ **Load `.aioson/docs/briefing/briefing-craft.md`** when: an existing briefing reads as PM-handover-ready (it shouldn't yet), the conversation produces feature-shaped problems instead of JTBD-shaped ones, the briefing has > 3 unanswered open questions, a Theme is complex enough to warrant partitioning, or you need the switch-interview script for real-user JTBD framing. The doc has strong-vs-weak markers, Opportunity Solution Tree structure, full Cagan four-risks framing, and a switch-interview script.
256
+
257
+ **Load `.aioson/skills/process/briefing-expansion-scout/SKILL.md`** when the user asks whether an idea is worth pursuing, the briefing is too thin for team discussion, or the idea has a rich surface (workflow, collaboration, editor/builder, generator, dashboard, automation, templates, media output, workspaces, boards, cards, pipelines, operational CRUD, admin/management surfaces, Trello/CRM/Kanban behavior). Write `.aioson/briefings/{slug}/expansion-scout.md`; keep it exploratory and do not turn it into PRD scope.
258
+
259
+ ## Mode: Continue / modify existing briefing
238
260
 
239
261
  After the user selects which briefing to continue:
240
262
 
@@ -315,6 +337,41 @@ briefings:
315
337
 
316
338
  **Status lifecycle:** `draft` → `approved` → `implemented`
317
339
 
340
+ ### `.aioson/briefings/{slug}/solution-options.md` (optional)
341
+
342
+ Write this whenever **Horizontal solution exploration** runs. It holds the breadth so `briefings.md` stays lean and just references it. @product reads it when present to choose the shape; no option is approved here.
343
+
344
+ ```markdown
345
+ ---
346
+ slug: {slug}
347
+ created_at: {ISO-date}
348
+ recommended: {option-id}
349
+ ---
350
+
351
+ # Solution options — {Title}
352
+
353
+ > Exploratory. No option is approved here; @product chooses.
354
+
355
+ ## Option A — {name}
356
+ - Shape: [the approach in 1-2 lines]
357
+ - Operational surface:
358
+
359
+ | Object | Parent / owner | Required actions | Management surface | Empty / error states |
360
+ |---|---|---|---|---|
361
+
362
+ - Value / Risk / Effort / Completeness: ...
363
+
364
+ ## Option B — {name}
365
+ [same structure]
366
+
367
+ ## Comparison
368
+ | Option | Value | Risk | Effort | Completeness | Recommended |
369
+ |---|---|---|---|---|---|
370
+
371
+ ## Recommendation
372
+ [Which shape and why — for @product to weigh, not a commitment.]
373
+ ```
374
+
318
375
  ## Additional theme files (optional)
319
376
 
320
377
  When a topic within the briefing is complex enough to warrant its own file, create it at `.aioson/briefings/{slug}/{specific-theme}.md`.
@@ -346,7 +403,7 @@ Skip silently when the dossier is absent.
346
403
  - **Never overwrite an existing briefing** without confirming with the user first.
347
404
  - **Slug must be confirmed** by the user before any file is written.
348
405
  - **Never recommend `@sheldon` (or any post-PRD agent) as the next step.** The only handoff from `@briefing` is `@product`. If the briefing surfaces a need for `@sheldon` / `@architect` / `@analyst` expertise, record that need inside the briefing (Risks / Open questions) as a *recommendation for `@product`'s enrichment phase*. `@product` decides when to invoke specialists after the PRD exists. See `briefing-craft.md` §1 "Mitigating weak markers" for examples.
349
- - Use `interaction_language` (fallback: `conversation_language`) from `.aioson/context/project.context.md` for all interaction and output.
406
+ - Use `interaction_language` (fallback: `conversation_language`) from `.aioson/context/project.context.md` for all interaction and output.
350
407
 
351
408
  ## Responsibility boundary
352
409
 
@@ -379,5 +436,5 @@ Skip silently when the dossier is absent.
379
436
  aioson briefing:approve # mark as approved
380
437
  ```
381
438
  Then: activate `/aioson:agent:product` — it will detect the approved briefing automatically.
382
- > Recommended: `/compact` first when continuing the same feature. Use `/clear` only for a hard reset, feature switch, polluted context, or security-sensitive reset.
439
+ > Recommended: `/compact` first when continuing the same feature. Use `/clear` only for a hard reset, feature switch, polluted context, or security-sensitive reset.
383
440
  ---
@@ -13,16 +13,17 @@ Follow the first-party process skill at `.aioson/skills/process/design-hybrid-fo
13
13
 
14
14
  ## Required input
15
15
 
16
- - Exactly 2 primary design skills to fuse (and 0–2 optional modifier skills) — chosen by the user in Step 1 Intake
17
- - `.aioson/skills/design/` and `.aioson/installed-skills/` — the available design skills to pick parents/modifiers from
16
+ - Exactly 2 primary design parents to fuse (and 0–2 optional modifiers) — chosen by the user in Step 1 Intake. Each parent or modifier may be a local AIOSON design skill OR an external DESIGN.md source (a refero.design md-example or similar portable design spec)
17
+ - `.aioson/skills/design/` and `.aioson/installed-skills/` — the available local design skills to pick parents/modifiers from
18
+ - `.aioson/skills/process/design-hybrid-forge/references/external-source-ingestion.md` — load before ingesting any external DESIGN.md source
18
19
  - `.aioson/skills/process/design-hybrid-forge/SKILL.md` — the first-party process skill this agent follows
19
- - `.aioson/context/design-variation-preset.md` (if present) — preferred visual variation overlay and `modifier_policy`, read before asking questions
20
- - `.aioson/context/project.context.md` (if present) — `interaction_language` for user-facing communication
21
-
22
- ## Context discovery
23
- Before parent/modifier selection, run `aioson context:search . --query="<hybrid design skill task>" --agent=design-hybrid-forge --mode=planning --paths=".aioson/skills/design,.aioson/installed-skills" --json 2>/dev/null || true`; hits are hints. This never replaces the deterministic design-skill validation or required process skill loading.
24
-
25
- ## Default output mode
20
+ - `.aioson/context/design-variation-preset.md` (if present) — preferred visual variation overlay and `modifier_policy`, read before asking questions
21
+ - `.aioson/context/project.context.md` (if present) — `interaction_language` for user-facing communication
22
+
23
+ ## Context discovery
24
+ Before parent/modifier selection, run `aioson context:search . --query="<hybrid design skill task>" --agent=design-hybrid-forge --mode=planning --paths=".aioson/skills/design,.aioson/installed-skills" --json 2>/dev/null || true`; hits are hints. This never replaces the deterministic design-skill validation or required process skill loading.
25
+
26
+ ## Default output mode
26
27
  Unless the user explicitly asks for marketplace/core promotion, generate a project-local installed skill:
27
28
 
28
29
  - `.aioson/installed-skills/{hybrid-name}/SKILL.md`
@@ -43,8 +44,8 @@ Do not write into `.aioson/skills/design/` or the AIOSON core gallery unless the
43
44
  1. If `.aioson/context/design-variation-preset.md` exists, read it before asking questions. Treat it as the preferred visual variation overlay and honor its `modifier_policy` when present.
44
45
  2. List available design skills from `.aioson/skills/design/` and `.aioson/installed-skills/`.
45
46
  3. Ask for:
46
- - 2 primary design skills
47
- - optional 0–2 modifier skills by default, or 0–3 in advanced mode when allowed by the preset or explicitly approved by the user
47
+ - 2 primary design parents — each either a local AIOSON design skill or an external DESIGN.md source (refero.design md-example or similar)
48
+ - optional 0–2 modifiers by default, or 0–3 in advanced mode when allowed by the preset or explicitly approved by the user
48
49
  - optional variation overlay if no preset file exists yet
49
50
  - optional name suggestion
50
51
  - optional target domain
@@ -56,6 +57,7 @@ Do not write into `.aioson/skills/design/` or the AIOSON core gallery unless the
56
57
  - primary parents are not from the same family
57
58
  - modifier skills do not duplicate a primary parent
58
59
  6. Load `references/pair-compatibility.md`.
60
+ 7. If any parent or modifier is an external DESIGN.md source, load `references/external-source-ingestion.md` now: ingest and normalize each external source into parent DNA, validate eligibility (a source missing substrate + tokens can only be a modifier), and capture its provenance (name, URL, retrieval date) for `.skill-meta.json`. External sources are references, not templates — the hybrid stays a new identity, never a clone.
59
61
 
60
62
  ## Step 2 — Identity synthesis
61
63
  Load `references/crossover-protocol.md` and complete Phase 2 with the user:
@@ -95,7 +97,7 @@ The package must include:
95
97
  - `previews/{hybrid-name}-website.html`
96
98
  - `.skill-meta.json`
97
99
 
98
- The metadata file must record author and model/provider information when the user or runtime makes it available.
100
+ The metadata file must record author and model/provider information when the user or runtime makes it available, plus a `sources[]` array naming each parent/modifier's `type` (`local`/`external`); for external DESIGN.md sources also record `url`, `retrieved_at`, and `license: "unspecified — reference only"` (refero.design and similar publish these as references, not licensed templates).
99
101
  If a variation overlay was selected, persist it in `.skill-meta.json` and reflect it in the generated previews and final SKILL.md.
100
102
  After the hybrid skill is successfully generated, archive the active preset by moving or removing `.aioson/context/design-variation-preset.md`. Keep the history copy under `.aioson/context/history/design-variation-presets/`.
101
103
 
@@ -114,6 +116,8 @@ Only if the user explicitly asks to promote the hybrid:
114
116
  - At most 2 modifiers are allowed by default.
115
117
  - Up to 3 modifiers are allowed only in advanced mode, and still cannot own substrate or structure.
116
118
  - Modifiers never own substrate or structure.
119
+ - A primary parent or modifier may be an external DESIGN.md source (refero.design md-example or similar), but it must be normalized to parent DNA via `references/external-source-ingestion.md` before use, and its provenance must be recorded in `.skill-meta.json`.
120
+ - Anti-clone: the hybrid is always a new identity. Never reproduce an external source's brand name, logo, trademarked assets, or its exact palette/wordmark 1:1, and never name the hybrid after the source.
117
121
  - The output must be a single selectable design skill, not multiple concurrently active design skills.
118
122
  - Default destination is `.aioson/installed-skills/{hybrid-name}/`.
119
123
  - Do not write into `.aioson/skills/design/` or marketplace/core files unless the user explicitly asks for promotion.
@@ -147,8 +151,8 @@ Before ending your response, always append:
147
151
  ## Next Up
148
152
  - Hybrid skill package created
149
153
  - Next step: `@dev` (apply skill) or test with target agent
150
- - `/compact` → recommended before continuing the same workflow
151
- - `/clear` → use only for a hard reset, feature switch, polluted context, or security-sensitive reset
154
+ - `/compact` → recommended before continuing the same workflow
155
+ - `/clear` → use only for a hard reset, feature switch, polluted context, or security-sensitive reset
152
156
 
153
157
  **Session artifacts written:**
154
158
  - [ ] [list each file created or modified]
@@ -46,7 +46,7 @@ Read `.aioson/context/dev-state.md` if it exists.
46
46
  - Start on `next_step` immediately — no exploration, no discovery pass.
47
47
 
48
48
  **dev-state.md NOT found (cold start):**
49
- - Read only: `.aioson/context/project.context.md` + `.aioson/context/features.md` (if present). Stop there.
49
+ - Read only: `.aioson/context/project.context.md` + `.aioson/context/features.md` (if present). Stop there.
50
50
  - **Bootstrap:** read `bootstrap/how-it-works.md` + `bootstrap/current-state.md` (hot log) if present. Older shipped work is in `bootstrap/current-state-archive.md` (cold) — `grep` / `memory:search` it before re-implementing something; never load it at activation.
51
51
  - Ask what feature/task to work on.
52
52
  - Run `aioson memory:summary . --last=5`, then `aioson context:pack . --agent=dev --goal="<goal>"`.
@@ -78,7 +78,7 @@ If `dev-state.md` lists `simple-plans/{slug}.md` in the context package, operate
78
78
  - Load the simple plan and `.aioson/docs/dev/simple-plan-lane.md`; skip PRD/spec/requirements/architecture/implementation-plan artifacts.
79
79
  - If missing `Context selected`, `Implementation intelligence`, or `Useful options considered`, enrich first: selected context, existing pattern, framework leverage, structure/data boundary.
80
80
  - Implement written scope, done criteria, expected files, and verification command.
81
- - If the work expands beyond the simple-plan lane, mark the plan `paused`, update `.aioson/context/dev-state.md`, and hand off to the correct workflow agent.
81
+ - If the work expands beyond the simple-plan lane, mark the plan `paused`, update `.aioson/context/dev-state.md`, and hand off to the correct workflow agent.
82
82
 
83
83
  Check whether a `prd-{slug}.md` file exists in `.aioson/context/` before reading anything else.
84
84
 
@@ -88,6 +88,7 @@ Load the primary package first. Then load phase-triggered files from the plan, r
88
88
  - `requirements-{slug}.md` — data shape, rules, ACs, migrations, edge cases.
89
89
  - `architecture.md` — module boundaries, integrations, auth/security, shared contracts.
90
90
  - `ui-spec-{slug}.md` (project mode: `ui-spec.md`) — UI components, frontend routes, states, copy placement, visual QA.
91
+ - `.aioson/briefings/{slug}/prototype.html` when the PRD has a `## Prototype reference` — the development source for screens and interactions. Load `.aioson/docs/prototype-contract.md`; reproduce its Core screens and interactions against the real stack, and never ship a Core action it demonstrates ("add card", "create board", "manage members") while the build lacks it. It is mock-only — copy the behavior, not the mock persistence.
91
92
  - PRD / Sheldon enrichment — only when product ambiguity blocks implementation.
92
93
  - `discovery.md` / `spec.md` — only when project-level entity maps or conventions are needed.
93
94
 
@@ -187,7 +188,7 @@ If `framework_installed=true` in `project.context.md`:
187
188
 
188
189
  ## Context integrity
189
190
 
190
- Read `.aioson/context/project.context.md` before implementation and keep it trustworthy.
191
+ Read `.aioson/context/project.context.md` before implementation and keep it trustworthy.
191
192
 
192
193
  Rules:
193
194
  - If the file is inconsistent with the actual scope or stack already proven by the active artifacts, repair the objectively inferable metadata inside the workflow before coding.
@@ -216,11 +217,23 @@ After a slice lands a *new* reusable pattern, append a node to the brain (q rate
216
217
  - Before the first edit, state in your working notes that the design-doc and readiness artifacts (slugged `-{slug}.md` in feature mode) were loaded for SMALL/MEDIUM work. If either is absent, stop and route to `@discovery-design-doc`.
217
218
  - If `.aioson/plans/{slug}/harness-contract.json` exists, run `aioson harness:check . --slug={slug}` before declaring a phase done; for MEDIUM or harness-driven work use `aioson harness:check . --slug={slug} --strict` so binary criteria without executable `verification` stay visible as blockers.
218
219
  - Before handing off to `@qa`, run `aioson ac:test-audit . --feature={slug}` when a feature slug exists. If any AC is missing test evidence, add the missing test or route explicitly to `@tester`; do not rely on prose QA sign-off to cover it.
219
- - Before editing any touched file, estimate whether the resulting file can exceed 500 lines. If yes, emit the file-size alert and 2-3 concrete split/extraction options before continuing.
220
-
221
- ## Built-in dev modules
222
-
223
- The detailed dev protocol is split into on-demand framework docs:
220
+ - Before editing any touched file, estimate whether the resulting file can exceed 500 lines. If yes, emit the file-size alert and 2-3 concrete split/extraction options before continuing.
221
+
222
+ ## Implementation verification ledger
223
+
224
+ Use `aioson verify:implementation` when a feature slug exists and any trigger applies: MEDIUM user-facing behavior, rich prototype surface, material before/after fix, accepted AC/spec/plan, or a dev summary with known gaps or unverified behavior. Skip it for typo-only docs, mechanical formatting, local experiments, and MICRO work with no durable behavior.
225
+
226
+ Protocol:
227
+
228
+ 1. Before or during implementation, run `aioson verify:implementation . --feature={slug} --prepare-ledger --json` and keep `.aioson/context/features/{slug}/implementation-ledger.md` current with explicit claims, evidence, commands, and gaps.
229
+ 2. Before handoff, run `aioson verify:implementation . --feature={slug} --check-ledger --json`. If `ready_for_prompt:false`, fix the ledger or name why verification is advisory.
230
+ 3. Use `aioson verify:implementation . --feature={slug} --build-prompt --policy=strict --json` only when a clean auditor/manual report is needed. This prepares evidence; it does not run an external model.
231
+ 4. When a verification report exists, run `aioson verify:implementation . --feature={slug} --check-report=<path> --policy=strict --json`. `NEEDS_DEV_FIX` blocks dev handoff; `NEEDS_SCOPE_DECISION` routes to `@product`/`@sheldon`; `NEEDS_QA_RECHECK` routes to `@qa`; `INCONCLUSIVE` names missing evidence before continuing.
232
+ 5. Never run `aioson verify:implementation --tool=...` automatically from workflow handoff. External auditors are opt-in only; if strict verification is needed and no report exists, build the prompt/report package or ask for explicit runner authorization.
233
+
234
+ ## Built-in dev modules
235
+
236
+ The detailed dev protocol is split into on-demand framework docs:
224
237
 
225
238
  - `.aioson/docs/dev/stack-conventions.md`
226
239
  - `.aioson/docs/dev/execution-discipline.md`
@@ -321,8 +334,8 @@ Interface copy, onboarding text, email content, and marketing text are not withi
321
334
 
322
335
  ## Hard constraints
323
336
  - Use `interaction_language` (fallback: `conversation_language`) from project context for all interaction/output.
324
- - **AC→test floor (all classifications, incl. MICRO):** no acceptance criterion (PRD or requirements) may be marked done while it has zero tests. Tests carry the same weight as code at the completion gate. Prefer naming tests with the exact `AC-*` ID so `aioson ac:test-audit . --feature={slug}` can prove coverage deterministically.
325
- - For SMALL/MEDIUM implementation, do not write code before confirming the design-doc and readiness artifacts exist (`design-doc-{slug}.md`/`readiness-{slug}.md` in feature mode, `design-doc.md`/`readiness.md` in project mode). Load the one named by `.aioson/context/dev-state.md` at activation and load the other before edits when readiness/design details are needed for the touched paths.
337
+ - **AC→test floor (all classifications, incl. MICRO):** no acceptance criterion (PRD or requirements) may be marked done while it has zero tests. Tests carry the same weight as code at the completion gate. Prefer naming tests with the exact `AC-*` ID so `aioson ac:test-audit . --feature={slug}` can prove coverage deterministically.
338
+ - For SMALL/MEDIUM implementation, do not write code before confirming the design-doc and readiness artifacts exist (`design-doc-{slug}.md`/`readiness-{slug}.md` in feature mode, `design-doc.md`/`readiness.md` in project mode). Load the one named by `.aioson/context/dev-state.md` at activation and load the other before edits when readiness/design details are needed for the touched paths.
326
339
  - If a touched file is expected to exceed 500 lines, pause with an explicit file-size alert and concrete split options.
327
340
  - Never present multiple open questions in one turn when `profile=creator` (or absent/auto). When a real decision requires user input, use `AskUserQuestion` with a localized recommendation marker on the first option, plain-language `why`, and a localized non-default pause option. Never fire `AskUserQuestion` on agent activation without a stated task — see decision-presentation Rule 7.
328
341
  - If discovery/architecture is ambiguous, ask for clarification before implementing guessed behavior.
@@ -191,8 +191,9 @@ Keep scouts capped at 3 per parent session and 20 files per scope. If more is ne
191
191
  - Always use PLANNING before EXECUTING; never load full `.aioson/rules/`, `.aioson/docs/`, or `.aioson/design-docs/` without a selected reason.
192
192
  - Load `.aioson/context/design-doc*.md` and `.aioson/context/readiness*.md` before SMALL/MEDIUM implementation or continuity edits only when they are selected or required by the active feature/slice.
193
193
  - Apply selected `.aioson/design-docs/` governance before creating files, splitting modules, naming APIs, or adding reusable code.
194
- - If a touched file may exceed 500 lines, alert with 2-3 split options. In pair mode wait one turn; if no response and change is narrow, use least risky split.
195
- - Do not silently replace `@product`, `@analyst`, or `@architect` when the task clearly needs them.
194
+ - If a touched file may exceed 500 lines, alert with 2-3 split options. In pair mode wait one turn; if no response and change is narrow, use least risky split.
195
+ - For non-trivial feature work, keep `.aioson/context/features/{slug}/implementation-ledger.md` current with `aioson verify:implementation --prepare-ledger/--check-ledger`; validate any existing report with `--check-report` before handoff.
196
+ - Do not silently replace `@product`, `@analyst`, or `@architect` when the task clearly needs them.
196
197
  - Do not route bounded technical work to `@product` only because it needs a small plan; use the Simple Plan lane instead.
197
198
  - When the immediate scope gate triggers, do not code first. Output only the handoff and the reason.
198
199
  - Keep changes narrow and reviewable. Ask before taking a broad or risky step.
@@ -12,7 +12,7 @@ Evaluate this immediately after reading this file and before loading any other c
12
12
  If the user only activates `@product` without naming a feature, source document, briefing, or concrete product task:
13
13
 
14
14
  1. When the CLI is available, run `aioson context:select . --agent=product --mode=planning --task="agent activation without concrete task" --paths=""`.
15
- 2. Load only: `.aioson/context/project.context.md`, filename listings of `plans/` and `prds/` (names only — no file contents), the YAML frontmatter of `.aioson/briefings/config.md`, and the `.aioson/context/features.md` table.
15
+ 2. Load only: `.aioson/context/project.context.md`, filename listings of `plans/` and `prds/` (names only — no file contents), the YAML frontmatter of `.aioson/briefings/config.md`, and the `.aioson/context/features.md` table.
16
16
  3. Present the starting menu (continue the `in_progress` feature, follow an approved briefing, start from a listed source, or enrichment) and stop.
17
17
 
18
18
  Do NOT load on activation: `plans/`/`prds/` contents, `prd*.md` contents, dossiers, handoffs, bootstrap, rules/docs (including the product modules), or any skill. `aioson memory:summary . --last=5` stays allowed. Everything else loads later via the modes below.
@@ -81,7 +81,7 @@ After source selection, extract goals, user needs, constraints, and feature desc
81
81
 
82
82
  Before the first user-facing question, build a compact evidence map:
83
83
 
84
- 1. Read `.aioson/context/project.context.md`, selected source documents, `.aioson/context/features.md`, and files selected by `context:select --mode=planning`. For existing PRDs read titles/frontmatter first — full content only for PRDs the current feature touches; load the dossier only for the active slug and prior handoffs only when selected.
84
+ 1. Read `.aioson/context/project.context.md`, selected source documents, `.aioson/context/features.md`, and files selected by `context:select --mode=planning`. For existing PRDs read titles/frontmatter first — full content only for PRDs the current feature touches; load the dossier only for the active slug and prior handoffs only when selected.
85
85
  2. If the feature depends on existing behavior, inspect available discovery/scan artifacts and targeted code search before asking the user to describe what the code already does.
86
86
  3. Check `researchs/` for fresh cache entries when market, product pattern, pricing, competitor, compliance, or time-sensitive UX assumptions would change the PRD.
87
87
  4. Run fresh web search only for stale/missing evidence that can change scope, risk, positioning, or options.
@@ -176,7 +176,7 @@ Status lifecycle: `in_progress` → `done`, `paused`, or `abandoned`.
176
176
  - `in_progress` = active; blocks opening another feature until resolved. `paused` = intentionally parked, non-blocking. `done` / `abandoned` = closed.
177
177
 
178
178
  **Integrity check — run this before every Feature mode conversation:**
179
- 1. Read `.aioson/context/features.md` if it exists.
179
+ 1. Read `.aioson/context/features.md` if it exists.
180
180
  2. Check for any entry with `status: in_progress`.
181
181
  3. If found, stop and offer: continue, pause, abandon, or summarize `prd-{slug}.md`. Do not start a new feature until the user resolves the open one.
182
182
  4. Ignore `paused`, `done`, and `abandoned` entries for the blocking check.
@@ -187,8 +187,8 @@ Status lifecycle: `in_progress` → `done`, `paused`, or `abandoned`.
187
187
  2. Confirm: "I'll save this as `prd-{slug}.md` — does that work?"
188
188
  3. Write `prd-{slug}.md`.
189
189
  After writing the PRD, emit: `aioson runtime:emit . --agent=product --type=milestone --summary="PRD written: {slug}, classification: {class}" 2>/dev/null || true`
190
- 4. Add or update `.aioson/context/features.md`: `| {slug} | in_progress | {ISO-date} | — |`
191
- Create `.aioson/context/features.md` if it does not yet exist. If a row for `{slug}` already exists, update it in place — never append a second row for the same slug (a duplicate `in_progress` row breaks the `aioson feature:current` resolver and downstream slug routing).
190
+ 4. Add or update `.aioson/context/features.md`: `| {slug} | in_progress | {ISO-date} | — |`
191
+ Create `.aioson/context/features.md` if it does not yet exist. If a row for `{slug}` already exists, update it in place — never append a second row for the same slug (a duplicate `in_progress` row breaks the `aioson feature:current` resolver and downstream slug routing).
192
192
  After registering, emit: `aioson runtime:emit . --agent=product --type=milestone --summary="Feature registered: {slug}" 2>/dev/null || true`
193
193
 
194
194
  ## Required input
@@ -211,7 +211,7 @@ If the project already has code:
211
211
 
212
212
  ## Context integrity
213
213
 
214
- Read `.aioson/context/project.context.md` before any product decision.
214
+ Read `.aioson/context/project.context.md` before any product decision.
215
215
 
216
216
  Rules:
217
217
  - If the file is inconsistent with the active project artifacts or with decisions already confirmed in the conversation, correct the objectively inferable fields inside the workflow before continuing.
@@ -237,7 +237,7 @@ Run this before asking the first product question or writing any PRD:
237
237
  2. Load `.aioson/skills/process/decision-presentation/SKILL.md` only before a real user-facing decision question.
238
238
  3. Load `.aioson/docs/product/conversation-playbook.md` only when a conversation/intake is actually needed.
239
239
  4. Load `.aioson/docs/product/research-loop.md` before the first research-backed synthesis, finalize decision, or web search; derive the current keyword set.
240
- 5. Load `.aioson/skills/process/product-scope-expansion/SKILL.md` only when a scout exists, the user asks for richer options, or a rich-surface feature needs approved expansion; write `.aioson/context/features/{slug}/scope-expansion.md` before PRD incorporation.
240
+ 5. Load `.aioson/skills/process/product-scope-expansion/SKILL.md` when a scout exists, the user asks for richer options, a rich-surface feature needs approved expansion, or the feature implies workspaces, boards, cards, pipelines, CRM/Kanban behavior, collaboration, admin/management surfaces, repeated-use CRUD, dashboards, editors/builders, automation, templates, or media output; write `.aioson/context/features/{slug}/scope-expansion.md` before PRD incorporation.
241
241
  6. Before writing/updating any PRD, run `context:select --mode=executing`, then load `.aioson/docs/product/quality-lens.md` and `.aioson/docs/product/prd-contract.md`.
242
242
  7. If `project_type` is `site`/`web_app`, `design_skill` is set, or visual quality is mentioned, preserve the design-skill decision and `## Visual identity`.
243
243
 
@@ -251,7 +251,7 @@ The essential product conversation rules are:
251
251
  2. Cadence by `profile` (from `project.context.md`): `creator` (or absent/auto) → 1 decision per turn via `AskUserQuestion` with a localized recommendation marker on the first option and a localized pause option always available; `developer` → up to 5 numbered decisions per batch; `team` → up to 5 per batch + emit executive summary at `agent:epilogue`/`agent:done`
252
252
  3. End every batch with: `6 - Finalize — write the PRD now with what we have.`
253
253
  4. Reflect understanding before opening a new topic
254
- 5. Surface edge cases, ownership, empty states, dependencies, and failure modes proactively — before "Finalize", every acceptance criterion must state its failure/empty behavior, not only the happy path. Defer full per-entity enumeration to @analyst, but do not write an AC whose error path is undefined.
254
+ 5. Surface edge cases, ownership, empty states, dependencies, and failure modes proactively — before "Finalize", every acceptance criterion must state its failure/empty behavior, not only the happy path. Defer full per-entity enumeration to @analyst, but do not write an AC whose error path is undefined. For every named Core product object, force an operational surface check: where the user creates it, lists/selects it, edits it, deletes/archives it, restores it if applicable, and what management page/modal/panel owns that behavior.
255
255
  6. Narrow scope when the user is expanding too broadly
256
256
  7. No filler openers
257
257
  8. Ask one unresolved decision question per branch, then give one explicit recommendation in the same turn when confidence is high.
@@ -269,6 +269,10 @@ The essential product conversation rules are:
269
269
  Creation / enrichment mode writes `.aioson/context/prd.md`.
270
270
  Feature mode writes `.aioson/context/prd-{slug}.md`.
271
271
 
272
+ Before writing, rich-surface PRDs must have their Core operational surfaces incorporated from `product-scope-expansion`: the relevant objects and management surfaces belong in `## MVP scope`, `## User flows`, `## Out of scope`, or `## Open questions`. Do not route to implementation while a Core action such as "add card", "edit board", "create workspace", or "manage members" is only implied by a noun.
273
+
274
+ When a prototype exists (`.aioson/briefings/{slug}/prototype.html`), add a `## Prototype reference` section to the PRD pointing to the prototype + manifest and its lock status, and keep the PRD consistent with it. Load `.aioson/docs/prototype-contract.md` for the section format and lock semantics; mark the prototype `locked` once scope is frozen. The prototype is the authoritative screen/interaction reference downstream — the PRD is how it reaches @analyst, @architect, @dev, and the rest of the chain.
275
+
272
276
  The exact PRD structure, visual identity rules, and next-step routing live in:
273
277
 
274
278
  - `.aioson/docs/product/quality-lens.md`
@@ -278,7 +282,7 @@ The exact PRD structure, visual identity rules, and next-step routing live in:
278
282
 
279
283
  After writing the PRD, always emit a structured handoff message. Do not end the session without it.
280
284
 
281
- **Sensitive-surface floor — check before choosing the MICRO handoff:** if the feature touches money/payments, auth, ownership/authz, uploads, external URLs/webhooks, secrets/credentials, or sensitive storage, it is **not** MICRO even with no new entities. Set `classification: SMALL`, use the SMALL/MEDIUM handoff (route to @sheldon/@analyst), and never go straight to @dev. When the CLI is available, run `aioson classify . --feature={slug}` and honor `floored: true`. The floor only raises the tier.
285
+ **Sensitive-surface floor — check before choosing the MICRO handoff:** if the feature touches money/payments, auth, ownership/authz, uploads, external URLs/webhooks, secrets/credentials, or sensitive storage, it is **not** MICRO even with no new entities. Set `classification: SMALL`, use the SMALL/MEDIUM handoff (route to @sheldon/@analyst), and never go straight to @dev. Rich operational surfaces (workspaces, boards/cards, Kanban/CRM pipelines, CRUD/admin management) also floor to at least SMALL for the same reason — they need management screens, so they must not take the MICRO shortcut that skips @analyst/@architect/the prototype. When the CLI is available, run `aioson classify . --feature={slug}` and honor `floored: true` (reported under `sensitive_surfaces` and/or `operational_surfaces`). The floor only raises the tier. When the same command reports `recommend_prototype: true`, ensure a clickable prototype exists before finalizing — if none does, route back to `@briefing-refiner` prototype mode first; the deterministic tool, not just prose, is asking for it.
282
286
 
283
287
  **For new features (SMALL/MEDIUM):**
284
288
  ```
@@ -343,13 +347,13 @@ If a question is outside product scope, redirect briefly: "That's an architectur
343
347
  - Keep PRD files focused: if a section is growing beyond 5 bullet points, summarize.
344
348
  - Always run the integrity check before starting a feature conversation — never skip it.
345
349
  - Never start a new feature while another is `in_progress` in `features.md` without explicit user confirmation to continue, pause, or abandon it.
346
- - **Always register every new feature in `.aioson/context/features.md` before ending the session.** No PRD is complete without a corresponding `.aioson/context/features.md` entry. Create `.aioson/context/features.md` if it does not exist.
350
+ - **Always register every new feature in `.aioson/context/features.md` before ending the session.** No PRD is complete without a corresponding `.aioson/context/features.md` entry. Create `.aioson/context/features.md` if it does not exist.
347
351
  - **Sensitive-surface floor:** never route a feature to @dev as MICRO when it touches money/auth/ownership/uploads/external URLs/secrets/sensitive storage — set `classification: SMALL` and route through @analyst.
348
352
  - **Always emit the structured handoff** after writing the PRD. The session is not done until the next agent and action are explicit.
349
353
 
350
354
  ## Dev handoff producer
351
355
 
352
- When classification is **MICRO** (next agent is `@dev` directly), produce `.aioson/context/dev-state.md` before the final `agent:epilogue`/`agent:done` call so the next `/aioson:agent:dev` session auto-resumes on cold start:
356
+ When classification is **MICRO** (next agent is `@dev` directly), produce `.aioson/context/dev-state.md` before the final `agent:epilogue`/`agent:done` call so the next `/aioson:agent:dev` session auto-resumes on cold start:
353
357
 
354
358
  ```bash
355
359
  aioson dev:state:write . --feature={slug} \
@@ -183,10 +183,19 @@ Both `@tester` and `@pentester` are official AIOSON agents. Surface them explici
183
183
  - Verdict is trending PASS (no unresolved Critical/High) — `@validator` is the final binary gate immediately before `feature:close`
184
184
  > "Harness contract detected ({path}). Activate `/aioson:agent:validator` to run binary verification of `criteria[]` before `feature:close`. The validator first executes the contract's `verification` commands deterministically via `aioson harness:check . --slug={slug}` and only LLM-judges criteria without one. Prefer the fresh-context route: `aioson harness:validate . --slug={slug}` generates a self-contained `validator-prompt.txt` (criteria + check results + diff vs base) to execute in an isolated subagent — schema in `.aioson/docs/sheldon/harness-contract.md`."
185
185
 
186
- When AIOSON CLI is available and feature mode is MEDIUM, prefer the tracked invocation `aioson agent:invoke pentester . --mode=app_target --feature={slug} --scope="{target}"` instead of telling the user to type the slash command — same effect, dashboard logs the run. The same convention applies to `@validator` via `aioson agent:invoke validator . --feature={slug}`.
187
-
188
- ## Review process
189
- 1. **Map AC items** from `prd.md` — mark each: covered / partial / missing.
186
+ When AIOSON CLI is available and feature mode is MEDIUM, prefer the tracked invocation `aioson agent:invoke pentester . --mode=app_target --feature={slug} --scope="{target}"` instead of telling the user to type the slash command — same effect, dashboard logs the run. The same convention applies to `@validator` via `aioson agent:invoke validator . --feature={slug}`.
187
+
188
+ ## Implementation verification evidence
189
+
190
+ If `.aioson/context/features/{slug}/implementation-ledger.md` exists, include its claims/gaps in the QA evidence map. If `.aioson/context/features/{slug}/verification-report.md` or a relevant `verification-runs/*-report.md` exists, validate it with `aioson verify:implementation . --feature={slug} --check-report=<path> --policy=strict --json` before Gate D.
191
+
192
+ - `NEEDS_DEV_FIX`, `NEEDS_SECURITY_REVIEW`, or `INCONCLUSIVE` with missing required evidence blocks Gate D until routed and resolved.
193
+ - `NEEDS_SCOPE_DECISION` routes to `@product`/`@sheldon`; QA must not silently accept scope drift.
194
+ - `NEEDS_QA_RECHECK` means rerun the named checks before PASS.
195
+ - Absence of a report is not itself a failure unless the dev handoff or feature policy made verification strict; record it as residual risk when relevant.
196
+
197
+ ## Review process
198
+ 1. **Map AC items** from `prd.md` — mark each: covered / partial / missing.
190
199
  2. **Risk-first review** — work through checklist by category.
191
200
  3. **Write missing tests** — for Critical/High findings, write the test. Do not just describe it. **AC→test floor (all classifications):** every AC marked `missing` or `partial` must get at least one test before the feature can close — write it for Critical/High, otherwise route the uncovered ACs to `@tester`. No AC ships with zero tests. Run `aioson ac:test-audit . --feature={slug}` and treat a failed audit as Gate D blocked evidence, not advisory prose.
192
201
  4. **Deliver report** — ordered by severity, each finding: location + risk + fix.
@@ -71,11 +71,25 @@ Find the highest-authority source for each claim:
71
71
  2. Planned work: analyst requirements/spec, architecture, design-doc, readiness, UI/PM/orchestrator outputs, implementation plan.
72
72
  3. Delivered work: `git diff`, changed files, dev-state, test output, QA/tester/pentester findings, last handoff.
73
73
 
74
- If the answer is in the code or diff, inspect it instead of asking.
75
-
76
- ## Review Loop
77
-
78
- ### 1. Name the scope
74
+ If the answer is in the code or diff, inspect it instead of asking.
75
+
76
+ ## Implementation verification reports
77
+
78
+ In `post-dev`, `post-fix`, or `final` mode, treat `.aioson/context/features/{slug}/implementation-ledger.md` and verification reports as delivery evidence, not as proof. If `.aioson/context/features/{slug}/verification-report.md` or a relevant `verification-runs/*-report.md` exists, run `aioson verify:implementation . --feature={slug} --check-report=<path> --policy=strict --json` before issuing your verdict.
79
+
80
+ When `workflow:next` injects an `Implementation verification briefing`, consume its policy verdict and route as the already-validated machine surface for the latest local report. Do not run `--tool` from `@scope-check`; external runner execution remains opt-in and belongs to explicit dev/operator authorization. A briefing `PASS` still requires normal diff and scope comparison before approval.
81
+
82
+ - `PASS`: continue your normal scope comparison; a PASS does not replace diff review.
83
+ - `NEEDS_DEV_FIX`: route to `@dev` with the finding `file:line`.
84
+ - `NEEDS_SCOPE_DECISION`: route to `@product` or `@sheldon`; do not patch scope locally.
85
+ - `NEEDS_QA_RECHECK`: route to `@qa`.
86
+ - `INCONCLUSIVE`: name the missing evidence and block only if the implementation relied on that report or the trigger policy made verification strict.
87
+
88
+ If the ledger exists but no report exists and the dev handoff claims high-risk/rich-surface completion, request a prompt/report package from `@dev` instead of approving by summary.
89
+
90
+ ## Review Loop
91
+
92
+ ### 1. Name the scope
79
93
  Identify project vs feature mode, slug (via **Feature slug resolution**), selected mode, source artifacts, and missing evidence.
80
94
 
81
95
  If a required PRD or analyst artifact is missing in `pre-dev`, stop and route to the owner. If a `post-*` mode has no diff or delivery artifact to inspect, report that limitation explicitly.
@@ -260,7 +260,7 @@ After RF-04:
260
260
  2. If the PRD names technologies, integrations, or technical patterns that may be stale, load `.aioson/docs/sheldon/web-intelligence.md`
261
261
  3. Before presenting improvements, sizing, in-place enrichment, or phased-plan output, load `.aioson/docs/sheldon/quality-lens.md`
262
262
  4. Before presenting improvements, sizing, in-place enrichment, or phased-plan output, load `.aioson/docs/sheldon/enrichment-paths.md`
263
- 5. Load `.aioson/skills/process/sheldon-expansion-audit/SKILL.md` when expansion artifacts exist or the PRD has a rich surface but seems too thin or inflated; write/read `.aioson/context/features/{slug}/expansion-audit.md` before final enrichment decisions.
263
+ 5. Load `.aioson/skills/process/sheldon-expansion-audit/SKILL.md` when expansion artifacts exist, the PRD has a rich surface but seems too thin or inflated, or the PRD implies workspaces, boards, cards, pipelines, CRM/Kanban behavior, collaboration, admin/management surfaces, repeated-use CRUD, dashboards, editors/builders, automation, templates, or media output; write/read `.aioson/context/features/{slug}/expansion-audit.md` before final enrichment decisions.
264
264
 
265
265
  Do not create enrichment output until the research loop, quality lens, enrichment-paths docs, and required expansion audit have been loaded.
266
266
 
@@ -268,8 +268,9 @@ Do not create enrichment output until the research loop, quality lens, enrichmen
268
268
 
269
269
  After consolidating sources:
270
270
 
271
- - identify missing requirements, edge cases, acceptance-criteria gaps, unresolved technical decisions, unmapped dependencies, incomplete user flows, and contradictions
272
- - present improvements by priority
271
+ - identify missing requirements, edge cases, acceptance-criteria gaps, unresolved technical decisions, unmapped dependencies, incomplete user flows, and contradictions
272
+ - audit operational surface completeness for every Core object: parent/owner, lifecycle, create/list/edit/delete/archive/restore behavior, management surface, empty/error states, and permissions. Missing Core add/edit/manage flows are critical gaps, not optional improvements.
273
+ - present improvements by priority
273
274
  - ask the user which improvements to apply
274
275
  - score the scope
275
276
  - justify whether the result should stay in-place or become a phased external plan
@@ -41,11 +41,11 @@ Apply when `project_type=site` and the operation is `default-create` or `refine-
41
41
 
42
42
  ## Activation guard
43
43
 
44
- If activated without a feature slug or concrete task: read only `.aioson/context/project.context.md` + `.aioson/context/project-pulse.md` (or run `aioson context:select . --agent=ux-ui --mode=planning --task="agent activation without concrete task"`), report the current stage, ask what to design, and stop. Do not load PRDs, discovery, or architecture before that answer.
44
+ If activated without a feature slug or concrete task: read only `.aioson/context/project.context.md` + `.aioson/context/project-pulse.md` (or run `aioson context:select . --agent=ux-ui --mode=planning --task="agent activation without concrete task"`), report the current stage, ask what to design, and stop. Do not load PRDs, discovery, or architecture before that answer.
45
45
 
46
46
  ## Feature slug resolution
47
47
 
48
- Resolve `{slug}` before choosing any output path — never guess it or write feature work to a bare filename. Run `aioson feature:current . 2>/dev/null` (single source of truth: pulse `active_feature`, else the unique `in_progress` feature). A non-empty slug means feature mode — write `ui-spec-{slug}.md`. Empty output: run `aioson feature:current . --json` and branch on `source` — `none` is genuine project mode (write the bare `ui-spec.md`), while `ambiguous: true` means several features are `in_progress`, so ask which `{slug}` and never pick one. An explicit activation slug wins but still writes the slugged path. Without the CLI, read `active_feature` from `.aioson/context/project-pulse.md`, falling back to the lone `in_progress` row in `.aioson/context/features.md`. Never overwrite another feature's `ui-spec-{slug}.md`.
48
+ Resolve `{slug}` before choosing any output path — never guess it or write feature work to a bare filename. Run `aioson feature:current . 2>/dev/null` (single source of truth: pulse `active_feature`, else the unique `in_progress` feature). A non-empty slug means feature mode — write `ui-spec-{slug}.md`. Empty output: run `aioson feature:current . --json` and branch on `source` — `none` is genuine project mode (write the bare `ui-spec.md`), while `ambiguous: true` means several features are `in_progress`, so ask which `{slug}` and never pick one. An explicit activation slug wins but still writes the slugged path. Without the CLI, read `active_feature` from `.aioson/context/project-pulse.md`, falling back to the lone `in_progress` row in `.aioson/context/features.md`. Never overwrite another feature's `ui-spec-{slug}.md`.
49
49
 
50
50
  ## Required input
51
51
 
@@ -53,6 +53,7 @@ Load each item at the step that needs it — never all upfront:
53
53
 
54
54
  - `.aioson/context/project.context.md`
55
55
  - `.aioson/context/prd.md` or `prd-{slug}.md` when present
56
+ - `.aioson/briefings/{slug}/prototype.html` when the PRD has a `## Prototype reference` — the authoritative screen/interaction/visual realization; load `.aioson/docs/prototype-contract.md` and refine on top of it, never contradict it
56
57
  - `.aioson/context/discovery.md` when selected because current flows/entities affect UI
57
58
  - `.aioson/context/architecture.md` when selected because component boundaries, routes, or frontend architecture affect UI
58
59
  - `.aioson/context/spec-{slug}.md` (feature mode, if present)