digraph TransitionPatterns {
    start [shape=Mdiamond]
    plan [label="Plan"]
    implement [label="Implement"]
    review [
        label="Review",
        shape=tab,
        prompt="Review the implementation for correctness and \
            code quality. If changes are needed, respond with: \
            {\"preferred_next_label\": \"fix\"}. If everything \
            looks good, respond with: \
            {\"preferred_next_label\": \"approve\"}."
    ]
    gate [shape=diamond, label="Check Result"]
    fast_path [label="Fast Path"]
    slow_path [label="Slow Path"]
    preferred [label="Preferred"]
    exit [shape=Msquare]

    start -> plan -> implement -> review
    review -> implement [label="Fix"]
    review -> gate      [label="Approve"]
    review -> gate      [weight=-1]
    gate -> fast_path [condition="outcome=success"]
    gate -> slow_path
    fast_path -> preferred [weight=10]
    fast_path -> exit      [weight=1]
    slow_path -> exit
    preferred -> exit
}
