@pavp/storywright 1.6.0 → 1.6.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.
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: story-split
3
- description: Split an oversize story into an epic plus Cohn+Gherkin children. Mechanical NxN dep matrix and per-child V audit. Asks ONLY in terminal. Never auto-splits.
3
+ description: Split an oversize story into an epic plus Cohn+Gherkin children. Mechanical NxN dep matrix and per-child V audit. Inherits all hard rules from storywright-base.
4
4
  trigger: "/story-split | split this story | divide this story | dividir historia | this is too big"
5
- intent: Splitting skill driven by INVEST failure reasons. Produces an epic plus N child story stubs in the v2.2 canonical Cohn+Gherkin shape, with mechanical dependency matrix and Valuable audit per child.
6
- version: 2.2.0
5
+ intent: Splitting skill driven by INVEST failure reasons. Behavior 100% identical to siblings except for source (oversize story) and split-behavior (ALWAYS produces epic + N children, never a single story).
6
+ version: 2.3.0
7
7
  inputs:
8
8
  - text
9
9
  - image
@@ -14,6 +14,7 @@ outputs:
14
14
  - story-2.md
15
15
  - .storywright-context.json
16
16
  composes:
17
+ - _components/storywright-base
17
18
  - _components/invest-checklist
18
19
  - _components/clarification-questions
19
20
  - _components/acceptance-criteria
@@ -22,114 +23,58 @@ composes:
22
23
 
23
24
  ## Purpose
24
25
 
25
- When a story is an epic in disguise, splitting badly is worse than not splitting. This skill uses established INVEST-compatible patterns to propose a clean decomposition, then mechanically verifies each child's independence and value before saving. The user always approves the plan before any child is written.
26
+ When a story is an epic in disguise, splitting badly is worse than not splitting. This skill uses established INVEST-compatible patterns to propose a clean decomposition, then mechanically verifies each child's independence and value before saving.
26
27
 
27
- ## Hard rules (v2.2 parity with refine/generate)
28
+ **All hard rules, canonical output shape, language detection, terminal-only Q, mechanical NxN dep matrix, per-child V audit, context persistence, and INVEST handling live in `[[storywright-base]]`. Read that first. Anything in this file is a SOURCE-SPECIFIC or SPLIT-BEHAVIOR delta only.**
28
29
 
29
- 1. **Terminal-only clarifications.** Never write any sidecar question file. All gap questions through `AskUserQuestion`, batched ≤4. Non-blocking gaps → `⚠️ Assumed` inline.
30
+ ## Source-specific differential
30
31
 
31
- 2. **Children are Cohn+Gherkin canonical.** Each child has ONE Use Case block + ONE AC scenario (one Given chain + one `When` + one `Then`). If a child still needs >1 `When`/`Then` recursive re-split.
32
+ - **Source:** an oversize story (any prior source generate / refine / from-figma may all hand off here). The story has failed INVEST on I, E, or S OR the deterministic pre-split count is ≥2.
33
+ - **What changes vs base:** the skill does NOT produce a single story. It ALWAYS produces an epic + N children. Each child obeys the base canonical block. The user must approve the split plan before children are written.
32
34
 
33
- 3. **No mini-PRDs in children.** Same prohibition list as refine v2.2 — no NFR blocks, no Edge Cases enumerations, no Dependencies prose, no per-claim visual specs, refinement logs ≤3 lines (≤5 if recursive split).
35
+ ## Split behavior differential
34
36
 
35
- 4. **Output language matches the user's chat language.** Auto-detect via rule 4a; ask only if signals split. Persist via rule 9.
37
+ This skill IS the split behavior. It always emits multiple files:
38
+ - `epic.md` — title, why-split, INVEST failure reasons, mechanical NxN matrix, build order, V audit per child, list of children.
39
+ - `story-1.md`, `story-2.md`, … — one canonical story per child (per base shape).
40
+ - `.storywright-context.json` — persisted answers.
36
41
 
37
- 5. **Visual inference confidence single banner only** in each child's Design Reference block. No per-claim `[mockup-pixel-derived]` tags.
42
+ NO `split-plan.md`. The plan lives inside `epic.md`.
38
43
 
39
- 6. **Sibling task IDs.** When referencing tickets that don't exist yet, follow rule F (naming pattern) instead of inventing slugs.
40
-
41
- 7. **Chrome detection — closed list** (nav rail, top bar, footer, toast slot, modal scrim, app tabs). If image shows chrome and the input doesn't mention it, ask whether to add as its own child, attach to an existing child, or scope out.
42
-
43
- 8. **Anti-PRD is part of each child's INVEST `Small` criterion** — see `[[invest-checklist]]` Small.
44
-
45
- 9. **Cross-skill context persistence.** Read `<output-folder>/.storywright-context.json` first (exact folder only). Write updated answers back at the end. Schema:
46
- ```json
47
- {
48
- "version": 1,
49
- "decided_at": "<ISO date>",
50
- "decided_by_skill": "story-split",
51
- "language": "EN | ES | ...",
52
- "chrome_scope": "in-scope | in-scope-placeholder | sibling | out-of-scope",
53
- "siblings": "TODO | <list of IDs> | not-applicable",
54
- "design_source": "raster | figma | tokens",
55
- "naming_pattern": "<see rule F>",
56
- "extra": { "split_pattern": "...", "core_complexity": "..." }
57
- }
58
- ```
59
-
60
- 10. **Children independence — mechanical detection (A).** For each child Cj, parse its `Given:` lines for surface nouns owned by sibling Ci. If matched → `DEP(Cj → Ci)`. The dependency matrix IS the union of those matches. No intuition-based deps. Affected child's INVEST `Independent` becomes `PARTIAL · depends on <Ci>`. Build order in epic.md is a topological sort of the matrix.
61
-
62
- 11. **Per-child V audit (C).** For each candidate child, run one-line test: "If only this child ships and no sibling exists, does a real user complete a real task?". If answer is "no, useless until <other> ships" → mark V = `WEAK · merge-upstream-candidate` and recommend merging into the parent surface. Do not let stylistic/UI-fragment children survive the split.
63
-
64
- 12. **Passive-goal downstream prompt (G).** If any child's `I want to` verb is observational (view/see/read/browse/look/inspect/monitor) AND `so that` lacks a follow-up action → ask once via `AskUserQuestion` per child (batched ≤4 across children).
65
-
66
- 13. **Determinism on counts.** Use the same deterministic surface-vs-styling counter (rule D from refine v2.2) inside child re-split checks.
67
-
68
- ### 4a. Language auto-detect — expanded signals (E)
69
- Same weighted signal table as refine v2.2 (Gherkin keywords, persona phrasing, column names, domain verbs, title). Adopt silently when high+medium signals agree; ask only if split.
70
-
71
- ### Rule F. Naming pattern — ask once, persist
72
- Same kebab / verb-noun / domain-action / Jira-prefix options. Persist in `naming_pattern`. Reuse across this run AND future skills.
73
-
74
- ### Rule D. Surface vs styling (deterministic)
75
- A noun counts as a separate surface ONLY if it has its own user goal (verb). Styling, sub-components, and passive layout assertions do not count.
76
-
77
- ## When to use
78
-
79
- - `[[invest-checklist]]` returned `SPLIT RECOMMENDED` (I, E, or S fail).
80
- - User explicitly asks: "this story is too big, split it".
81
- - `[[story-refine]]` or `[[story-generate]]` deterministic pre-split test ≥2.
82
-
83
- ## Inputs & interpretation
84
-
85
- - **text** — the oversize story (or epic-scoped one-liner).
86
- - **image (optional)** — companion mockup. Use to validate scope and reveal hidden sub-flows.
87
- - **figma-link (optional)** — companion design. Prototype links / frame structure reveal natural flow boundaries.
88
-
89
- ### Mixed inputs source-priority
90
-
91
- - Text canonical for `User Story / Scope / Business Goal` of the epic.
92
- - Figma / image canonical for `flow structure / candidate children`.
93
- - Conflicts → BLOCKING `AskUserQuestion`. Never silently expand or shrink scope.
94
-
95
- ## Pre-split gate (STOP conditions)
44
+ ### Pre-split gate (STOP conditions) run BEFORE pattern selection
96
45
 
97
46
  Run `[[invest-checklist]]` first:
98
-
99
- - **V FAILS** → STOP. Not a story. Combine with related user-facing work. Do not split.
100
- - **T FAILS** → fix in place via `[[story-refine]]`. Splitting untestable input produces untestable children.
47
+ - **V FAILS** → STOP. Not a story. Combine with related user-facing work.
48
+ - **T FAILS** → fix in place via `[[story-refine]]`.
101
49
  - **N FAILS** → fix in place. Story is over-prescriptive, not too big.
102
50
  - **E FAILS due to unknowns** → recommend a spike, not a split.
103
51
  - **I / E (size) / S FAIL** → proceed to pattern selection.
104
52
 
105
- ## Pattern catalog (apply in order; stop at first that fits)
53
+ ### Pattern catalog (apply in order; stop at first that fits)
106
54
 
107
55
  Humanizing Work methodology (Lawrence & Green).
108
56
 
109
- 1. **Workflow steps — thin end-to-end slices.** NOT step1/step2 of the journey. Each child delivers the FULL workflow with increasing sophistication.
110
- - ❌ Wrong: editorial / legal / publish. Story 1 alone delivers nothing.
57
+ 1. **Workflow steps — thin end-to-end slices.** Each child delivers the FULL workflow with increasing sophistication. NOT step1/step2 of the journey.
58
+ - ❌ Wrong: editorial / legal / publish.
111
59
  - ✅ Right: publish immediately. Story 2 adds editorial. Story 3 adds legal.
112
- 2. **CRUD operations.** "Manage" / "handle" / "maintain" → split into C/R/U/D.
60
+ 2. **CRUD operations.** "Manage" / "handle" / "maintain" → C/R/U/D.
113
61
  3. **Business rule variations.** Same feature, different rules (members / VIP / first-time).
114
62
  4. **Data type variations.** One story per data shape (jpg / pdf / mp4).
115
- 5. **Data entry / UI complexity.** Basic input first; fancy UI (calendar, autocomplete) as follow-ups.
116
- 6. **Major effort.** First implementation does the heavy infrastructure lift; subsequent stories are trivial additions.
63
+ 5. **Data entry / UI complexity.** Basic input first; fancy UI as follow-ups.
64
+ 6. **Major effort.** First implementation does the heavy infrastructure lift.
117
65
  7. **Simple / complex.** Strip variations from the core. Story 1 = simplest case that still delivers value.
118
66
  8. **Defer performance.** Make-it-work before make-it-fast.
119
67
  9. **Spike (last resort).** Time-boxed investigation. Not a story.
120
68
 
121
- **Anti-patterns (NOT splits):**
122
- - Horizontal slicing (frontend / backend) — no user value per child.
123
- - Task decomposition ("set up DB", "write endpoint").
124
- - Meaningless halves.
69
+ **Anti-patterns (NOT splits):** horizontal slicing (FE/BE), task decomposition, meaningless halves.
125
70
 
126
- ## Cynefin domain calibration
71
+ ### Cynefin domain calibration
127
72
 
128
73
  - **Obvious / Complicated** — enumerate all children, prioritize by value/risk.
129
- - **Complex** — produce 1–2 learning stories that ship something observable; let usage teach the rest.
74
+ - **Complex** — produce 1–2 learning stories; let usage teach the rest.
130
75
  - **Chaotic** — defer splitting; stabilize first.
131
76
 
132
- ## Meta-pattern (every pattern)
77
+ ### Meta-pattern (every pattern)
133
78
 
134
79
  1. Name the **core complexity** that makes the story big.
135
80
  2. List **all variations** of that complexity.
@@ -138,18 +83,13 @@ Humanizing Work methodology (Lawrence & Green).
138
83
 
139
84
  ## Application (step-by-step)
140
85
 
141
- 0. **Read prior context.** Load `<output-folder>/.storywright-context.json` if present (exact folder only). Apply resolved answers.
142
-
143
- 1. **Detect input types + companion sources.** Run conflict detection (mixed inputs). Run chrome detection (rule 7).
144
-
145
- 2. **Language resolution** via rule 4a.
86
+ Follow the **base Application** skeleton for the front-end behaviors (context load, language, persona, passive-goal, gap-check, siblings). Split-specific steps inserted after:
146
87
 
147
- 3. **Pre-split gate.** Run `[[invest-checklist]]`. Honor STOP conditions above.
88
+ 1. **Pre-split gate.** Run `[[invest-checklist]]`. Honor STOP conditions above.
148
89
 
149
- 4. **Pattern selection.** Apply catalog in order. Name first fit. Name the meta-pattern's "core complexity". Note Cynefin domain.
150
-
151
- 5. **Draft split plan** as a terminal table (no file yet):
90
+ 2. **Pattern selection.** Apply catalog in order. Name first fit + core complexity + Cynefin domain.
152
91
 
92
+ 3. **Draft split plan** as a terminal table (no file yet):
153
93
  ```
154
94
  ### Split Plan
155
95
  Rationale: <INVEST failure reasons>
@@ -157,109 +97,44 @@ Humanizing Work methodology (Lawrence & Green).
157
97
  Pattern(s): <names>
158
98
  Cynefin: <domain>
159
99
 
160
- | # | Proposed child | Pattern | V audit (rule 11) |
100
+ | # | Proposed child | Pattern | V audit (base rule 11) |
161
101
  |---|---|---|---|
162
- | 1 | ... | Workflow simple | PASS / WEAK·merge |
163
- | 2 | ... | Data variation | PASS |
164
- ```
165
-
166
- 6. **Strategic check before approval:**
167
- - Does the split reveal low-value work we can deprioritize or kill?
168
- - Are the children roughly equal in size?
169
- If neither holds, try a different pattern.
170
-
171
- 7. **STOP and ask the user to approve via `AskUserQuestion`:**
172
- - Approve → proceed to step 8.
173
- - Adjust → edit, re-loop.
174
- - Cancel → mark original as `NEEDS REFINEMENT`, stop.
175
-
176
- 8. **For each approved child, write the canonical block** (Use Case + AC + Design Ref + INVEST):
177
-
178
- ```markdown
179
- ### [Child Title]
180
-
181
- #### Use Case
182
- - **As a** [persona]
183
- - **I want to** [action]
184
- - **so that** [outcome — rule G applied]
185
-
186
- #### Acceptance Criteria
187
- - **Scenario:** [single outcome]
188
- - **Given:** [context — surface nouns drive dep matrix]
189
- - **When:** [single trigger]
190
- - **Then:** [single observable outcome]
191
-
192
- #### Design Reference (optional)
193
- **Source: <raster | figma | tokens> → <banner from rule 5>**
194
- - [link / path]
195
-
196
- #### INVEST
197
- - I — <PASS | PARTIAL · depends on <Ci>>
198
- - N/V/E/S/T — one line each
199
- - **Verdict:** READY | READY (after <Ci> builds) | WEAK·merge-upstream-candidate
200
-
201
- #### Refinement log (≤3 lines)
202
- - Split from parent; pattern: <name>.
203
102
  ```
204
103
 
205
- 9. **Build the dependency matrix mechanically (rule 10).** Parse each child's `Given` lines for surface nouns owned by other children. Emit the matrix in `epic.md`.
104
+ 4. **Strategic check before approval:**
105
+ - Does the split reveal low-value work we can deprioritize?
106
+ - Are children roughly equal in size?
206
107
 
207
- 10. **Run V audit per child (rule 11).** Flag merge-upstream candidates in `epic.md`. Recommend merging instead of keeping standalone.
108
+ 5. **STOP and ask the user to approve via `AskUserQuestion`.**
208
109
 
209
- 11. **Recursive re-split check.** For each child, run the deterministic counter (rule D). If count ≥2 for any child recursive split of that child. Surface the tree in `epic.md`.
110
+ 6. **For each approved child, write the base canonical block.** Each child is its own file (`story-<N>.md`).
210
111
 
211
- 12. **Coherence check** verify children together cover the original scope. Flag gaps or overlaps before saving.
112
+ 7. **Build dependency matrix mechanically (base rule 10).** Render in `epic.md`.
212
113
 
213
- 13. **Write `epic.md`** at `<output-folder>/`:
114
+ 8. **V audit per child (base rule 11).** Flag merge-upstream candidates in `epic.md`.
214
115
 
215
- ```markdown
216
- ### EPIC: <title>
116
+ 9. **Recursive re-split check.** For each child, run the base deterministic counter. If count ≥2 → recursive split of that child. Surface the tree in `epic.md`.
217
117
 
218
- **Why split:** <pattern + core complexity + INVEST failure reasons>
118
+ 10. **Coherence check** children together cover the original scope. Flag gaps or overlaps.
219
119
 
220
- **Cynefin domain:** <domain>
120
+ 11. **Write `epic.md`** with: why-split, Cynefin, matrix, build order, V audit, list of children.
221
121
 
222
- **Children independence matrix (mechanical, rule 10):**
223
-
224
- | | C1 | C2 | C3 | ... |
225
- |--------|----|----|----|-----|
226
- | C1 | — | | | |
227
- | C2 |DEP | — | | |
228
- | ... | | | | |
229
-
230
- **Build order (topological):** C1 → C2 → ...
231
-
232
- **V audit (rule 11):**
233
- - C1 — PASS
234
- - C2 — PASS
235
- - C3 — WEAK · merge-upstream-candidate (merge into C2)
236
-
237
- **Children:**
238
- 1. story-1.md — <slug per naming pattern F>
239
- 2. story-2.md
240
- ...
241
-
242
- **Design source:** <raster | figma | tokens>
243
- ```
244
-
245
- 14. **Write all `story-N.md` files** and `.storywright-context.json` updated with `split_pattern` and `core_complexity` under `extra`.
122
+ 12. **Persist context** to `.storywright-context.json` (`extra.split_pattern`, `extra.core_complexity`).
246
123
 
247
124
  ## Validate every child (must pass all 6)
248
125
 
249
- 1. Delivers user value independently (rule 11 V audit PASS).
250
- 2. Developable with explicit build order from the matrix (no implicit deps).
126
+ 1. Delivers user value independently (V audit PASS).
127
+ 2. Developable with explicit build order from the matrix.
251
128
  3. Testable: single Given/When/Then with observable outcome.
252
- 4. Sprintable (1–5 days work).
253
- 5. Union equals original scope (coherence check).
254
- 6. ≤60 lines per child story (anti-PRD via INVEST Small).
255
-
256
- A "no" on any line → revise the split.
129
+ 4. Sprintable (1–5 days).
130
+ 5. Union equals original scope.
131
+ 6. ≤60 lines per child story (anti-PRD via base rule 8).
257
132
 
258
133
  ## Examples
259
134
 
260
135
  ### Good
261
- Original: "Permitir login con Google" with INVEST Small + Estimable FAIL.
262
- Split:
136
+ Original: "Permitir login con Google" INVEST Small + Estimable FAIL.
137
+ Children:
263
138
  1. Web — new accounts only (Simple)
264
139
  2. Mobile — new accounts only (Simple)
265
140
  3. Account linking with existing email/password (Major effort)
@@ -270,52 +145,42 @@ Matrix mechanical:
270
145
  - C3.Given mentions "Google account exists" owned by C1 → DEP(C3 → C1)
271
146
  - C4 independent.
272
147
 
273
- V audit: all PASS.
274
-
275
- Build order: C1 → {C2, C3} → C4 (C4 parallel anytime).
148
+ V audit: all PASS. Build order: C1 → {C2, C3} → C4.
276
149
 
277
150
  ### Good — merge recommendation
278
- Original story produced child "results counter" + child "grid". Counter's V audit:
279
- - "If only counter ships and no grid exists, does a user complete a task?" → no.
280
- - V = WEAK · merge-upstream-candidate.
281
- - Epic recommends merging counter into grid child.
282
-
283
- ### Bad
284
- Splitting "Permitir login con Google" into "Backend auth endpoint" + "Frontend login button". Task split, not story split. Both fail rule 11.
151
+ "Results counter" child V audit:
152
+ - "If only counter ships, no grid, does a user complete a task?" → no.
153
+ - V = WEAK · merge-upstream-candidate. Recommend merging into the grid child.
285
154
 
286
155
  ### Bad
287
- Claiming all 5 children Independent without running rule 10 matrix.
156
+ Splitting into "Backend auth endpoint" + "Frontend login button". Task split, no user value per child. Fails base rule 11.
288
157
 
289
158
  ### Bad
290
- Writing any sidecar question file. Violates rule 1.
159
+ Claiming children Independent without running the mechanical matrix (base rule 10).
291
160
 
292
- ## Common Pitfalls
161
+ ## Common Pitfalls (split-specific)
293
162
 
294
- - Skipping the INVEST pre-split gate. Splitting non-V or non-T input.
163
+ - Skipping the pre-split INVEST gate.
295
164
  - Workflow split done step-by-step instead of thin end-to-end.
296
- - Horizontal slicing (frontend / backend / DB).
165
+ - Horizontal slicing (FE/BE/DB).
297
166
  - Task splits.
298
- - Splitting on size alone without naming pattern or core complexity.
299
- - Forcing a pattern that doesn't fit.
167
+ - Splitting on size alone without naming a pattern or core complexity.
300
168
  - Auto-splitting without user approval.
301
- - Skipping the mechanical matrix (rule 10).
302
- - Skipping per-child V audit (rule 11).
303
- - Letting tree go >5 children — that's an initiative, not an epic.
169
+ - Letting the tree go >5 children — that's an initiative, not an epic.
304
170
  - Splitting in Chaotic Cynefin — stabilize first.
305
- - Re-asking questions already in `.storywright-context.json`.
171
+ - All other pitfalls in `[[storywright-base]]` apply equally.
306
172
 
307
173
  ## References
308
174
 
175
+ - [[storywright-base]] — the rulebook
309
176
  - [[invest-checklist]]
310
177
  - [[story-generate]]
311
178
  - [[story-refine]]
312
- - [[clarification-questions]]
179
+ - [[story-from-figma]]
313
180
 
314
181
  <claude-specific>
182
+ - Read `[[storywright-base]]` before applying. Do not duplicate its rules in your reasoning.
315
183
  - Use extended thinking for pattern selection (compare options explicitly).
316
- - Cache the 9-pattern catalog and the v2.2 hard-rule list.
317
- - Build the dependency matrix from Given-text parsing (rule 10), not intuition.
318
- - Run V audit per child (rule 11) and flag merge candidates loudly.
319
- - Never call Write for any sidecar question file. Use `AskUserQuestion`.
320
- - Read `.storywright-context.json` ONLY from the exact target output folder.
184
+ - Cache the 9-pattern catalog.
185
+ - Build the dependency matrix from Given-text parsing (base rule 10), not intuition.
321
186
  </claude-specific>