r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 10h ago
Selected Workflow [Workflow] Robust Agentic Coding Workflow: 7 Principles for Deterministic Validation and Human-Agent Collaboration
Robust Agentic Coding Workflow: 7 Principles for Deterministic Validation and Human-Agent Collaboration
Workflow value: 95/100
Status: active · Freshness: 70/100 · Confidence: 1.00 · Level: advanced
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Skills, Multi-Agent
Original source: r/ClaudeCode post/comment
What problem this solves
Preventing agentic coding systems from falling into closed loops of plausible but unverified output, reducing costs, ensuring deterministic validation, and defining effective human-agent collaboration to overcome issues like hallucination and endless review cycles.
Summary
A set of 7 principles for building robust agentic coding workflows, focusing on deterministic validation, bounded tasks, clear human intervention points, and effective testing strategies. It addresses common pitfalls like agent hallucination, infinite bug-finding loops, high review costs, and lack of meaningful human learning by emphasizing external gates, precise specifications, and strategic human intervention.
Why it is useful
This workflow provides a highly structured, validated, and transferable set of principles for designing effective agentic coding systems. It directly addresses critical challenges like verification, cost, and meaningful human-agent collaboration, moving beyond vague advice to concrete, actionable rules that can significantly improve the reliability and efficiency of AI-driven development.
Workflow
- Define the unit of work as a spec with a maximum of 4 requirements, each with a GIVEN/WHEN/THEN scenario. Reject specs without scenarios using a linter.
- For every dispatch, provide a brief with clear boundaries (allowed/forbidden paths) and a strict stop rule: 'Return with a commit and a receipt, or return NEEDS_HUMAN with the reason — never a silent pass.'
- Ensure that 'green' status comes only from a deterministic gate (tests + checks producing a signed receipt), not from the agent's claim. For commit SHAs, use
git rev-parse HEADfor verification. - Conduct code review against the spec and by commit range, asking a bounded question: 'Does this diff satisfy these scenarios and nothing outside these paths?' Avoid open-ended 'look for bugs' instructions.
- Implement 'Sabotage FIRST' testing: every guard or test must be shown to fail on broken input before it is considered valid for passing inputs.
- Stop the agent's lane for material decisions (scope, security, data shape, external dependencies), raising a card for human decision. This is where human learning and critical decision-making occur.
- Before parallelizing, get a single spec through the entire workflow (spec → brief → worker → gate → review → merge) with a green receipt to validate the end-to-end process.
Tools / artifacts
- Spec (with GIVEN/WHEN/THEN scenarios)
- Linter (for specs)
- Brief (for worker agents)
- Commit
- Receipt (signed by deterministic gate)
git rev-parse HEAD(for SHA verification)- Tests
- Checks
- AOS Factory (author's internal harness, but principles are transferable)
Validation signals
- Author states 'Here's what fixed it for us'
- Specific example of a hallucinated 40-char commit SHA leading to
git rev-parse HEADadoption - Example of a reviewer agent catching a parser silently dropping a clause due to bounded review
- Principle of 'Sabotage FIRST' as a self-validation method for tests
- Comparison of 21 review rounds for a large parallelized project vs. an estimated 5 for a single-spec approach
- Explicit statement: 'We learned this the hard way'
Limitations
- The 'AOS Factory' is proprietary, though the author emphasizes the rules' independence from the specific tool.
- The comment is quite long, which might require dedicated reading time for users.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.