A workflow is a named pipeline of steps with preconditions, iteration
limits, and gates. Templates live in
src/workflows/templates/ and are dispatched by
src/dispatch.ts.
| Workflow | What it does | When to use |
|---|---|---|
counsel |
Single specialist Q&A | Quick legal questions |
review |
Specialist → evaluator gate → plain-language → verification → final gate | Contract reviews, compliance checks |
adversarial |
Builder + attacker + synthesizer | Stress-test a clause, position, or argument |
roundtable |
Parallel expert panel → debate → synthesis | Cross-disciplinary opinions on one matter |
legal-design |
Document transformation with meaning preservation | Plain-language redesign, accessibility passes |
full-bench |
Maximum team engagement, all phases | High-stakes matters, M&A, regulated industries |
pre-engagement |
Intake + team selection | Briefing analysis before kickoff |
verification |
Standalone 10-pass verification | Audit an existing deliverable |
tabulate |
Tabular multi-document review, every cell cited | Compare a clause across N contracts |
export const reviewTemplate: WorkflowTemplate = {
id: 'review',
name: 'Review',
steps: [
'intake',
'specialist_analysis',
'evaluator_gate',
'plain_language_review',
'verification_pass',
'final_gate',
'delivered',
],
stepDefinitions: {
specialist_analysis: {
preconditions: ['intake'],
maxIterations: 2,
qualityCheckType: 'self',
},
evaluator_gate: {
preconditions: ['specialist_analysis'],
requiresEvaluatorGate: true,
maxRevisionLoops: 2,
},
/* ... */
},
};
delivered.
The executor (src/workflows/executor.ts) walks the template
generically; the per-workflow orchestrator prompt provides judgement on
how to traverse it (e.g. when to revise vs. escalate).