BMAD-METHOD/.claude/workflows/greenfield-fullstack.yaml

291 lines
10 KiB
YAML

# Greenfield Fullstack Workflow - Claude Native Format
workflow:
name: greenfield-fullstack
description: "Create a new full-stack application from scratch"
type: greenfield
category: fullstack
metadata:
version: "1.0.0"
author: "BMAD System"
last_updated: "2024-01-01"
requirements:
- User specification document
- Technical preferences (optional)
- UI/UX requirements (optional)
sequence:
- step: 1
name: "Project Analysis"
agent: analyst
task: analyze_specification
template: project_brief
inputs:
- "user_spec.md"
creates: ".claude/context/artifacts/project-brief.json"
validators:
- schema: ".claude/schemas/project_brief.schema.json"
- checklist: ".claude/checklists/story-draft-checklist.md"
on_fail:
retry: 1
escalate_to: "pm"
render:
renderer: "project-brief"
from: ".claude/context/artifacts/project-brief.json"
to: ".claude/context/artifacts/project-brief.md"
description: "Analyze user requirements and create project brief"
instructions: |
Load the analyst agent prompt from .claude/agents/analyst/prompt.md
Apply the project brief template from .claude/templates/project-brief.md
Generate comprehensive project analysis including market context and technical feasibility
Focus on full-stack requirements including frontend, backend, and integration needs
Save output to .claude/context/artifacts/project-brief.md
- step: 2
name: "Requirements Documentation"
agent: pm
task: create_prd
template: prd
inputs:
- ".claude/context/artifacts/project-brief.json"
creates: ".claude/context/artifacts/prd.json"
validators:
- schema: ".claude/schemas/product_requirements.schema.json"
- checklist: ".claude/checklists/story-draft-checklist.md"
on_fail:
retry: 1
escalate_to: "analyst"
render:
renderer: "prd"
from: ".claude/context/artifacts/prd.json"
to: ".claude/context/artifacts/prd.md"
depends_on: [1]
description: "Create Product Requirements Document"
instructions: |
Load the PM agent prompt from .claude/agents/pm/prompt.md
Reference the project brief from step 1
Apply the PRD template from .claude/templates/prd.md
Generate detailed requirements document covering frontend, backend, and integration requirements
Include user stories, API specifications, data models, and user flows
Save output to .claude/context/artifacts/prd.md
- step: 3
name: "UI/UX Design"
agent: ux-expert
task: design_interface
template: ui_spec
inputs:
- ".claude/context/artifacts/prd.json"
creates: ".claude/context/artifacts/ux-spec.json"
validators:
- schema: ".claude/schemas/ux_spec.schema.json"
on_fail:
retry: 1
escalate_to: "architect"
render:
renderer: "ux-spec"
from: ".claude/context/artifacts/ux-spec.json"
to: ".claude/context/artifacts/ui-spec.md"
depends_on: [2]
description: "Design user interface and experience"
instructions: |
Load the UX Expert agent prompt from .claude/agents/ux-expert/prompt.md
Reference PRD from step 2
Apply the UI spec template from .claude/templates/ui-spec.md
Generate comprehensive UI/UX specifications including wireframes and user flows
Design responsive interfaces and interaction patterns
Save output to .claude/context/artifacts/ui-spec.md
- step: 4
name: "AI UI Generation Prompt"
agent: ux-expert
task: generate_ai_prompt
inputs:
- ".claude/context/artifacts/ui-spec.md"
creates: ".claude/context/artifacts/v0-prompt.md"
depends_on: [3]
optional: true
description: "Generate AI prompt for UI generation tools"
instructions: |
Load the UX Expert agent prompt from .claude/agents/ux-expert/prompt.md
Reference the front-end spec from step 3
Generate optimized prompts for AI UI tools like v0, Lovable, or similar
Include specific component requirements, styling preferences, and interactions
Save output to .claude/context/artifacts/v0-prompt.md
- step: 5
name: "Full-Stack Architecture"
agent: architect
task: design_architecture
template: fullstack_architecture
inputs:
- ".claude/context/artifacts/prd.json"
- ".claude/context/artifacts/ux-spec.json"
creates: ".claude/context/artifacts/system-architecture.json"
validators:
- schema: ".claude/schemas/system_architecture.schema.json"
on_fail:
retry: 1
escalate_to: "pm"
render:
renderer: "architecture"
from: ".claude/context/artifacts/system-architecture.json"
to: ".claude/context/artifacts/fullstack-architecture.md"
depends_on: [2, 3]
description: "Design comprehensive full-stack architecture"
instructions: |
Load the Architect agent prompt from .claude/agents/architect/prompt.md
Reference PRD and UI specifications from previous steps
Apply the fullstack architecture template from .claude/templates/fullstack-architecture.md
Design both frontend and backend architecture including database schema
Include deployment strategy, API design, state management, and security considerations
Consider integration points between frontend and backend
Save output to .claude/context/artifacts/fullstack-architecture.md
- step: 6
name: "Frontend Implementation"
agent: developer
task: implement_frontend
creates: "src/frontend/"
inputs:
- ".claude/context/artifacts/ui-spec.md"
- ".claude/context/artifacts/fullstack-architecture.md"
depends_on: [3, 5]
description: "Implement frontend components and pages"
instructions: |
Load the Developer agent prompt from .claude/agents/developer/prompt.md
Reference UI spec and architecture documents
Generate React/Vue/Angular components, pages, and routing
Include state management, API integration, and styling
Implement responsive design and accessibility features
Save outputs to src/frontend/components/, src/frontend/pages/, src/frontend/styles/
- step: 7
name: "Backend Implementation"
agent: developer
task: implement_backend
creates: "src/backend/"
inputs:
- ".claude/context/artifacts/fullstack-architecture.md"
depends_on: [5]
description: "Implement backend API and services"
instructions: |
Load the Developer agent prompt from .claude/agents/developer/prompt.md
Reference architecture document and PRD
Generate API endpoints, database models, and business logic
Include authentication, validation, and error handling
Implement data access layers and external service integrations
Save outputs to src/backend/api/, src/backend/models/, src/backend/services/
- step: 8
name: "Integration & Testing"
agent: qa
task: create_test_plan
template: test_plan
inputs:
- ".claude/context/artifacts/ui-spec.md"
- ".claude/context/artifacts/fullstack-architecture.md"
creates: ".claude/context/artifacts/test-plan.json"
validators:
- schema: ".claude/schemas/test_plan.schema.json"
on_fail:
retry: 1
escalate_to: "architect"
render:
renderer: "test-plan"
from: ".claude/context/artifacts/test-plan.json"
to: ".claude/context/artifacts/test-plan.md"
depends_on: [6, 7]
description: "Create comprehensive testing strategy"
instructions: |
Load the QA agent prompt from .claude/agents/qa/prompt.md
Reference all implementation artifacts from previous steps
Apply the test plan template from .claude/templates/test-plan.md
Generate testing strategy including unit, integration, and e2e tests
Include frontend testing, API testing, and full user journey tests
Create test scenarios for all user flows and edge cases
Save output to .claude/context/artifacts/test-plan.md
- step: 9
name: "Implementation Review"
agent: architect
task: review_implementation
inputs:
- "src/frontend/"
- "src/backend/"
- ".claude/context/artifacts/test-plan.md"
creates: ".claude/context/artifacts/review-notes.json"
validators:
- schema: ".claude/schemas/review_notes.schema.json"
render:
renderer: "review-notes"
from: ".claude/context/artifacts/review-notes.json"
to: ".claude/context/artifacts/review-notes.md"
depends_on: [6, 7, 8]
description: "Review and validate full-stack implementation"
instructions: |
Load the Architect agent prompt again from .claude/agents/architect/prompt.md
Review all generated artifacts and implementation
Validate consistency between architecture and implementation
Check integration points between frontend and backend
Verify security measures, performance considerations, and best practices
Provide improvement recommendations and deployment guidance
Save output to .claude/context/artifacts/review-notes.md
outputs:
documents:
- project-brief.json
- project-brief.md
- prd.json
- prd.md
- ux-spec.json
- ui-spec.md
- system-architecture.json
- fullstack-architecture.md
- test-plan.json
- test-plan.md
- review-notes.md
- v0-prompt.md (optional)
frontend_code:
- src/frontend/components/
- src/frontend/pages/
- src/frontend/styles/
- src/frontend/hooks/
- src/frontend/utils/
- src/frontend/types/
backend_code:
- src/backend/api/
- src/backend/models/
- src/backend/services/
- src/backend/middleware/
- src/backend/utils/
- src/backend/config/
configuration:
- package.json
- docker-compose.yml
- Dockerfile.frontend
- Dockerfile.backend
- .env.example
- .gitignore
testing:
- tests/frontend/
- tests/backend/
- tests/integration/
- tests/e2e/
project_types:
- web-app
- saas
- enterprise-app
- prototype
- mvp
when_to_use:
- Building production-ready applications
- Multiple team members will be involved
- Complex feature requirements
- Need comprehensive documentation
- Long-term maintenance expected
- Enterprise or customer-facing applications