feat(workflows): Implement intelligent file discovery protocol and Phase 4 BMGD workflows

## Core Workflow Engine Enhancements

### discover_inputs Protocol (MAJOR)
- Added reusable `discover_inputs` protocol to workflow.xml for intelligent file loading
- Supports three loading strategies:
  - FULL_LOAD: Load all shards for PRD, Architecture, UX (changed pattern from /index.md to /*/*.md)
  - SELECTIVE_LOAD: Load specific shard via template variable (e.g., epic-{{epic_num}}.md)
  - INDEX_GUIDED: Load index, analyze TOC, intelligently load relevant docs (with "DO NOT BE LAZY" mandate)
- Auto-discovers whole vs sharded documents with proper fallback
- Provides transparent reporting of loaded content with file counts
- Invoked via <invoke-protocol name="discover_inputs" /> tag in workflow instructions

### Advanced Elicitation Improvements
- Renamed adv-elicit.xml to advanced-elicitation.xml for clarity
- Updated all references across agents and commands

### Shard Document Tool Enhancement
- Added Step 6: Handle Original Document with three options:
  - [d] Delete - Remove original (recommended, prevents confusion)
  - [m] Move to archive - Backup original to archive folder
  - [k] Keep - Warning about defeating sharding purpose
- Prevents issue where both whole and sharded versions exist, confusing discover_inputs protocol

## BMM Module - Input File Pattern Standardization

### Phase 1 - Analysis (1 workflow)
- product-brief: Added load_strategy (FULL_LOAD for research/brainstorming, INDEX_GUIDED for document_project)
- Updated instructions.md to use invoke-protocol, replaced manual fuzzy matching

### Phase 2 - Planning (4 workflows)
- prd: Added load_strategy, updated instructions to reference {product_brief_content}, {research_content}
- create-ux-design: Added load_strategy, removed fuzzy matching from instructions
- tech-spec: Added load_strategy for brownfield context discovery
- All epics patterns updated to support SELECTIVE_LOAD for specific epic shards

### Phase 3 - Solutioning (2 workflows)
- architecture: Added load_strategy, updated instructions to use pre-loaded {prd_content}, {epics_content}, {ux_design_content}
- solutioning-gate-check: Added load_strategy, replaced manual discovery with protocol invocation

### Phase 4 - Implementation (8 workflows)
- code-review: Added load_strategy, fixed sharded patterns to /*/*.md, added step 1.5 for protocol
- correct-course: Added complete input_file_patterns section (was missing), added step 0.5
- create-story: Added load_strategy, updated to SELECTIVE_LOAD for epics, added step 1.5
- dev-story: Added complete input_file_patterns section (was missing), added step 0.5
- epic-tech-context: Added load_strategy, updated PRD extraction to use {prd_content}, added step 1.5
- retrospective: Added load_strategy for architecture/prd (FULL_LOAD), epics (SELECTIVE_LOAD), added step 0.5
- sprint-planning: Fixed sharded pattern to load ALL epics (/*/*.md), added step 0.5
- story-context: Added load_strategy, updated doc collection to reference pre-loaded content, added step 1.5

### Sprint Artifacts Path Corrections
- story-done: Added missing sprint_artifacts variable, fixed sprint_status path from {context_dir} to {sprint_artifacts}
- story-ready: Added missing sprint_artifacts variable
- story-context: Fixed undefined {context_dir} -> {sprint_artifacts}
- correct-course: Added sprint_artifacts and sprint_status variables

## BMGD Module - Phase 4 Production Workflows (NEW)

Added complete Phase 4 implementation workflows for game development:
- code-review: Senior developer review for completed game features
- correct-course: Sprint change management for game projects
- create-story: Story generation for game mechanics/features
- dev-story: Feature implementation workflow
- epic-tech-context: Technical spec generation per game epic
- retrospective: Epic completion review and lessons learned
- sprint-planning: Game development sprint status tracking
- story-context: Dynamic context assembly for game stories
- story-done: Story completion workflow
- story-ready: Story readiness workflow

All BMGD workflows follow BMM patterns with game-specific adaptations.

## Agent Updates

### BMM Agents
- Updated all 7 BMM agents (analyst, architect, dev, pm, sm, tea, tech-writer, ux-designer)
- Standardized web bundle configurations

### BMGD Agents
- Updated 4 game development agents (game-architect, game-designer, game-dev, game-scrum-master)
- Aligned with BMM agent structure

### CIS Agents
- Updated 5 creative intelligence agents for consistency

## Documentation & Configuration

- Updated CHANGELOG.md with Phase 4 workflow additions
- Updated files-manifest.csv and task-manifest.csv
- Updated .claude commands for all agents
- Fixed formatting issues from previous commits

## Breaking Changes

NONE - All changes are backward compatible. Workflows without input_file_patterns continue to work.
Workflows with input_file_patterns now benefit from intelligent auto-loading.

## Migration Notes

Existing workflows can gradually adopt discover_inputs protocol by:
1. Adding load_strategy to existing input_file_patterns in workflow.yaml
2. Adding <invoke-protocol name="discover_inputs" /> step in instructions.md
3. Replacing manual file loading with references to {pattern_name_content} variables
This commit is contained in:
Brian Madison
2025-11-12 19:18:38 -06:00
parent 8f7d259c81
commit 48cf5c8056
126 changed files with 5891 additions and 366 deletions

View File

@@ -68,7 +68,7 @@ You must fully embody this agent's persona and follow all activation instruction
<item cmd="*document-project" workflow="{project-root}/.bmad/bmm/workflows/document-project/workflow.yaml">Generate comprehensive documentation of an existing Project</item>
<item cmd="*research" workflow="{project-root}/.bmad/bmm/workflows/1-analysis/research/workflow.yaml">Guide me through Research</item>
<item cmd="*party-mode" workflow="{project-root}/.bmad/core/workflows/party-mode/workflow.yaml">Consult with other expert agents from the party</item>
<item cmd="*adv-elicit" exec="{project-root}/.bmad/core/tasks/adv-elicit.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*advanced-elicitation" exec="{project-root}/.bmad/core/tasks/advanced-elicitation.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>

View File

@@ -73,7 +73,7 @@ You must fully embody this agent's persona and follow all activation instruction
<item cmd="*validate-architecture" validate-workflow="{project-root}/.bmad/bmm/workflows/3-solutioning/architecture/workflow.yaml">Validate Architecture Document</item>
<item cmd="*solutioning-gate-check" workflow="{project-root}/.bmad/bmm/workflows/3-solutioning/solutioning-gate-check/workflow.yaml">Validate solutioning complete, ready for Phase 4 (Level 2-4 only)</item>
<item cmd="*party-mode" workflow="{project-root}/.bmad/core/workflows/party-mode/workflow.yaml">Consult with other expert agents from the party</item>
<item cmd="*adv-elicit" exec="{project-root}/.bmad/core/tasks/adv-elicit.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*advanced-elicitation" exec="{project-root}/.bmad/core/tasks/advanced-elicitation.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>

View File

@@ -77,7 +77,7 @@ You must fully embody this agent's persona and follow all activation instruction
<item cmd="*validate-tech-spec" validate-workflow="{project-root}/.bmad/bmm/workflows/2-plan-workflows/tech-spec/workflow.yaml">Validate Technical Specification Document</item>
<item cmd="*correct-course" workflow="{project-root}/.bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml">Course Correction Analysis</item>
<item cmd="*party-mode" workflow="{project-root}/.bmad/core/workflows/party-mode/workflow.yaml">Consult with other expert agents from the party</item>
<item cmd="*adv-elicit" exec="{project-root}/.bmad/core/tasks/adv-elicit.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*advanced-elicitation" exec="{project-root}/.bmad/core/tasks/advanced-elicitation.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>

View File

@@ -86,7 +86,7 @@ You must fully embody this agent's persona and follow all activation instruction
<item cmd="*epic-retrospective" workflow="{project-root}/.bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml" data="{project-root}/.bmad/_cfg/agent-manifest.csv">(Optional) Facilitate team retrospective after an epic is completed</item>
<item cmd="*correct-course" workflow="{project-root}/.bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml">(Optional) Execute correct-course task</item>
<item cmd="*party-mode" workflow="{project-root}/.bmad/core/workflows/party-mode/workflow.yaml">Consult with other expert agents from the party</item>
<item cmd="*adv-elicit" exec="{project-root}/.bmad/core/tasks/adv-elicit.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*advanced-elicitation" exec="{project-root}/.bmad/core/tasks/advanced-elicitation.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>

View File

@@ -73,7 +73,7 @@ You must fully embody this agent's persona and follow all activation instruction
<item cmd="*ci" workflow="{project-root}/.bmad/bmm/workflows/testarch/ci/workflow.yaml">Scaffold CI/CD quality pipeline</item>
<item cmd="*test-review" workflow="{project-root}/.bmad/bmm/workflows/testarch/test-review/workflow.yaml">Review test quality using comprehensive knowledge base and best practices</item>
<item cmd="*party-mode" workflow="{project-root}/.bmad/core/workflows/party-mode/workflow.yaml">Consult with other expert agents from the party</item>
<item cmd="*adv-elicit" exec="{project-root}/.bmad/core/tasks/adv-elicit.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*advanced-elicitation" exec="{project-root}/.bmad/core/tasks/advanced-elicitation.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>

View File

@@ -83,7 +83,7 @@ You must fully embody this agent's persona and follow all activation instruction
<item cmd="*explain-concept" action="Create a clear technical explanation with examples and diagrams for a complex concept. Break it down into digestible sections using task-oriented approach. Include code examples and Mermaid diagrams where helpful.">Create clear technical explanations with examples</item>
<item cmd="*standards-guide" action="Display the complete documentation standards from {project-root}/src/modules/bmm/workflows/techdoc/documentation-standards.md in a clear, formatted way for the user.">Show BMAD documentation standards reference (CommonMark, Mermaid, OpenAPI)</item>
<item cmd="*party-mode" workflow="{project-root}/.bmad/core/workflows/party-mode/workflow.yaml">Consult with other expert agents from the party</item>
<item cmd="*adv-elicit" exec="{project-root}/.bmad/core/tasks/adv-elicit.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*advanced-elicitation" exec="{project-root}/.bmad/core/tasks/advanced-elicitation.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>

View File

@@ -72,7 +72,7 @@ You must fully embody this agent's persona and follow all activation instruction
<item cmd="*create-design" workflow="{project-root}/.bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.yaml">Conduct Design Thinking Workshop to Define the User Specification</item>
<item cmd="*validate-design" validate-workflow="{project-root}/.bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.yaml">Validate UX Specification and Design Artifacts</item>
<item cmd="*party-mode" workflow="{project-root}/.bmad/core/workflows/party-mode/workflow.yaml">Consult with other expert agents from the party</item>
<item cmd="*adv-elicit" exec="{project-root}/.bmad/core/tasks/adv-elicit.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*advanced-elicitation" exec="{project-root}/.bmad/core/tasks/advanced-elicitation.xml">Advanced elicitation techniques to challenge the LLM to get better results</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>

View File

@@ -4,6 +4,6 @@ description: 'When called from workflow'
# Advanced Elicitation
LOAD and execute the task at: {project-root}/bmad/core/tasks/adv-elicit.xml
LOAD and execute the task at: {project-root}/bmad/core/tasks/advanced-elicitation.xml
Follow all instructions in the task file exactly as written.