prodigy 0.4.4

Turn ad-hoc Claude sessions into reproducible development pipelines with parallel AI agents
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
{
  "documentation_map": {
    "chapters": [
      {
        "id": "workflow-basics",
        "title": "Workflow Basics",
        "file": "book/src/workflow-basics.md",
        "sections": [
          {
            "heading": "Overview",
            "topics": ["Workflow types", "Standard workflows", "MapReduce workflows"]
          },
          {
            "heading": "Simple Workflows",
            "topics": ["Array format", "Sequential execution"]
          },
          {
            "heading": "Full Workflow Structure",
            "topics": ["Commands field", "Environment variables", "Secrets", "Env files", "Profiles", "Merge workflows"]
          },
          {
            "heading": "Available Fields",
            "topics": ["commands", "env", "secrets", "env_files", "profiles", "merge"]
          },
          {
            "heading": "Command Types",
            "topics": ["shell", "claude", "goal_seek", "foreach", "validate", "write_file", "analyze"]
          },
          {
            "heading": "Command-Level Options",
            "topics": ["id", "commit_required", "timeout", "cwd/working_dir", "output_file", "when", "on_failure", "on_success", "capture_output", "capture_format", "capture_streams"]
          },
          {
            "heading": "Environment Configuration",
            "topics": ["Global env", "Secret variables", "Environment files", "Profiles", "Step-level overrides"]
          },
          {
            "heading": "Merge Workflows",
            "topics": ["merge variables", "merge.worktree", "merge.source_branch", "merge.target_branch", "merge.session_id", "merge timeout"]
          }
        ],
        "features_documented": [
          "Workflow structure",
          "Simple vs full format",
          "Command types overview",
          "Environment configuration",
          "Merge workflows"
        ]
      },
      {
        "id": "mapreduce",
        "title": "MapReduce Workflows",
        "file": "book/src/mapreduce.md",
        "sections": [
          {
            "heading": "Quick Start",
            "topics": ["Minimal example", "Setup phase", "Map phase", "Reduce phase"]
          },
          {
            "heading": "Complete Structure",
            "topics": ["name", "mode: mapreduce", "setup", "map", "reduce", "merge", "error_policy"]
          },
          {
            "heading": "Map Phase Configuration",
            "topics": ["input", "json_path", "agent_template", "max_parallel", "filter", "sort_by", "max_items", "offset", "distinct", "agent_timeout_secs"]
          },
          {
            "heading": "Backoff Strategies",
            "topics": ["Fixed backoff", "Linear backoff", "Exponential backoff", "Fibonacci backoff", "Duration format", "humantime"]
          },
          {
            "heading": "Error Collection Strategies",
            "topics": ["aggregate", "immediate", "batched:N"]
          },
          {
            "heading": "Setup Phase (Advanced)",
            "topics": ["Simple array format", "Full configuration", "timeout", "capture_outputs"]
          },
          {
            "heading": "Global Storage Architecture",
            "topics": ["~/.prodigy/events/", "~/.prodigy/dlq/", "~/.prodigy/state/"]
          },
          {
            "heading": "Event Tracking",
            "topics": ["Agent lifecycle events", "Work item status", "Checkpoint saves", "JSONL format"]
          },
          {
            "heading": "Checkpoint and Resume",
            "topics": ["Checkpoint structure", "Resume behavior", "prodigy resume-job", "Work item recovery"]
          },
          {
            "heading": "Dead Letter Queue (DLQ)",
            "topics": ["DLQ storage", "DLQ retry", "prodigy dlq retry", "DLQ commands"]
          },
          {
            "heading": "Common Pitfalls",
            "topics": ["CaptureConfig fields", "Backoff enum syntax", "Duration format errors", "Variable references", "max_delay field", "Nested commands syntax"]
          },
          {
            "heading": "Troubleshooting",
            "topics": ["Workflow validation errors", "Error messages", "Performance issues", "Resume not working"]
          },
          {
            "heading": "Performance Tuning",
            "topics": ["max_parallel tuning", "Timeout configuration", "Circuit breaker tuning"]
          },
          {
            "heading": "Real-World Use Cases",
            "topics": ["PR review", "Multi-file refactoring", "Documentation drift analysis", "Test parallelization"]
          },
          {
            "heading": "Workflow Format Comparison",
            "topics": ["Simple vs full format", "When to use each"]
          }
        ],
        "features_documented": [
          "MapReduce mode",
          "Setup phase with capture_outputs",
          "Map phase with parallelism",
          "Reduce phase aggregation",
          "Error policies and circuit breakers",
          "Retry configuration with backoff strategies",
          "DLQ and resume functionality",
          "Global storage",
          "Event tracking"
        ]
      },
      {
        "id": "commands",
        "title": "Command Types",
        "file": "book/src/commands.md",
        "sections": [
          {
            "heading": "Shell Commands",
            "topics": ["Simple execution", "Output capture", "Failure handling", "Timeout", "Conditional execution"]
          },
          {
            "heading": "Claude Commands",
            "topics": ["Simple command", "Arguments", "commit_required", "Output capture"]
          },
          {
            "heading": "Goal-Seeking Commands",
            "topics": ["Iterative refinement", "goal", "claude/shell", "validate", "threshold", "max_attempts", "timeout_seconds", "fail_on_incomplete"]
          },
          {
            "heading": "Foreach Commands",
            "topics": ["Iteration", "input source", "parallel execution", "do block", "continue_on_error", "max_items", "${item} variable"]
          },
          {
            "heading": "Write File Commands",
            "topics": ["Plain text", "JSON", "YAML", "format validation", "mode", "create_dirs"]
          },
          {
            "heading": "Validation Commands",
            "topics": ["shell/claude validation", "result_file", "threshold", "expected_schema", "on_incomplete handler"]
          },
          {
            "heading": "Command Reference",
            "topics": ["Common fields", "id", "timeout", "commit_required", "when", "capture", "capture_format", "on_success", "on_failure", "validate", "output_file"]
          },
          {
            "heading": "CaptureStreams Configuration",
            "topics": ["capture", "capture_format", "future enhancements"]
          },
          {
            "heading": "Capture Format Examples",
            "topics": ["string", "number", "json", "lines", "boolean"]
          },
          {
            "heading": "Deprecated Fields",
            "topics": ["test:", "command: in validation", "Nested commands", "Legacy variable aliases"]
          }
        ],
        "features_documented": [
          "Shell commands",
          "Claude commands",
          "Goal-seeking with validation",
          "Foreach iteration",
          "Write file with format validation",
          "Validation commands",
          "Capture formats",
          "On failure/success handlers"
        ]
      },
      {
        "id": "variables",
        "title": "Variable Interpolation",
        "file": "book/src/variables.md",
        "sections": [
          {
            "heading": "Overview",
            "topics": ["Built-in variables", "Custom captured variables", "Interpolation syntax"]
          },
          {
            "heading": "Variable Availability by Phase",
            "topics": ["Phase-specific variables", "Standard variables", "Output variables", "Item variables", "Map aggregation", "Merge variables"]
          },
          {
            "heading": "Available Variables",
            "topics": ["Standard variables", "System variables", "Output variables", "MapReduce variables", "Merge variables", "Validation variables", "Git context variables", "Legacy aliases"]
          },
          {
            "heading": "MapReduce Variables",
            "topics": ["${item}", "${item.*}", "${item_index}", "${item_total}", "${map.total}", "${map.successful}", "${map.failed}", "${map.results}", "${worker.id}"]
          },
          {
            "heading": "Using map.results in Reduce Phase",
            "topics": ["Supported commands", "write_file support", "Environment variable limits", "Best practices"]
          },
          {
            "heading": "Custom Variable Capture",
            "topics": ["capture field", "capture_format", "Capture streams", "Nested JSON field access", "Variable scope", "Precedence"]
          },
          {
            "heading": "Troubleshooting",
            "topics": ["Variable not found", "Invalid syntax", "Phase mismatches", "Empty values", "Best practices"]
          }
        ],
        "features_documented": [
          "Standard variables",
          "System variables",
          "Output variables",
          "MapReduce variables",
          "Merge variables",
          "Validation variables",
          "Git context variables",
          "Custom capture",
          "Variable scope and precedence"
        ]
      },
      {
        "id": "environment",
        "title": "Environment Configuration",
        "file": "book/src/environment.md",
        "sections": [
          {
            "heading": "Architecture Overview",
            "topics": ["WorkflowConfig", "EnvironmentConfig", "Internal vs user-facing"]
          },
          {
            "heading": "Global Environment Variables",
            "topics": ["Static env", "Environment inheritance", "Parent environment"]
          },
          {
            "heading": "MapReduce Environment Variables",
            "topics": ["Defining variables", "Variable interpolation", "Setup phase", "Map phase", "Reduce phase", "Merge phase"]
          },
          {
            "heading": "Environment Files",
            "topics": [".env format", "Loading order", "Precedence", "Override behavior"]
          },
          {
            "heading": "Secrets Management",
            "topics": ["Secret providers", "aws", "vault", "env", "file", "custom", "Masking in logs"]
          },
          {
            "heading": "Environment Profiles",
            "topics": ["Profile definition", "description field", "Multiple profiles", "Profile selection"]
          },
          {
            "heading": "Per-Command Environment Overrides",
            "topics": ["Shell syntax", "ENV=value command", "Single/multiple overrides"]
          },
          {
            "heading": "Environment Precedence",
            "topics": ["Precedence hierarchy", "Shell overrides", "Global env", "Env files", "Parent environment"]
          },
          {
            "heading": "Best Practices",
            "topics": ["Configuration files", "Secrets", "Profiles", "Shell overrides", "Documentation"]
          },
          {
            "heading": "Common Patterns",
            "topics": ["Multi-environment workflows", "Provider-based secrets", "Build matrix", "Temporary changes"]
          }
        ],
        "features_documented": [
          "Global environment variables",
          "Environment files (.env)",
          "Secrets management",
          "Environment profiles",
          "Variable interpolation",
          "Precedence rules",
          "MapReduce environment variables"
        ]
      },
      {
        "id": "advanced",
        "title": "Advanced Features",
        "file": "book/src/advanced.md",
        "sections": [
          {
            "heading": "Conditional Execution",
            "topics": ["when clause", "Expression syntax", "Comparison operators", "Logical operators", "Type coercion"]
          },
          {
            "heading": "On Success Handlers",
            "topics": ["Follow-up commands", "Handler features"]
          },
          {
            "heading": "On Failure Handlers",
            "topics": ["Failure recovery", "max_attempts", "fail_workflow", "commit_required"]
          },
          {
            "heading": "Nested Conditionals",
            "topics": ["Chained execution", "Complex control flow"]
          }
        ],
        "features_documented": [
          "Conditional execution with when clauses",
          "Expression syntax for conditions",
          "On success handlers",
          "On failure handlers with retry",
          "Nested conditionals"
        ]
      },
      {
        "id": "error-handling",
        "title": "Error Handling",
        "file": "book/src/error-handling.md",
        "sections": [
          {
            "heading": "Command-Level Error Handling",
            "topics": ["on_failure configuration", "Simple forms", "Advanced configuration"]
          },
          {
            "heading": "Failure Handler Configuration",
            "topics": ["strategy", "timeout", "handler_failure_fatal", "fail_workflow", "capture", "commands"]
          },
          {
            "heading": "Handler Strategies",
            "topics": ["recovery", "fallback", "cleanup", "custom"]
          }
        ],
        "features_documented": [
          "Command-level error handling",
          "on_failure handlers",
          "Handler strategies",
          "Retry configuration",
          "Timeout configuration"
        ]
      },
      {
        "id": "examples",
        "title": "Examples",
        "file": "book/src/examples.md",
        "sections": [
          {
            "heading": "Example 1: Simple Build and Test",
            "topics": ["Basic workflow", "on_failure handler"]
          },
          {
            "heading": "Example 2: Coverage Improvement with Goal Seeking",
            "topics": ["goal_seek command", "validate script", "threshold", "max_attempts"]
          },
          {
            "heading": "Example 3: Foreach Iteration",
            "topics": ["Sequential foreach", "Parallel foreach", "Complex item structure"]
          },
          {
            "heading": "Example 4: Parallel Code Review",
            "topics": ["MapReduce workflow", "JSONPath", "Parallel agents", "Results aggregation"]
          },
          {
            "heading": "Example 5: Conditional Deployment",
            "topics": ["Conditional execution", "when clause", "capture_output"]
          }
        ],
        "features_documented": [
          "Practical workflow examples",
          "Goal-seeking workflow",
          "Foreach examples",
          "MapReduce examples",
          "Conditional deployment"
        ]
      },
      {
        "id": "retry-configuration",
        "title": "Retry Configuration",
        "file": "book/src/retry-configuration.md",
        "sections": [
          {
            "heading": "Overview",
            "topics": ["Enhanced retry system", "Workflow-level retry", "RetryConfig structure"]
          },
          {
            "heading": "RetryConfig Structure",
            "topics": ["attempts", "backoff", "initial_delay", "max_delay", "jitter", "jitter_factor", "retry_on", "retry_budget", "on_failure"]
          },
          {
            "heading": "Basic Retry Configuration",
            "topics": ["Default values", "Exponential backoff", "Duration format"]
          },
          {
            "heading": "Backoff Strategies",
            "topics": ["Fixed backoff", "Linear backoff", "Exponential backoff", "Delay sequences"]
          }
        ],
        "features_documented": [
          "Retry configuration",
          "Backoff strategies",
          "Duration format",
          "Retry budget",
          "Jitter configuration"
        ]
      },
      {
        "id": "composition",
        "title": "Workflow Composition",
        "file": "book/src/composition.md",
        "sections": [
          {
            "heading": "Overview",
            "topics": ["Import workflows", "Extend base workflows", "Templates", "Parameters", "Sub-workflows"]
          },
          {
            "heading": "Workflow Imports",
            "topics": ["Basic import", "Import with alias", "Selective import", "Multiple imports"]
          },
          {
            "heading": "Workflow Extension (Inheritance)",
            "topics": ["Basic extension", "Base resolution paths", "Child workflow overrides"]
          }
        ],
        "features_documented": [
          "Workflow imports",
          "Selective imports",
          "Workflow extension",
          "Base resolution"
        ]
      },
      {
        "id": "configuration",
        "title": "Configuration",
        "file": "book/src/configuration.md",
        "sections": [
          {
            "heading": "Quick Start",
            "topics": ["Minimal project config", "Minimal workflow config"]
          },
          {
            "heading": "Configuration File Locations",
            "topics": ["Workflow configuration", "Project configuration", "Global configuration", "Format support"]
          },
          {
            "heading": "Configuration Precedence Rules",
            "topics": ["Overall precedence", "Environment variables", "Project config", "Global config", "Defaults"]
          }
        ],
        "features_documented": [
          "Configuration file locations",
          "Project configuration",
          "Global configuration",
          "Format support",
          "Precedence rules"
        ]
      },
      {
        "id": "git-context-advanced",
        "title": "Advanced Git Context",
        "file": "book/src/git-context-advanced.md",
        "sections": [
          {
            "heading": "Overview",
            "topics": ["Automatic tracking", "Pattern filtering", "Format modifiers"]
          },
          {
            "heading": "How Git Tracking Works",
            "topics": ["GitChangeTracker", "Automatic tracking", "When tracking is active"]
          },
          {
            "heading": "Git Context Variables",
            "topics": ["Step-level variables", "Workflow-level variables", "Variable reference"]
          }
        ],
        "features_documented": [
          "Automatic git tracking",
          "Step-level file tracking",
          "Workflow-level file tracking",
          "Commit tracking",
          "Modification statistics"
        ]
      },
      {
        "id": "mapreduce-worktree-architecture",
        "title": "MapReduce Worktree Architecture",
        "file": "book/src/mapreduce-worktree-architecture.md",
        "sections": [
          {
            "heading": "Overview",
            "topics": ["Worktree hierarchy", "Parent worktree", "Child worktrees"]
          },
          {
            "heading": "Worktree Hierarchy",
            "topics": ["Parent worktree location", "Parent worktree purpose", "Child worktree location", "Child worktree purpose"]
          },
          {
            "heading": "Branch Naming Conventions",
            "topics": ["Parent branch format", "Agent branch format", "Components"]
          },
          {
            "heading": "Merge Flow",
            "topics": ["Agent merge", "Parent to master merge"]
          }
        ],
        "features_documented": [
          "Worktree hierarchy",
          "Branch naming conventions",
          "Merge flows",
          "Agent isolation",
          "Parent worktree isolation"
        ]
      },
      {
        "id": "troubleshooting",
        "title": "Troubleshooting",
        "file": "book/src/troubleshooting.md",
        "sections": [
          {
            "heading": "Common Issues",
            "topics": ["Variables not interpolating", "Capture not working", "Validation failing"]
          }
        ],
        "features_documented": [
          "Variable interpolation issues",
          "Capture format issues",
          "Validation issues"
        ]
      },
      {
        "id": "automated-documentation",
        "title": "Automated Documentation",
        "file": "book/src/automated-documentation.md",
        "sections": [
          {
            "heading": "Overview",
            "topics": ["Feature analysis", "Drift detection", "Documentation updates", "mdBook integration"]
          },
          {
            "heading": "Prerequisites",
            "topics": ["Prodigy installation", "mdBook installation", "Claude Code CLI", "Git setup"]
          },
          {
            "heading": "Quick Start",
            "topics": ["Initialize commands", "Initialize mdBook", "Project configuration"]
          }
        ],
        "features_documented": [
          "Automated documentation",
          "Feature analysis",
          "Drift detection",
          "Documentation updates",
          "mdBook integration"
        ]
      }
    ],
    "summary": {
      "total_chapters": 16,
      "documentation_coverage": {
        "core_features": [
          "Workflow basics (structure, commands, environment)",
          "MapReduce mode (parallel processing)",
          "Command types (shell, claude, goal-seek, foreach, validation, write_file)",
          "Variable interpolation (standard, custom, git context)",
          "Environment configuration (global, files, secrets, profiles)",
          "Advanced features (conditionals, error handling, retry)",
          "Workflow composition (imports, extension)",
          "Configuration management",
          "Git context and tracking",
          "Automated documentation"
        ],
        "well_documented_areas": [
          "Basic workflow structure",
          "MapReduce configuration with all options",
          "Error handling and retry strategies",
          "Variable types and scope",
          "Environment configuration with multiple providers",
          "Command types and their options"
        ],
        "partially_documented_areas": [
          "Advanced composition features (templates, parameters)",
          "Custom handlers and strategies",
          "Profile activation at runtime",
          "Per-command environment in modern syntax"
        ]
      }
    }
  }
}