Skip to content

feat: suggest shard-doc in document-creation workflow completion steps #1641

@sabo961

Description

@sabo961

Summary

Document-creation workflows (create-prd, create-architecture, create-epics-and-stories) should offer shard-doc as a post-completion step when the output document is large. Currently, the framework's consumption side fully supports sharded documents (via discover_inputs protocol with 3 loading strategies), but the creation side never suggests producing them.

The Gap

Side Sharding Support
Consumption (discover_inputs) Sophisticated — checks sharded folder FIRST, falls back to whole file. Three strategies: FULL_LOAD, SELECTIVE_LOAD, INDEX_GUIDED
Creation (workflow completion) None — no workflow suggests sharding after document creation

Workflows affected

Workflow Completion Step Suggests Sharding?
create-architecture step-08-complete No
create-prd step-12-complete No
create-epics-and-stories step-04-final-validation No

Proposed Behavior

After a document-creation workflow completes, add a conditional post-completion check:

  1. Measure the created document (line count + number of ## headings)
  2. If document exceeds threshold (~500 lines or 5+ level-2 sections):
    • Inform user: "Your document is X lines with Y sections."
    • Offer: [S] Shard now using shard-doc / [C] Continue without sharding
  3. If user selects S, invoke shard-doc task with the created document

Implementation options

  • Centralized (preferred): Add post-completion hook in workflow.xml so all document-creating workflows benefit automatically
  • Per-workflow: Add to each completion step individually (more duplication)

Context

Environment

  • BMAD Method version: 6.0.0 (installed via bmad-setup)
  • Discovered while analyzing sharding candidates in a real project with 2000+ line architecture doc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions