# Research Workflow - Multi-Type Research System
name: research
description: "Adaptive research workflow supporting multiple research types: market research, deep research prompt generation, technical/architecture evaluation, competitive intelligence, user research, and domain analysis"
author: "BMad"

# Critical variables from config
config_source: "{project-root}/bmad/bmm/config.yaml"
output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
date: system-generated

# Workflow components - ROUTER PATTERN
installed_path: "{project-root}/bmad/bmm/workflows/1-analysis/research"
instructions: "{installed_path}/instructions-router.md" # Router loads specific instruction sets
validation: "{installed_path}/checklist.md"

# Research type specific instructions (loaded by router)
instructions_market: "{installed_path}/instructions-market.md"
instructions_deep_prompt: "{installed_path}/instructions-deep-prompt.md"
instructions_technical: "{installed_path}/instructions-technical.md"

# Templates (loaded based on research type)
template_market: "{installed_path}/template-market.md"
template_deep_prompt: "{installed_path}/template-deep-prompt.md"
template_technical: "{installed_path}/template-technical.md"

# Output configuration (dynamic based on research type)
default_output_file: "{output_folder}/research-{{research_type}}-{{date}}.md"
market_output: "{output_folder}/market-research-{{product_name_slug}}-{{date}}.md"
deep_prompt_output: "{output_folder}/deep-research-prompt-{{date}}.md"
technical_output: "{output_folder}/technical-research-{{date}}.md"

# Research types supported
research_types:
  market:
    name: "Market Research"
    description: "Comprehensive market analysis with TAM/SAM/SOM"
    instructions: "{instructions_market}"
    template: "{template_market}"
    output: "{market_output}"
  deep_prompt:
    name: "Deep Research Prompt Generator"
    description: "Generate optimized prompts for AI research platforms"
    instructions: "{instructions_deep_prompt}"
    template: "{template_deep_prompt}"
    output: "{deep_prompt_output}"
  technical:
    name: "Technical/Architecture Research"
    description: "Technology evaluation and architecture pattern research"
    instructions: "{instructions_technical}"
    template: "{template_technical}"
    output: "{technical_output}"
  competitive:
    name: "Competitive Intelligence"
    description: "Deep competitor analysis"
    instructions: "{instructions_market}" # Uses market with competitive focus
    template: "{template_market}"
    output: "{output_folder}/competitive-intelligence-{{date}}.md"
  user:
    name: "User Research"
    description: "Customer insights and persona development"
    instructions: "{instructions_market}" # Uses market with user focus
    template: "{template_market}"
    output: "{output_folder}/user-research-{{date}}.md"
  domain:
    name: "Domain/Industry Research"
    description: "Industry and domain deep dives"
    instructions: "{instructions_market}" # Uses market with domain focus
    template: "{template_market}"
    output: "{output_folder}/domain-research-{{date}}.md"

# Research parameters (can be overridden at runtime)
research_depth: "comprehensive" # Options: quick, standard, comprehensive
enable_web_research: true
enable_competitor_analysis: true
enable_financial_modeling: true

# Data sources and tools
required_tools:
  - web_search: "For real-time data gathering across all research types"
  - calculator: "For calculations (TAM/SAM/SOM, TCO, etc.)"
  - data_analysis: "For trends, patterns, and comparative analysis"

# Recommended input documents (varies by research type)
recommended_inputs:
  market:
    - product_brief: "Product or business description"
    - target_customers: "Customer segment hypotheses"
    - competitor_list: "Known competitors (optional)"
  technical:
    - requirements_doc: "Technical requirements"
    - architecture_doc: "Current architecture (if brownfield)"
    - constraints_list: "Technical constraints"
  deep_prompt:
    - research_question: "Initial research question or topic"
    - context_docs: "Background documents for context"

# Claude Code integration points
claude_code_enhancements:
  - injection_point: "research-subagents"
  - available_subagents:
      - market-researcher: "Deep market intelligence gathering"
      - trend-spotter: "Emerging trends and weak signals"
      - data-analyst: "Quantitative analysis"
      - competitor-analyzer: "Competitive intelligence"
      - user-researcher: "Customer insights"
      - technical-evaluator: "Technology assessment"

# Workflow configuration
interactive: true # User checkpoints throughout
autonomous: false # Requires user input
allow_parallel: true # Can run research tasks in parallel

# Research frameworks available (context dependent)
frameworks:
  market:
    - "TAM/SAM/SOM Analysis"
    - "Porter's Five Forces"
    - "Jobs-to-be-Done"
    - "Technology Adoption Lifecycle"
    - "SWOT Analysis"
    - "Value Chain Analysis"
  technical:
    - "Trade-off Analysis"
    - "Architecture Decision Records (ADR)"
    - "Technology Radar"
    - "Comparison Matrix"
    - "Cost-Benefit Analysis"
  deep_prompt:
    - "ChatGPT Deep Research Best Practices"
    - "Gemini Deep Research Framework"
    - "Grok DeepSearch Optimization"
    - "Claude Projects Methodology"
    - "Iterative Prompt Refinement"

# Data sources (for web research)
data_sources:
  - "Industry reports and publications"
  - "Government statistics and databases"
  - "Financial reports and SEC filings"
  - "News articles and press releases"
  - "Academic research papers"
  - "Technical documentation and RFCs"
  - "GitHub repositories and discussions"
  - "Stack Overflow and developer forums"
  - "Market research firm reports"
  - "Social media and communities"
  - "Patent databases"
  - "Benchmarking studies"
