Custom Workflows
Prodara workflows orchestrate how the AI agent interacts with the compiler. The default workflow covers the full specify → clarify → plan → implement → review cycle, but you can customize it or define entirely new workflows.
Default Workflow
When you run prodara build, the engine executes these phases in order:
Specify
Parse the full specification and build the product graph.
Clarify
Identify ambiguities and produce structured questions.
Plan
Diff against the previous build and generate an incremental plan.
Tasks
Break the plan into ordered, actionable tasks.
Analyze
Run consistency and metrics analysis across tasks.
Implement
Generate implementation instructions for each task.
Review
Run the reviewer pipeline with configured reviewers.
Phase Kinds
Each workflow step maps to a PhaseKind. The engine exports individual runner functions for each kind:
| Kind | Runner | Output Type |
|---|---|---|
| specify | runSpecifyPhase() | SpecifyOutput |
| clarify | runClarifyPhase() | ClarifyOutput |
| plan | runPlanPhase() | PlanOutput |
| tasks | runTasksPhase() | TasksOutput |
| analyze | runAnalyzePhase() | AnalyzeOutput |
| implement | runImplementPhase() | ImplementOutput |
Defining Custom Workflows
Define a custom workflow in your prodara.config.json using the WorkflowSchema structure. Each step specifies a phase kind and optional configuration.
{
"workflows": {
"quick-check": {
"steps": [
{ "phase": "specify" },
{ "phase": "clarify", "autoResolve": true }
]
},
"full-review": {
"steps": [
{ "phase": "specify" },
{ "phase": "clarify" },
{ "phase": "plan" },
{ "phase": "tasks" },
{ "phase": "analyze" },
{ "phase": "implement" },
{ "phase": "review", "reviewers": ["architecture", "security", "quality"] }
]
}
}
}--workflow CLI flag to select a named workflow: prodara build --workflow quick-checkReview Gates
Review gates are special workflow steps that run the reviewer pipeline. You can configure which reviewers run and how many fix attempts are allowed.
{
"review": {
"maxFixAttempts": 3,
"reviewers": ["architecture", "quality", "security"],
"fixLoop": {
"severity": "error",
"autoFix": true
}
}
}Clarify Phase
The clarify phase identifies ambiguities in the specification and produces structured questions. Auto-resolution can answer common questions automatically.
{
"clarify": {
"maxQuestions": 10,
"priority": "high",
"ambiguityThreshold": "medium",
"autoResolve": true
}
}Programmatic API
Run workflows programmatically using the runWorkflow() function or execute individual phases:
import {
runWorkflow,
runSpecifyPhase,
runClarifyPhase,
runPlanPhase,
} from '@prodara/compiler';
// Run the full workflow
const result = await runWorkflow({ rootDir: './project' });
// Or run individual phases
const specResult = await runSpecifyPhase(config);
const clarifyResult = await runClarifyPhase(specResult, config);
const planResult = await runPlanPhase(specResult, config);Next Steps
See the Interactive Workflows tutorial to build a custom workflow from scratch. Read about interactive modes like Explore, Help, and Party.