AgentSkillsCN

Story Cycle

故事周期

SKILL.md

Skill: Story Development Cycle v2.0 (OpenCode Integration)

Master Source: _bmad/bmb/workflows/story-cycle/ | Version: 2.0.0 | Cross-Platform: Claude Code + Open Code


Description

Complete modular story development cycle with validation loops, pre-planning gates, research protocols, and cross-platform support. Replaces monolithic workflows with 9-step modular architecture.


Workflow Architecture

code
┌─────────────────────────────────────────────────────────────────────────────┐
│  STORY DEVELOPMENT CYCLE v2.0 — Modular Architecture                       │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐  │
│  │ 01-create-  │ →  │ 02-validate-│ →  │ 03-create-  │ →  │ 04-validate-│  │
│  │   story     │    │   story     │    │   context   │    │   context   │  │
│  └─────────────┘    └─────────────┘    └─────────────┘    └─────────────┘  │
│        ↓ fail              ↺ loop             ↓                 ↺ loop     │
│                                                                             │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐  │
│  │ 05-pre-     │ →  │ 06-dev-     │ →  │ 07-code-    │ →  │ 08-story-   │  │
│  │   planning  │    │   story     │    │   review    │    │   done      │  │
│  └─────────────┘    └─────────────┘    └─────────────┘    └─────────────┘  │
│        ↓ fail              ↺ loop             ↺ loop             ↓         │
│                                                                             │
│  ┌─────────────┐                                                            │
│  │ 09-retro-   │  ← [if last story of epic]                                │
│  │   spective  │                                                            │
│  └─────────────┘                                                            │
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │ CROSS-CUTTING: correct-course, audit-checkpoint, stale-check        │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────────┘

Triggers

code
story-cycle
story cycle
develop story
story dev cycle
/start story
/new story

Usage

Start New Story

bash
story-cycle

Prompts for:

  • Epic number
  • Story number (optional, or finds next)
  • Mode (create/continue)

Continue Existing Story

bash
story-cycle continue {story_key}

Resumes from current story state.

Jump to Specific Step

bash
story-cycle step={step_number} story={story_key}

Example: story-cycle step=5 story=3-1-implement-feature


Master Workflow Reference

Main Documentation: _bmad/bmb/workflows/story-cycle/README.md

Step Files (linked from steps/):

StepFiledescriptionAgent
0101-create-story.mdCreate story from epicSM
0202-validate-story.mdValidate story 100%SM
0303-create-context.mdBuild context XMLSM
0404-validate-context.mdValidate + stale checkSM
0505-pre-planning.mdResearch gate (NEW)Dev
0606-dev-story.mdTDD implementationDev
0707-code-review.mdMulti-agent reviewDev/Reviewer
0808-story-done.mdComplete storySM
0909-retrospective.mdEpic retrospectiveSM

Sub-Skills (Individual Steps)

Each step can be invoked independently:

CommandDescriptionLoads
create-storyCreate a new story from epicsteps/01-create-story.md
validate-storyValidate story filesteps/02-validate-story.md
create-contextBuild context XMLsteps/03-create-context.md
validate-contextValidate context + stale checksteps/04-validate-context.md
pre-planningResearch and planning gatesteps/05-pre-planning.md
dev-storyImplement with TDDsteps/06-dev-story.md
code-reviewReview implementationsteps/07-code-review.md
story-doneMark story completesteps/08-story-done.md
retrospectiveEpic retrospectivesteps/09-retrospective.md

Utility Commands

CommandDescriptionLoads
stale-checkFile freshness validationutils/_stale-check.md
correct-courseRecovery handlerutils/_correct-course.md
auditQuality auditutils/_audit-checkpoint.md

Configuration

Expects these files to exist:

yaml
# _bmad/bmb/config.yaml
user_name: {name}
communication_language: {language}
output_folder: "_bmad-output"

# _bmad-output/sprint-artifacts/sprint-status.yaml
# _bmad-output/epics.md
# _bmad-output/project-planning-artifacts/architecture.md

Output Artifacts

code
_bmad-output/sprint-artifacts/
├── {epic}-{story}-{slug}.md           # Story file
├── {epic}-{story}-{slug}-context.xml   # Context XML
├── {epic}-{story}-{slug}-handoff.md    # Handoff artifact
├── sprint-status.yaml                  # Updated each step
└── epic-{N}-retrospective.md           # Epic completion (if applicable)

Governance Rules

Mandatory Research (Before Implementation)

Every story MUST include research using MCP tools:

TooldescriptionQuery Pattern
Context7Official docsresolve-library-idget-library-docs
DeepWikiGitHub patternsask_question with repo-specific query
Tavily/ExaCommunity solutionsSemantic search for patterns
RepomixLocal analysisPack and grep existing code

Validation Gates (100% Pass Required)

  • Story file exists at correct path
  • User story format complete (As a/I want/So that)
  • At least 3 acceptance criteria defined
  • Context XML passes freshness check
  • Pre-planning gate passed
  • All tests passing
  • Code review approved

Recovery Handlers

Correct Course Workflow

Triggered when:

  • Story stuck >2x timebox
  • Validation unable to pass
  • External blockers identified

Actions:

  1. Pause current workflow
  2. Assess situation
  3. Propose options:
    • Split story
    • Defer to next sprint
    • Escalate to architect
  4. Document decision
  5. Resume or terminate

Command: /correct-course {story_key}

Stale Check

Triggered:

  • At context creation
  • Before development
  • After significant delays

Command: /stale-check {context_file}


Examples

Example 1: Start New Story

code
User: story-cycle

Agent: Welcome to Story Development Cycle v2.0!
      Loading configuration...

      Current Sprint: Sprint 5
      Available Epics:
      - Epic 21: Production Hardening (3 stories remaining)
      - Epic 22: UX Modernization (5 stories remaining)

      Which epic? [21/22]

Example 2: Continue Story

code
User: story-cycle continue 21-2-fix-auth

Agent: Loading story 21-2-fix-auth...
      Current status: ready-for-implementation

      Resuming from Step 05: Pre-Planning

Example 3: Jump to Step

code
User: story-cycle step=6 story=21-2-fix-auth

Agent: Jumping to Step 06: Develop Story
      Proceeding with TDD implementation...

Error Handling

ErrorAction
Config not foundPrompt for user_name, language
Sprint status missingCreate new sprint-status.yaml
Epic not foundShow available epics from epics.md
Story not foundOffer to create new story
Validation failsLoop back with specific fixes
Timebox exceededTrigger correct-course workflow

v2.0 Improvements Over v1.0

Issuev1.0v2.0 Solution
Monolithic file552 lines, >15KB10 modular files, each <5KB
No pre-planning gateAgents implement without contextStep 05: Pre-planning enforcement
Stale contextNo freshness checks_stale-check.md validator
No standards checkInconsistent code qualityConstitution check in pre-planning
Superficial validationGeneric checklistsProject-specific validation
No recovery pathStories get stuck_correct-course.md handler
No audit trailContext lost between agentsFormal handoff artifacts
Platform-specific.agent/workflows/ onlyCross-platform via BMAD

Token Optimization

This skill uses minimal references. Full workflow definitions are in _bmad/bmb/workflows/story-cycle/. This pattern:

  • ✅ Ensures consistency (single source)
  • ✅ Enables live updates
  • ✅ Reduces token count by ~80%

Related Skills

Skilldescription
bmm-workflowsBMM workflow integration
bmad-core-integrationAgent access and routing
asglAutonomous loop orchestration
architecture-remediationGod store/component fixes

Command Aliases

AliasMaps To
@story-cycleFull story development cycle
@create-storyCreate story step
@dev-storyDevelopment step (TDD)
@code-reviewCode review step
@correct-courseCorrect course utility
@retroRetrospective

Generated: 2026-01-08 | Master: _bmad/bmb/workflows/story-cycle/