@pavp/storywright 1.1.0 → 1.2.0
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.
package/package.json
CHANGED
|
@@ -37,6 +37,7 @@ Invoked by `story-generate`, `story-refine`, `story-split`, and `story-from-figm
|
|
|
37
37
|
- **Data inputs** (auth scope, identifiers, format)
|
|
38
38
|
- **Constraints** (platform, accessibility, locale, SLA)
|
|
39
39
|
- **Out-of-scope assumptions**
|
|
40
|
+
- **Multi-source conflicts** (when text + image + Figma are all provided): explicit disagreement between sources MUST be surfaced. Examples: text says "Google only" but Figma shows multiple providers; text mentions 1 flow but Figma shows 3; image shows error state not mentioned in text. Never silently pick a winner.
|
|
40
41
|
2. For each axis, mark one of: ANSWERED · INFERRABLE · BLOCKING.
|
|
41
42
|
3. Drop `ANSWERED`. For `INFERRABLE`, do NOT ask — mark assumption in the story output with `> ⚠️ Assumed:`.
|
|
42
43
|
4. For `BLOCKING`, draft questions. Limit to **3 questions max per round**. Prefer multiple-choice or yes/no.
|
|
@@ -47,6 +47,14 @@ A Figma file usually represents N screens / N flows. This skill maps that visual
|
|
|
47
47
|
- Ask the user to either (a) install an MCP Figma server, (b) export the relevant frames as PNGs and drop them in chat, or (c) paste a textual description of the flows.
|
|
48
48
|
- Continue under the chosen fallback. The rest of the skill works with screenshots via Claude vision.
|
|
49
49
|
|
|
50
|
+
### Phase 0.5 — Detect companion inputs
|
|
51
|
+
|
|
52
|
+
Before extracting from Figma, check whether the user attached:
|
|
53
|
+
- **Accompanying text** (goal, story draft, constraints) — treat as canonical for `User Story / Scope / Business Goal`. Figma is canonical for `Components / States / Flows`.
|
|
54
|
+
- **Reference screenshots** — usually redundant when Figma is available; use only if Figma frames are missing states the screenshots show.
|
|
55
|
+
|
|
56
|
+
If text + Figma both describe the same flow but disagree (e.g., text says "single page form", Figma shows multi-step wizard), **surface the conflict** in clarifications and ask before drafting. Do NOT silently pick a winner. See `[[story-generate]]` "Mixed inputs" section for source priority.
|
|
57
|
+
|
|
50
58
|
### Phase 1 — Inventory
|
|
51
59
|
|
|
52
60
|
1. List pages in the file (if MCP allows).
|
|
@@ -49,9 +49,37 @@ Use vision. Extract:
|
|
|
49
49
|
### Figma links
|
|
50
50
|
If MCP Figma is available (see `[[story-from-figma]]`), use it to enumerate frames, components, navigation. If not, fall back to asking the user to drop screenshots.
|
|
51
51
|
|
|
52
|
+
### Mixed inputs (text + image + Figma)
|
|
53
|
+
|
|
54
|
+
The skill is designed to **fuse multiple sources** in a single invocation. Common pairings:
|
|
55
|
+
|
|
56
|
+
- **Text + screenshot** — text states the goal, image shows the proposed UI. Use text for `User Story / Goal / Scope`, image for `Components / States / Edge cases / UX flow`.
|
|
57
|
+
- **Text + Figma link** — text gives intent, Figma gives implementation surface. Use text for `User Story / Business goal`, Figma for `Technical considerations / Edge cases / Components / Multi-screen flows`.
|
|
58
|
+
- **Text + image + Figma** — full triangulation. Highest fidelity; also highest chance of conflict.
|
|
59
|
+
|
|
60
|
+
**Source priority (when sources disagree):**
|
|
61
|
+
|
|
62
|
+
| Section | Primary | Secondary | Tertiary |
|
|
63
|
+
|---|---|---|---|
|
|
64
|
+
| User Story / Goal | Text | Figma (frame titles, callouts) | Image |
|
|
65
|
+
| Business Rules / Scope | Text | Figma | Image |
|
|
66
|
+
| UI Components / States | Figma | Image | Text |
|
|
67
|
+
| Edge Cases | Figma + Image (states shown) | Text | — |
|
|
68
|
+
| Technical Considerations | Figma (component naming, design system refs) | Text | Image |
|
|
69
|
+
| Acceptance Criteria | Triangulate all three | — | — |
|
|
70
|
+
|
|
71
|
+
**Conflict handling:**
|
|
72
|
+
|
|
73
|
+
1. **Detect the conflict explicitly.** Example: text says "Google only" but Figma shows Google + Facebook buttons.
|
|
74
|
+
2. **Do NOT silently pick a winner.** Surface the conflict in `clarifications.md` as a BLOCKING question: *"Text says X but design shows Y — which is canonical?"*
|
|
75
|
+
3. **If the user is in-session, ask immediately** before drafting. If running batch, mark the story `DRAFT` and write both options in scope/out-of-scope with `> ⚠️ Conflict:` annotation.
|
|
76
|
+
4. **Scope coverage check:** if Figma shows N flows but text describes 1, ask whether to (a) generate 1 story bounded to text, (b) generate N stories from Figma, or (c) generate 1 story + flag remaining flows as roadmap.
|
|
77
|
+
|
|
52
78
|
## Application (step-by-step)
|
|
53
79
|
|
|
54
|
-
1. **Detect input
|
|
80
|
+
1. **Detect input types present** — text, image, figma-link, or any combination. Branch accordingly:
|
|
81
|
+
- **Single source** → process as before.
|
|
82
|
+
- **Mixed sources** → run the "Mixed inputs" protocol above, including source-priority lookup and explicit conflict detection BEFORE drafting.
|
|
55
83
|
2. **Intake gap check** — invoke `[[clarification-questions]]`. If it returns BLOCKING questions, **ask first** before drafting.
|
|
56
84
|
3. **Detect language** of input (es | en | other). Output in the input language.
|
|
57
85
|
4. **Draft skeleton** of the structured story (all 15 sections from the template).
|