@pavp/storywright 1.0.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.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: risks-and-dependencies
3
+ description: Surface technical, product, and organizational risks plus blocking dependencies for a story. Each item has owner, likelihood, mitigation. Returns only the risks+deps block.
4
+ trigger: "internal use by story-* skills"
5
+ intent: Component skill that turns hidden assumptions into tracked risks and dependencies so PMs and tech leads can act on them.
6
+ version: 1.0.0
7
+ inputs:
8
+ - story-context
9
+ - business-rules
10
+ - technical-considerations
11
+ outputs:
12
+ - risks-and-dependencies-block
13
+ ---
14
+
15
+ ## Purpose
16
+
17
+ Risks and dependencies that aren't written down end up as outages or missed launches. Make them visible at story time.
18
+
19
+ ## When to use
20
+
21
+ Late in `story-generate`, after business rules and technical considerations are drafted — those inform what's risky.
22
+
23
+ ## Inputs & interpretation
24
+
25
+ - **story-context** — surface, novelty
26
+ - **business-rules** — compliance/policy items often imply risks
27
+ - **technical-considerations** — new SDKs, new infra, new patterns imply risk
28
+
29
+ ## Application (step-by-step)
30
+
31
+ 1. Enumerate **dependencies** (blocking other work):
32
+ - Other stories / teams
33
+ - External APIs (auth providers, payment, analytics)
34
+ - Infra changes (new env var, new DB column)
35
+ - Designs / copy / legal sign-off
36
+ 2. For each dependency: `<what> · owner · status (READY / IN-PROGRESS / NOT-STARTED) · blocking?`
37
+ 3. Enumerate **risks** across 4 categories:
38
+ - **Technical** (latency, scale, integration brittleness)
39
+ - **Product** (adoption assumption, UX confusion)
40
+ - **Security / privacy** (PII exposure, attack surface)
41
+ - **Operational** (oncall toil, monitoring gap)
42
+ 4. For each risk: `<risk> · likelihood (L/M/H) · impact (L/M/H) · mitigation`
43
+ 5. If a risk is high-impact AND high-likelihood, flag it `🚨` so it gets attention in review.
44
+ 6. Emit under two subheadings: `### Dependencias` and `### Riesgos` (or English).
45
+
46
+ Example:
47
+
48
+ ```
49
+ ### Dependencias
50
+ | Dependencia | Owner | Estado | Bloquea? |
51
+ |---|---|---|---|
52
+ | Google OAuth credentials in staging | Platform team | READY | No |
53
+ | Account-linking design (final) | Design — @maria | IN-PROGRESS | Sí |
54
+ | Legal review of consent copy | Legal — @sam | NOT-STARTED | Sí |
55
+
56
+ ### Riesgos
57
+ | Riesgo | Likelihood | Impact | Mitigación |
58
+ |---|---|---|---|
59
+ | 🚨 Account-linking edge cases not fully scoped | H | H | Spike before pickup; document edge matrix |
60
+ | Workspace domain restriction config drift | M | M | Read domain list from config service, not env var |
61
+ | OAuth callback latency on slow networks | M | L | Add timeout + retry; pre-existing pattern from sign-up |
62
+ ```
63
+
64
+ ## Examples
65
+
66
+ ### Good
67
+
68
+ See above — owners named, statuses observable, mitigations actionable.
69
+
70
+ ### Bad
71
+
72
+ `- Could be risky.` (no axis, no owner, no mitigation)
73
+
74
+ ## Common Pitfalls
75
+
76
+ - Listing "the user might not like it" as a risk. Tie to a measurable adoption signal.
77
+ - Owners as "the team". Assign a person or named role.
78
+ - Mitigations as "be careful". Mitigations are actions.
79
+
80
+ ## References
81
+
82
+ - [[business-rules]]
83
+ - [[invest-checklist]] (Independent check often surfaces dependencies)
84
+
85
+ <claude-specific>
86
+ Use extended thinking. Risks cluster — surfacing one often reveals others in the same category.
87
+ </claude-specific>
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: story-from-figma
3
+ description: Generate user stories from a Figma file or frame URL. Uses an MCP Figma server to enumerate frames, components, navigation, and states; falls back to asking for screenshots if MCP is unavailable.
4
+ trigger: "story from figma | generate from figma | analizar figma | https://www.figma.com/"
5
+ intent: Multimodal entrypoint skill. Inspects a Figma design, infers user flows and screens, and produces one or more stories via story-generate.
6
+ version: 1.0.0
7
+ inputs:
8
+ - figma-link
9
+ outputs:
10
+ - story.jira-wiki.md (per generated story)
11
+ - story.standard.md (per generated story)
12
+ - clarifications.md
13
+ composes:
14
+ - _components/clarification-questions
15
+ - _components/acceptance-criteria
16
+ - _components/invest-checklist
17
+ - _components/definition-of-done
18
+ - _components/business-rules
19
+ - _components/edge-cases
20
+ - _components/analytics-events
21
+ - _components/risks-and-dependencies
22
+ - _components/jira-wiki-formatter
23
+ ---
24
+
25
+ ## Purpose
26
+
27
+ A Figma file usually represents N screens / N flows. This skill maps that visual structure into stories — one story per logical user goal, not one per frame.
28
+
29
+ ## When to use
30
+
31
+ - User pastes a Figma link.
32
+ - User says "generate stories from this design".
33
+
34
+ ## Inputs & interpretation
35
+
36
+ - **figma-link** — file URL, page URL, or specific frame URL. Detect the scope:
37
+ - File URL → consider the whole file; ask which page or flow to focus on
38
+ - Page URL → enumerate frames in that page
39
+ - Frame URL → single-screen analysis (usually one story)
40
+
41
+ ## Application (step-by-step)
42
+
43
+ ### Phase 0 — MCP availability check
44
+
45
+ 1. Verify an MCP Figma server is connected to Claude Code. See `mcp-figma-notes.md` in this skill folder for setup options.
46
+ 2. If MCP is unavailable:
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
+ - Continue under the chosen fallback. The rest of the skill works with screenshots via Claude vision.
49
+
50
+ ### Phase 1 — Inventory
51
+
52
+ 1. List pages in the file (if MCP allows).
53
+ 2. For the target page, list frames with:
54
+ - Frame name
55
+ - Frame type (entry, modal, error state, empty state, success state, loading, etc.)
56
+ - Outgoing prototype links (which other frame each interactive element points to)
57
+ 3. Identify the **flows** by grouping frames connected by prototype links. One flow = one candidate story (or epic if large).
58
+
59
+ ### Phase 2 — Per-flow inference
60
+
61
+ For each flow:
62
+
63
+ 1. Identify the **goal** (what user outcome does this flow achieve?).
64
+ 2. Identify the **entry point** (where does the user start?).
65
+ 3. Enumerate **states**: empty, loading, success, error, edge.
66
+ 4. Identify **components** (forms, lists, modals) and their **inputs/outputs**.
67
+ 5. Score confidence per inference: HIGH (visible in design), MEDIUM (implied), LOW (assumed). Anything below HIGH gets `> ⚠️ Assumed:` in the output.
68
+ 6. Pass the structured inference to `[[story-generate]]` to produce the full story.
69
+
70
+ ### Phase 3 — Splitting check
71
+
72
+ If a single flow has too many states or branches, run `[[invest-checklist]]` first. If it returns `SPLIT RECOMMENDED`, hand off to `[[story-split]]` before generating.
73
+
74
+ ### Phase 4 — Output
75
+
76
+ For each story:
77
+ - Emit `story.jira-wiki.md` + `story.standard.md` per the formatter.
78
+ - Emit a single `flow-summary.md` listing all stories produced and the frames they map to, so reviewers can audit traceability.
79
+
80
+ If any inference is LOW confidence, add to `clarifications.md`.
81
+
82
+ ## Examples
83
+
84
+ ### Good
85
+
86
+ Input: Figma file URL with 3 flows on the "Auth" page (login, signup, password reset).
87
+
88
+ Output:
89
+ - 3 stories (one per flow).
90
+ - Each story references the frames it derived from: `Maps to frames: AUTH-001, AUTH-002, AUTH-003`.
91
+ - Account-recovery flow flagged for `[[story-split]]` because it had 12 frames covering multiple recovery methods.
92
+
93
+ ### Bad
94
+
95
+ One story per frame. Frames are screens; stories are user goals. A single goal may span 5 frames.
96
+
97
+ ## Common Pitfalls
98
+
99
+ - Treating each frame as a story.
100
+ - Skipping prototype-link analysis — without flow structure, inferred user goals are guesses.
101
+ - Ignoring empty/error/loading states. Designers usually include them; PMs often miss them.
102
+ - Trusting MEDIUM/LOW inferences silently. Always surface them.
103
+ - Generating stories without verifying that the design covers all error paths (often the design only shows the happy path).
104
+
105
+ ## References
106
+
107
+ - [[story-generate]]
108
+ - [[story-split]]
109
+ - [[clarification-questions]]
110
+ - `./mcp-figma-notes.md` (setup of MCP server)
111
+
112
+ <claude-specific>
113
+ - Use Claude's native vision when MCP is unavailable and the user drops PNGs.
114
+ - Use extended thinking for flow grouping — prototype links can be ambiguous.
115
+ - Cache the Phase 2 inference checklist across calls.
116
+ - When MCP Figma is available, batch frame metadata fetches into one round trip to minimize tool round-trips.
117
+ </claude-specific>
@@ -0,0 +1,54 @@
1
+ # Setting up a Figma MCP server
2
+
3
+ `story-from-figma` works best when Claude Code can call a Figma MCP server. This file documents the options known to work; we do **not** ship our own server.
4
+
5
+ ## Option A — Official Figma Dev Mode MCP (recommended)
6
+
7
+ Figma's Dev Mode MCP exposes file/frame metadata directly to AI agents. Setup:
8
+
9
+ 1. Open Figma → enable Dev Mode on your file/team plan.
10
+ 2. From the Dev Mode panel, copy the MCP server URL or token.
11
+ 3. In your Claude Code MCP config (`~/.claude/mcp.json` or project `.mcp.json`):
12
+ ```json
13
+ {
14
+ "mcpServers": {
15
+ "figma": {
16
+ "type": "http",
17
+ "url": "https://mcp.figma.com/sse",
18
+ "headers": {
19
+ "Authorization": "Bearer ${FIGMA_TOKEN}"
20
+ }
21
+ }
22
+ }
23
+ }
24
+ ```
25
+ 4. Set `FIGMA_TOKEN` in your shell environment.
26
+ 5. Restart Claude Code.
27
+
28
+ Check availability inside Claude Code: ask "what MCP tools are available for figma?" — expect tools like `figma_get_file`, `figma_get_frame`, `figma_list_frames`.
29
+
30
+ ## Option B — Community Figma MCP
31
+
32
+ Several community implementations exist (search GitHub for `figma-mcp` or `figma-context-mcp`). Setup is similar but tool names differ. The skill is written to be tool-name-agnostic — it asks Claude to "list pages", "list frames", "fetch frame metadata" using whichever tools the server provides.
33
+
34
+ ## Option C — No MCP (screenshot fallback)
35
+
36
+ If you cannot set up MCP:
37
+
38
+ 1. In Figma, select the frames you care about.
39
+ 2. `Export` → PNG @ 2x.
40
+ 3. Drop the PNGs into Claude Code chat alongside the prompt.
41
+ 4. The skill will use Claude vision and degrade gracefully — flow structure must be described by the user.
42
+
43
+ ## Permissions reminder
44
+
45
+ A Figma token gives read access to your designs. Use a **scoped token** with read-only access to the specific team/project. Never commit the token to git.
46
+
47
+ ## Troubleshooting
48
+
49
+ | Symptom | Likely cause | Fix |
50
+ |---|---|---|
51
+ | "Tool not found" in chat | MCP not connected | Restart Claude Code; verify `~/.claude/mcp.json` |
52
+ | 401 / 403 | Token missing or revoked | Re-issue scoped token |
53
+ | Empty frame list | Figma file is private to another team | Switch token / share file with token's account |
54
+ | Slow responses | Large file | Pass a page URL instead of the whole file URL |
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: story-generate
3
+ description: Transform an ambiguous prompt, half-baked story, screenshot, or Figma link into a Jira-ready user story with acceptance criteria, DoD, edge cases, and risks. Ask only critical clarifying questions.
4
+ trigger: "generate a user story | write a user story | turn this into a story | crear historia de usuario"
5
+ intent: Top-level orchestrator skill that drives the full story generation flow by composing component skills.
6
+ version: 1.0.0
7
+ inputs:
8
+ - text
9
+ - image
10
+ - figma-link
11
+ outputs:
12
+ - story.jira-wiki.md
13
+ - story.standard.md
14
+ - clarifications.md
15
+ composes:
16
+ - _components/clarification-questions
17
+ - _components/acceptance-criteria
18
+ - _components/invest-checklist
19
+ - _components/definition-of-done
20
+ - _components/business-rules
21
+ - _components/edge-cases
22
+ - _components/analytics-events
23
+ - _components/risks-and-dependencies
24
+ - _components/jira-wiki-formatter
25
+ ---
26
+
27
+ ## Purpose
28
+
29
+ Take whatever the PM has — a one-liner, a half-baked story, a screenshot, a Figma link — and produce a story that an engineer can pick up and ship without follow-up questions. Always output two artifacts (Jira wiki + CommonMark).
30
+
31
+ ## When to use
32
+
33
+ - The user has a goal but not a story (e.g., "Permitir login con Google").
34
+ - The user pastes a vague story and wants it production-ready.
35
+ - The user drops an image/Figma link and asks for stories.
36
+
37
+ ## Inputs & how to interpret each
38
+
39
+ ### Text prompts
40
+ Anything from a single phrase to a paragraph. If the prompt names only a feature, infer the implicit user goal.
41
+
42
+ ### Local images (PNG/JPG)
43
+ Use vision. Extract:
44
+ - UI elements (buttons, fields, navigation)
45
+ - Visible states (loading, error, success)
46
+ - Inferred flow (what does each element trigger?)
47
+ - Confidence per inference (high / medium / low). Anything below high → add `> ⚠️ Assumed:` blockquote in the output and surface in clarifications.
48
+
49
+ ### Figma links
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
+
52
+ ## Application (step-by-step)
53
+
54
+ 1. **Detect input type** (text | image | figma-link | mixed). Branch accordingly.
55
+ 2. **Intake gap check** — invoke `[[clarification-questions]]`. If it returns BLOCKING questions, **ask first** before drafting.
56
+ 3. **Detect language** of input (es | en | other). Output in the input language.
57
+ 4. **Draft skeleton** of the structured story (all 15 sections from the template).
58
+ 5. **Fill the CORE first** (always required, in order):
59
+ 1. **Title** — concise, ≤8 words.
60
+ 2. **Summary** — single value-focused sentence ("Enable Google login for trial users to reduce signup friction"), NOT a feature label ("Add Google button"). Elevator pitch.
61
+ 3. **User Story** (As a / I want to / so that).
62
+ - **Persona check:** if role is "user" or "customer", push for sharper ("trial user", "Workspace admin"). Generic personas hide motivation.
63
+ - **"So that" check:** outcome must be distinct from action. "So I can save my work" = restating; "So I don't lose progress if tab crashes" = real motivation.
64
+ 4. **Acceptance Criteria** via `[[acceptance-criteria]]` — at minimum the happy path + one failure mode.
65
+ 5. **Definition of Done** via `[[definition-of-done]]`.
66
+
67
+ 6. **Fill OPTIONAL sections only if they have real content.** Drop any that would be empty or boilerplate:
68
+ - Contexto / Business goal — include when there's a stated trigger or KPI
69
+ - Scope / Out of scope — include when boundaries are non-obvious
70
+ - `[[business-rules]]` — include when invariants exist beyond the ACs
71
+ - Technical considerations — include when surface/SDK/flag matters
72
+ - `[[edge-cases]]` — include when ≥3 high-impact edges exist
73
+ - `[[analytics-events]]` — include when story has measurable funnel
74
+ - `[[risks-and-dependencies]]` — include when there are real blockers or unknowns
75
+
76
+ The bias is **less is more**. A clean 4-section story beats a 15-section one full of `N/A`.
77
+ 6. **Run INVEST self-check** via `[[invest-checklist]]`:
78
+ - `READY` → continue.
79
+ - `NOT A STORY` (V failed) → STOP. Tell the user this is a tech task, not a user story. Suggest reframing or combining with user-facing work.
80
+ - `NEEDS REFINEMENT` (T or N failed) → revise the failing sections in place.
81
+ - `RUN A SPIKE` (E failed on unknowns) → recommend a 1–2 day investigation; do not split or generate yet.
82
+ - `SPLIT RECOMMENDED` (I, E, or S failed) → STOP. Hand off to `[[story-split]]`. **Never auto-split.**
83
+ 7. **Render outputs** via `[[jira-wiki-formatter]]`:
84
+ - `story.jira-wiki.md` — Jira wiki markup
85
+ - `story.standard.md` — CommonMark
86
+ 8. **If clarifications remain unresolved** (user skipped them, or low-confidence visual inferences exist):
87
+ - Emit `clarifications.md` with the outstanding questions
88
+ - Mark the story output with a `DRAFT` banner at the top
89
+ - Tell the user explicitly what would unblock promoting from DRAFT to READY
90
+ 9. **Present both artifacts** as fenced code blocks. Ask the user whether to save to disk (offer paths under `./stories/<slug>/`).
91
+
92
+ ## Examples
93
+
94
+ ### Good — text prompt
95
+ Input: *"Permitir login con Google"*
96
+
97
+ Flow:
98
+ 1. Run gap check → 3 BLOCKING questions: scope of accounts, account linking, surface (web/mobile/both).
99
+ 2. Ask the 3 questions, wait for answers.
100
+ 3. Draft + fill all 15 sections.
101
+ 4. INVEST → `READY`.
102
+ 5. Render both outputs.
103
+ 6. Done.
104
+
105
+ ### Good — image input
106
+ Input: screenshot of a dashboard with a filter sidebar.
107
+
108
+ Flow:
109
+ 1. Vision: extract filter categories, infer apply/reset actions.
110
+ 2. Confidence on "filters persist across navigation" → MEDIUM → mark as `⚠️ Assumed` and surface in clarifications.
111
+ 3. Run gap check → 1 BLOCKING (does this replace or augment current filters?).
112
+ 4. Ask, draft, fill, INVEST, render.
113
+
114
+ ### Bad
115
+
116
+ Input: *"Build the new dashboard"*
117
+
118
+ Don't draft. The scope is too broad. Run gap check → propose splitting into smaller stories at the **clarification step**, before the story is drafted. (Effectively delegates to `[[story-split]]` upfront.)
119
+
120
+ ## Common Pitfalls
121
+
122
+ - Drafting before asking the critical questions. Always run intake first.
123
+ - Ignoring confidence in image inferences. If you guessed, say so.
124
+ - Auto-splitting. Never. Propose, wait, then split.
125
+ - Mixing English and Spanish in the output. Pick the input language.
126
+ - Skipping the `clarifications.md` file when assumptions remain.
127
+
128
+ ## References
129
+
130
+ - [[story-refine]] (use when input is an existing story to improve)
131
+ - [[story-split]] (use when INVEST fails on Independent/Estimable/Small)
132
+ - [[story-from-figma]] (use when input is a Figma link)
133
+ - [[clarification-questions]]
134
+
135
+ ## Output templates
136
+
137
+ See `templates/story.jira-wiki.md` and `templates/story.standard.md` in this skill's folder for the canonical section ordering and formatting.
138
+
139
+ <claude-specific>
140
+ - Use extended thinking for INVEST check and for vision confidence scoring.
141
+ - Cache the 15-section taxonomy and component invocation order across calls.
142
+ - When input includes images, attach them to the same message as the prompt to use Claude's native vision (do not describe-then-reason in two steps).
143
+ - Use prompt caching on the component skill bodies (they're long and reused).
144
+ </claude-specific>
@@ -0,0 +1,54 @@
1
+ h2. {{Title}}
2
+
3
+ *Summary:* {{value-focused one-liner}}
4
+
5
+ h3. User Story
6
+ * *As a* {{persona}}
7
+ * *I want to* {{action}}
8
+ * *so that* {{outcome}}
9
+
10
+ h3. Acceptance Criteria
11
+
12
+ *AC-1: {{scenario title}}*
13
+ * *Given* {{precondition}}
14
+ * *When* {{trigger}}
15
+ * *Then* {{observable outcome}}
16
+
17
+ h3. Definition of Done
18
+ * (/) {{line 1}}
19
+ * (/) {{line 2}}
20
+
21
+ ----
22
+
23
+ h3. Contexto
24
+ {{trigger: feedback / OKR / incident / competitor}}
25
+
26
+ h3. Business Goal
27
+ {{metric or hypothesis this moves}}
28
+
29
+ h3. Scope
30
+ * {{in 1}}
31
+
32
+ h3. Out of Scope
33
+ * {{out 1}}
34
+
35
+ h3. Business Rules
36
+ # {{rule 1}}
37
+
38
+ h3. Technical Considerations
39
+ * {{api / sdk / flag / data model}}
40
+
41
+ h3. Dependencies
42
+ ||What||Owner||Status||Blocks?||
43
+ |{{dep}}|{{owner}}|{{READY/IN-PROGRESS}}|{{Yes/No}}|
44
+
45
+ h3. Risks
46
+ ||Risk||L||I||Mitigation||
47
+ |{{risk}}|{{L/M/H}}|{{L/M/H}}|{{action}}|
48
+
49
+ h3. Analytics
50
+ ||Event||Trigger||Payload||
51
+ |{{event_name}}|{{when}}|{{fields}}|
52
+
53
+ h3. Edge Cases
54
+ * *{{axis}}:* {{behavior}}
@@ -0,0 +1,59 @@
1
+ # {{Title}}
2
+
3
+ **Summary:** {{value-focused one-liner}}
4
+
5
+ ## User Story
6
+ - **As a** {{persona}}
7
+ - **I want to** {{action}}
8
+ - **so that** {{outcome}}
9
+
10
+ ## Acceptance Criteria
11
+
12
+ **AC-1: {{scenario title}}**
13
+ - **Given** {{precondition}}
14
+ - **When** {{trigger}}
15
+ - **Then** {{observable outcome}}
16
+
17
+ ## Definition of Done
18
+ - [ ] {{line 1}}
19
+ - [ ] {{line 2}}
20
+
21
+ ---
22
+
23
+ <!-- Optional sections — keep only those with content. Delete the rest. -->
24
+
25
+ ## Contexto
26
+ {{trigger: feedback / OKR / incident / competitor}}
27
+
28
+ ## Business Goal
29
+ {{metric or hypothesis this moves}}
30
+
31
+ ## Scope
32
+ - {{in 1}}
33
+
34
+ ## Out of Scope
35
+ - {{out 1}}
36
+
37
+ ## Business Rules
38
+ 1. {{rule 1}}
39
+
40
+ ## Technical Considerations
41
+ - {{api / sdk / flag / data model}}
42
+
43
+ ## Dependencies
44
+ | What | Owner | Status | Blocks? |
45
+ |---|---|---|---|
46
+ | {{dep}} | {{owner}} | {{READY/IN-PROGRESS}} | {{Yes/No}} |
47
+
48
+ ## Risks
49
+ | Risk | L | I | Mitigation |
50
+ |---|---|---|---|
51
+ | {{risk}} | {{L/M/H}} | {{L/M/H}} | {{action}} |
52
+
53
+ ## Analytics
54
+ | Event | Trigger | Payload |
55
+ |---|---|---|
56
+ | `{{event_name}}` | {{when}} | {{fields}} |
57
+
58
+ ## Edge Cases
59
+ - **{{axis}}:** {{behavior}}
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: story-refine
3
+ description: Audit an existing user story for gaps and fill them in place. Surfaces missing AC, DoD, edge cases, risks; asks clarifications only for blocking unknowns. Returns dual-format refined story.
4
+ trigger: "refine this story | improve this story | refinar historia | this story is incomplete"
5
+ intent: Refinement skill for stories that already exist but are incomplete or weakly specified. Composes the same component skills as story-generate but skips the drafting step.
6
+ version: 1.0.0
7
+ inputs:
8
+ - text
9
+ outputs:
10
+ - story.jira-wiki.md
11
+ - story.standard.md
12
+ - clarifications.md
13
+ composes:
14
+ - _components/clarification-questions
15
+ - _components/acceptance-criteria
16
+ - _components/invest-checklist
17
+ - _components/definition-of-done
18
+ - _components/business-rules
19
+ - _components/edge-cases
20
+ - _components/analytics-events
21
+ - _components/risks-and-dependencies
22
+ - _components/jira-wiki-formatter
23
+ ---
24
+
25
+ ## Purpose
26
+
27
+ When the PM already has a story written but it's missing sections, has hand-wavy ACs, or never went through INVEST, this skill brings it up to standard without rewriting it from scratch.
28
+
29
+ ## When to use
30
+
31
+ - User pastes an existing story (text) and asks to make it Jira-ready.
32
+ - A story has ACs but no DoD, or vice versa.
33
+ - INVEST gate fails on `Testable` or `Negotiable` — fixable in place (not splittable).
34
+
35
+ For oversized stories that fail `Independent / Estimable / Small`, hand off to `[[story-split]]` instead.
36
+
37
+ ## Inputs & interpretation
38
+
39
+ - **text** — existing story. Detect which sections are present, which are missing, which are weak.
40
+
41
+ ## Application (step-by-step)
42
+
43
+ 1. **Parse the existing story.** Map content into the 15-section taxonomy. Note: present / missing / weak.
44
+ 2. **Gap-check the weak sections** via `[[clarification-questions]]`. If gaps are inferrable, mark `⚠️ Assumed` and proceed. Only ask BLOCKING questions.
45
+ 3. **Detect language** of the existing story; preserve it in the output.
46
+ 4. **Fill missing/weak sections** in dependency order:
47
+ - Reglas de negocio → `[[business-rules]]`
48
+ - Consideraciones técnicas → inline
49
+ - Edge cases → `[[edge-cases]]`
50
+ - Criterios de aceptación → `[[acceptance-criteria]]`
51
+ - Analytics → `[[analytics-events]]`
52
+ - Riesgos + dependencias → `[[risks-and-dependencies]]`
53
+ - DoD → `[[definition-of-done]]`
54
+ 5. **Preserve original wording** where it was already good. Mark changed sections with a comment trail at the end of the story:
55
+ ```
56
+ ---
57
+ Refinement log:
58
+ - Added Edge Cases (8 cases)
59
+ - Strengthened AC-2 (was untestable: "should work properly")
60
+ - Added analytics block
61
+ ```
62
+ 6. **Run INVEST** via `[[invest-checklist]]`.
63
+ - `READY` → render outputs.
64
+ - `NEEDS REFINEMENT` → iterate on the failing dimension.
65
+ - `SPLIT RECOMMENDED` → STOP. Tell the user the story should go through `[[story-split]]` instead.
66
+ 7. **Render** both outputs via `[[jira-wiki-formatter]]`.
67
+ 8. **Emit `clarifications.md`** if assumptions remain unresolved.
68
+
69
+ ## Examples
70
+
71
+ ### Good
72
+
73
+ Input: a story with title + User Story + 2 vague ACs ("It should be fast", "User can log in").
74
+
75
+ Output:
76
+ - Original title/user story preserved.
77
+ - AC-1 rewritten to Given/When/Then with observable outcomes.
78
+ - AC-2 split into AC-2 (happy path) and AC-3 (failure path).
79
+ - Added Edge Cases section (5 cases).
80
+ - Added DoD section.
81
+ - Refinement log appended.
82
+
83
+ ### Bad
84
+
85
+ Rewriting the whole story when only 2 sections were weak. Preserve good content.
86
+
87
+ ## Common Pitfalls
88
+
89
+ - Treating refine like generate. If the PM already wrote the user goal, don't restate it.
90
+ - Renumbering ACs the team may already reference externally. Append new ACs at the end.
91
+ - Skipping the refinement log. Reviewers need to see what changed.
92
+
93
+ ## References
94
+
95
+ - [[story-generate]]
96
+ - [[story-split]]
97
+ - [[invest-checklist]]
98
+
99
+ <claude-specific>
100
+ - Diff the original sections against the refined ones in your reasoning; only emit changes that materially improve the story.
101
+ - Cache the 15-section taxonomy.
102
+ </claude-specific>