@sireai/optimus 0.1.42 → 0.1.43

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 (47) hide show
  1. package/dist/cli/optimus.js +57 -39
  2. package/dist/cli/optimus.js.map +1 -1
  3. package/dist/integrations/feishu/feishu-doc-service.d.ts +14 -2
  4. package/dist/integrations/feishu/feishu-doc-service.js +33 -12
  5. package/dist/integrations/feishu/feishu-doc-service.js.map +1 -1
  6. package/dist/integrations/feishu/feishu-document-reader.d.ts +33 -0
  7. package/dist/integrations/feishu/feishu-document-reader.js +597 -0
  8. package/dist/integrations/feishu/feishu-document-reader.js.map +1 -0
  9. package/dist/task-environment/delivery/delivery-warning-copy.d.ts +2 -0
  10. package/dist/task-environment/delivery/delivery-warning-copy.js +24 -0
  11. package/dist/task-environment/delivery/delivery-warning-copy.js.map +1 -0
  12. package/dist/task-environment/delivery/feishu-analysis-doc-service.d.ts +32 -2
  13. package/dist/task-environment/delivery/feishu-analysis-doc-service.js +343 -17
  14. package/dist/task-environment/delivery/feishu-analysis-doc-service.js.map +1 -1
  15. package/dist/task-environment/delivery/feishu-card-primitives.d.ts +33 -0
  16. package/dist/task-environment/delivery/feishu-card-primitives.js +95 -0
  17. package/dist/task-environment/delivery/feishu-card-primitives.js.map +1 -0
  18. package/dist/task-environment/delivery/feishu-card-renderer.d.ts +1 -0
  19. package/dist/task-environment/delivery/feishu-card-renderer.js +34 -71
  20. package/dist/task-environment/delivery/feishu-card-renderer.js.map +1 -1
  21. package/dist/task-environment/delivery/feishu-content/feishu-copy-config.js +1 -0
  22. package/dist/task-environment/delivery/feishu-content/feishu-copy-config.js.map +1 -1
  23. package/dist/task-environment/delivery/feishu-notifier.js +4 -0
  24. package/dist/task-environment/delivery/feishu-notifier.js.map +1 -1
  25. package/dist/task-environment/delivery/pm-feishu-card-renderer.d.ts +19 -0
  26. package/dist/task-environment/delivery/pm-feishu-card-renderer.js +177 -0
  27. package/dist/task-environment/delivery/pm-feishu-card-renderer.js.map +1 -0
  28. package/dist/task-environment/delivery/sentry-feishu-card-renderer.d.ts +1 -0
  29. package/dist/task-environment/delivery/sentry-feishu-card-renderer.js +33 -70
  30. package/dist/task-environment/delivery/sentry-feishu-card-renderer.js.map +1 -1
  31. package/dist/task-environment/delivery/task-delivery-service.d.ts +6 -1
  32. package/dist/task-environment/delivery/task-delivery-service.js +136 -8
  33. package/dist/task-environment/delivery/task-delivery-service.js.map +1 -1
  34. package/dist/types.d.ts +2 -0
  35. package/package.json +1 -1
  36. package/task-harnesses/bugfix/ACCEPT.md +3 -2
  37. package/task-harnesses/bugfix/CONSTRAINTS.md +10 -4
  38. package/task-harnesses/bugfix/EVOLUTION.md +2 -8
  39. package/task-harnesses/bugfix/ROLE.md +7 -11
  40. package/task-harnesses/bugfix/STANDARD.md +81 -0
  41. package/task-harnesses/pm/ACCEPT.md +27 -57
  42. package/task-harnesses/pm/CONSTRAINTS.md +40 -36
  43. package/task-harnesses/pm/CONTEXT.md +32 -37
  44. package/task-harnesses/pm/EVOLUTION.md +61 -27
  45. package/task-harnesses/pm/ROLE.md +25 -27
  46. package/task-harnesses/pm/STANDARD.md +426 -129
  47. package/task-harnesses/pm/ANNOTATION_PATTERN.md +0 -58
@@ -1,68 +1,275 @@
1
1
  # STANDARD
2
2
 
3
- Defines the mandatory execution sequence, result contract, and closure standard.
3
+ Defines the mandatory PM execution flow, artifact contract, and delivery standard.
4
4
 
5
5
  ## Execution sequence
6
6
  Complete work in this order:
7
7
 
8
8
  1. `Read`
9
9
  - read the full source requirement document
10
- - extract explicit goals, users, flows, states, constraints, and missing information
11
- - identify review-critical rules such as thresholds, counts, ordering, gating, frequency limits, role boundaries, and content-type distinctions
10
+ - extract goals, users, flows, states, constraints, open questions, and explicit source facts
11
+ - identify review-critical rules such as thresholds, counts, ordering, gating, permissions, formulas, and content-type distinctions
12
12
 
13
13
  2. `Map`
14
14
  - build a requirement map before designing screens or writing HTML
15
- - include at minimum:
15
+ - include:
16
16
  - product goal
17
17
  - target user
18
+ - bounded scope
18
19
  - entry point
19
20
  - core flow
20
21
  - key states
21
- - requirement-critical rules
22
+ - critical rules
22
23
  - explicit non-goals
23
24
  - open questions
24
25
 
25
26
  3. `Plan Representation`
26
- - for each requirement-critical rule, choose exactly one:
27
+ - for each critical rule, choose exactly one:
27
28
  - `Represented Interactively`
28
29
  - `Represented via Annotation`
29
30
  - `Downgraded / Simulated`
30
31
  - `Not Represented`
31
- - prefer interaction for core user behavior and decision-critical meaning
32
- - use annotation when meaning is review-critical but not faithfully expressible through lightweight interaction
33
- - use downgrade/simulation only when it still supports useful review
34
- - choose `Represented Interactively` only when the prototype will contain clear behavioral evidence of that rule
35
- - if the rule is mainly conveyed by explanation, scenario toggles, or approximation rather than direct behavior, classify it as `Represented via Annotation` or `Downgraded / Simulated`
32
+ - use `Represented Interactively` only when the prototype will contain direct behavioral evidence
33
+ - use `Represented via Annotation` when the rule is review-critical but not faithfully expressible through lightweight interaction
36
34
 
37
35
  4. `Frame`
38
- - define the minimum prototype scope that makes the core flow reviewable
39
- - decide covered screens, transitions, states, and review-mode needs
36
+ - define the minimum screen and state set that makes the accepted scope reviewable
40
37
  - reduce breadth before inventing detail
41
- - record only the minimum assumptions needed for continuity
38
+ - keep assumptions minimal and explicit
42
39
 
43
40
  5. `Build`
44
- - produce one reviewable interactive HTML prototype package
45
- - convert requirement meaning into UI structure, interaction, and visible states
46
- - add review mode when rule meaning cannot be carried clearly by interaction alone
47
- - use annotation content to mark `Confirmed`, `Simulated`, and `Open Question` where helpful
41
+ - produce one reviewable `prototype.html`
42
+ - make the main path, major states, and key transitions inspectable
43
+ - add anchored review annotations where interaction is insufficient
48
44
 
49
- 6. `Deliver`
45
+ 6. `Review`
46
+ - explicitly spawn one reviewer subagent after the first build
47
+ - reviewer input must include:
48
+ - source requirement document
49
+ - source URL when available
50
+ - accepted scope
51
+ - requirement map
52
+ - representation plan
53
+ - `prototype.html` when present
54
+ - `result.md`
55
+ - `annotations.json` when present
56
+ - previous review findings and builder revisions when this is round 2 or 3
57
+ - current round number and maximum round count
58
+ - reviewer must judge against the reviewer rubric defined below
59
+ - record one review round log entry containing:
60
+ - round number
61
+ - reviewer verdict
62
+ - key gaps
63
+ - recommended revisions or explicit approval
64
+
65
+ 7. `Revise`
66
+ - if the reviewer finds material gaps, revise the prototype and rerun the reviewer subagent
67
+ - maximum review rounds: 3 total
68
+ - stop early when:
69
+ - the reviewer approves closure, or
70
+ - another revise-and-review pass is unlikely to improve trustworthiness materially
71
+ - if the final reviewer verdict still finds material gaps after the maximum rounds, downgrade closure instead of looping further
72
+ - the builder must read the latest reviewer output before revising
73
+ - each new review round must include:
74
+ - the previous reviewer findings
75
+ - what the builder changed
76
+ - what the builder intentionally did not change and why
77
+
78
+ 8. `Deliver`
50
79
  - generate `result.md`
51
- - declare outputs precisely
52
- - surface assumptions, open questions, uncovered areas, and representation choices explicitly
80
+ - generate `annotations.json` whenever a prototype exists
81
+ - generate `review-log.md` whenever the reviewer loop ran
82
+ - declare deviations, simulations, and unresolved implementation-critical points precisely
53
83
 
54
84
  If execution stops early, explain which step could not be completed and why.
55
85
 
86
+ ## Review loop standard
87
+ - the reviewer subagent must be explicitly requested; do not assume it will appear automatically
88
+ - the reviewer must not rewrite the prototype directly; it judges and recommends
89
+ - the builder applies revisions and owns the updated artifacts
90
+ - provide the reviewer with facts first, not builder conclusions first
91
+ - the reviewer should treat the source requirement and produced artifacts as primary evidence; builder framing is supporting context only
92
+ - reviewer findings do not justify unlimited scope growth, denser chrome, or extra speculative screens by default
93
+ - each review round should classify every material finding as one of:
94
+ - `Must Fix Before Complete`
95
+ - `Can Ship As Partial`
96
+ - `Open Question`
97
+ - examples of `Must Fix Before Complete`:
98
+ - missing core flow coverage
99
+ - important requirement content is omitted, misunderstood, or inconsistent with the source document
100
+ - missing or materially wrong key rule representation
101
+ - deeper business or interaction logic is only described textually and not demonstrated clearly enough through the prototype
102
+ - explicit source fact drift that changes review interpretation
103
+ - simulated behavior presented as if it were faithful interaction
104
+ - annotation layer and `annotations.json` disagree on important meaning
105
+ - the artifact set is too weak to guide downstream AI coding without major guessing about rules, state behavior, or implementation intent
106
+ - UI quality is materially below design-review expectations, especially when the requirement document already contains screenshots, diagrams, or strong structural visual cues that were not meaningfully used
107
+ - examples of `Can Ship As Partial`:
108
+ - useful prototype exists, but some non-core states remain merged or downgraded
109
+ - some important but secondary rules remain annotation-only or simulated
110
+ - the core design direction is usable, but parts of the visual system or interaction polish still fall below designer-grade expectations
111
+ - examples of `Open Question`:
112
+ - requirement ambiguity prevents stronger representation without invention
113
+
114
+ ## Reviewer input contract
115
+ Each reviewer round should receive these inputs in this priority order:
116
+
117
+ 1. `Source facts`
118
+ - requirement document
119
+ - source URL when available
120
+ - explicit accepted scope
121
+
122
+ 2. `Produced artifacts`
123
+ - `prototype.html` when present
124
+ - `result.md`
125
+ - `annotations.json` when present
126
+
127
+ 3. `Builder framing`
128
+ - requirement map
129
+ - representation plan
130
+ - declared deviations, simulations, and unresolved points
131
+
132
+ 4. `Round context`
133
+ - current round number
134
+ - maximum rounds: `3`
135
+ - previous reviewer findings and builder revisions for rounds 2 and 3
136
+
137
+ ## Reviewer output contract
138
+ Each reviewer round must produce a compact review record that the builder can consume directly.
139
+
140
+ Minimum fields:
141
+ - `Round`
142
+ - `Reviewer Verdict`
143
+ - `Coverage Assessment`
144
+ - `Logic Demonstrability Assessment`
145
+ - `AI Coding Readiness Assessment`
146
+ - `UI Fidelity Assessment`
147
+ - `Core Panel Visibility Check`
148
+ - `New Regression Since Previous Round`
149
+ - `Must Fix Before Complete`
150
+ - `Can Ship As Partial`
151
+ - `Open Questions`
152
+ - `Suggested Revisions`
153
+
154
+ Allowed `Reviewer Verdict` values:
155
+ - `Must Fix Before Complete`
156
+ - `Can Ship As Partial`
157
+ - `Approved for Prototype Complete`
158
+
159
+ ## Builder handoff contract
160
+ After each review round, the builder must:
161
+ - read the full reviewer output
162
+ - revise the prototype and companion artifacts when `Must Fix Before Complete` findings exist
163
+ - preserve unresolved but non-blocking findings inside `result.md` when closure remains partial
164
+ - run a full core-panel self-check before requesting the next review, not only a point fix for the previous `Must Fix`
165
+ - prefer downgrade over another revise round when the next change would require speculative product invention, materially larger scope, or a noisier prototype that reduces reviewability
166
+ - write a concise round handoff into `review-log.md` containing:
167
+ - what was changed
168
+ - what was intentionally left unchanged
169
+ - why the next review should or should not still expect a gap
170
+
171
+ ## Reviewer rubric
172
+ The reviewer must evaluate the prototype against these principles in order:
173
+
174
+ 1. `Requirement completeness and correctness`
175
+ - the interactive prototype must reflect the requirement document fully enough for the accepted scope
176
+ - important requirement content must not be missing, misunderstood, or inconsistent
177
+
178
+ 2. `Logic demonstrability`
179
+ - deeper logic chains, dependencies, and cause-effect behavior must be demonstrated clearly
180
+ - the prototype must not stop at first-layer description when the requirement meaning depends on richer interaction logic
181
+
182
+ 3. `Representation correctness`
183
+ - interaction, annotation, simulation, and omission must each be used deliberately and truthfully
184
+ - if a rule needs to be understood for review, the prototype must either demonstrate it or annotate it clearly
185
+ - avoid reviewer-driven overbuilding: do not add extra flows, fake data breadth, or decorative complexity unless they directly improve requirement understanding
186
+
187
+ 4. `Implementation readiness for AI coding`
188
+ - the artifact set must give downstream AI coding enough rule context, implementation guardrails, and annotation coverage to avoid major guessing
189
+ - `result.md` and `annotations.json` must supplement the prototype where direct interaction is insufficient
190
+
191
+ 5. `UI design quality and visual fidelity`
192
+ - the prototype should reach designer-grade quality for its intended fidelity level
193
+ - visual style, layout cues, screenshots, diagrams, and structural hints from the requirement document should be used as first-priority guidance when present
194
+ - avoid generic or template-looking UI when the source document provides stronger visual direction
195
+ - every core panel must remain visibly populated and reviewable after each revision; do not accept a panel that retains only a title, labels, or empty chrome while its intended information carrier disappears
196
+ - for `Represented Interactively` modules, visible content must remain materially present:
197
+ - charts must still show visible bars, lines, points, or equivalent graphical carriers rather than only captions or axes
198
+ - explanatory panels such as scope / exclusion / guardrail areas must retain enough information density to communicate their product meaning, not collapse into thin placeholder copy
199
+ - if a revision fixes one issue but causes another panel to become visually blank, materially thinner, or harder to interpret, treat it as a new blocking regression
200
+
201
+ 6. `Artifact consistency`
202
+ - `prototype.html`, `result.md`, and `annotations.json` must agree on key rules, limitations, and truth status
203
+
204
+ 7. `Regression control after revision`
205
+ - every later review round must re-check the whole accepted prototype surface, not only the previous `Must Fix` list
206
+ - the reviewer must explicitly check for:
207
+ - newly blank or near-blank core panels
208
+ - graph containers whose DOM exists but whose intended visual content is no longer meaningfully visible
209
+ - explanatory regions whose copy became materially thinner or lost review-critical meaning
210
+ - regressions where a previously acceptable panel becomes weaker after a later fix
211
+ - if such regressions appear, record them under `New Regression Since Previous Round` and classify them as `Must Fix Before Complete` when they reduce reviewability materially
212
+ - if a proposed follow-up revision would mainly add complexity, speculative branches, or visual clutter without improving requirement truth, prefer `Prototype Partial` over further churn
213
+
214
+ ## Closure policy
215
+ - decide closure only after the final review round
216
+ - `Prototype Complete` requires:
217
+ - reviewer approval with no unresolved `Must Fix Before Complete` findings
218
+ - accepted scope, core path, major states, and key rules are reviewable
219
+ - source fact drift is absent or explicitly declared and immaterial
220
+ - deeper logic chains are demonstrated clearly enough for review
221
+ - the artifact set can guide downstream AI coding without major rule ambiguity
222
+ - UI quality is credible for design review and meaningfully uses source visual guidance when present
223
+ - `Prototype Partial` requires:
224
+ - a meaningful prototype exists
225
+ - reviewer found remaining material gaps, but the output is still useful for review
226
+ - remaining weakness is declared clearly in `result.md`
227
+ - prefer `Prototype Partial` over a larger but less truthful or less readable prototype assembled only to satisfy late review suggestions
228
+ - `Analysis Only` requires:
229
+ - no trustworthy interactive prototype was produced, or
230
+ - trustworthy completion would require heavy invention, or
231
+ - repeated review still shows the prototype is too weak to present as a meaningful interactive artifact
232
+ - do not use review-round exhaustion as a reason to mark `Prototype Complete`
233
+ - if closure is `Prototype Partial` or `Analysis Only`, state the strongest blocker or downgrade reason explicitly
234
+
56
235
  ## Prototype standard
57
- - the primary artifact is an interactive `prototype.html`
236
+ - `prototype.html` is the main review artifact
58
237
  - the prototype must make the main user flow inspectable
59
- - the prototype should support meaningful review actions such as navigation, state changes, or key transitions
60
- - prioritize depth on the core path over shallow breadth
61
- - when major requirement meaning cannot be expressed clearly by interaction alone, include review annotations
62
- - review annotations should be anchored to concrete UI targets, states, or transitions whenever possible
63
- - the prototype must remain understandable when annotations are hidden or minimized
238
+ - prefer depth on the core path over shallow breadth
239
+ - support meaningful review actions such as navigation, state changes, or key transitions
240
+ - keep the prototype understandable when annotations are hidden or minimized
241
+ - keep core panels visibly reviewable across revisions
242
+ - do not count a panel as interactively represented when its main carrier is visually missing, nearly invisible, or replaced by bare labels only
243
+ - if the accepted scope includes charted data, preserve visible graphical expression rather than text-only scaffolding
64
244
 
65
- ## Result contract
245
+ ## Annotation standard
246
+ - use a dedicated review mode when annotation density would otherwise disrupt normal reading
247
+ - keep review-only controls secondary, collapsible, or minimized
248
+ - assign stable target ids
249
+ - recommended target attribute: `data-pm-target="<id>"`
250
+ - recommended annotation attribute: `data-pm-annotation="<id>"`
251
+ - each annotation should have one primary target whenever possible
252
+ - clicking an annotation should focus its target; clicking a target affordance should reveal the linked annotation
253
+ - use stronger linkage such as numbered mapping or connector lines only when it improves readability
254
+
255
+ ### Truth semantics
256
+ - `Confirmed`: faithful to the source requirement
257
+ - `Simulated`: represented approximately for review
258
+ - `Open Question`: unresolved and review-relevant
259
+
260
+ ### Good annotation targets
261
+ - server-side rules that materially affect UX
262
+ - formulas, thresholds, ordering, permissions, and gating
263
+ - approximations that could be mistaken as final behavior
264
+ - unresolved behavior reviewers must notice
265
+
266
+ ### Bad annotation targets
267
+ - long PRD excerpts without interpretation
268
+ - screen facts already obvious from the UI
269
+ - visual design commentary with no product impact
270
+ - missing core flows that should have been prototyped directly
271
+
272
+ ## Runtime result contract
66
273
  - return exactly one runtime JSON object
67
274
  - normal completion and analysis-only closure both return `completed`
68
275
  - return `failed` only for true runtime exceptions
@@ -77,110 +284,200 @@ If execution stops early, explain which step could not be completed and why.
77
284
  }
78
285
  ```
79
286
 
80
- ## Result artifacts
287
+ ## Artifact contract
81
288
  - always generate `result.md` on normal completion
82
289
  - generate `prototype.html` for `Prototype Complete` and `Prototype Partial`
290
+ - generate `annotations.json` whenever `prototype.html` is generated
291
+ - generate `review-log.md` when the PM review loop ran
83
292
  - use repository-independent artifact paths
84
293
  - `result.md` is the only framework-required result artifact
85
- - any task-private files must be declared inside `result.md`
86
-
87
- ## Result content
88
- At minimum, `result.md` must include:
89
-
90
- ### Delivery Summary
91
- - `Closure`
92
- - `Document Basis`
93
- - `Prototype Scope`
94
- - `Core Flow`
95
- - `Platform`
96
- - `Coverage`
97
- - `Uncovered Areas`
98
- - `Assumptions`
99
- - `Open Questions`
100
- - `Next Action`
101
-
102
- ### Outputs
103
- - `Main Review Artifact`
104
- - `Additional Files`
105
- - `Output Notes`
106
-
107
- ### Requirement Mapping
108
- - `Requirement-Critical Rules`
109
- - `Represented Interactively`
110
- - `Represented via Annotation`
111
- - `Downgraded / Simulated`
112
- - `Not Represented`
113
- - `Representation Notes`
114
-
115
- ### Detail
116
- - `Product Goal`
117
- - `Target User`
118
- - `Requirement Summary`
119
- - `Covered Screens / Sections`
120
- - `Key Interactions`
121
- - `States Included`
122
- - `Confirmed Requirements Used`
123
- - `Inferred Structure`
124
- - `Interaction Fidelity Notes`
125
- - `Review Annotation Notes`
126
- - `Assumptions`
127
- - `Open Questions`
128
- - `Recommended Next Step`
129
-
130
- ## Result rules
131
- - separate confirmed requirement content from inferred structure
132
- - prefer explicit gaps over fake completeness
133
- - if annotation-assisted explanation is used, state what was annotated and why interaction was insufficient
134
- - do not claim a requirement was fully represented when it was only approximated or annotated
135
- - ensure representation fields reflect the actual prototype, not the intended prototype
136
- - if a key rule was merged or flattened for simplicity, record that downgrade explicitly
137
- - `Represented Interactively` requires clear behavioral evidence in the prototype itself, not only surrounding explanation
138
- - if a rule depends mainly on annotation, scenario controls, review notes, or narrative explanation, do not classify it as fully interactive
139
-
140
- ## Closure standard
141
- - `Prototype Complete`: accepted scope, core path, major states, and key rules are reviewable through faithful interaction or clear anchored annotation
142
- - `Prototype Partial`: a meaningful prototype exists, but important parts remain uncovered, over-merged, or materially downgraded
143
- - `Analysis Only`: no trustworthy interactive prototype was produced; explain blockers and minimum missing input
144
-
145
- ## Result template
294
+ - task-private files are optional and must support review directly
295
+
296
+ ## Feishu delivery document
297
+ - default language is Chinese unless the task explicitly requires another language
298
+ - treat the Feishu delivery document as a delivery portal, not as a second PRD
299
+ - detailed interaction belongs in `prototype.html`
300
+ - rule supplements belong in `result.md`
301
+ - structured annotation handoff belongs in `annotations.json`
302
+
303
+ ### Required structure
304
+ 1. `需求文档`
305
+ - provide the direct jump link to the source requirement
306
+
307
+ 2. `产物`
308
+ - provide the downloadable artifact set
309
+ - keep artifact purpose attached to the artifact itself
310
+ - do not duplicate artifact content in the delivery document
311
+
312
+ ## `annotations.json` contract
313
+ - purpose: machine-readable export of anchored review annotations
314
+ - paired artifact: normally `prototype.html`
315
+ - top-level fields:
316
+ - `version`
317
+ - `artifact`
318
+ - `annotations`
319
+ - `annotations` may be empty, but must exist when the file is generated
320
+
321
+ ### Each annotation record must include
322
+ - `id`
323
+ - `target`
324
+ - `type`
325
+ - `status`
326
+ - `priority`
327
+ - `title`
328
+ - `content`
329
+
330
+ ### `target` must include
331
+ - `elementId`
332
+ - optional `page`
333
+ - optional `anchor`: `top` | `right` | `bottom` | `left` | `inline` | `state`
334
+
335
+ ### Recommended enums
336
+ - `type`:
337
+ - `interaction`
338
+ - `state`
339
+ - `calculation`
340
+ - `data_rule`
341
+ - `edge_case`
342
+ - `empty_state`
343
+ - `error_state`
344
+ - `permission`
345
+ - `out_of_scope`
346
+ - `open_question`
347
+ - `status`:
348
+ - `confirmed`
349
+ - `assumption`
350
+ - `simulated`
351
+ - `open_question`
352
+ - `priority`:
353
+ - `high`
354
+ - `medium`
355
+ - `low`
356
+
357
+ ### Optional fields
358
+ - `secondaryTargets`
359
+ - `structured`
360
+ - `sourceRefs`
361
+ - `implementationImpact`
362
+ - `reviewerNote`
363
+
364
+ ### Generation rules
365
+ - create one record per review-meaningful annotation, not per DOM node
366
+ - if a rule is represented via annotation in the requirement map, it must appear here
367
+ - keep truth status aligned with the prototype
368
+ - use `structured` when formulas, state keys, limits, or forbidden interpretations matter
369
+
370
+ ### Example
371
+ ```json
372
+ {
373
+ "version": "1.0",
374
+ "artifact": "prototype.html",
375
+ "annotations": [
376
+ {
377
+ "id": "ann-load-rate-all-rule",
378
+ "target": {
379
+ "page": "power-dashboard",
380
+ "elementId": "load-rate-trend-chart",
381
+ "anchor": "right"
382
+ },
383
+ "type": "calculation",
384
+ "status": "confirmed",
385
+ "priority": "high",
386
+ "title": "All Load Rate calculation rule",
387
+ "content": "All Load Rate must be calculated as total power divided by total capacity. Average-based calculation is not allowed.",
388
+ "structured": {
389
+ "formula": "sum(room.power) / sum(room.capacity) * 100%",
390
+ "forbiddenFormula": "avg(room.loadRate)"
391
+ },
392
+ "implementationImpact": "Affects trend aggregation logic, KPI cards, and chart tooltip consistency.",
393
+ "sourceRefs": [
394
+ "Load Rate Trend > All view"
395
+ ]
396
+ }
397
+ ]
398
+ }
399
+ ```
400
+
401
+ ## `result.md` contract
402
+ Keep `result.md` dense, implementation-oriented, and in Chinese unless the task explicitly requires another language.
403
+
404
+ ### Must include
405
+ 1. `规则补充`
406
+ - implementation-critical product rules
407
+ - key business logic or calculation rules
408
+ - important state, permission, ordering, threshold, or edge-case notes
409
+
410
+ 2. `原型未完全表达的点`
411
+ - rules or branches not fully captured by direct interaction
412
+ - simulations, merges, or approximations that must not be mistaken as final behavior
413
+ - open points that materially affect implementation understanding
414
+
415
+ 3. `闭环判定`
416
+ - final closure level: `Prototype Complete` / `Prototype Partial` / `Analysis Only`
417
+ - the strongest reviewer-backed reason for that closure
418
+ - if closure is not `Prototype Complete`, the top remaining blocker or downgrade reason
419
+
420
+ ### Must not do
421
+ - do not use `result.md` as a delivery index
422
+ - do not carry `需求文档` or artifact listing here
423
+ - do not add sections such as `产物文件`, `Artifacts`, `Artifact Files`, `需求文档`, or `产物`
424
+ - do not rewrite the PRD
425
+ - do not let prototype sample data appear indistinguishable from source fact
426
+ - do not dump full per-round review logs into `result.md`; keep detailed round logs in `review-log.md`
427
+
428
+ ### Template
429
+ ```md
430
+ # 规则补充
431
+ - Load Rate 的 All 口径必须使用 total power / total capacity,不能使用平均值。
432
+ - 历史范围下 KPI `Power` 的精确定义仍待确认,当前原型仅保留交互与展示位置。
433
+ - 权限不足时仅展示空状态说明,不在原型中模拟真实鉴权流程。
434
+
435
+ # 原型未完全表达的点
436
+ - Live 数据刷新为轻量模拟,不能视为真实刷新策略。
437
+ - Last 90 Days 的聚合粒度仍需产品确认后才能进入研发实现。
438
+
439
+ # 闭环判定
440
+ - Closure Level:Prototype Partial
441
+ - 判定依据:核心路径可评审,但历史场景下 Power 统计口径仍未明确,且部分规则仍以 annotation 承载。
442
+ - 主要剩余问题:历史 Power KPI 的精确定义仍是 Open Question。
443
+ ```
444
+
445
+ ## `review-log.md` contract
446
+ - purpose: preserve the reviewer subagent loop as an audit trail
447
+ - language may be concise Chinese with stable English verdict tokens
448
+ - one round entry per review pass
449
+ - minimum fields per round:
450
+ - `Round`
451
+ - `Reviewer Verdict`
452
+ - `Must Fix`
453
+ - `Can Ship As Partial`
454
+ - `Open Questions`
455
+ - `Builder Action`
456
+ - if the first review approves the prototype directly, still record that approval round
457
+
458
+ ### Template
146
459
  ```md
147
- # Delivery Summary
148
- - Closure: Prototype Complete
149
- - Document Basis: source requirement document provided with the task
150
- - Prototype Scope: First-run onboarding only
151
- - Core Flow: Open invite -> fill profile -> complete setup
152
- - Platform: responsive
153
- - Coverage: invite landing, profile form, completion state
154
- - Uncovered Areas: admin approval flow, edge-case recovery paths
155
- - Assumptions: invite is valid for one user session
156
- - Open Questions: SSO is optional or required?
157
- - Next Action: review flow coverage and copy gaps
158
-
159
- # Outputs
160
- - Main Review Artifact: `prototype.html`
161
- - Additional Files: none
162
- - Output Notes: private outputs live under `artifactDir`
163
-
164
- # Requirement Mapping
165
- - Requirement-Critical Rules: invite entry, profile setup, completion confirmation
166
- - Represented Interactively: invite landing, profile form, submit, validation, success transition
167
- - Represented via Annotation: backend invite validation timing and account-provisioning dependency
168
- - Downgraded / Simulated: loading and approval check are simulated only
169
- - Not Represented: admin exception handling path
170
- - Representation Notes: approval timing is review-critical but backend-owned, so it is explained through anchored annotation instead of fake workflow logic
171
-
172
- # Detail
173
- - Product Goal: Reduce first-day confusion
174
- - Target User: New employee
175
- - Requirement Summary: Requirement input asks for a reviewable onboarding prototype
176
- - Covered Screens / Sections: invite landing, profile setup, confirmation
177
- - Key Interactions: start onboarding, form validation, submit, success transition
178
- - States Included: empty, validation error, loading, success
179
- - Confirmed Requirements Used: invite entry, profile setup, completion confirmation
180
- - Inferred Structure: lightweight validation and loading states to preserve flow continuity
181
- - Interaction Fidelity Notes: validation and submit flow are interactive; backend approval timing is annotation-assisted
182
- - Review Annotation Notes: approval dependency is attached to submit and success states in review mode
183
- - Assumptions: backend behavior is simulated only
184
- - Open Questions: whether manager approval is required before activation
185
- - Recommended Next Step: confirm approval rule and add branch state if needed
460
+ # Review Log
461
+
462
+ ## Round 1
463
+ - Reviewer Verdict: Must Fix Before Complete
464
+ - Must Fix:
465
+ - `All Load Rate` 计算口径未在原型或 annotation 中明确。
466
+ - Can Ship As Partial:
467
+ - 历史 Power KPI 口径仍可暂时保留为开放问题。
468
+ - Open Questions:
469
+ - `Last 90 Days` 聚合粒度是否按月展示仍待确认。
470
+ - Builder Action:
471
+ - 新增 `All Load Rate` 计算口径 annotation,并调整结果说明。
186
472
  ```
473
+
474
+ ## Final self-check
475
+ - review loop ran and did not exceed 3 rounds
476
+ - reviewer was explicitly requested as a subagent, not implied
477
+ - final closure matches the last reviewer verdict
478
+ - every material key rule has a declared representation mode
479
+ - any remaining downgraded or missing behavior is disclosed in `result.md`
480
+ - `annotations.json` matches the actual annotation layer in `prototype.html`
481
+ - `result.md` contains no delivery-index or artifact-list sections
482
+ - source facts are preserved or deviations are explicitly declared
483
+ - sample data is not presented as source truth
@@ -1,58 +0,0 @@
1
- # PM Review Annotation Pattern
2
-
3
- Reusable implementation convention for review-mode annotations in PM prototypes.
4
-
5
- ## Goal
6
- - keep the prototype itself reviewable
7
- - attach rule meaning to the exact UI it explains
8
- - avoid replacing interaction with detached explanation blocks
9
-
10
- ## Structure
11
- 1. `Review mode`
12
- - provide a dedicated toggle
13
- - keep annotation chrome hidden or minimized outside review mode
14
-
15
- 2. `Target anchors`
16
- - assign stable target ids
17
- - recommended attribute: `data-pm-target="<id>"`
18
-
19
- 3. `Annotation records`
20
- - bind each annotation to one primary target
21
- - recommended attribute: `data-pm-annotation="<id>"`
22
- - recommended fields:
23
- - `targetId`
24
- - `type`: `confirmed` | `simulated` | `open-question`
25
- - `title`
26
- - `body`
27
- - optional `secondaryTargets`
28
-
29
- 4. `Focused guidance`
30
- - selecting an annotation should highlight the bound target
31
- - optional connector lines may be used when they improve readability
32
- - prefer one focused annotation at a time
33
-
34
- ## Recommended behavior
35
- - click annotation item -> scroll target into view -> highlight target -> optionally show connector
36
- - click target badge -> open linked annotation detail
37
- - switching annotation should clear the previous focus state
38
-
39
- ## Visual semantics
40
- - `Confirmed`: neutral or positive emphasis
41
- - `Simulated`: caution emphasis
42
- - `Open Question`: unresolved emphasis
43
- - use color as reinforcement, not as the only signal
44
-
45
- ## Good annotation content
46
- - server-side rules that materially affect UX
47
- - thresholds, limits, gating, ordering, and role boundaries
48
- - prototype approximations that could otherwise be mistaken as final behavior
49
- - unresolved details reviewers must notice
50
-
51
- ## Bad annotation content
52
- - long PRD excerpts with no interpretation
53
- - generic summary already obvious from the screen
54
- - visual design commentary that does not affect product understanding
55
- - missing core flows that should have been prototyped directly
56
-
57
- ## Rule of thumb
58
- If UI alone would cause requirement misunderstanding, add an anchored annotation. If direct interaction explains the requirement better, build the interaction instead.