@hyperdrive.bot/bmad-workflow 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1017 -0
  3. package/bin/dev +5 -0
  4. package/bin/dev.cmd +3 -0
  5. package/bin/dev.js +5 -0
  6. package/bin/run +5 -0
  7. package/bin/run.cmd +3 -0
  8. package/bin/run.js +5 -0
  9. package/dist/commands/config/show.d.ts +34 -0
  10. package/dist/commands/config/show.js +108 -0
  11. package/dist/commands/config/validate.d.ts +29 -0
  12. package/dist/commands/config/validate.js +131 -0
  13. package/dist/commands/decompose.d.ts +79 -0
  14. package/dist/commands/decompose.js +327 -0
  15. package/dist/commands/demo.d.ts +18 -0
  16. package/dist/commands/demo.js +107 -0
  17. package/dist/commands/epics/create.d.ts +123 -0
  18. package/dist/commands/epics/create.js +459 -0
  19. package/dist/commands/epics/list.d.ts +120 -0
  20. package/dist/commands/epics/list.js +280 -0
  21. package/dist/commands/hello/index.d.ts +12 -0
  22. package/dist/commands/hello/index.js +34 -0
  23. package/dist/commands/hello/world.d.ts +8 -0
  24. package/dist/commands/hello/world.js +24 -0
  25. package/dist/commands/prd/fix.d.ts +39 -0
  26. package/dist/commands/prd/fix.js +140 -0
  27. package/dist/commands/prd/validate.d.ts +112 -0
  28. package/dist/commands/prd/validate.js +302 -0
  29. package/dist/commands/stories/create.d.ts +95 -0
  30. package/dist/commands/stories/create.js +431 -0
  31. package/dist/commands/stories/develop.d.ts +91 -0
  32. package/dist/commands/stories/develop.js +460 -0
  33. package/dist/commands/stories/list.d.ts +84 -0
  34. package/dist/commands/stories/list.js +291 -0
  35. package/dist/commands/stories/move.d.ts +66 -0
  36. package/dist/commands/stories/move.js +273 -0
  37. package/dist/commands/stories/qa.d.ts +99 -0
  38. package/dist/commands/stories/qa.js +530 -0
  39. package/dist/commands/workflow.d.ts +97 -0
  40. package/dist/commands/workflow.js +390 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.js +1 -0
  43. package/dist/models/agent-options.d.ts +50 -0
  44. package/dist/models/agent-options.js +1 -0
  45. package/dist/models/agent-result.d.ts +29 -0
  46. package/dist/models/agent-result.js +1 -0
  47. package/dist/models/index.d.ts +10 -0
  48. package/dist/models/index.js +10 -0
  49. package/dist/models/phase-result.d.ts +65 -0
  50. package/dist/models/phase-result.js +7 -0
  51. package/dist/models/provider.d.ts +28 -0
  52. package/dist/models/provider.js +18 -0
  53. package/dist/models/story.d.ts +154 -0
  54. package/dist/models/story.js +18 -0
  55. package/dist/models/workflow-config.d.ts +148 -0
  56. package/dist/models/workflow-config.js +1 -0
  57. package/dist/models/workflow-result.d.ts +164 -0
  58. package/dist/models/workflow-result.js +7 -0
  59. package/dist/services/agents/agent-runner-factory.d.ts +31 -0
  60. package/dist/services/agents/agent-runner-factory.js +44 -0
  61. package/dist/services/agents/agent-runner.d.ts +46 -0
  62. package/dist/services/agents/agent-runner.js +29 -0
  63. package/dist/services/agents/claude-agent-runner.d.ts +81 -0
  64. package/dist/services/agents/claude-agent-runner.js +332 -0
  65. package/dist/services/agents/gemini-agent-runner.d.ts +82 -0
  66. package/dist/services/agents/gemini-agent-runner.js +350 -0
  67. package/dist/services/agents/index.d.ts +7 -0
  68. package/dist/services/agents/index.js +7 -0
  69. package/dist/services/file-system/file-manager.d.ts +110 -0
  70. package/dist/services/file-system/file-manager.js +223 -0
  71. package/dist/services/file-system/glob-matcher.d.ts +75 -0
  72. package/dist/services/file-system/glob-matcher.js +126 -0
  73. package/dist/services/file-system/path-resolver.d.ts +183 -0
  74. package/dist/services/file-system/path-resolver.js +400 -0
  75. package/dist/services/logging/workflow-logger.d.ts +232 -0
  76. package/dist/services/logging/workflow-logger.js +552 -0
  77. package/dist/services/orchestration/batch-processor.d.ts +113 -0
  78. package/dist/services/orchestration/batch-processor.js +187 -0
  79. package/dist/services/orchestration/dependency-graph-executor.d.ts +60 -0
  80. package/dist/services/orchestration/dependency-graph-executor.js +447 -0
  81. package/dist/services/orchestration/index.d.ts +10 -0
  82. package/dist/services/orchestration/index.js +8 -0
  83. package/dist/services/orchestration/input-detector.d.ts +125 -0
  84. package/dist/services/orchestration/input-detector.js +381 -0
  85. package/dist/services/orchestration/story-queue.d.ts +94 -0
  86. package/dist/services/orchestration/story-queue.js +170 -0
  87. package/dist/services/orchestration/story-type-detector.d.ts +80 -0
  88. package/dist/services/orchestration/story-type-detector.js +258 -0
  89. package/dist/services/orchestration/task-decomposition-service.d.ts +67 -0
  90. package/dist/services/orchestration/task-decomposition-service.js +607 -0
  91. package/dist/services/orchestration/workflow-orchestrator.d.ts +659 -0
  92. package/dist/services/orchestration/workflow-orchestrator.js +2201 -0
  93. package/dist/services/parsers/epic-parser.d.ts +117 -0
  94. package/dist/services/parsers/epic-parser.js +264 -0
  95. package/dist/services/parsers/prd-fixer.d.ts +86 -0
  96. package/dist/services/parsers/prd-fixer.js +194 -0
  97. package/dist/services/parsers/prd-parser.d.ts +123 -0
  98. package/dist/services/parsers/prd-parser.js +286 -0
  99. package/dist/services/parsers/standalone-story-parser.d.ts +114 -0
  100. package/dist/services/parsers/standalone-story-parser.js +255 -0
  101. package/dist/services/parsers/story-parser-factory.d.ts +81 -0
  102. package/dist/services/parsers/story-parser-factory.js +108 -0
  103. package/dist/services/parsers/story-parser.d.ts +122 -0
  104. package/dist/services/parsers/story-parser.js +262 -0
  105. package/dist/services/scaffolding/decompose-session-scaffolder.d.ts +74 -0
  106. package/dist/services/scaffolding/decompose-session-scaffolder.js +315 -0
  107. package/dist/services/scaffolding/file-scaffolder.d.ts +94 -0
  108. package/dist/services/scaffolding/file-scaffolder.js +314 -0
  109. package/dist/services/validation/config-validator.d.ts +88 -0
  110. package/dist/services/validation/config-validator.js +167 -0
  111. package/dist/types/task-graph.d.ts +142 -0
  112. package/dist/types/task-graph.js +5 -0
  113. package/dist/utils/colors.d.ts +49 -0
  114. package/dist/utils/colors.js +50 -0
  115. package/dist/utils/error-formatter.d.ts +64 -0
  116. package/dist/utils/error-formatter.js +279 -0
  117. package/dist/utils/errors.d.ts +170 -0
  118. package/dist/utils/errors.js +233 -0
  119. package/dist/utils/formatters.d.ts +84 -0
  120. package/dist/utils/formatters.js +162 -0
  121. package/dist/utils/logger.d.ts +63 -0
  122. package/dist/utils/logger.js +78 -0
  123. package/dist/utils/progress.d.ts +104 -0
  124. package/dist/utils/progress.js +161 -0
  125. package/dist/utils/retry.d.ts +114 -0
  126. package/dist/utils/retry.js +160 -0
  127. package/dist/utils/shared-flags.d.ts +28 -0
  128. package/dist/utils/shared-flags.js +43 -0
  129. package/package.json +119 -0
package/README.md ADDED
@@ -0,0 +1,1017 @@
1
+ # BMAD Orchestrator CLI
2
+
3
+ [![CI](https://github.com/your-org/super-repo/actions/workflows/ci.yml/badge.svg)](https://github.com/your-org/super-repo/actions/workflows/ci.yml)
4
+ [![Tests](https://github.com/your-org/super-repo/actions/workflows/test.yml/badge.svg)](https://github.com/your-org/super-repo/actions/workflows/test.yml)
5
+ [![codecov](https://codecov.io/gh/your-org/super-repo/branch/main/graph/badge.svg)](https://codecov.io/gh/your-org/super-repo)
6
+ [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
7
+ [![Version](https://img.shields.io/npm/v/bmad-workflow.svg)](https://npmjs.org/package/bmad-workflow)
8
+ [![Downloads/week](https://img.shields.io/npm/dw/bmad-workflow.svg)](https://npmjs.org/package/bmad-workflow)
9
+
10
+ A professional command-line tool for orchestrating AI-driven development workflows. Built with oclif framework, this CLI manages PRD → Epic → Story → Development workflows, spawning Claude AI agents to generate documentation and implement features.
11
+
12
+ ## Table of Contents
13
+
14
+ - [Features](#features)
15
+ - [Pipelined Workflow Architecture](#pipelined-workflow-architecture)
16
+ - [Installation](#installation)
17
+ - [Prerequisites](#prerequisites)
18
+ - [Global Installation](#global-installation-recommended)
19
+ - [Local Installation](#local-installation-project-specific)
20
+ - [Quick Start](#quick-start)
21
+ - [Configuration](#configuration)
22
+ - [Commands](#commands)
23
+ - [Common Workflows](#common-workflows)
24
+ - [Troubleshooting](#troubleshooting)
25
+ - [Development](#development)
26
+ - [License](#license)
27
+
28
+ ## Features
29
+
30
+ - **PRD to Epic Generation**: Parse Product Requirement Documents and generate epic files
31
+ - **Epic to Story Generation**: Break down epics into implementable user stories
32
+ - **Automated Development**: Execute development workflows with AI agents
33
+ - **Pipelined Workflow Execution**: Story creation and development run concurrently for 44% faster execution
34
+ - **Parallel Processing**: Support for concurrent epic/story creation with configurable concurrency
35
+ - **Type-Safe**: Built with TypeScript in strict mode for reliability
36
+ - **Comprehensive Testing**: Unit, integration, and e2e test infrastructure
37
+ - **Structured Logging**: Production-ready logging with Pino
38
+ - **Real-Time Progress Tracking**: Visual progress indicators showing concurrent phase execution
39
+ - **Dry-Run Mode**: Preview actions without execution
40
+ - **Graceful Cancellation**: Cancel workflows with Ctrl+C without corrupting state
41
+ - **Flexible Execution Modes**: Choose between pipelined (default) or sequential execution
42
+
43
+ ## Pipelined Workflow Architecture
44
+
45
+ The BMAD CLI features a **pipelined workflow architecture** that executes story creation and development phases **concurrently**, significantly reducing total workflow time.
46
+
47
+ ### How It Works
48
+
49
+ Traditional sequential workflow processes one phase at a time:
50
+
51
+ ```
52
+ Sequential: [Create All Stories] → [Develop All Stories]
53
+ └─ 15 × 60s = 900s ─┘ └─ 15 × 120s = 1800s ─┘
54
+ Total: 2700s (45 minutes)
55
+ ```
56
+
57
+ Pipelined workflow overlaps story creation and development:
58
+
59
+ ```
60
+ Pipelined: [Create Stories ─────────────────────┐
61
+ └→ Queue → [Dev Worker 1] → Done │
62
+ └→ Queue → [Dev Worker 2] → Done │ Concurrent Execution
63
+ └→ Queue → [Dev Worker 3] → Done │
64
+ └→ Queue → [Dev Worker...] → Done ┘
65
+ Total: ~1500s (25 minutes) - 44% faster
66
+ ```
67
+
68
+ **Key Components:**
69
+
70
+ - **Story Queue**: Thread-safe FIFO queue coordinates story handoff from creation to development
71
+ - **Producer Phase**: Story creation enqueues completed stories as they finish
72
+ - **Worker Pool**: Multiple concurrent dev workers consume from queue (configurable via `--parallel`)
73
+ - **Pipeline Coordinator**: Orchestrates concurrent phases using Promise.allSettled
74
+
75
+ ### Performance Benefits
76
+
77
+ | Workflow Size | Sequential | Pipelined | Time Saved |
78
+ | ------------- | ---------- | --------- | ---------- |
79
+ | 5 stories | 15 min | 10 min | 33% |
80
+ | 10 stories | 30 min | 18 min | 40% |
81
+ | 15 stories | 45 min | 25 min | 44% |
82
+ | 20 stories | 60 min | 35 min | 42% |
83
+
84
+ **Performance scales with:**
85
+
86
+ - Number of stories in epic (more stories = greater benefit)
87
+ - Worker pool size (`--parallel` flag)
88
+ - Story creation vs development time ratio
89
+
90
+ ### When to Use Each Mode
91
+
92
+ **Pipelined Mode (Default, Recommended):**
93
+
94
+ - ✅ Processing multiple stories (3+)
95
+ - ✅ Normal operation with adequate API rate limits
96
+ - ✅ Maximizing throughput
97
+ - ✅ Modern development workflows
98
+
99
+ **Sequential Mode (`--no-pipeline`):**
100
+
101
+ - ⚠️ Debugging workflow issues
102
+ - ⚠️ API rate limit constraints
103
+ - ⚠️ Single story processing
104
+ - ⚠️ Backward compatibility requirements
105
+
106
+ ## Installation
107
+
108
+ ### Prerequisites
109
+
110
+ Before installing the BMAD Orchestrator CLI, ensure you have:
111
+
112
+ - **Node.js 18.x LTS or higher** - [Download Node.js](https://nodejs.org/)
113
+ - **Claude CLI** - Required for AI agent operations. Install and authenticate Claude CLI before using this tool.
114
+ - **Git** - For repository operations and version control
115
+
116
+ ### Global Installation (Recommended)
117
+
118
+ Install the CLI globally to use `bmad-workflow` command anywhere:
119
+
120
+ ```bash
121
+ npm install -g @bmad/workflow-cli
122
+ ```
123
+
124
+ Verify the installation:
125
+
126
+ ```bash
127
+ bmad-workflow --version
128
+ bmad-workflow --help
129
+ ```
130
+
131
+ ### Local Installation (Project-specific)
132
+
133
+ Install as a development dependency in your project:
134
+
135
+ ```bash
136
+ npm install --save-dev @bmad/workflow-cli
137
+ ```
138
+
139
+ Run via npx:
140
+
141
+ ```bash
142
+ npx bmad-workflow --version
143
+ npx bmad-workflow --help
144
+ ```
145
+
146
+ Or add to your package.json scripts:
147
+
148
+ ```json
149
+ {
150
+ "scripts": {
151
+ "workflow": "bmad-workflow"
152
+ }
153
+ }
154
+ ```
155
+
156
+ Then run with:
157
+
158
+ ```bash
159
+ npm run workflow -- --help
160
+ ```
161
+
162
+ ## Quick Start
163
+
164
+ 1. **Navigate to your project directory:**
165
+
166
+ ```bash
167
+ cd your-project
168
+ ```
169
+
170
+ 2. **Create BMAD configuration:**
171
+
172
+ Create `.bmad-core/core-config.yaml` with your project settings:
173
+
174
+ ```yaml
175
+ # Required: PRD configuration
176
+ prdFile: docs/prd.md
177
+ prdSharded: true
178
+ prdShardedLocation: docs/prd
179
+
180
+ # Required: Epic configuration
181
+ epicFilePattern: epic-{n}*.md
182
+
183
+ # Required: Architecture configuration
184
+ architectureSharded: true
185
+ architectureShardedLocation: docs/architecture
186
+
187
+ # Required: Story location
188
+ devStoryLocation: docs/stories
189
+
190
+ # Optional: Files to load during development
191
+ devLoadAlwaysFiles:
192
+ - docs/architecture/coding-standards.md
193
+ - docs/architecture/tech-stack.md
194
+
195
+ # Optional: QA configuration
196
+ qaLocation: docs/qa
197
+ ```
198
+
199
+ 3. **Run your first workflow:**
200
+
201
+ ```bash
202
+ bmad-workflow workflow docs/prd.md
203
+ ```
204
+
205
+ This will:
206
+ - Parse the PRD document
207
+ - Generate epics from the PRD
208
+ - Create user stories from each epic
209
+ - Execute development workflows for each story
210
+
211
+ ## Configuration
212
+
213
+ The BMAD CLI requires a `.bmad-core/core-config.yaml` file in your project root. This file defines paths and settings for the workflow orchestration.
214
+
215
+ ### Configuration File Format
216
+
217
+ Create `.bmad-core/core-config.yaml` with the following structure:
218
+
219
+ ```yaml
220
+ # PRD Configuration
221
+ prdFile: docs/prd.md # Path to main PRD file
222
+ prdVersion: v4 # PRD version (optional)
223
+ prdSharded: true # Whether PRD is split across multiple files
224
+ prdShardedLocation: docs/prd # Directory containing PRD shards
225
+
226
+ # Epic Configuration
227
+ epicFilePattern: epic-{n}*.md # Pattern for epic filenames ({n} = epic number)
228
+
229
+ # Architecture Configuration
230
+ architectureFile: docs/architecture.md # Path to main architecture file (optional)
231
+ architectureVersion: v4 # Architecture version (optional)
232
+ architectureSharded: true # Whether architecture is split across files
233
+ architectureShardedLocation: docs/architecture # Directory containing architecture files
234
+
235
+ # Story Configuration
236
+ devStoryLocation: docs/stories # Directory for active stories
237
+
238
+ # QA Configuration
239
+ qaLocation: docs/qa # Directory for QA artifacts
240
+
241
+ # Development Configuration (Optional)
242
+ devLoadAlwaysFiles: # Files loaded during development
243
+ - docs/architecture/coding-standards.md
244
+ - docs/architecture/tech-stack.md
245
+ - docs/architecture/source-tree.md
246
+
247
+ # Markdown Exploder (Optional)
248
+ markdownExploder: true # Enable markdown section splitting
249
+
250
+ # Debug Log (Optional)
251
+ devDebugLog: .ai/debug-log.md # Path to debug log file
252
+
253
+ # Slash Command Prefix (Optional)
254
+ slashPrefix: BMad # Prefix for slash commands
255
+ ```
256
+
257
+ ### Validating Configuration
258
+
259
+ Validate your configuration file:
260
+
261
+ ```bash
262
+ bmad-workflow config validate
263
+ ```
264
+
265
+ This command will:
266
+
267
+ - Check if the configuration file exists
268
+ - Validate YAML syntax
269
+ - Verify required fields are present
270
+ - Check field types and values
271
+ - Report specific errors with suggestions
272
+
273
+ ### Viewing Configuration
274
+
275
+ Display your current configuration:
276
+
277
+ ```bash
278
+ # Display as YAML (human-readable)
279
+ bmad-workflow config show
280
+
281
+ # Display as JSON (machine-readable)
282
+ bmad-workflow config show --json
283
+ ```
284
+
285
+ ## Commands
286
+
287
+ ### Workflow Commands
288
+
289
+ #### `workflow` - Complete PRD → Epic → Story → Dev Orchestration
290
+
291
+ Execute the complete workflow from a single entry point:
292
+
293
+ ```bash
294
+ # Start workflow from PRD
295
+ bmad-workflow workflow docs/PRD-feature.md
296
+
297
+ # Start from epic, skip development
298
+ bmad-workflow workflow docs/epics/epic-1.md --skip-dev
299
+
300
+ # Dry run to preview actions
301
+ bmad-workflow workflow docs/PRD-feature.md --dry-run
302
+
303
+ # Custom parallelization and intervals
304
+ bmad-workflow workflow docs/PRD-feature.md --parallel 5 --prd-interval 60
305
+
306
+ # Use sequential mode for backward compatibility
307
+ bmad-workflow workflow docs/PRD-feature.md --no-pipeline
308
+
309
+ # Pipelined mode (default) - story creation and dev run in parallel
310
+ bmad-workflow workflow docs/PRD-feature.md --pipeline
311
+ ```
312
+
313
+ **Flags:**
314
+
315
+ - `--dry-run` - Preview actions without execution
316
+ - `--parallel <n>` - Max concurrent epic/story creations (default: 3)
317
+ - `--prd-interval <seconds>` - Seconds between epic creation batches (default: 60)
318
+ - `--epic-interval <seconds>` - Seconds between story creation batches (default: 60)
319
+ - `--story-interval <seconds>` - Seconds between story development (default: 60)
320
+ - `--skip-epics` - Skip epic creation phase
321
+ - `--skip-stories` - Skip story creation phase
322
+ - `--skip-dev` - Skip development phase
323
+ - `--reference <file>` - Additional context files for AI agents (repeatable)
324
+ - `--prefix <string>` - Filename prefix for generated files
325
+ - `--verbose` - Detailed output mode
326
+ - `--pipeline` - Enable pipelined workflow (story and dev phases in parallel, default: true)
327
+ - `--no-pipeline` - Disable pipelined mode (execute phases sequentially)
328
+
329
+ ### Epic Commands
330
+
331
+ #### `epics create` - Create Epic Files from PRD
332
+
333
+ Generate epic files from a PRD document:
334
+
335
+ ```bash
336
+ # Create all epics from PRD
337
+ bmad-workflow epics create docs/prd.md
338
+
339
+ # Create specific range of epics
340
+ bmad-workflow epics create docs/prd.md --start 2 --count 3
341
+
342
+ # Create with additional context
343
+ bmad-workflow epics create docs/prd.md --reference docs/architecture.md --interval 5
344
+ ```
345
+
346
+ **Flags:**
347
+
348
+ - `--start <n>` - Start from epic number N (default: 1)
349
+ - `--count <n>` - Number of epics to create (default: all remaining)
350
+ - `--interval <seconds>` - Seconds to wait between epic creations (default: 0)
351
+ - `--prefix <string>` - Filename prefix for epic files
352
+ - `--reference <file>` - Reference file paths for AI agent context (repeatable)
353
+
354
+ #### `epics list` - List All Epics
355
+
356
+ Display all epic files with metadata:
357
+
358
+ ```bash
359
+ # Display epics in table format
360
+ bmad-workflow epics list
361
+
362
+ # Output as JSON
363
+ bmad-workflow epics list --json
364
+ ```
365
+
366
+ **Flags:**
367
+
368
+ - `--json` - Output as JSON array
369
+
370
+ ### Story Commands
371
+
372
+ #### `stories create` - Create Story Files from Epic
373
+
374
+ Generate story files from an epic:
375
+
376
+ ```bash
377
+ # Create all stories from epic
378
+ bmad-workflow stories create docs/epics/epic-1-foundation.md
379
+
380
+ # Create with high concurrency
381
+ bmad-workflow stories create epic.md --parallel 10
382
+
383
+ # Create starting from specific story
384
+ bmad-workflow stories create epic.md --start 3
385
+
386
+ # Create with additional context
387
+ bmad-workflow stories create epic.md --reference docs/architecture.md --reference docs/api-spec.md
388
+ ```
389
+
390
+ **Flags:**
391
+
392
+ - `--parallel <n>` - Max concurrent story creations (default: 7)
393
+ - `--interval <seconds>` - Seconds between batches (default: 30)
394
+ - `--start <n>` - Story number to start from
395
+ - `--prefix <string>` - Filename prefix for stories
396
+ - `--reference <file>` - Additional context files for AI agents (repeatable)
397
+
398
+ #### `stories develop` - Execute Development Workflow
399
+
400
+ Develop stories using Claude AI dev agents:
401
+
402
+ ```bash
403
+ # Develop all AUTH stories
404
+ bmad-workflow stories develop "docs/stories/AUTH-*.md"
405
+
406
+ # Develop with custom interval
407
+ bmad-workflow stories develop "**/*-auth-*.md" --interval 60
408
+
409
+ # Develop with architecture reference
410
+ bmad-workflow stories develop "stories/*.md" --reference docs/architecture.md
411
+ ```
412
+
413
+ **Flags:**
414
+
415
+ - `--interval <seconds>` - Seconds to wait between stories (default: 30)
416
+ - `--reference <file>` - Additional context files for dev agents (repeatable)
417
+
418
+ **Note:** Stories are developed sequentially (one at a time) to prevent conflicts.
419
+
420
+ #### `stories list` - List All Stories
421
+
422
+ Display all stories with filtering options:
423
+
424
+ ```bash
425
+ # List all stories
426
+ bmad-workflow stories list
427
+
428
+ # List only draft stories
429
+ bmad-workflow stories list --status=draft
430
+
431
+ # List stories from epic 4
432
+ bmad-workflow stories list --epic=4
433
+
434
+ # List ready stories from epic 4 as JSON
435
+ bmad-workflow stories list --status=ready --epic=4 --json
436
+ ```
437
+
438
+ **Flags:**
439
+
440
+ - `--status <value>` - Filter by story status (draft, ready, done, inprogress, failed)
441
+ - `--epic <n>` - Filter by epic number
442
+ - `--json` - Output results as JSON
443
+
444
+ #### `stories move` - Move Stories to QA Directory
445
+
446
+ Move completed story files to QA directory:
447
+
448
+ ```bash
449
+ # Move all stories matching pattern
450
+ bmad-workflow stories move "4.7-*.md"
451
+
452
+ # Move without confirmation
453
+ bmad-workflow stories move "4.*-*.md" --force
454
+
455
+ # Move specific story
456
+ bmad-workflow stories move "STORY-123-*.md"
457
+ ```
458
+
459
+ **Flags:**
460
+
461
+ - `--force` - Skip confirmation prompt
462
+
463
+ ### Config Commands
464
+
465
+ #### `config show` - Display Current Configuration
466
+
467
+ ```bash
468
+ # Display as YAML
469
+ bmad-workflow config show
470
+
471
+ # Display as JSON
472
+ bmad-workflow config show --json
473
+ ```
474
+
475
+ #### `config validate` - Validate Configuration File
476
+
477
+ ```bash
478
+ bmad-workflow config validate
479
+ ```
480
+
481
+ ## Common Workflows
482
+
483
+ ### Complete PRD Implementation
484
+
485
+ Execute the full PRD → Epic → Story → Dev pipeline:
486
+
487
+ ```bash
488
+ bmad-workflow workflow docs/PRD-new-feature.md --parallel 5
489
+ ```
490
+
491
+ ### Incremental Epic Creation
492
+
493
+ Create epics one batch at a time with delays:
494
+
495
+ ```bash
496
+ # Create first 3 epics
497
+ bmad-workflow epics create docs/prd.md --start 1 --count 3 --interval 60
498
+
499
+ # Create next batch
500
+ bmad-workflow epics create docs/prd.md --start 4 --count 3 --interval 60
501
+ ```
502
+
503
+ ### Parallel Story Generation
504
+
505
+ Generate all stories from an epic with high concurrency:
506
+
507
+ ```bash
508
+ bmad-workflow stories create docs/epics/epic-2-backend.md --parallel 10 --interval 30
509
+ ```
510
+
511
+ ### Sequential Story Development
512
+
513
+ Develop stories one at a time with delays:
514
+
515
+ ```bash
516
+ bmad-workflow stories develop "docs/stories/FEAT-*.md" --interval 120
517
+ ```
518
+
519
+ ### Dry Run Preview
520
+
521
+ Preview workflow actions without executing:
522
+
523
+ ```bash
524
+ bmad-workflow workflow docs/PRD-feature.md --dry-run --verbose
525
+ ```
526
+
527
+ ## Troubleshooting
528
+
529
+ ### Common Errors and Solutions
530
+
531
+ #### "Configuration file not found"
532
+
533
+ **Error:**
534
+
535
+ ```
536
+ Configuration file not found at '.bmad-core/core-config.yaml'.
537
+ Ensure you're running this command from the project root directory.
538
+ ```
539
+
540
+ **Solutions:**
541
+
542
+ 1. Check that you're in the project root directory:
543
+
544
+ ```bash
545
+ pwd # Should show your project root
546
+ ls .bmad-core/core-config.yaml # Should exist
547
+ ```
548
+
549
+ 2. Create the configuration file if it doesn't exist:
550
+
551
+ ```bash
552
+ mkdir -p .bmad-core
553
+ # Copy the configuration example from the Configuration section above
554
+ ```
555
+
556
+ 3. Verify file permissions:
557
+ ```bash
558
+ ls -la .bmad-core/core-config.yaml
559
+ # Ensure you have read permissions
560
+ ```
561
+
562
+ #### "Invalid YAML syntax in configuration file"
563
+
564
+ **Error:**
565
+
566
+ ```
567
+ Invalid YAML syntax in '.bmad-core/core-config.yaml' at line 5:
568
+ unexpected end of the stream within a double quoted scalar
569
+ ```
570
+
571
+ **Solutions:**
572
+
573
+ 1. Check YAML syntax using an online validator
574
+ 2. Common YAML errors:
575
+ - Missing quotes around strings with special characters
576
+ - Incorrect indentation (use spaces, not tabs)
577
+ - Unclosed quotes or brackets
578
+
579
+ 3. Validate your configuration:
580
+ ```bash
581
+ bmad-workflow config validate
582
+ ```
583
+
584
+ #### "Claude CLI not found"
585
+
586
+ **Error:**
587
+
588
+ ```
589
+ Agent execution failed
590
+ → Exit code: 127
591
+ → Error output: claude: command not found
592
+ 💡 Suggestion: Ensure Claude CLI is installed and accessible in your PATH.
593
+ Run "claude --version" to verify.
594
+ ```
595
+
596
+ **Solutions:**
597
+
598
+ 1. Install Claude CLI:
599
+
600
+ ```bash
601
+ # Follow Anthropic's official installation guide
602
+ # https://docs.anthropic.com/claude/docs/claude-cli
603
+ ```
604
+
605
+ 2. Authenticate Claude CLI:
606
+
607
+ ```bash
608
+ claude auth login
609
+ ```
610
+
611
+ 3. Verify installation:
612
+
613
+ ```bash
614
+ claude --version
615
+ which claude
616
+ ```
617
+
618
+ 4. Add Claude CLI to PATH (if not already):
619
+ ```bash
620
+ # For bash/zsh
621
+ export PATH="/path/to/claude:$PATH"
622
+ # Add to ~/.bashrc or ~/.zshrc for persistence
623
+ ```
624
+
625
+ #### "File not found: docs/prd.md"
626
+
627
+ **Error:**
628
+
629
+ ```
630
+ ✗ Error: File not found: docs/prd.md
631
+ 💡 Suggestion: Check that you're in the project root directory and
632
+ the path 'docs/prd.md' is correct.
633
+ ```
634
+
635
+ **Solutions:**
636
+
637
+ 1. Verify the file exists:
638
+
639
+ ```bash
640
+ ls -la docs/prd.md
641
+ ```
642
+
643
+ 2. Check your current directory:
644
+
645
+ ```bash
646
+ pwd
647
+ cd /path/to/your/project
648
+ ```
649
+
650
+ 3. Use absolute path if needed:
651
+ ```bash
652
+ bmad-workflow workflow /absolute/path/to/docs/prd.md
653
+ ```
654
+
655
+ #### "Permission denied" on File Operations
656
+
657
+ **Error:**
658
+
659
+ ```
660
+ ✗ Error: Permission denied: docs/stories
661
+ 💡 Suggestion: Check that you're in the project root directory and
662
+ the path 'docs/stories' is correct.
663
+ ```
664
+
665
+ **Solutions:**
666
+
667
+ 1. Check file/directory permissions:
668
+
669
+ ```bash
670
+ ls -la docs/stories
671
+ ```
672
+
673
+ 2. Fix permissions if needed:
674
+
675
+ ```bash
676
+ chmod 755 docs/stories
677
+ ```
678
+
679
+ 3. Ensure you have write access to the directory:
680
+ ```bash
681
+ # Create directory if it doesn't exist
682
+ mkdir -p docs/stories
683
+ ```
684
+
685
+ #### "Invalid epic format at line 42"
686
+
687
+ **Error:**
688
+
689
+ ```
690
+ ✗ Error: Invalid epic format at line 42
691
+ 💡 Suggestion: Problem at line 42: "## Epic A: Title".
692
+ Check the expected format for this section.
693
+ ```
694
+
695
+ **Solutions:**
696
+
697
+ 1. Check the epic numbering format - must use numbers:
698
+
699
+ ```markdown
700
+ <!-- ✓ Correct -->
701
+
702
+ ## Epic 1: Foundation
703
+
704
+ ## Epic 2: Backend Services
705
+
706
+ <!-- ✗ Incorrect -->
707
+
708
+ ## Epic A: Foundation
709
+
710
+ ## Epic B: Backend Services
711
+ ```
712
+
713
+ 2. Verify markdown structure in PRD/epic files
714
+
715
+ 3. Use consistent heading levels (## for epics)
716
+
717
+ #### "Configuration validation failed"
718
+
719
+ **Error:**
720
+
721
+ ```
722
+ ✗ Error: Invalid field "prdFile"
723
+ 💡 Suggestion: Field 'prdFile' expects string, got number.
724
+ Example: 'docs/prd.md'
725
+ ```
726
+
727
+ **Solutions:**
728
+
729
+ 1. Check field types in configuration:
730
+
731
+ ```yaml
732
+ # ✓ Correct
733
+ prdFile: docs/prd.md
734
+ prdSharded: true
735
+
736
+ # ✗ Incorrect
737
+ prdFile: 123
738
+ prdSharded: "yes"
739
+ ```
740
+
741
+ 2. Run validation to see all errors:
742
+
743
+ ```bash
744
+ bmad-workflow config validate
745
+ ```
746
+
747
+ 3. Refer to the Configuration section for field requirements
748
+
749
+ #### "Workflow completed with failures"
750
+
751
+ When workflows complete with failures, check the summary output for specific error details:
752
+
753
+ ```bash
754
+ # Run with verbose mode for detailed error output
755
+ bmad-workflow workflow docs/prd.md --verbose
756
+ ```
757
+
758
+ **Common causes:**
759
+
760
+ - Agent timeout (increase intervals with --interval flags)
761
+ - API rate limits (reduce --parallel count)
762
+ - Invalid file formats (check PRD/epic structure)
763
+ - Missing dependencies (verify configuration files exist)
764
+
765
+ ### Pipeline-Specific Issues
766
+
767
+ #### "Pipeline mode enabled but running sequentially"
768
+
769
+ If you notice the pipeline is not executing concurrently:
770
+
771
+ **Possible causes:**
772
+
773
+ 1. **Dry-run mode enabled** - Pipeline only works in execution mode:
774
+
775
+ ```bash
776
+ # Remove --dry-run to use pipeline
777
+ bmad-workflow workflow docs/prd.md
778
+ ```
779
+
780
+ 2. **Only one phase enabled** - Pipeline requires both story and dev phases:
781
+
782
+ ```bash
783
+ # Correct: both phases enabled (default)
784
+ bmad-workflow workflow docs/prd.md
785
+
786
+ # Won't pipeline: dev phase skipped
787
+ bmad-workflow workflow docs/prd.md --skip-dev
788
+ ```
789
+
790
+ 3. **Explicitly disabled** - Check for `--no-pipeline` flag:
791
+ ```bash
792
+ # Use --pipeline or omit flag (default is pipeline mode)
793
+ bmad-workflow workflow docs/prd.md --pipeline
794
+ ```
795
+
796
+ #### Pipeline Performance Not as Expected
797
+
798
+ If pipeline mode isn't showing performance improvements:
799
+
800
+ 1. **Low story count** - Pipeline benefits scale with story count:
801
+ - 1-2 stories: Minimal benefit
802
+ - 3-5 stories: ~30% improvement
803
+ - 10+ stories: ~40-44% improvement
804
+
805
+ 2. **Worker pool size too small** - Increase concurrency:
806
+
807
+ ```bash
808
+ # Increase to 5 workers (default is 3)
809
+ bmad-workflow workflow docs/prd.md --parallel 5
810
+ ```
811
+
812
+ 3. **Story creation bottleneck** - If stories create slowly, increase story creation parallelism:
813
+
814
+ ```bash
815
+ bmad-workflow stories create epic.md --parallel 10
816
+ ```
817
+
818
+ 4. **API rate limits** - Monitor for rate limit errors and adjust intervals:
819
+ ```bash
820
+ bmad-workflow workflow docs/prd.md --story-interval 90
821
+ ```
822
+
823
+ #### Workers Not Processing Stories
824
+
825
+ If dev workers appear idle while stories are queued:
826
+
827
+ **Solutions:**
828
+
829
+ 1. Check verbose output for worker status:
830
+
831
+ ```bash
832
+ bmad-workflow workflow docs/prd.md --verbose
833
+ ```
834
+
835
+ 2. Verify stories are completing creation successfully
836
+
837
+ 3. Check for errors in story phase that prevent queue enqueuing
838
+
839
+ 4. Monitor worker logs for processing errors
840
+
841
+ ### Performance Issues
842
+
843
+ #### Slow Epic/Story Creation
844
+
845
+ If creation is slow:
846
+
847
+ 1. **Increase parallelization:**
848
+
849
+ ```bash
850
+ bmad-workflow workflow docs/prd.md --parallel 10
851
+ ```
852
+
853
+ 2. **Reduce intervals:**
854
+
855
+ ```bash
856
+ bmad-workflow workflow docs/prd.md --prd-interval 30 --epic-interval 30
857
+ ```
858
+
859
+ 3. **Process in batches:**
860
+ ```bash
861
+ bmad-workflow epics create docs/prd.md --start 1 --count 5
862
+ bmad-workflow epics create docs/prd.md --start 6 --count 5
863
+ ```
864
+
865
+ #### High Memory Usage
866
+
867
+ If experiencing high memory usage:
868
+
869
+ 1. **Reduce concurrency:**
870
+
871
+ ```bash
872
+ bmad-workflow workflow docs/prd.md --parallel 3
873
+ ```
874
+
875
+ 2. **Process smaller batches**
876
+ 3. **Monitor with verbose mode:**
877
+ ```bash
878
+ bmad-workflow workflow docs/prd.md --verbose
879
+ ```
880
+
881
+ ### Getting Help
882
+
883
+ If you encounter issues not covered here:
884
+
885
+ 1. **Run with verbose mode** for detailed logs:
886
+
887
+ ```bash
888
+ bmad-workflow workflow docs/prd.md --verbose
889
+ ```
890
+
891
+ 2. **Check configuration validation:**
892
+
893
+ ```bash
894
+ bmad-workflow config validate
895
+ ```
896
+
897
+ 3. **Verify prerequisites:**
898
+
899
+ ```bash
900
+ node --version # Should be 18.x or higher
901
+ claude --version # Should return Claude CLI version
902
+ ```
903
+
904
+ 4. **Report issues** with:
905
+ - Error message and suggestion
906
+ - Command used
907
+ - Configuration file (sanitized)
908
+ - Node.js and CLI versions
909
+
910
+ ## Documentation
911
+
912
+ ### Architecture & API Documentation
913
+
914
+ For in-depth technical documentation:
915
+
916
+ - **[Architecture Overview](docs/ARCHITECTURE.md)** - System design, components, and data flow
917
+ - **[API Documentation](docs/api/README.md)** - Complete API reference for all services, commands, and models
918
+ - **[Contributing Guide](docs/CONTRIBUTING.md)** - Development guidelines and contribution process
919
+
920
+ ### Documentation Structure
921
+
922
+ ```
923
+ docs/
924
+ ├── ARCHITECTURE.md # System architecture and design patterns
925
+ ├── CONTRIBUTING.md # Contribution guidelines and standards
926
+ └── api/ # API reference documentation
927
+ ├── README.md # API overview and conventions
928
+ ├── commands/ # Command API documentation
929
+ ├── services/ # Service layer API docs
930
+ └── models/ # Type definitions and interfaces
931
+ ```
932
+
933
+ ## Development
934
+
935
+ ### Local Development Setup
936
+
937
+ If you're contributing to the BMAD Orchestrator CLI:
938
+
939
+ ```bash
940
+ # Clone the repository
941
+ cd packages/cli/bmad-workflow
942
+
943
+ # Install dependencies
944
+ npm install
945
+
946
+ # Build from source
947
+ npm run build
948
+
949
+ # Run locally using dev script
950
+ ./bin/dev --help
951
+ ```
952
+
953
+ For detailed development guidelines, testing practices, and coding standards, see **[CONTRIBUTING.md](docs/CONTRIBUTING.md)**.
954
+
955
+ ### Project Structure
956
+
957
+ ```
958
+ packages/cli/bmad-workflow/
959
+ ├── src/
960
+ │ ├── commands/ # oclif command classes
961
+ │ ├── services/ # Business logic layer
962
+ │ ├── models/ # TypeScript types and interfaces
963
+ │ └── utils/ # Pure utility functions
964
+ ├── test/
965
+ │ ├── commands/ # Command integration tests
966
+ │ ├── services/ # Service unit tests
967
+ │ ├── fixtures/ # Test data
968
+ │ └── helpers/ # Test utilities
969
+ ├── tsconfig.json # TypeScript configuration (strict mode)
970
+ ├── package.json # Project manifest
971
+ └── README.md # This file
972
+ ```
973
+
974
+ ### Build
975
+
976
+ Compile TypeScript to JavaScript:
977
+
978
+ ```bash
979
+ npm run build
980
+ ```
981
+
982
+ ### Linting
983
+
984
+ Run ESLint to check code quality:
985
+
986
+ ```bash
987
+ npm run lint
988
+ ```
989
+
990
+ ### Testing
991
+
992
+ Run the test suite:
993
+
994
+ ```bash
995
+ npm run test
996
+ ```
997
+
998
+ Run tests with coverage:
999
+
1000
+ ```bash
1001
+ npm run test:coverage
1002
+ ```
1003
+
1004
+ ### TypeScript Configuration
1005
+
1006
+ This project uses TypeScript strict mode with the following flags enabled:
1007
+
1008
+ - `noImplicitAny`
1009
+ - `strictNullChecks`
1010
+ - `strictFunctionTypes`
1011
+ - `strictPropertyInitialization`
1012
+ - `noImplicitThis`
1013
+ - `alwaysStrict`
1014
+
1015
+ ## License
1016
+
1017
+ MIT