bmad-synthesize
npx skills add https://github.com/jschulte/claude-plugins --skill bmad-synthesize
Agent 安装分布
Skill 文档
BMAD Synthesize
Auto-generate BMAD planning artifacts from StackShift reverse-engineering documentation.
Estimated Time: 10-30 minutes (depending on mode)
Prerequisites: Gear 2 (Reverse Engineer) completed with all 11 docs
Output: 4 BMAD artifacts in _bmad-output/planning-artifacts/
When to Use This Skill
Use this skill when:
- Gear 2 has generated all 11 reverse-engineering docs
- You want BMAD artifacts without running the full BMAD conversation flow
- You chose
bmad-autopilotas the implementation framework in Gear 1 - You want to convert existing reverse-engineering docs into BMAD format
- You need a PRD, Architecture doc, Epics, or UX spec generated from code analysis
Trigger Phrases:
- “Generate BMAD artifacts from reverse-engineering docs”
- “Create PRD from the codebase analysis”
- “Auto-generate BMAD planning documents”
- “Synthesize BMAD artifacts”
- “Run BMAD auto-pilot”
What This Skill Does
Reads all 11 reverse-engineering docs and maps their content into 4 BMAD planning artifacts:
| BMAD Artifact | Primary Source Docs | Coverage |
|---|---|---|
prd.md |
functional-specification, business-context, technical-debt-analysis, integration-points | ~90% |
architecture.md |
data-architecture, integration-points, operations-guide, decision-rationale, configuration-reference, observability-requirements | ~85% |
epics.md |
functional-specification (FRs grouped by domain), business-context (personas), technical-debt-analysis (migration matrix) | ~75% |
ux-design-specification.md |
visual-design-system, business-context (personas), functional-specification (user stories) | ~65% |
Three Modes
Mode 1: YOLO (Fully Automatic)
Time: ~10 minutes User input: None
- Maps all 11 docs to BMAD artifacts automatically
- For questions the docs can’t answer, infers from available context
- Treats
[INFERRED]items as accepted - Resolves
[NEEDS USER INPUT]items with best-effort inference - Generates all 4 artifacts in one shot
Best for: Quick artifact generation, overnight runs, batch processing, when you plan to refine later.
Mode 2: Guided (Recommended)
Time: ~15-20 minutes User input: 5-10 targeted questions
- Auto-populates everything the docs can answer (high confidence)
- Presents targeted questions ONLY for genuinely ambiguous items:
- Business vision refinement (from business-context.md
[NEEDS USER INPUT]items) - Priority trade-offs between competing requirements
- Persona validation (are the inferred personas correct?)
- Architecture preferences not visible in code
- Epic scoping decisions
- Business vision refinement (from business-context.md
- Generates all 4 artifacts with user input incorporated
Best for: Most projects. Good balance of speed and quality.
Mode 3: Interactive
Time: ~25-30 minutes User input: Full conversation
- Pre-loads all 11 docs as context (you don’t start from zero)
- Walks through each BMAD artifact section by section
- Shows draft content for each section, asks for approval/changes
- Most thorough, but slowest
- Essentially BMAD’s collaborative flow with a massive head start
Best for: Critical projects, when precision matters, when you want full control.
Document Mapping (Detailed)
prd.md Generation
Source â BMAD PRD Section
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
business-context.md
âââ Product Vision â ## Product Vision
âââ Target Users & Personas â ## Target Users
âââ Business Goals â ## Success Criteria / ## KPIs
âââ Competitive Landscape â ## Market Context
âââ Stakeholder Map â ## Stakeholders
âââ Business Constraints â ## Constraints & Assumptions
functional-specification.md
âââ Functional Requirements â ## FR1: Title, ## FR2: Title, ...
âââ Non-Functional Reqs â ## NFR1: Title, ## NFR2: Title, ...
âââ User Stories â Embedded in FRs as acceptance criteria
âââ Business Rules â ## Business Rules
âââ System Boundaries â ## Scope
âââ Success Criteria â ## Success Criteria
âââ User Personas â Supplements ## Target Users
âââ Product Positioning â Supplements ## Product Vision
technical-debt-analysis.md
âââ Migration Priority Matrix â ## Known Issues & Constraints
âââ Security Vulnerabilities â ## NFR: Security Requirements
integration-points.md
âââ External Services â ## External Dependencies
âââ Auth Flows â ## NFR: Authentication & Authorization
architecture.md Generation
Source â BMAD Architecture Section
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
data-architecture.md
âââ Data Models â ## Data Models
âââ API Endpoints â ## API Contracts
âââ Database ER Diagram â ## Data Layer
âââ JSON/GraphQL Schemas â ## API Contracts (detail)
âââ Domain Model / Contexts â ## Domain Model
integration-points.md
âââ External Services â ## External Integrations
âââ Internal Service Deps â ## Service Architecture
âââ Data Flow Diagrams â ## System Architecture Diagram
âââ Auth Flows â ## Authentication Architecture
âââ Webhook Integrations â ## Event Architecture
operations-guide.md
âââ Deployment Procedures â ## Deployment Architecture
âââ Infrastructure Overview â ## Infrastructure
âââ Scalability Strategy â ## Scalability & Performance
âââ Monitoring â ## Observability Architecture
decision-rationale.md
âââ Technology Selection â ## Technology Stack
âââ ADRs â ## ADR-001: Title, ## ADR-002: Title, ...
âââ Design Principles â ## Design Principles
âââ Trade-offs â ## Trade-offs & Constraints
configuration-reference.md
âââ Environment Variables â ## Configuration Architecture
âââ Feature Flags â ## Feature Management
observability-requirements.md
âââ Logging Strategy â ## Observability Architecture
âââ Monitoring Strategy â ## Monitoring & Alerting
âââ Alerting Rules â ## SLA & SLO Targets
epics.md Generation
Source â BMAD Epics
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
functional-specification.md
âââ FRs grouped by domain â ## Epic N: Domain Name
âââ User Stories per FR â ### Story N.M: Title
âââ Acceptance Criteria â Acceptance Criteria per story
business-context.md
âââ Personas â "As a [persona]..." in user stories
âââ Business Goals â Epic priority ordering
technical-debt-analysis.md
âââ Migration Priority Matrix â ## Epic: Technical Debt Resolution
âââ Quick Wins â High-priority stories in debt epic
integration-points.md
âââ External Integrations â ## Epic: Integration & Connectivity
Epic Grouping Strategy:
- Group FRs by domain/feature area (auth, data management, reporting, etc.)
- Each group becomes an Epic
- Each FR within a group becomes a Story
- Add a “Technical Foundation” epic for infrastructure/debt items
- Add an “Integration” epic for external service work
- Priority ordering: P0 epics first, then P1, P2, P3
ux-design-specification.md Generation
Source â BMAD UX Design Section
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
visual-design-system.md
âââ Component Library â ## Component Inventory
âââ Design Tokens â ## Design Tokens
âââ Responsive Breakpoints â ## Responsive Design
âââ Accessibility Standards â ## Accessibility Requirements
âââ User Flows â ## User Flows
business-context.md
âââ Personas â ## User Personas (with journey maps)
âââ Business Constraints â ## Design Constraints
functional-specification.md
âââ User Stories â ## Key User Journeys
âââ Business Rules â ## Interaction Patterns
Process
Step 0: Verify Prerequisites
# Check that Gear 2 is complete
DOCS_DIR="docs/reverse-engineering"
REQUIRED_DOCS=("functional-specification.md" "integration-points.md" "configuration-reference.md" "data-architecture.md" "operations-guide.md" "technical-debt-analysis.md" "observability-requirements.md" "visual-design-system.md" "test-documentation.md" "business-context.md" "decision-rationale.md")
MISSING=0
for doc in "${REQUIRED_DOCS[@]}"; do
if [ ! -f "$DOCS_DIR/$doc" ]; then
echo "MISSING: $doc"
MISSING=$((MISSING + 1))
fi
done
if [ $MISSING -gt 0 ]; then
echo "ERROR: $MISSING docs missing. Run Gear 2 first: /stackshift.reverse-engineer"
exit 1
fi
echo "All 11 reverse-engineering docs found. Ready to synthesize."
If docs are missing: Guide user to run /stackshift.reverse-engineer first.
If only 9 docs exist (legacy): business-context.md and decision-rationale.md may be missing from older runs. Generate them first using the reverse-engineer skill, or proceed with reduced coverage (warn user).
Step 1: Load All Reverse-Engineering Docs
Read all 11 docs from docs/reverse-engineering/ into memory. Parse each for structured content:
- Extract all FRs, NFRs, user stories, personas
- Extract all data models, API contracts, integration points
- Extract all ADRs, technology selections, design principles
- Extract all business context, goals, constraints
- Note all
[INFERRED]and[NEEDS USER INPUT]markers
Step 2: Choose Mode
Ask the user which mode to use:
How should BMAD artifacts be generated?
A) YOLO - Fully automatic, no questions asked (~10 min)
Best for: Quick generation, batch processing, refine later
B) Guided - Auto-fill + 5-10 targeted questions (~15-20 min) (Recommended)
Best for: Most projects, good balance of speed and quality
C) Interactive - Section-by-section review (~25-30 min)
Best for: Critical projects, maximum precision
Step 3: Generate Artifacts (Mode-Dependent)
YOLO Mode
- Generate prd.md: Map all source sections per the mapping above. For
[NEEDS USER INPUT]items, use best-effort inference and mark with[AUTO-INFERRED - review recommended]. - Generate architecture.md: Map all technical docs. Generate Mermaid diagrams for system architecture and data flow.
- Generate epics.md: Group FRs into domain-based epics. Create stories with “As a [persona]” format. Set priorities from FR priorities.
- Generate ux-design-specification.md: Map visual design system + persona journey maps.
- Write all artifacts to
_bmad-output/planning-artifacts/. - Generate a coverage report showing what percentage of each artifact was filled from docs vs inferred.
Guided Mode
- Parse and score: Read all docs, identify
[NEEDS USER INPUT]items and low-confidence sections. - Auto-fill high-confidence sections: Everything that maps cleanly from docs.
- Present targeted questions (5-10 max):
- “The codebase suggests [X] as the primary user persona. Is this accurate, or would you refine it?”
- “Business goals appear to center on [X]. What are the top 3 success metrics?”
- “The architecture uses [X]. For the BMAD architecture doc, should we document the current state or a target state?”
- “FRs group naturally into [N] domains: [list]. Does this epic structure make sense?”
- “The competitive landscape suggests [X]. Any corrections?”
- Incorporate answers into artifacts.
- Write all artifacts.
Interactive Mode
- Create context brief: One-page summary of all 11 docs for quick reference.
- Walk through prd.md section by section:
- Show draft for each section
- Ask: “Approve as-is, or modify?”
- Incorporate changes
- Walk through architecture.md section by section (same approach).
- Walk through epics.md: Present epic groupings, ask for approval, refine stories.
- Walk through ux-design-specification.md: Present design system mapping, ask for approval.
- Write all artifacts.
Step 4: Write Output
Create _bmad-output/planning-artifacts/ directory and write all 4 artifacts:
_bmad-output/
âââ planning-artifacts/
âââ prd.md
âââ architecture.md
âââ epics.md
âââ ux-design-specification.md
Each artifact includes YAML frontmatter:
---
stepsCompleted: [1, 2, 3]
inputDocuments:
- docs/reverse-engineering/functional-specification.md
- docs/reverse-engineering/business-context.md
- docs/reverse-engineering/integration-points.md
# ... all source docs used
workflowType: prd # or architecture, epics, ux-design
project_name: "<from state file>"
date: "<current date>"
synthesize_mode: "yolo" # or guided, interactive
coverage_score: 92 # percentage of sections filled from docs
---
Step 5: Generate Synthesis Report
Output a summary showing:
BMAD Synthesis Complete
âââââââââââââââââââââââ
Mode: Guided
Time: 18 minutes
Artifacts Generated:
prd.md - 94% from docs, 6% user input
architecture.md - 88% from docs, 12% inferred
epics.md - 82% from docs, 18% structured from FRs
ux-design-specification.md - 68% from docs, 32% inferred
Items Requiring Review:
- prd.md: 2 items marked [AUTO-INFERRED]
- architecture.md: 1 ADR with [INFERRED] rationale
- epics.md: Story priorities may need reordering
Next Steps:
- Review artifacts in _bmad-output/planning-artifacts/
- Install BMAD: npx bmad-method@alpha install
- Run: *workflow-init (BMAD will use these artifacts as starting point)
- Or: Manually refine artifacts before handing off to BMAD
Output Format
prd.md Structure
---
stepsCompleted: [1, 2, 3, 4, 5]
workflowType: prd
project_name: "..."
date: "..."
synthesize_mode: "guided"
---
# [Product Name] - Product Requirements Document
## Product Vision
[From business-context.md Product Vision]
## Target Users
[From business-context.md Personas + functional-spec User Personas]
### Persona 1: [Name]
- **Role:** ...
- **Goals:** ...
- **Pain Points:** ...
## Success Criteria
[From functional-spec Success Criteria + business-context Business Goals]
- Criterion 1
- Criterion 2
## Functional Requirements
### FR1: [Title]
**Priority:** P0
**Description:** [From functional-spec FR-001]
**Acceptance Criteria:**
- [ ] Criterion 1
- [ ] Criterion 2
### FR2: [Title]
...
## Non-Functional Requirements
### NFR1: [Title]
**Priority:** P1
**Description:** [From functional-spec NFR-001]
## External Dependencies
[From integration-points.md]
## Constraints & Assumptions
[From business-context.md Business Constraints]
## Known Issues
[From technical-debt-analysis.md high-priority items]
architecture.md Structure
---
stepsCompleted: [1, 2, 3]
workflowType: architecture
---
# [Product Name] - Technical Architecture
## System Architecture Diagram
[Mermaid diagram from integration-points Data Flow Diagrams]
## Technology Stack
[From decision-rationale.md Technology Selection]
## Domain Model
[From data-architecture.md Domain Model / Bounded Contexts]
## API Contracts
[From data-architecture.md API Endpoints]
### GET /api/resource
**Description:** ...
**Request:** ...
**Response:** ...
## Data Models
[From data-architecture.md Data Models]
### ModelName
- **field1**: type - description
- **field2**: type - description
## ADR-001: [Decision Title]
**Context:** [From decision-rationale.md]
**Decision:** ...
**Rationale:** ...
## Deployment Architecture
[From operations-guide.md]
## Scalability & Performance
[From operations-guide.md Scalability Strategy]
## Observability Architecture
[From observability-requirements.md]
Integration with Existing Workflows
From Spec Kit â BMAD Synthesize
If you already ran Gears 1-5 with Spec Kit and want BMAD artifacts too:
- The reverse-engineering docs are already generated
- Run
/stackshift.bmad-synthesizedirectly - BMAD artifacts supplement (don’t replace)
.specify/structure
From BMAD Synthesize â BMAD Workflow
After generating artifacts:
- Install BMAD:
npx bmad-method@alpha install - Run
*workflow-init - BMAD agents will find and use the pre-generated artifacts
- PM agent refines PRD, Architect agent refines Architecture
- Much faster than starting from scratch
Batch Mode Integration
When running batch processing (/stackshift.batch):
- Batch session can include
synthesize_mode: "yolo"in answers - Each repo gets BMAD artifacts generated automatically after Gear 2
- Useful for enterprise-scale documentation of many services
Success Criteria
- â
All 4 BMAD artifacts generated in
_bmad-output/planning-artifacts/ - â prd.md contains FRs, NFRs, personas, success criteria, constraints
- â architecture.md contains data models, API contracts, ADRs, deployment architecture
- â epics.md contains domain-grouped epics with user stories
- â ux-design-specification.md contains design system and user journey maps
- â Each artifact has YAML frontmatter with source tracking
- â Synthesis report shows coverage percentages
- â
[AUTO-INFERRED]items clearly marked for review
Next Steps
After BMAD Synthesize:
- Review artifacts in
_bmad-output/planning-artifacts/ - Refine manually or hand off to BMAD agents for collaborative refinement
- Install BMAD (if not installed):
npx bmad-method@alpha install - Run BMAD workflow:
*workflow-initâ agents will use your artifacts as starting point - Or use directly: Artifacts are valid BMAD format, can be used as-is for implementation
Technical Notes
- Read all 11 docs using the Read tool (parallel reads recommended)
- For Mermaid diagrams in architecture.md, generate from integration-points.md data flow descriptions
- Epic grouping uses domain clustering: analyze FR titles and descriptions for common themes
- User story format: “As a [persona from business-context], I want [FR description], so that [business goal]”
- Priority inheritance: Stories inherit priority from their source FR
- ADR numbering: Sequential from decision-rationale.md, preserving original order