Intermediate · ~15 minutes

Interactive Workflows

Define custom workflows that combine build phases, review gates, and interactive modes. Build a "design review" workflow that uses Explore, Party, and Review in sequence.

1 Understand the Default Workflow

By default, prodara build runs all 7 phases in order: specify → clarify → plan → tasks → analyze → implement → review. Custom workflows let you run a subset or reorder them.

ℹ️
Each phase has a typed output. See the Custom Workflows reference for all phase kinds and their output types.

2 Create a Quick-Check Workflow

Start with a simple workflow that only runs specify and clarify — useful for fast feedback during spec authoring:

prodara.config.json
{
  "workflows": {
    "quick-check": {
      "steps": [
        { "phase": "specify" },
        { "phase": "clarify", "autoResolve": true }
      ]
    }
  }
}

Run it with the --workflow flag:

prodara build --workflow quick-check .

3 Build a Design Review Workflow

Now create a more sophisticated workflow that combines specification, planning, and review with specific reviewer selection:

prodara.config.json
{
  "workflows": {
    "design-review": {
      "steps": [
        { "phase": "specify" },
        { "phase": "clarify" },
        { "phase": "plan" },
        { "phase": "analyze" },
        {
          "phase": "review",
          "reviewers": ["architecture", "security"]
        }
      ]
    }
  }
}

This workflow skips implementation and only reviews architecture and security. Use it when evaluating design changes before committing to implementation.

4 Configure the Fix Loop

The review phase includes an automatic fix loop. Configure how many attempts the agent gets and which severity levels trigger fixes:

prodara.config.json (reviewFix section)
{
  "reviewFix": {
    "maxAttempts": 5,
    "severity": "warning",
    "autoFix": true
  }
}
💡
Set "autoFix": false to get review findings without automatic fix attempts — useful for manual review workflows.

5 Run Workflows Programmatically

Use the runWorkflow() API or run individual phases for maximum control:

custom-pipeline.ts
import {
  runWorkflow,
  runSpecifyPhase,
  runClarifyPhase,
  autoResolveClarifications,
} from '@prodara/compiler';

// Run a named workflow
const result = await runWorkflow({
  rootDir: './project',
  workflow: 'design-review',
});

// Or compose phases manually
const spec = await runSpecifyPhase(config);
const clarify = await runClarifyPhase(spec, config);
const resolved = autoResolveClarifications(clarify);

console.log(`Resolved ${resolved.length} clarifications`);

Next Steps