Skip to content

Step Verification Pattern

Ensure each workflow step is truly complete before moving to the next. Prevents skipping incomplete work and requires evidence of completion.

[execute-step] → [verify-step] → verified=yes → [next-step]
→ verified=no → [retry-or-escalate]
{
"type": "agent-directive",
"id": "execute-step",
"directive": "Implement {{current_step_name}}:\n{{current_step_action}}",
"completionCondition": "Step implementation complete",
"inputSchema": {
"type": "object",
"properties": {
"implementation_summary": { "type": "string" }
},
"required": ["implementation_summary"]
},
"connections": { "success": "verify-step" }
}
{
"type": "agent-directive",
"id": "verify-step",
"directive": "Verify step {{current_step_name}} completed:\n- Expected: {{expected_output}}\n- Check actual result matches expected\n- Provide evidence",
"inputSchema": {
"type": "object",
"properties": {
"step_verified": { "type": "string", "enum": ["yes", "no"] },
"verification_evidence": { "type": "string" }
},
"required": ["step_verified", "verification_evidence"]
},
"connections": { "success": "check-verification" }
}
{
"type": "condition",
"id": "check-verification",
"condition": {
"operator": "eq",
"left": { "contextPath": "step_verified" },
"right": "yes"
},
"connections": {
"true": "proceed-to-next",
"false": "handle-failure"
}
}

Specify what counts as evidence:

{
"directive": "Verify implementation. Evidence must include:\n- Test command output (npm test results)\n- API response (curl output)\n- File diff (git diff)\n- Screenshot (for UI changes)"
}

Store step metadata in context:

{
"initialData": {
"current_step_index": 1,
"current_step_name": "Step 1",
"current_step_action": "Implement feature X",
"expected_output": "Feature X works with tests passing"
}
}

Use expression nodes to update:

{
"type": "expression",
"id": "increment-step",
"expressions": ["current_step_index = current_step_index + 1"]
}

From development-flow.json:

{
"id": "verify-step-implementation",
"directive": "Verify step {{current_step_index}} ({{current_step_name}}) implementation.\n\nExpected outcome: {{expected_outcome}}\n\nVerification checklist:\n- Functionality works as expected\n- Tests pass (if applicable)\n- No regressions introduced\n\nProvide concrete evidence for each claim.",
"inputSchema": {
"properties": {
"step_verified": { "type": "string", "enum": ["yes", "no"] },
"verification_evidence": { "type": "string" },
"issues_found": { "type": "string" }
},
"required": ["step_verified", "verification_evidence"]
}
}

On failure, either retry or escalate:

{
"type": "condition",
"id": "check-retry-limit",
"condition": {
"operator": "lt",
"left": { "contextPath": "current_iteration" },
"right": 3
},
"connections": {
"true": "fix-and-retry",
"false": "escalate-to-user"
}
}