BMAD-METHOD/expansion-packs/bmad-wechat-mini-game-dev/workflows/game-dev-greenfield.yaml

228 lines
9.8 KiB
YAML

workflow:
id: wechat-mini-game-dev-greenfield
name: WeChat Mini Game Development - Greenfield Project
description: A specialized workflow for creating WeChat Mini Games from concept to launch. This workflow guides teams through the unique aspects of Mini Game development, including component-based architecture, JavaScript/TypeScript, and integration with WeChat's extensive API ecosystem (e.g., user authentication, cloud storage, social features). It emphasizes performance optimization for mobile devices and adherence to WeChat's platform policies.
type: greenfield
project_types:
- wechat-2d-casual-game
- wechat-puzzle-game
- wechat-hyper-casual-game
- wechat-educational-game
- wechat-social-simulation-game
sequence:
- agent: game-designer
creates: project-brief.md
optional_steps:
- wechat_mini_game_market_analysis
- competitor_gameplay_review
- monetization_strategy_planning
notes: "Define the game concept, focusing on mechanics that work well with touch controls and short play sessions, typical for the WeChat platform. Consider social sharing and monetization from the start. SAVE OUTPUT: Copy final project-brief.md to your project's docs/design/ folder."
- agent: game-designer
creates: game-design-doc.md
requires: project-brief.md
optional_steps:
- ui_flow_and_wireframing
- wechat_api_integration_planning
- data_persistence_strategy
notes: "Create a GDD tailored for Mini Games. Define UI/UX flow, component interactions, and how WeChat APIs (login, storage, sharing) will be used. Plan for different screen aspect ratios. SAVE OUTPUT: Copy final game-design-doc.md to your project's docs/design/ folder."
- agent: game-pm
creates: prd.md
requires:
- project-brief.md
- game-design-doc.md
notes: "Create a Product Requirements Document (PRD) from the project brief and GDD. SAVE OUTPUT: Copy final prd.md to your project's docs/ folder."
- agent: game-architect
creates: architecture.md
requires:
- game-design-doc.md
- prd.md
optional_steps:
- client_server_architecture_design
- cloud_function_planning
- database_schema_design
- asset_optimization_strategy
notes: "Design the technical architecture: client-side structure (JavaScript/TypeScript, game engine/library), backend services (e.g., WeChat Cloud Base, custom server), API endpoints, and data models. Define the asset pipeline and optimization strategy for fast loading times. SAVE OUTPUT: Copy final architecture.md to your project's docs/architecture/ folder."
- agent: game-pm
updates: prd.md (if needed)
requires: architecture.md
condition: architecture_suggests_prd_changes
notes: "If the architecture requires changes to the product scope, update the PRD and re-export the complete unredacted prd.md to the docs/ folder."
- agent: game-po
validates: all_artifacts
uses: po-master-checklist
notes: "Validate all documents for consistency, completeness, and feasibility within the WeChat Mini Game ecosystem."
- agent: various
updates: any_flagged_documents
condition: po_checklist_issues
notes: "If the PO finds issues, the relevant agent must fix the flagged documents and re-export the updated versions to the docs/ folder."
- project_setup_guidance:
action: initialize_wechat_mini_game_project
notes: "Use WeChat Developer Tools to create a new project. Set up the project structure: pages/, components/, utils/, assets/. Configure app.json with necessary pages, permissions, and settings. Initialize a version control system (Git)."
- agent: game-po
action: shard_documents
creates: sharded_docs
requires: all_artifacts_in_project
notes: |
Shard documents for IDE development:
- Option A: Use PO agent to shard: @game-po then ask to shard docs/prd.md
- Option B: Manual: Drag shard-doc task + docs/prd.md into chat
- Creates docs/prd/ and docs/architecture/ folders with sharded content
- agent: game-sm
action: create_story
creates: story.md
requires: sharded_docs
repeats: for_each_epic
notes: |
Story creation cycle:
- SM Agent (New Chat): @game-sm → *create
- Creates next story from sharded docs
- Story starts in "Draft" status
- agent: game-qa
action: test_design
updates: story.md
requires: story.md
optional: true
condition: user_wants_test_design
notes: |
OPTIONAL: Design tests for the draft story.
- Analyze the story for risks related to performance, compatibility, and WeChat API usage.
- Create test cases to mitigate these risks.
- agent: game-po
action: review_draft_story
updates: story.md
requires: story.md
optional: true
condition: user_wants_story_review
notes: |
OPTIONAL: Review and approve the draft story.
- Ensure the story aligns with the product vision and is technically sound.
- Update story status: Draft → Approved
- agent: game-dev
action: implement_story
creates: implementation_files
requires: story.md
notes: |
Dev Agent (New Chat): @game-dev
- Implements the approved story using JavaScript/TypeScript.
- Tests implementation in WeChat Developer Tools and on physical devices.
- Marks story as "Review" when complete.
- agent: game-qa
action: review_implementation
updates: implementation_files
requires: implementation_files
optional: true
notes: |
OPTIONAL: QA Agent (New Chat): @qa → review-story
- Senior dev reviews code for quality, performance, and adherence to guidelines.
- Fixes small issues directly.
- Creates a checklist for any remaining items.
- Updates story status (Review → Done or stays Review).
- agent: game-dev
action: address_qa_feedback
updates: implementation_files
condition: qa_left_unchecked_items
notes: |
If QA left unchecked items:
- Dev Agent (New Chat): Address the remaining items.
- Return to QA for final approval.
- repeat_development_cycle: ""
action: continue_for_all_stories
notes: |
Repeat the story cycle (SM → Dev → QA) for all stories in the PRD.
Continue until the MVP is complete.
- agent: game-po
action: epic_retrospective
creates: epic-retrospective.md
condition: epic_complete
optional: true
notes: |
OPTIONAL: After an epic is completed.
- Validate that the epic was completed correctly and meets the definition of done.
- Document learnings and identify areas for improvement.
- workflow_end: ""
action: project_complete
notes: |
All stories for the MVP are implemented and reviewed.
The project is ready for submission to WeChat for review.
Reference: {root}/data/bmad-kb.md#IDE Development Workflow
flow_diagram: |
```mermaid
graph TD
A[Start: Greenfield Project] --> B[game-designer: project-brief.md]
B --> C[game-pm: prd.md]
C --> D[game-architect: architecture.md]
D --> E{Architecture suggests PRD changes?}
E -->|Yes| F[game-pm: update prd.md]
E -->|No| G[game-po: validate all artifacts]
F --> G
G --> I{PO finds issues?}
I -->|Yes| J[Return to relevant agent for fixes]
I -->|No| K[Project Setup & Doc Sharding]
J --> G
K --> L[game-sm: create story]
L --> M{Review draft story?}
M -->|Yes| N[game-po: review & approve story]
M -->|No| O[game-dev: implement story]
N --> O
O --> P{QA review?}
P -->|Yes| Q[game-qa: review implementation]
P -->|No| R{More stories?}
Q --> S{QA found issues?}
S -->|Yes| T[game-dev: address QA feedback]
S -->|No| R
T --> Q
R -->|Yes| L
R -->|No| U{Epic retrospective?}
U -->|Yes| V[game-po: epic retrospective]
U -->|No| W[Project Complete]
V --> W
style W fill:#90EE90
style K fill:#ADD8E6
style L fill:#ADD8E6
style O fill:#ADD8E6
style B fill:#FFE4B5
style C fill:#FFE4B5
style D fill:#FFE4B5
style G fill:#FFE4B5
style N fill:#F0E68C
style Q fill:#F0E68C
style V fill:#F0E68C
```
decision_guidance:
when_to_use:
- Building a new WeChat Mini Game from scratch.
- Projects with clear, defined goals but flexible implementation details.
- When a comprehensive design and planning phase is desired before development.
- Projects that require backend integration for social features or data persistence.
handoff_prompts:
analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD."
pm_to_architect: "PRD is ready. Save it as docs/prd.md in your project, then create the technical architecture."
architect_review: "Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?"
architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/."
updated_to_po: "All documents are ready in the docs/ folder. Please validate all artifacts for consistency and adherence to WeChat platform guidelines."
po_issues: "The PO found issues with [document]. Please return to [agent] to fix and re-save the updated document."
complete: "All planning artifacts have been validated and saved in the docs/ folder. You can now move to the IDE environment to begin development."