AI agent workflow orchestration rules for reliable coding
Summary
A concise ruleset for AI agent workflow orchestration from nextpath.ai, covering plan mode, subtask strategy, self-improvement loops, verification, ego management, and bug fixing. The rules are designed to make AI coding agents more reliable by enforcing structured planning, iterative correction, and disciplined verification before presenting results.
Key Insight
- Plan mode first for non-trivial tasks: Any task with 3+ steps or architectural decisions should start in plan mode - stop and re-plan immediately if something goes sideways. Use plan mode for verification steps too, not just building.
- Subtask strategy matters: Use subtasks to keep main context window clean. Offload research, exploration, and parallel analysis to subtasks. For complex problems, throw more compute at it via subtasks. One task per subtask for focused execution.
- Self-improvement loop is key: After any correction from the user, update
tasks/lessons.mdwith the pattern. Write rules for yourself that prevent the same mistake. Ruthlessly iterate on these lessons until mistake rate drops. Review lessons at session start for relevant project. - Verification before done - always: Don’t claim something works without proving it. Diff behaviour between main and your changes when relevant. Use Claude’s verification mode (plan mode again). Run tests, check logs, demonstrate correctness.
- Demand elegance (balanced): For non-trivial changes, pause and ask “is there a more elegant way?” If it feels hacky (“knowing everything I know now, implement the elegant solution”). Skip this for simple, obvious fixes - don’t over-engineer. Challenge your own work before presenting it.
- Autonomous bug fixing: When given a bug report, just fix it - don’t ask for hand-holding. Point at logs, errors, failing tests - then resolve them. Zero context switching required from the user. Go fix failing CI tests without being told how.
- Task management flow: Plan first (write plan to
tasks/todo.mdwith checkable items), check in before starting implementation, mark items complete as you go, do high-level summary at each step, add review section totasks/todo.md, capture lessons totasks/lessons.mdafter corrections. - Core principles: Simplicity first (make every change as simple as possible, impact > minimal code). No laziness (find root causes, no temporary fixes, senior developer standards). Minimal impact (changes should only touch what’s necessary, avoid introducing bugs).