# tech-spec Workflow Rule

This rule defines the tech-spec workflow.

## Workflow Description

Technical specification workflow for quick-flow projects. Creates focused tech spec and generates epic + stories (1 story for simple changes, 2-5 stories for features). Tech-spec only - no PRD needed.

## Workflow Definition

# Technical Specification
name: tech-spec
description: "Technical specification workflow for quick-flow projects. Creates focused tech spec and generates epic + stories (1 story for simple changes, 2-5 stories for features). 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-status: "{output_folder}/bmm-workflow-status.yaml"

# Runtime variables (captured during workflow execution)
story_count: runtime-captured
epic_slug: runtime-captured
change_type: runtime-captured
field_type: runtime-captured

# 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 (unified approach - always generates epic + stories)
instructions_generate_stories: "{installed_path}/instructions-generate-stories.md"
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"
epics_file: "{output_folder}/epics.md"
sprint_artifacts: "{output_folder}/sprint_artifacts"

# Smart input file references - handles both whole docs and sharded docs
# Priority: Whole document first, then sharded version
# Strategy: How to load sharded documents (FULL_LOAD, SELECTIVE_LOAD, INDEX_GUIDED)
input_file_patterns:
  product_brief:
    description: "Product vision and goals (optional)"
    whole: "{output_folder}/*brief*.md"
    sharded: "{output_folder}/*brief*/index.md"
    load_strategy: "FULL_LOAD"
  research:
    description: "Market or domain research (optional)"
    whole: "{output_folder}/*research*.md"
    sharded: "{output_folder}/*research*/index.md"
    load_strategy: "FULL_LOAD"
  document_project:
    description: "Brownfield project documentation (optional)"
    sharded: "{output_folder}/index.md"
    load_strategy: "INDEX_GUIDED"

standalone: true


## Usage

Reference this workflow with `@workflow-tech-spec` to execute the guided workflow.

## Module

Part of the BMAD BMM module.
