workflow - ondatra-ai/flow-test GitHub Wiki
Core Principle: Requirements drive code. Requirements.md is the single source of truth.
flowchart LR
A[Phase 1:<br/>FILL TASK INFO] --> B[Phase 2:<br/>PLAN REQUIREMENTS] --> C[Phase 3:<br/>PLAN EXECUTION] --> D[Phase 4:<br/>EXECUTE] --> E[Phase 5:<br/>FINALIZE]
C -.->|Requirements unclear| B
D -.->|Replan - 1st time| C
D -.->|Replan failed - 2nd time| B
style A fill:#ff0000,color:#ffffff,stroke:#ff0000,stroke-width:2px
style E fill:#ffffff,color:#ff0000,stroke:#ff0000,stroke-width:2px
Input: Task description
Output: task.md
(section: TASK INFO)
- Create
task.md
from template - Fill TASK INFO section with task details
- Initialize TASK PROGRESS section
Human Gate:
User Response | Action | Next Step |
---|---|---|
approve | Approve task info | → Phase 2 |
clarify | Need clarification | → Revise |
Input: task.md
with TASK INFO
Output: task.md
(sections: TASK PROGRESS, REQUIREMENT UPDATES)
- Compare task with current
requirements.md
- Document what requirements need to:
- ADD (new features)
- MODIFY (changed behavior)
- REMOVE (deprecated)
- CLARIFY (ambiguous)
- Define success criteria
Human Gate:
User Response | Action | Next Step |
---|---|---|
approve | Approve requirements plan | → Phase 3 |
revise | Changes needed | → Retry |
clarify | Need more information | → Gather |
Input: Approved task.md
with requirements
Output: Implementation plan in task.md
(section: EXECUTION PLAN)
- Break down into implementation steps
- List files to create/modify/delete
- Define execution order
- Plan requirements.md updates
Human Gate:
User Response | Action | Next Step |
---|---|---|
approve | Approve execution plan | → Phase 4 |
revise | Plan needs changes | → Retry |
bad-requirements | Requirements unclear | → Phase 2 |
Input: Approved plan
Output: Updated requirements + implemented code
- Update requirements.md FIRST (desired end state)
- Implement code changes per plan
- Track progress in task.md (including replan count)
- Validate against success criteria
Human Gate:
User Response | Action | Next Step |
---|---|---|
approve | Implementation complete | → Phase 5 |
fix | Implementation needs fixes | → Retry |
replan | Bad plan (check replan count) | → Phase 3 (1st time) or Phase 2 (2nd time) |
bad-requirements | Requirements issue | → Phase 2 |
Input: Working implementation
Output: Completed task with updated requirements
-
Save all requirements to
requirements.md
(ensure persistent state) - Validate ALL requirements (not just new ones)
- Verify implementation matches requirements
- Mark task complete in task.md
Result: Task done, requirements saved, ready for next
Human Gate: None (final phase)
- Requirements First: Always update requirements.md BEFORE coding
- Human Approval: Required at each phase before proceeding to next phase
- Loop Back: Return to earlier phases when issues found
- Single Truth: requirements.md defines the system
- Replan Limit: After ONE failed replan attempt, MUST go to Phase 2 to replan requirements
-
requirements.md
- Project requirements (persistent) -
task.md
- Current task analysis/plan (per task)
- New Project: Create requirements.md
- New Task: Start at Phase 1 (FILL TASK INFO)
- Follow Gates: Get approval before proceeding
- Loop When Needed: Go back if issues found