bmad初始化

This commit is contained in:
2025-11-01 19:22:39 +08:00
parent 5b21dc0bd5
commit 426ae41f54
447 changed files with 80633 additions and 0 deletions

View File

@@ -0,0 +1,107 @@
# Tech-Spec Workflow Validation Checklist
**Purpose**: Validate tech-spec workflow outputs are definitive, complete, and implementation-ready.
**Scope**: Levels 0-1 software projects
**Expected Outputs**: tech-spec.md + story files (1 for Level 0, 2-3 for Level 1)
---
## 1. Output Files Exist
- [ ] tech-spec.md created in output folder
- [ ] Story file(s) created in dev_story_location
- Level 0: 1 story file (story-{slug}.md)
- Level 1: epics.md + 2-3 story files (story-{epic-slug}-N.md)
- [ ] bmm-workflow-status.md updated to Phase 4
- [ ] No unfilled {{template_variables}}
---
## 2. Tech-Spec Definitiveness (CRITICAL)
### No Ambiguity Allowed
- [ ] **Zero "or" statements**: NO "use X or Y", "either A or B", "options include"
- [ ] **Specific versions**: All frameworks, libraries, tools have EXACT versions
- ✅ GOOD: "Python 3.11", "React 18.2.0", "winston v3.8.2"
- ❌ BAD: "Python 2 or 3", "React 18+", "a logger like pino or winston"
- [ ] **Definitive decisions**: Every technical choice is final, not a proposal
### Implementation Clarity
- [ ] Source tree shows EXACT file paths (not "somewhere in src/")
- [ ] Each file marked as create/modify/delete
- [ ] Technical approach describes SPECIFIC implementation
- [ ] Implementation stack has complete toolchain with versions
---
## 3. Story Quality
### Story Format
- [ ] All stories use "As a [role], I want [capability], so that [benefit]" format
- [ ] Each story has numbered acceptance criteria
- [ ] Tasks reference AC numbers: (AC: #1), (AC: #2)
- [ ] Dev Notes section links back to tech-spec.md
### Story Sequencing (If Level 1)
- [ ] **Vertical slices**: Each story delivers complete, testable functionality
- [ ] **Sequential ordering**: Stories in logical progression
- [ ] **No forward dependencies**: No story depends on later work
- [ ] Each story leaves system in working state
### Coverage
- [ ] Story acceptance criteria derived from tech-spec testing section
- [ ] Story tasks map to tech-spec implementation guide
- [ ] Files in stories match tech-spec source tree
---
## 4. Workflow Status Integration
- [ ] bmm-workflow-status.md shows current_phase = "4-Implementation"
- [ ] Phase 2 ("2-Plan") marked complete
- [ ] First story in TODO section, others in BACKLOG (if Level 1)
- [ ] Next action clear (review story, run story-ready)
---
## 5. Readiness for Implementation
- [ ] Developer can start coding from tech-spec alone
- [ ] All technical questions answered definitively
- [ ] Testing approach clear and verifiable
- [ ] Deployment strategy documented
---
## 6. Critical Failures (Auto-Fail)
- [ ]**Non-definitive technical decisions** (any "option A or B" or vague choices)
- [ ]**Missing versions** (framework/library without specific version)
- [ ]**Stories don't match template** (incompatible with story-context/dev-story workflows)
- [ ]**Missing tech-spec sections** (required section missing from tech-spec.md)
- [ ]**Stories have forward dependencies** (would break sequential implementation)
- [ ]**Vague source tree** (file changes not specific)
---
## Validation Notes
**Document any findings:**
- Definitiveness score: [All definitive / Some ambiguity / Significant ambiguity]
- Strengths:
- Issues to address:
- Recommended actions:
**Ready for implementation?** [Yes / No - explain]
---
_Adapt based on Level 0 vs Level 1. Focus on definitiveness above all else._

View File

@@ -0,0 +1,11 @@
# {{project_name}} - Epic Breakdown
## Epic Overview
{{epic_overview}}
---
## Epic Details
{{epic_details}}

View File

@@ -0,0 +1,167 @@
# Level 0 - Minimal User Story Generation
<workflow>
<critical>This generates a single user story for Level 0 atomic changes</critical>
<critical>Level 0 = single file change, bug fix, or small isolated task</critical>
<critical>This workflow runs AFTER tech-spec.md has been completed</critical>
<critical>Output format MUST match create-story template for compatibility with story-context and dev-story workflows</critical>
<step n="1" goal="Load tech spec and extract the change">
<action>Read the completed tech-spec.md file from {output_folder}/tech-spec.md</action>
<action>Load bmm-workflow-status.md from {output_folder}/bmm-workflow-status.md</action>
<action>Extract dev_story_location from config (where stories are stored)</action>
<action>Extract the problem statement from "Technical Approach" section</action>
<action>Extract the scope from "Source Tree Structure" section</action>
<action>Extract time estimate from "Implementation Guide" or technical details</action>
<action>Extract acceptance criteria from "Testing Approach" section</action>
</step>
<step n="2" goal="Generate story slug and filename">
<action>Derive a short URL-friendly slug from the feature/change name</action>
<action>Max slug length: 3-5 words, kebab-case format</action>
<example>
- "Migrate JS Library Icons" → "icon-migration"
- "Fix Login Validation Bug" → "login-fix"
- "Add OAuth Integration" → "oauth-integration"
</example>
<action>Set story_filename = "story-{slug}.md"</action>
<action>Set story_path = "{dev_story_location}/story-{slug}.md"</action>
</step>
<step n="3" goal="Create user story in standard format">
<action>Create 1 story that describes the technical change as a deliverable</action>
<action>Story MUST use create-story template format for compatibility</action>
<guidelines>
**Story Point Estimation:**
- 1 point = < 1 day (2-4 hours)
- 2 points = 1-2 days
- 3 points = 2-3 days
- 5 points = 3-5 days (if this high, question if truly Level 0)
**Story Title Best Practices:**
- Use active, user-focused language
- Describe WHAT is delivered, not HOW
- Good: "Icon Migration to Internal CDN"
- Bad: "Run curl commands to download PNGs"
**Story Description Format:**
- As a [role] (developer, user, admin, etc.)
- I want [capability/change]
- So that [benefit/value]
**Acceptance Criteria:**
- Extract from tech-spec "Testing Approach" section
- Must be specific, measurable, and testable
- Include performance criteria if specified
**Tasks/Subtasks:**
- Map directly to tech-spec "Implementation Guide" tasks
- Use checkboxes for tracking
- Reference AC numbers: (AC: #1), (AC: #2)
- Include explicit testing subtasks
**Dev Notes:**
- Extract technical constraints from tech-spec
- Include file paths from "Source Tree Structure"
- Reference architecture patterns if applicable
- Cite tech-spec sections for implementation details
</guidelines>
<action>Initialize story file using user_story_template</action>
<template-output file="{story_path}">story_title</template-output>
<template-output file="{story_path}">role</template-output>
<template-output file="{story_path}">capability</template-output>
<template-output file="{story_path}">benefit</template-output>
<template-output file="{story_path}">acceptance_criteria</template-output>
<template-output file="{story_path}">tasks_subtasks</template-output>
<template-output file="{story_path}">technical_summary</template-output>
<template-output file="{story_path}">files_to_modify</template-output>
<template-output file="{story_path}">test_locations</template-output>
<template-output file="{story_path}">story_points</template-output>
<template-output file="{story_path}">time_estimate</template-output>
<template-output file="{story_path}">architecture_references</template-output>
</step>
<step n="4" goal="Update status - Level 0 single story">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/workflow-status">
<param>mode: update</param>
<param>action: complete_workflow</param>
<param>workflow_name: tech-spec</param>
</invoke-workflow>
<check if="success == true">
<output>✅ Tech-spec complete! Next: {{next_workflow}}</output>
</check>
<action>Load {{status_file_path}}</action>
<action>Set STORIES_SEQUENCE: [{slug}]</action>
<action>Set TODO_STORY: {slug}</action>
<action>Set TODO_TITLE: {{story_title}}</action>
<action>Set IN_PROGRESS_STORY: (empty)</action>
<action>Set STORIES_DONE: []</action>
<action>Save {{status_file_path}}</action>
<output>Story queue initialized with single story: {slug}</output>
</step>
<step n="5" goal="Provide user guidance for next steps">
<action>Display completion summary</action>
**Level 0 Planning Complete!**
**Generated Artifacts:**
- `tech-spec.md` → Technical source of truth
- `story-{slug}.md` → User story ready for implementation
**Story Location:** `{story_path}`
**Next Steps (choose one path):**
**Option A - Full Context (Recommended for complex changes):**
1. Load SM agent: `{project-root}/bmad/bmm/agents/sm.md`
2. Run story-context workflow
3. Then load DEV agent and run dev-story workflow
**Option B - Direct to Dev (For simple, well-understood changes):**
1. Load DEV agent: `{project-root}/bmad/bmm/agents/dev.md`
2. Run dev-story workflow (will auto-discover story)
3. Begin implementation
**Progress Tracking:**
- All decisions logged in: `bmm-workflow-status.md`
- Next action clearly identified
<ask>Ready to proceed? Choose your path:
1. Generate story context (Option A - recommended)
2. Go directly to dev-story implementation (Option B - faster)
3. Exit for now
Select option (1-3):</ask>
</step>
</workflow>

View File

@@ -0,0 +1,278 @@
# Level 1 - Epic and Stories Generation
<workflow>
<critical>This generates epic and user stories for Level 1 projects after tech-spec completion</critical>
<critical>This is a lightweight story breakdown - not a full PRD</critical>
<critical>Level 1 = coherent feature, 1-10 stories (prefer 2-3), 1 epic</critical>
<critical>This workflow runs AFTER tech-spec.md has been completed</critical>
<critical>Story format MUST match create-story template for compatibility with story-context and dev-story workflows</critical>
<step n="1" goal="Load tech spec and extract implementation tasks">
<action>Read the completed tech-spec.md file from {output_folder}/tech-spec.md</action>
<action>Load bmm-workflow-status.md from {output_folder}/bmm-workflow-status.md</action>
<action>Extract dev_story_location from config (where stories are stored)</action>
<action>Identify all implementation tasks from the "Implementation Guide" section</action>
<action>Identify the overall feature goal from "Technical Approach" section</action>
<action>Extract time estimates for each implementation phase</action>
<action>Identify any dependencies between implementation tasks</action>
</step>
<step n="2" goal="Create single epic">
<action>Create 1 epic that represents the entire feature</action>
<action>Epic title should be user-facing value statement</action>
<action>Epic goal should describe why this matters to users</action>
<guidelines>
**Epic Best Practices:**
- Title format: User-focused outcome (not implementation detail)
- Good: "JS Library Icon Reliability"
- Bad: "Update recommendedLibraries.ts file"
- Scope: Clearly define what's included/excluded
- Success criteria: Measurable outcomes that define "done"
</guidelines>
<example>
**Epic:** JS Library Icon Reliability
**Goal:** Eliminate external dependencies for JS library icons to ensure consistent, reliable display and improve application performance.
**Scope:** Migrate all 14 recommended JS library icons from third-party CDN URLs (GitHub, jsDelivr) to internal static asset hosting.
**Success Criteria:**
- All library icons load from internal paths
- Zero external requests for library icons
- Icons load 50-200ms faster than baseline
- No broken icons in production
</example>
<action>Derive epic slug from epic title (kebab-case, 2-3 words max)</action>
<example>
- "JS Library Icon Reliability" → "icon-reliability"
- "OAuth Integration" → "oauth-integration"
- "Admin Dashboard" → "admin-dashboard"
</example>
<action>Initialize epics.md summary document using epics_template</action>
<template-output file="{output_folder}/epics.md">epic_title</template-output>
<template-output file="{output_folder}/epics.md">epic_slug</template-output>
<template-output file="{output_folder}/epics.md">epic_goal</template-output>
<template-output file="{output_folder}/epics.md">epic_scope</template-output>
<template-output file="{output_folder}/epics.md">epic_success_criteria</template-output>
<template-output file="{output_folder}/epics.md">epic_dependencies</template-output>
</step>
<step n="3" goal="Determine optimal story count">
<critical>Level 1 should have 2-3 stories maximum - prefer longer stories over more stories</critical>
<action>Analyze tech spec implementation tasks and time estimates</action>
<action>Group related tasks into logical story boundaries</action>
<guidelines>
**Story Count Decision Matrix:**
**2 Stories (preferred for most Level 1):**
- Use when: Feature has clear build/verify split
- Example: Story 1 = Build feature, Story 2 = Test and deploy
- Typical points: 3-5 points per story
**3 Stories (only if necessary):**
- Use when: Feature has distinct setup, build, verify phases
- Example: Story 1 = Setup, Story 2 = Core implementation, Story 3 = Integration and testing
- Typical points: 2-3 points per story
**Never exceed 3 stories for Level 1:**
- If more needed, consider if project should be Level 2
- Better to have longer stories (5 points) than more stories (5x 1-point stories)
</guidelines>
<action>Determine story_count = 2 or 3 based on tech spec complexity</action>
</step>
<step n="4" goal="Generate user stories from tech spec tasks">
<action>For each story (2-3 total), generate separate story file</action>
<action>Story filename format: "story-{epic_slug}-{n}.md" where n = 1, 2, or 3</action>
<guidelines>
**Story Generation Guidelines:**
- Each story = multiple implementation tasks from tech spec
- Story title format: User-focused deliverable (not implementation steps)
- Include technical acceptance criteria from tech spec tasks
- Link back to tech spec sections for implementation details
**Story Point Estimation:**
- 1 point = < 1 day (2-4 hours)
- 2 points = 1-2 days
- 3 points = 2-3 days
- 5 points = 3-5 days
**Level 1 Typical Totals:**
- Total story points: 5-10 points
- 2 stories: 3-5 points each
- 3 stories: 2-3 points each
- If total > 15 points, consider if this should be Level 2
**Story Structure (MUST match create-story format):**
- Status: Draft
- Story: As a [role], I want [capability], so that [benefit]
- Acceptance Criteria: Numbered list from tech spec
- Tasks / Subtasks: Checkboxes mapped to tech spec tasks (AC: #n references)
- Dev Notes: Technical summary, project structure notes, references
- Dev Agent Record: Empty sections for context workflow to populate
</guidelines>
<for-each story="1 to story_count">
<action>Set story_path_{n} = "{dev_story_location}/story-{epic_slug}-{n}.md"</action>
<action>Create story file from user_story_template with the following content:</action>
<template-output file="{story_path_{n}}">
- story_title: User-focused deliverable title
- role: User role (e.g., developer, user, admin)
- capability: What they want to do
- benefit: Why it matters
- acceptance_criteria: Specific, measurable criteria from tech spec
- tasks_subtasks: Implementation tasks with AC references
- technical_summary: High-level approach, key decisions
- files_to_modify: List of files that will change
- test_locations: Where tests will be added
- story_points: Estimated effort (1/2/3/5)
- time_estimate: Days/hours estimate
- architecture_references: Links to tech-spec.md sections
</template-output>
</for-each>
<critical>Generate exactly {story_count} story files (2 or 3 based on Step 3 decision)</critical>
</step>
<step n="5" goal="Create story map and implementation sequence">
<action>Generate visual story map showing epic → stories hierarchy</action>
<action>Calculate total story points across all stories</action>
<action>Estimate timeline based on total points (1-2 points per day typical)</action>
<action>Define implementation sequence considering dependencies</action>
<example>
## Story Map
```
Epic: Icon Reliability
├── Story 1: Build Icon Infrastructure (3 points)
└── Story 2: Test and Deploy Icons (2 points)
```
**Total Story Points:** 5
**Estimated Timeline:** 1 sprint (1 week)
## Implementation Sequence
1. **Story 1** → Build icon infrastructure (setup, download, configure)
2. **Story 2** → Test and deploy (depends on Story 1)
</example>
<template-output file="{output_folder}/epics.md">story_summaries</template-output>
<template-output file="{output_folder}/epics.md">story_map</template-output>
<template-output file="{output_folder}/epics.md">total_points</template-output>
<template-output file="{output_folder}/epics.md">estimated_timeline</template-output>
<template-output file="{output_folder}/epics.md">implementation_sequence</template-output>
</step>
<step n="6" goal="Update status and populate story backlog">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/workflow-status">
<param>mode: update</param>
<param>action: complete_workflow</param>
<param>workflow_name: tech-spec</param>
<param>populate_stories_from: {epics_output_file}</param>
</invoke-workflow>
<check if="success == true">
<output>✅ Status updated! Loaded {{total_stories}} stories from epics.</output>
<output>Next: {{next_workflow}} ({{next_agent}} agent)</output>
</check>
<check if="success == false">
<output>⚠️ Status update failed: {{error}}</output>
</check>
</step>
<step n="7" goal="Finalize and provide user guidance">
<action>Confirm all stories map to tech spec implementation tasks</action>
<action>Verify total story points align with tech spec time estimates</action>
<action>Verify stories are properly sequenced with dependencies noted</action>
<action>Confirm all stories have measurable acceptance criteria</action>
**Level 1 Planning Complete!**
**Epic:** {{epic_title}}
**Total Stories:** {{story_count}}
**Total Story Points:** {{total_points}}
**Estimated Timeline:** {{estimated_timeline}}
**Generated Artifacts:**
- `tech-spec.md` → Technical source of truth
- `epics.md` → Epic and story summary
- `story-{epic_slug}-1.md` → First story (ready for implementation)
- `story-{epic_slug}-2.md` → Second story
{{#if story_3}}
- `story-{epic_slug}-3.md` → Third story
{{/if}}
**Story Location:** `{dev_story_location}/`
**Next Steps - Iterative Implementation:**
**1. Start with Story 1:**
a. Load SM agent: `{project-root}/bmad/bmm/agents/sm.md`
b. Run story-context workflow (select story-{epic_slug}-1.md)
c. Load DEV agent: `{project-root}/bmad/bmm/agents/dev.md`
d. Run dev-story workflow to implement story 1
**2. After Story 1 Complete:**
- Repeat process for story-{epic_slug}-2.md
- Story context will auto-reference completed story 1
**3. After Story 2 Complete:**
{{#if story_3}}
- Repeat process for story-{epic_slug}-3.md
{{/if}}
- Level 1 feature complete!
**Progress Tracking:**
- All decisions logged in: `bmm-workflow-status.md`
- Next action clearly identified
<ask>Ready to proceed? Choose your path:
1. Generate context for story 1 (recommended - run story-context)
2. Go directly to dev-story for story 1 (faster)
3. Exit for now
Select option (1-3):</ask>
</step>
</workflow>

View File

@@ -0,0 +1,253 @@
# PRD Workflow - Small Projects (Level 0-1)
<workflow>
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<critical>This is the SMALL instruction set for Level 0-1 projects - tech-spec with story generation</critical>
<critical>Level 0: tech-spec + single user story | Level 1: tech-spec + epic/stories</critical>
<critical>Project analysis already completed - proceeding directly to technical specification</critical>
<critical>NO PRD generated - uses tech_spec_template + story templates</critical>
<critical>DOCUMENT OUTPUT: Technical, precise, definitive. Specific versions only. User skill level ({user_skill_level}) affects conversation style ONLY, not document content.</critical>
<step n="0" goal="Validate workflow readiness" tag="workflow-status">
<action>Check if {output_folder}/bmm-workflow-status.yaml exists</action>
<check if="status file not found">
<output>No workflow status file found. Tech-spec workflow can run standalone or as part of BMM workflow path.</output>
<output>**Recommended:** Run `workflow-init` first for project context tracking and workflow sequencing.</output>
<ask>Continue in standalone mode or exit to run workflow-init? (continue/exit)</ask>
<check if="continue">
<action>Set standalone_mode = true</action>
</check>
<check if="exit">
<action>Exit workflow</action>
</check>
</check>
<check if="status file found">
<action>Load the FULL file: {output_folder}/bmm-workflow-status.yaml</action>
<action>Parse workflow_status section</action>
<action>Check status of "tech-spec" workflow</action>
<action>Get project_level from YAML metadata</action>
<action>Find first non-completed workflow (next expected workflow)</action>
<check if="project_level >= 2">
<output>**Incorrect Workflow for Level {{project_level}}**
Tech-spec is for Level 0-1 projects. Level 2-4 should use PRD workflow.
**Correct workflow:** `prd` (PM agent)
</output>
<action>Exit and redirect to prd</action>
</check>
<check if="tech-spec status is file path (already completed)">
<output>⚠️ Tech-spec already completed: {{tech-spec status}}</output>
<ask>Re-running will overwrite the existing tech-spec. Continue? (y/n)</ask>
<check if="n">
<output>Exiting. Use workflow-status to see your next step.</output>
<action>Exit workflow</action>
</check>
</check>
<check if="tech-spec is not the next expected workflow">
<output>⚠️ Next expected workflow: {{next_workflow}}. Tech-spec is out of sequence.</output>
<ask>Continue with tech-spec anyway? (y/n)</ask>
<check if="n">
<output>Exiting. Run {{next_workflow}} instead.</output>
<action>Exit workflow</action>
</check>
</check>
<action>Set standalone_mode = false</action>
</check>
</step>
<step n="1" goal="Confirm project scope and update tracking">
<action>Use {{project_level}} from status data</action>
<action>Update Workflow Status:</action>
<template-output file="{{status_file_path}}">current_workflow</template-output>
<check if="project_level == 0">
<action>Set to: "tech-spec (Level 0 - generating tech spec)"</action>
</check>
<check if="project_level == 1">
<action>Set to: "tech-spec (Level 1 - generating tech spec)"</action>
</check>
<template-output file="{{status_file_path}}">progress_percentage</template-output>
<action>Set to: 20%</action>
<action>Save {{status_file_path}}</action>
<check if="project_level == 0">
<action>Confirm Level 0 - Single atomic change</action>
<ask>Please describe the specific change/fix you need to implement:</ask>
</check>
<check if="project_level == 1">
<action>Confirm Level 1 - Coherent feature</action>
<ask>Please describe the feature you need to implement:</ask>
</check>
</step>
<step n="2" goal="Generate DEFINITIVE tech spec">
<critical>Generate tech-spec.md - this is the TECHNICAL SOURCE OF TRUTH</critical>
<critical>ALL TECHNICAL DECISIONS MUST BE DEFINITIVE - NO AMBIGUITY ALLOWED</critical>
<action>Update progress:</action>
<template-output file="{{status_file_path}}">progress_percentage</template-output>
<action>Set to: 40%</action>
<action>Save {{status_file_path}}</action>
<action>Initialize and write out tech-spec.md using tech_spec_template</action>
<critical>DEFINITIVE DECISIONS REQUIRED:</critical>
**BAD Examples (NEVER DO THIS):**
- "Python 2 or 3" ❌
- "Use a logger like pino or winston" ❌
**GOOD Examples (ALWAYS DO THIS):**
- "Python 3.11" ✅
- "winston v3.8.2 for logging" ✅
**Source Tree Structure**: EXACT file changes needed
<template-output file="tech-spec.md">source_tree</template-output>
**Technical Approach**: SPECIFIC implementation for the change
<template-output file="tech-spec.md">technical_approach</template-output>
**Implementation Stack**: DEFINITIVE tools and versions
<template-output file="tech-spec.md">implementation_stack</template-output>
**Technical Details**: PRECISE change details
<template-output file="tech-spec.md">technical_details</template-output>
**Testing Approach**: How to verify the change
<template-output file="tech-spec.md">testing_approach</template-output>
**Deployment Strategy**: How to deploy the change
<template-output file="tech-spec.md">deployment_strategy</template-output>
<invoke-task halt="true">{project-root}/bmad/core/tasks/adv-elicit.xml</invoke-task>
</step>
<step n="3" goal="Validate cohesion" optional="true">
<action>Offer to run cohesion validation</action>
<ask>Tech-spec complete! Before proceeding to implementation, would you like to validate project cohesion?
**Cohesion Validation** checks:
- Tech spec completeness and definitiveness
- Feature sequencing and dependencies
- External dependencies properly planned
- User/agent responsibilities clear
- Greenfield/brownfield-specific considerations
Run cohesion validation? (y/n)</ask>
<check if="yes">
<action>Load {installed_path}/checklist.md</action>
<action>Review tech-spec.md against "Cohesion Validation (All Levels)" section</action>
<action>Focus on Section A (Tech Spec), Section D (Feature Sequencing)</action>
<action>Apply Section B (Greenfield) or Section C (Brownfield) based on field_type</action>
<action>Generate validation report with findings</action>
</check>
</step>
<step n="4" goal="Generate user stories based on project level">
<action>Use {{project_level}} from status data</action>
<check if="project_level == 0">
<action>Invoke instructions-level0-story.md to generate single user story</action>
<action>Story will be saved to user-story.md</action>
<action>Story links to tech-spec.md for technical implementation details</action>
</check>
<check if="project_level == 1">
<action>Invoke instructions-level1-stories.md to generate epic and stories</action>
<action>Epic and stories will be saved to epics.md
<action>Stories link to tech-spec.md implementation tasks</action>
</check>
</step>
<step n="5" goal="Finalize and determine next steps">
<action>Confirm tech-spec is complete and definitive</action>
<check if="project_level == 0">
<action>Confirm user-story.md generated successfully</action>
</check>
<check if="project_level == 1">
<action>Confirm epics.md generated successfully</action>
</check>
## Summary
<check if="project_level == 0">
- **Level 0 Output**: tech-spec.md + user-story.md
- **No PRD required**
- **Direct to implementation with story tracking**
</check>
<check if="project_level == 1">
- **Level 1 Output**: tech-spec.md + epics.md
- **No PRD required**
- **Ready for sprint planning with epic/story breakdown**
</check>
## Next Steps
<check if="standalone_mode != true">
<action>Load the FULL file: {output_folder}/bmm-workflow-status.yaml</action>
<action>Find workflow_status key "tech-spec"</action>
<critical>ONLY write the file path as the status value - no other text, notes, or metadata</critical>
<action>Update workflow_status["tech-spec"] = "{output_folder}/bmm-tech-spec-{{date}}.md"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<action>Find first non-completed workflow in workflow_status (next workflow to do)</action>
<action>Determine next agent from path file based on next workflow</action>
</check>
<output>**✅ Tech-Spec Complete, {user_name}!**
**Deliverables Created:**
<check if="project_level == 0">
- ✅ tech-spec.md - Technical specification
- ✅ user-story.md - Single user story
</check>
<check if="project_level == 1">
- ✅ tech-spec.md - Technical specification
- ✅ epics.md - Epic and story breakdown
</check>
**Next Steps:**
- **Next required:** {{next_workflow}} ({{next_agent}} agent)
- **Optional:** Create test plan or document UI changes if applicable
Check status anytime with: `workflow-status`
</output>
</step>
</workflow>

View File

@@ -0,0 +1,55 @@
# {{project_name}} - Technical Specification
**Author:** {{user_name}}
**Date:** {{date}}
**Project Level:** {{project_level}}
**Project Type:** {{project_type}}
**Development Context:** {{development_context}}
---
## Source Tree Structure
{{source_tree}}
---
## Technical Approach
{{technical_approach}}
---
## Implementation Stack
{{implementation_stack}}
---
## Technical Details
{{technical_details}}
---
## Development Setup
{{development_setup}}
---
## Implementation Guide
{{implementation_guide}}
---
## Testing Approach
{{testing_approach}}
---
## Deployment Strategy
{{deployment_strategy}}

View File

@@ -0,0 +1,56 @@
# Story: {{story_title}}
Status: Draft
## Story
As a {{role}},
I want {{capability}},
so that {{benefit}}.
## Acceptance Criteria
{{acceptance_criteria}}
## Tasks / Subtasks
{{tasks_subtasks}}
## Dev Notes
### Technical Summary
{{technical_summary}}
### Project Structure Notes
- Files to modify: {{files_to_modify}}
- Expected test locations: {{test_locations}}
- Estimated effort: {{story_points}} story points ({{time_estimate}})
### References
- **Tech Spec:** See tech-spec.md for detailed implementation
- **Architecture:** {{architecture_references}}
## Dev Agent Record
### Context Reference
<!-- Path(s) to story context XML will be added here by context workflow -->
### Agent Model Used
<!-- Will be populated during dev-story execution -->
### Debug Log References
<!-- Will be populated during dev-story execution -->
### Completion Notes List
<!-- Will be populated during dev-story execution -->
### File List
<!-- Will be populated during dev-story execution -->

View File

@@ -0,0 +1,39 @@
# Technical Specification Workflow (Level 0)
name: tech-spec-sm
description: "Technical specification workflow for Level 0 projects (single atomic changes). Creates focused tech spec for bug fixes, single endpoint additions, or small isolated changes. Tech-spec only - no PRD needed."
author: "BMad"
# Critical variables from config
config_source: "{project-root}/bmad/bmm/config.yaml"
project_name: "{config_source}:project_name"
output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
# Workflow components
installed_path: "{project-root}/bmad/bmm/workflows/2-plan-workflows/tech-spec"
instructions: "{installed_path}/instructions.md"
template: "{installed_path}/tech-spec-template.md"
# Story generation instructions (invoked based on level)
instructions_level0_story: "{installed_path}/instructions-level0-story.md"
instructions_level1_stories: "{installed_path}/instructions-level1-stories.md"
# Templates
user_story_template: "{installed_path}/user-story-template.md"
epics_template: "{installed_path}/epics-template.md"
# Output configuration
default_output_file: "{output_folder}/tech-spec.md"
user_story_file: "{output_folder}/user-story.md"
epics_file: "{output_folder}/epics.md"
# Recommended input documents (optional for Level 0)
recommended_inputs:
- bug_report: "Bug description or issue ticket"
- feature_request: "Brief feature description"
standalone: true