ReDoc Workflow Instructions

The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml You MUST have already loaded and processed: {project_root}/src/modules/bmb/workflows/redoc/workflow.yaml This is an AUTONOMOUS workflow - minimize user interaction unless clarification is absolutely required IMPORTANT: Process ONE document at a time to avoid token limits. Each README should be created individually, not batched. When using Task tool with sub-agents: Only request ONE workflow or agent documentation per invocation to prevent token overflow.

Load ALL BMAD convention documents from {bmad_conventions}: - agent_architecture.md - Understand agent XML structure and patterns - agent_command_patterns.md - Command syntax and activation patterns - agent_types.md - Standard agent categories and purposes - module_structure.md - Module organization and folder conventions - workflow_guide.md - Workflow structure and best practices

Internalize these conventions so you can:

Get target path from user:

Validate target path exists and determine target type:

Store target type as {{target_type}} for conditional processing

Build complete tree structure of {{target_path}} using Glob and file system tools

Identify all documentation points:

Create documentation map with execution order (deepest → shallowest):

Detect “massive folders” requiring child catalog documents:

Store execution order as {{doc_execution_plan}} - this ensures reverse-tree processing

TOKEN LIMIT WARNING: Process ONE item at a time to prevent token overflow issues. If using Task tool with sub-agents: NEVER batch multiple workflows/agents in a single invocation. Each README creation should be a separate operation with its own file save. Sequential processing is MANDATORY - do not attempt parallel documentation generation. For each individual workflow folder in execution plan (PROCESS ONE AT A TIME): 1. Read ALL files completely: - workflow.yaml (metadata, purpose, configuration) - instructions.md (step structure, goals) - template.md (output structure) if exists - checklist.md (validation criteria) if exists - Any supporting data files

  1. Synthesize understanding:

  2. Generate/update README.md:

  3. Save README.md to workflow folder

If multiple workflows need documentation, process them SEQUENTIALLY not in parallel. Each workflow gets its own complete processing cycle.

For each individual agent file in execution plan (PROCESS ONE AT A TIME):

  1. Read agent definition file completely:

  2. Synthesize understanding:

  3. Generate/update README.md (or agent-name-README.md if in shared folder):

  4. Save README.md

If clarification needed about purpose or unique features → Ask user briefly, then continue

For /workflows folder: 1. Read ALL workflow README.md files created in Step 3 2. Categorize workflows by purpose/type if folder is massive (>10 workflows): - Document generation workflows - Action workflows - Meta-workflows - Interactive workflows

  1. If massive folder detected:

  2. Generate/update /workflows/README.md:

  3. Save README.md

For /agents folder:

  1. Read ALL agent README.md files
  2. Categorize agents by type if massive folder (>10 agents):

  3. If massive folder detected:

  4. Generate/update /agents/README.md:

  5. Save README.md

For module root README.md: 1. Read module config.yaml for metadata and configuration 2. Read /workflows/README.md and /agents/README.md created in Step 4 3. Identify module’s unique purpose within BMAD ecosystem

  1. Generate/update module README.md:

    Structure:

    Focus on UNIQUE aspects using BMAD convention knowledge:

  2. Save README.md to module root

Verify all planned documentation was created/updated: - Check each item in {{doc_execution_plan}} - Confirm frontmatter dates are current - Validate file paths and links

Generate summary report showing:

Display summary to user

Would you like to see what changed since the last redoc run? [y/n]

For each README with last-redoc-date frontmatter: 1. Extract last-redoc-date timestamp 2. Use git log to find files modified since that date in the documented folder 3. Highlight files that changed but may need documentation updates 4. Report findings to user

Confirm autonomous workflow execution complete Provide path to all updated documentation Suggest next steps if needed (e.g., “Run redoc on parent module to update references”)