@pavp/storywright 1.5.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,196 +1,186 @@
1
1
  ---
2
2
  name: story-split
3
- description: Detect when a story is too big to ship in one sprint and propose an INVEST-driven split into an epic with sub-stories. Never auto-splits — always proposes, then waits for user confirmation.
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 that uses the INVEST failure reasons (from invest-checklist) as the rationale for decomposition. Produces an epic skeleton plus N child story stubs, ready to feed back into story-generate.
6
- version: 1.0.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
10
10
  - figma-link
11
11
  outputs:
12
- - split-plan.md
13
12
  - epic.md
14
- - story-1.md, story-2.md, ... (N child stubs)
13
+ - story-1.md
14
+ - story-2.md
15
+ - .storywright-context.json
15
16
  composes:
17
+ - _components/storywright-base
16
18
  - _components/invest-checklist
17
19
  - _components/clarification-questions
20
+ - _components/acceptance-criteria
21
+ - _components/jira-wiki-formatter
18
22
  ---
19
23
 
20
24
  ## Purpose
21
25
 
22
- When a story is an epic in disguise, splitting badly is worse than not splitting. This skill uses **established INVEST-compatible patterns** (workflow steps, business rules, user roles, data variations, happy/sad paths, simple/complex) to propose a clean decomposition. The user always approves the plan before any child stories are 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.
23
27
 
24
- ## When to use
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.**
25
29
 
26
- - `[[invest-checklist]]` returned `SPLIT RECOMMENDED` (failures on I, E, or S).
27
- - User explicitly asks: "this story is too big, split it".
28
- - Input visibly mixes ≥2 flows.
30
+ ## Source-specific differential
29
31
 
30
- ## Inputs & interpretation
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.
31
34
 
32
- - **text** the oversize story (or a one-line goal that's clearly epic-scoped).
33
- - **image (optional)** — companion mockup. Use to validate scope and reveal hidden sub-flows the text doesn't mention.
34
- - **figma-link (optional)** — companion design. Often makes splitting easier: prototype links and frame structure reveal natural flow boundaries that map to children.
35
+ ## Split behavior differential
35
36
 
36
- ### Mixed inputs
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.
37
41
 
38
- When the user provides text + image / Figma alongside the story:
39
- - **Text is canonical for User Story / Scope / Business Goal** of the epic.
40
- - **Figma / image is canonical for flow structure** — use prototype links to enumerate candidate sub-flows. Each flow is a candidate child story.
41
- - **Conflict handling:** if Figma shows N flows but text only mentions K (K < N), surface this in the gap-check via `[[clarification-questions]]` BEFORE drafting the split plan. Ask: "Figma includes flows for X, Y, Z — include in this epic, or scope out?" Never silently expand or shrink scope.
42
- - See `[[story-generate]]` "Mixed inputs" for the full source-priority matrix.
42
+ NO `split-plan.md`. The plan lives inside `epic.md`.
43
43
 
44
- ## Application (step-by-step)
44
+ ### Pre-split gate (STOP conditions) — run BEFORE pattern selection
45
45
 
46
- ### Pre-split gate — STOP conditions
46
+ Run `[[invest-checklist]]` first:
47
+ - **V FAILS** → STOP. Not a story. Combine with related user-facing work.
48
+ - **T FAILS** → fix in place via `[[story-refine]]`.
49
+ - **N FAILS** → fix in place. Story is over-prescriptive, not too big.
50
+ - **E FAILS due to unknowns** → recommend a spike, not a split.
51
+ - **I / E (size) / S FAIL** → proceed to pattern selection.
47
52
 
48
- Before splitting anything, run `[[invest-checklist]]` and apply these gates:
53
+ ### Pattern catalog (apply in order; stop at first that fits)
49
54
 
50
- - **Valuable FAILS** **STOP. Do not split.** A non-valuable item is a technical task, not a story. Combine it with related user-facing work; don't decompose it.
51
- - **Testable FAILS** → **fix in place** via `[[story-refine]]` first. Splitting an untestable story produces untestable children.
52
- - **Negotiable FAILS** → fix in place; the story is over-prescriptive, not too big.
53
- - **Estimable FAILS due to unknowns** → run a **spike** (Pattern 9 below), not a split.
54
- - **Independent / Estimable / Small FAIL** → continue to pattern selection.
55
+ Humanizing Work methodology (Lawrence & Green).
55
56
 
56
- ### Pattern catalog (apply in order; stop at first that fits)
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.
59
+ - ✅ Right: publish immediately. Story 2 adds editorial. Story 3 adds legal.
60
+ 2. **CRUD operations.** "Manage" / "handle" / "maintain" → C/R/U/D.
61
+ 3. **Business rule variations.** Same feature, different rules (members / VIP / first-time).
62
+ 4. **Data type variations.** One story per data shape (jpg / pdf / mp4).
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.
65
+ 7. **Simple / complex.** Strip variations from the core. Story 1 = simplest case that still delivers value.
66
+ 8. **Defer performance.** Make-it-work before make-it-fast.
67
+ 9. **Spike (last resort).** Time-boxed investigation. Not a story.
57
68
 
58
- Based on the Humanizing Work splitting methodology (Richard Lawrence & Peter Green).
69
+ **Anti-patterns (NOT splits):** horizontal slicing (FE/BE), task decomposition, meaningless halves.
59
70
 
60
- 1. **Workflow steps — thin end-to-end slices.**
61
- **Critical:** this is NOT "step 1 / step 2 / step 3" of the journey. Each child must deliver the **full** workflow with increasing sophistication.
62
- - ❌ Wrong: Story 1 = editorial review, Story 2 = legal approval, Story 3 = publish. (Story 1 alone delivers nothing observable to the user.)
63
- - ✅ Right: Story 1 = publish post immediately, no reviews. Story 2 = add editorial review step. Story 3 = add legal step. Each story produces visible behavior.
71
+ ### Cynefin domain calibration
64
72
 
65
- 2. **CRUD operations.** When the input says "manage" / "handle" / "maintain", it bundles operations. Split into Create / Read / Update / Delete.
73
+ - **Obvious / Complicated** enumerate all children, prioritize by value/risk.
74
+ - **Complex** — produce 1–2 learning stories; let usage teach the rest.
75
+ - **Chaotic** — defer splitting; stabilize first.
66
76
 
67
- 3. **Business rule variations.** Same feature, different rules → one story per rule (members / VIP / first-time discounts).
77
+ ### Meta-pattern (every pattern)
68
78
 
69
- 4. **Data type variations.** One story per data shape (counties / cities / custom areas; or jpg / pdf / mp4). Deliver simplest first.
79
+ 1. Name the **core complexity** that makes the story big.
80
+ 2. List **all variations** of that complexity.
81
+ 3. Pick **one variation** as the simplest complete vertical slice.
82
+ 4. Each other variation becomes its own story.
70
83
 
71
- 5. **Data entry / UI complexity.** Basic input first (`YYYY-MM-DD` text); fancy UI (calendar picker, autocomplete, drag-drop) as follow-ups.
84
+ ## Application (step-by-step)
72
85
 
73
- 6. **Major effort.** First implementation does the heavy infrastructure lift; subsequent stories are trivial additions (build Visa payments + infra in story 1; add Mastercard/Amex in story 2).
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:
74
87
 
75
- 7. **Simple / complex.** Strip variations from the core. Story 1 = simplest case that still delivers value; stories 2..N = each variation.
88
+ 1. **Pre-split gate.** Run `[[invest-checklist]]`. Honor STOP conditions above.
76
89
 
77
- 8. **Defer performance.** "Make it work" before "make it fast". Story 1 = functional, no SLA. Story 2 = optimize to <100ms / add caching / scale.
90
+ 2. **Pattern selection.** Apply catalog in order. Name first fit + core complexity + Cynefin domain.
78
91
 
79
- 9. **Spike (last resort).** None of 1–8 apply because the unknown blocks decomposition. Run a 1–2 day time-boxed investigation answering a specific question ("is this feasible on our stack?", "what does the third-party API actually return?"). A spike is **not a story** — it produces learning, not shippable code. After the spike, restart at pattern 1.
92
+ 3. **Draft split plan** as a terminal table (no file yet):
93
+ ```
94
+ ### Split Plan
95
+ Rationale: <INVEST failure reasons>
96
+ Core complexity: <meta-pattern>
97
+ Pattern(s): <names>
98
+ Cynefin: <domain>
80
99
 
81
- **Anti-patterns (these are NOT splits):**
82
- - Horizontal slicing (frontend story + backend story) — neither child has user value.
83
- - Task decomposition ("set up DB" / "write endpoint" / "build form").
84
- - Meaningless halves ("first half of feature" / "second half").
100
+ | # | Proposed child | Pattern | V audit (base rule 11) |
101
+ |---|---|---|---|
102
+ ```
85
103
 
86
- ### Cynefin domain calibration
104
+ 4. **Strategic check before approval:**
105
+ - Does the split reveal low-value work we can deprioritize?
106
+ - Are children roughly equal in size?
87
107
 
88
- Adjust the splitting strategy to uncertainty:
108
+ 5. **STOP and ask the user to approve via `AskUserQuestion`.**
89
109
 
90
- - **Obvious / Complicated** known problem, just engineering. Enumerate all children, prioritize by value/risk.
91
- - **Complex** — unclear what users want or what will work. Don't enumerate exhaustively; produce **1–2 learning stories** that ship something observable, then let real usage teach what to write next.
92
- - **Chaotic** — priorities shifting daily, fires burning. **Defer splitting** until stability returns. Stabilize first.
110
+ 6. **For each approved child, write the base canonical block.** Each child is its own file (`story-<N>.md`).
93
111
 
94
- ### Meta-pattern (applies across every pattern)
112
+ 7. **Build dependency matrix mechanically (base rule 10).** Render in `epic.md`.
95
113
 
96
- For any pattern you pick:
97
- 1. Name the **core complexity** that makes the story big.
98
- 2. List **all variations** of that complexity.
99
- 3. Pick **one variation** as the simplest complete vertical slice.
100
- 4. Each other variation becomes its own story.
114
+ 8. **V audit per child (base rule 11).** Flag merge-upstream candidates in `epic.md`.
101
115
 
102
- ### Procedure
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`.
103
117
 
104
- 1. Run `[[invest-checklist]]` and apply the pre-split gates above. If you should not split, say so explicitly and stop.
105
- 2. Apply the pattern catalog in order. Name the first pattern that fits and the meta-pattern's "core complexity".
106
- 3. **Draft a split plan** as a Markdown table:
107
- ```
108
- ### Split Plan
118
+ 10. **Coherence check** children together cover the original scope. Flag gaps or overlaps.
109
119
 
110
- **Rationale (from INVEST failure):**
111
- - S — FAIL: covers web + mobile + account-linking
112
- - E — FAIL: account-linking edge cases not scoped
120
+ 11. **Write `epic.md`** with: why-split, Cynefin, matrix, build order, V audit, list of children.
113
121
 
114
- **Core complexity (meta-pattern):** authenticating new users + reconciling them with pre-existing accounts.
115
- **Pattern(s) applied:** Workflow steps (thin end-to-end) + Simple→Complex
116
- **Cynefin domain:** Complicated (known problem, just engineering)
122
+ 12. **Persist context** to `.storywright-context.json` (`extra.split_pattern`, `extra.core_complexity`).
117
123
 
118
- | # | Proposed child story | Pattern | INVEST hint |
119
- |---|---|---|---|
120
- | 1 | Login Google — simplest path (new account, web) | Workflow / Simple | Smallest complete vertical slice |
121
- | 2 | Login Google — mobile | Data variation (surface) | Small, depends on #1 |
122
- | 3 | Account linking — Google ↔ existing email/password | Major effort | Independent flow |
123
- | 4 | Workspace domain restriction | Business rule variation | Independent |
124
+ ## Validate every child (must pass all 6)
124
125
 
125
- **Proposed epic title:** Login con Google (multi-surface + linking)
126
- ```
127
- 4. **Split evaluation (strategic check before approval).** Ask:
128
- - **Does the split reveal low-value work we can deprioritize or kill?** Good splits surface 80/20 — e.g., after splitting flight search, "flexible dates" turns out to be rarely used → drop it.
129
- - **Are the children roughly equal in size?** Equal-sized children give PMs prioritization flexibility mid-sprint.
130
- If neither holds, try a different pattern.
131
- 5. **STOP and ask the user to approve the plan.** Options:
132
- - "Approve plan" → proceed to step 6
133
- - "Adjust" → user edits the table or merges/splits rows
134
- - "Cancel" → leave the story unsplit (mark it as `NEEDS REFINEMENT` for the team to negotiate)
135
- 6. **After approval:**
136
- - Write `epic.md` — title, description, child story list, business goal, dependencies between children
137
- - Write one stub per child: title + 1-line user story + open clarifications. **Do not run the full story-generate flow yet** — stubs are placeholders; user invokes `[[story-generate]]` per child when ready.
138
- 7. **Coherence check** — verify the children together cover the original scope. If any child overlaps another or the union has gaps, flag it before saving.
139
- 8. **Recursive re-split check.** For each child, ask: still >1 sprint? If yes, restart at the pattern catalog **for that child**. Keep splitting until every leaf is sprint-shippable. Surface the tree visually in the plan.
140
- 9. **Save all artifacts** under `./stories/<epic-slug>/`:
141
- - `epic.md`
142
- - `story-1.md`, `story-2.md`, …
143
- - `split-plan.md` (the decision trail)
126
+ 1. Delivers user value independently (V audit PASS).
127
+ 2. Developable with explicit build order from the matrix.
128
+ 3. Testable: single Given/When/Then with observable outcome.
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).
144
132
 
145
133
  ## Examples
146
134
 
147
135
  ### Good
148
-
149
- Original: "Permitir login con Google" with INVEST failing on Small + Estimable.
150
-
151
- Split:
136
+ Original: "Permitir login con Google" — INVEST Small + Estimable FAIL.
137
+ Children:
152
138
  1. Web — new accounts only (Simple)
153
139
  2. Mobile — new accounts only (Simple)
154
- 3. Account linking with existing email/password (Complex, depends on #1)
155
- 4. Workspace domain restriction (Independent rule)
140
+ 3. Account linking with existing email/password (Major effort)
141
+ 4. Workspace domain restriction (Business rule variation)
156
142
 
157
- Each child is shippable in one sprint, each has clear value, each is testable.
143
+ Matrix mechanical:
144
+ - C2.Given mentions "Google sign-in handshake" owned by C1 → DEP(C2 → C1)
145
+ - C3.Given mentions "Google account exists" owned by C1 → DEP(C3 → C1)
146
+ - C4 independent.
158
147
 
159
- ### Bad
148
+ V audit: all PASS. Build order: C1 → {C2, C3} → C4.
160
149
 
161
- Splitting "Permitir login con Google" into "Backend auth endpoint" and "Frontend login button" that's a **task split**, not a story split. Both halves have no user value alone.
150
+ ### Goodmerge recommendation
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.
162
154
 
163
- ## Validate every child (must pass all 5)
164
-
165
- 1. **Delivers user value** independently? (not just "frontend done")
166
- 2. **Developable in isolation** with no hard ordering dependency?
167
- 3. **Testable** with concrete ACs?
168
- 4. **Sprintable** (1–5 days of work, single sprint)?
169
- 5. **Union equals original** — together do they cover the original scope?
155
+ ### Bad
156
+ Splitting into "Backend auth endpoint" + "Frontend login button". Task split, no user value per child. Fails base rule 11.
170
157
 
171
- A "no" on any line means revise the split.
158
+ ### Bad
159
+ Claiming children Independent without running the mechanical matrix (base rule 10).
172
160
 
173
- ## Common Pitfalls
161
+ ## Common Pitfalls (split-specific)
174
162
 
175
- - **Skipping the pre-split INVEST gate.** Splitting a non-Valuable item produces non-Valuable children. Splitting an untestable item produces untestable children. Fix first, split second.
176
- - **Workflow done step-by-step instead of thin end-to-end.** Story 1 = "review" / Story 2 = "approve" / Story 3 = "publish" means Story 1 alone is invisible to the user. Each child must deliver visible behavior.
177
- - **Horizontal slicing** (frontend / backend / DB). Each child must have user value.
178
- - **Task splits** ("set up DB", "wire API to button"). Tasks aren't stories.
179
- - **Splitting on size alone**, without naming the core complexity or pattern.
180
- - **Forcing a pattern that doesn't fit.** If pattern N doesn't apply, say no and move on; never bend.
181
- - **Auto-splitting without user approval.**
182
- - **Forgetting the coherence check**losing scope in the split.
183
- - **Skipping the strategic evaluation** (low-value reveal, equal sizing).
184
- - **Letting the tree go >5 children** — that's an initiative, not an epic.
185
- - **Splitting in chaos.** Stabilize first; splitting amid shifting priorities just multiplies churn.
163
+ - Skipping the pre-split INVEST gate.
164
+ - Workflow split done step-by-step instead of thin end-to-end.
165
+ - Horizontal slicing (FE/BE/DB).
166
+ - Task splits.
167
+ - Splitting on size alone without naming a pattern or core complexity.
168
+ - Auto-splitting without user approval.
169
+ - Letting the tree go >5 children — that's an initiative, not an epic.
170
+ - Splitting in Chaotic Cynefinstabilize first.
171
+ - All other pitfalls in `[[storywright-base]]` apply equally.
186
172
 
187
173
  ## References
188
174
 
175
+ - [[storywright-base]] — the rulebook
189
176
  - [[invest-checklist]]
190
177
  - [[story-generate]]
191
- - [[clarification-questions]]
178
+ - [[story-refine]]
179
+ - [[story-from-figma]]
192
180
 
193
181
  <claude-specific>
194
- - Use extended thinking pattern selection benefits from explicit comparison of options.
195
- - Cache the 8-pattern catalog.
182
+ - Read `[[storywright-base]]` before applying. Do not duplicate its rules in your reasoning.
183
+ - Use extended thinking for pattern selection (compare options explicitly).
184
+ - Cache the 9-pattern catalog.
185
+ - Build the dependency matrix from Given-text parsing (base rule 10), not intuition.
196
186
  </claude-specific>