src/bmm-skills/4-implementation/bmad-create-story/discover-inputs.md
Objective: Intelligently load project files (whole or sharded) based on the workflow's Input Files configuration.
Prerequisite: Only execute this protocol if the workflow defines an Input Files section. If no input file patterns are configured, skip this entirely.
For each pattern in the Input Files table, work through the following substeps in order:
If a sharded pattern exists for this input, determine the load strategy (defaults to FULL_LOAD if not specified), then apply the matching strategy:
Load ALL files in the sharded directory. Use this for PRD, Architecture, UX, brownfield docs, or whenever the full picture is needed.
.md files (e.g., {planning_artifacts}/*architecture*/*.md).index.md first if it exists, then alphabetical.{pattern_name_content} (e.g., {architecture_content}).Load a specific shard using a template variable. Example: used for epics with {{epic_num}}.
{{epic_num}}).{pattern_name_content}.Load index.md, analyze the structure and description of each doc in the index, then intelligently load relevant docs.
DO NOT BE LAZY -- use best judgment to load documents that might have relevant information, even if there is only a 5% chance of relevance.
index.md from the sharded directory.{pattern_name_content}.When in doubt, LOAD IT -- context is valuable, and being thorough is better than missing critical info.
After applying the matching strategy, mark the pattern as RESOLVED and move to the next pattern.
If no sharded matches were found OR no sharded pattern exists for this input:
{planning_artifacts}/*prd*.md).{pattern_name_content} (e.g., {prd_content}).If no matches were found for either sharded or whole patterns:
{pattern_name_content} to empty string.List all loaded content variables with file counts. Example:
OK Loaded {prd_content} from 5 sharded files: prd/index.md, prd/requirements.md, ...
OK Loaded {architecture_content} from 1 file: Architecture.md
OK Loaded {epics_content} from selective load: epics/epic-3.md
-- No ux_design files found
This gives the workflow transparency into what context is available.