From jaan-to
Generates user stories with Given/When/Then acceptance criteria following INVEST principles from PRDs, feature-persona-goal inputs, narratives, Jira epics, or screenshots.
npx claudepluginhub parhumm/jaan-to --plugin jaan-toThis skill uses the workspace's default tool permissions.
> Generate user stories with Given/When/Then acceptance criteria.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Generate user stories with Given/When/Then acceptance criteria.
Read before execution:
$JAAN_LEARN_DIR/jaan-to-pm-story-write.learn.md - Past lessons (loaded in Pre-Execution)skills/jaan-to:pm-story-write/template.md - Story output template$JAAN_OUTPUTS_DIR/research/45-pm-insights-synthesis.md - Reference research (optional)${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md - Language resolution protocolInput: $ARGUMENTS
Three input formats supported:
Feature-Persona-Goal: [feature] [persona] [goal]
/jaan-to:pm-story-write "bulk export feature" "system administrator" "analyze usage data offline"Narrative Description: Full feature description
/jaan-to:pm-story-write "As an admin I need to export user data to Excel for compliance reporting"Jira Context: Epic or story ID
/jaan-to:pm-story-write PROJ-123Screenshot path — Design screenshots showing the UI element this story refers to
The skill will extract feature/persona/goal from any format.
IMPORTANT: The input above is your starting point. Use it directly. Do NOT ask for the feature description again.
MANDATORY — Read and execute ALL steps in: ${CLAUDE_PLUGIN_ROOT}/docs/extending/pre-execution-protocol.md
Skill name: pm-story-write
Execute: Step 0 (Init Guard) → A (Load Lessons) → B (Resolve Template) → C (Offer Template Seeding)
Also optionally reference research insights:
$JAAN_OUTPUTS_DIR/research/45-pm-insights-synthesis.md
If files don't exist, continue without them.
Read and apply language protocol: ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md
Override field for this skill: language_pm-story-write
Analyze $ARGUMENTS format:
Jira ID Pattern (PROJ-123, EPIC-456):
Structured Format ([feature] [persona] [goal]):
Narrative Format (free text):
Show parsed understanding:
"I understand you want to create a story about:
- Feature: {feature}
- Persona: {persona}
- Goal: {goal}
Is this correct? [y/n]"
If "n", ask what needs clarification and reparse.
Ask clarifying questions (maximum 5, only if not already answered by input or Jira context):
Core Questions (from research Section 4):
"What specific context does this persona have? (e.g., 'busy parent', 'first-time user', 'power user with technical knowledge')"
"What is the genuine business value? Why does this matter to the business or user?"
"What dependencies exist? (e.g., APIs, other stories, design mockups, data sources)"
"What is explicitly OUT of scope for this story? What's deferred to later?"
"Is there an epic, related stories, or team conventions to reference?"
"Do you have design screenshots related to this story? If yes, provide file paths."
From LEARN.md "Better Questions": {Additional questions from past lessons, if file exists}
Skip questions if:
Based on feature type, identify relevant edge case categories from research Section 6.
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/pm-story-write-reference.mdsection "10 Edge Case Categories" for the full category table and auto-detection matrix by feature type.
Show mapping:
"Based on this being a {feature_type} feature, I've identified these applicable edge case categories:
- {Category N}: {reason why applicable}
- {Category M}: {reason why applicable}
I'll generate acceptance criteria covering these scenarios."
Based on gathered information, plan the complete story structure:
1. Story Statement Components:
2. Acceptance Criteria Plan (3-7 scenarios):
3. Scope Boundaries:
4. Dependencies:
5. Metadata:
Present planned story structure:
STORY PLAN
──────────────────────────────────────
Title: {Verb-First Title (max 10 words)}
Persona: {specific persona with context}
Feature: {capability}
Value: {business value}
ACCEPTANCE CRITERIA (Draft)
───────────────────────────────────────
✓ Scenario 1 (Happy Path): {brief description}
✓ Scenario 2 (Edge Case): {brief description}
✓ Scenario 3 (Edge Case): {brief description}
✓ Scenario 4 (Error Handling): {brief description}
{...additional scenarios if needed}
SCOPE
───────────────────────────────────────
In-Scope:
- {in-scope item 1}
- {in-scope item 2}
- {in-scope item 3}
Out-of-Scope:
- {out-of-scope item 1} → {reference or reason}
- {out-of-scope item 2} → {reference or reason}
DEPENDENCIES
───────────────────────────────────────
{list dependencies or "None"}
EDGE CASE COVERAGE
───────────────────────────────────────
Categories addressed: {comma-separated list from Step 2}
Minimum ACs required: {number}
"Ready to generate the full user story? [y/n/revise]"
Do NOT proceed to Phase 2 without explicit approval.
If "revise", ask what needs to change and return to the relevant Phase 1 step.
Use template from skills/jaan-to:pm-story-write/template.md based on research Section 5.
---
story_id: US-XXX # Placeholder for team to fill
epic: "{epic_name_or_id}"
title: "{Verb-First Title}"
priority: {high|medium|low|critical}
status: draft
estimate: TBD
labels: [{inferred_labels}]
created: {YYYY-MM-DD}
last_updated: {YYYY-MM-DD}
---
Section 1: Title
# US-XXX: {Verb-First Title}
Section 2: Context (2-4 sentences)
Explain WHY this story exists: business drivers, user research insights, relevant metrics. Make self-contained—no tribal knowledge.
If design screenshots were provided, embed them here using .
Section 3: Story Statement (Connextra format)
## Story Statement
**As a** {specific_persona_with_context}
**I want to** {single_capability}
**So that** {business_value}
Section 4: Acceptance Criteria (3-7 Gherkin scenarios)
Follow Gherkin best practices from research Section 2:
## Acceptance Criteria
### Scenario 1: {Happy_Path_Name}
\`\`\`gherkin
Given {precondition}
When {user_action}
Then {observable_outcome}
And {additional_outcome_if_needed}
\`\`\`
### Scenario 2: {Edge_Case_Name}
\`\`\`gherkin
Given {precondition}
When {action}
Then {outcome}
\`\`\`
### Scenario 3: {Error_Handling_Name}
\`\`\`gherkin
Given {precondition}
When {error_condition_occurs}
Then {user_sees_error_message}
And {system_maintains_data_integrity}
\`\`\`
[Include 3-7 scenarios covering happy path + key edge cases from Step 2]
Sections 5-9: Scope, Dependencies, Technical Notes, Open Questions, Definition of Done
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/pm-story-write-reference.mdsection "Story Template — Sections 5-9 Format Specifications" for the detailed markdown format of each section.
Before preview, validate against three checkpoints. All must pass.
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/pm-story-write-reference.mdsection "INVEST Compliance Checklist" for the full validation table with criteria, questions, and red flags.
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/pm-story-write-reference.mdsection "AC Testability Checklist" for the full checklist of acceptance criteria verification items.
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/pm-story-write-reference.mdsection "Definition of Ready Checklist" for the full 10-item readiness checklist.
 syntax and URL-encoded pathsIf story seems too large (>7 ACs or estimated >8 story points):
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/pm-story-write-reference.mdsection "Story Splitting Detection Patterns" for the 6 splitting patterns with examples.
Present the applicable patterns to the user and offer:
[1] Split now using pattern #{n} [2] Refine and keep as single story [3] Proceed as-is (will flag as >5 points)
If user chooses [1], guide them through splitting and restart from Step 3 with split stories. If user chooses [2], ask what to refine and return to Step 4. If user chooses [3], add note to story: "Note: Estimated >5 points—consider splitting during refinement."
Show complete story in markdown format:
---
{full YAML frontmatter}
---
{complete story content with all 9 sections}
"📋 Preview complete. Approve writing to output? [y/n]"
If "n", ask what needs revision and return to Step 4.
If approved, set up the output structure:
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/id-generator.sh"
# Define subdomain directory
SUBDOMAIN_DIR="$JAAN_OUTPUTS_DIR/pm/stories"
mkdir -p "$SUBDOMAIN_DIR"
# Generate next ID
NEXT_ID=$(generate_next_id "$SUBDOMAIN_DIR")
# Create folder and file paths
slug="{lowercase-hyphenated-from-title-max-50-chars}"
OUTPUT_FOLDER="${SUBDOMAIN_DIR}/${NEXT_ID}-${slug}"
MAIN_FILE="${OUTPUT_FOLDER}/${NEXT_ID}-story-${slug}.md"
Output Configuration
- ID: {NEXT_ID}
- Folder: $JAAN_OUTPUTS_DIR/pm/stories/{NEXT_ID}-{slug}/
- Main file: {NEXT_ID}-story-{slug}.md
If design screenshot paths were provided:
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/asset-embedding-reference.mdfor the asset resolution protocol (path detection, copy rules, markdown embedding).
Source ${CLAUDE_PLUGIN_ROOT}/scripts/lib/asset-handler.sh. For each screenshot: check is_jaan_path — if inside $JAAN_*, reference in-place; if external, ask user before copying. Use resolve_asset_path for markdown-relative paths.
mkdir -p "$OUTPUT_FOLDER"
cat > "$MAIN_FILE" <<'EOF'
{generated story content with Executive Summary}
EOF
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/index-updater.sh"
add_to_index \
"$SUBDOMAIN_DIR/README.md" \
"$NEXT_ID" \
"${NEXT_ID}-${slug}" \
"{Story Title}" \
"{1-2 sentence executive summary from story}"
✅ Story written to: $JAAN_OUTPUTS_DIR/pm/stories/{NEXT_ID}-{slug}/{NEXT_ID}-story-{slug}.md ✅ Index updated: $JAAN_OUTPUTS_DIR/pm/stories/README.md
After writing the story, provide Jira CSV and Linear JSON export options.
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/pm-story-write-reference.mdsection "Export Formats" for the Jira CSV and Linear GraphQL mutation templates.
After story is written, ask:
"Any feedback or improvements for this story? [y/n]"
If yes:
"How should I handle this feedback? [1] Fix now - Update this story [2] Learn - Save for future stories via /jaan-to:learn-add [3] Both - Fix now AND save lesson"
Option 1 - Fix now:
Option 2 - Learn for future:
/jaan-to:learn-add pm-story-write "{feedback}"Option 3 - Both:
/jaan-to:learn-add pm-story-write "{feedback}"If no:
$JAAN_OUTPUTS_DIR pathReference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/pm-story-write-reference.mdsection "Skill Definition of Done Checklist" for the full 13-item completion checklist covering Steps 0-8.