Skip to content

Commit 09ea37a

Browse files
committed
feat: implement comprehensive test suite and enhance codebase documentation for core phase and orchestration logic.
1 parent bfa2eff commit 09ea37a

97 files changed

Lines changed: 4490 additions & 175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,51 @@ flowai update --check # check without installing
8787

8888
---
8989

90+
## Design Principles
91+
92+
These are the **non-negotiable rules** that govern how FlowAI works. Every code change must respect them.
93+
94+
### Tool-Agnostic Core
95+
96+
The pipeline coordination layer (`src/core/`, `src/phases/`) **never** contains tool-specific logic. Each AI tool (Claude, Gemini, Cursor, Copilot) has its own plugin at `src/tools/<name>.sh` — that is the **only** place tool-specific commands, flags, or behaviors may live. You can swap tools freely without touching orchestration code.
97+
98+
### Behavior from Scripts, Not Roles or Skills
99+
100+
All agent coordination behavior — what to read, where to write, when to exit, how to signal — is defined in `src/phases/*.sh` and `src/core/phase.sh`. Roles describe domain expertise only. Skills add capabilities only. **Neither roles nor skills may contain pipeline coordination logic, signal paths, or artifact rules.** This makes behavior reliable and consistent regardless of which role or skill is assigned.
101+
102+
### KISS, DRY, Clean Code, DDD
103+
104+
- **KISS** — Each component does one thing. Phase scripts orchestrate; tool plugins launch CLIs; roles describe expertise; skills add capabilities.
105+
- **DRY** — Shared constants and logic live in one place. Tool plugins reference shared constants — they don't duplicate them.
106+
- **Clean Code** — Functions are small and named for what they do. No magic globals. Plugin API is discoverable.
107+
- **DDD** — The codebase maps domain concepts directly: pipeline phases → `src/phases/`, AI tools → `src/tools/`, agent roles → `src/roles/`, agent skills → `src/skills/`, core engine → `src/core/`.
108+
109+
### Review Cycle with Multiple Feedback Loops
110+
111+
The review cycle ensures quality through structured feedback:
112+
113+
```
114+
Implement → Review agent (creates review.md) → User approves or gives feedback
115+
↓ (if feedback)
116+
Review agent re-analyzes → Implement agent fixes → Review again
117+
↓ (if user approves review)
118+
Master agent final review (reads review.md + all artifacts)
119+
├── Needs follow-up → feedback sent to Implement → cycle repeats
120+
└── Ready → User approve / needs changes
121+
├── Approve → pipeline complete
122+
└── Needs changes → feedback to Implement → cycle repeats
123+
```
124+
125+
Key points:
126+
- Review agent writes a full QA report to **`review.md`** — the user can read it before deciding
127+
- Master reads `review.md` during its final review for full context
128+
- Both Master AI and the user can send revision context back to Implement
129+
- The cycle is self-healing: impl → review → master → (feedback) → impl → ...
130+
131+
> See [Agent Communication](docs/AGENT-COMMUNICATION.md) for the full approval matrix, signal protocol, and rejection flows.
132+
133+
---
134+
90135
## Features
91136

92137
### 🤖 Multi-Agent Orchestration
@@ -216,9 +261,15 @@ The MCP config is written to `.flowai/mcp.json` and automatically loaded by supp
216261

217262
---
218263

219-
### 🔄 Review Rejection Loop
264+
### 🔄 Review Cycle — Multi-Layer Quality Gates
265+
266+
The review cycle has **three feedback loops** to catch issues at different levels:
267+
268+
1. **Review Agent** writes a full QA report to `review.md` — the user reads it and approves or provides feedback
269+
2. **Master Agent** runs a final sign-off reading `review.md` + all artifacts — catches cross-cutting issues the reviewer may miss
270+
3. **User** gets final approval with Master's opinion appended — approve to complete, or send changes back
220271

221-
When the review phase rejects an implementation, the review agent writes structured rejection context — what failed, why, and what to fix. On re-run, the implement agent focuses **only on failed items**, not a full re-implementation. This dramatically reduces iteration time and token usage.
272+
When any loop rejects, the implement agent receives structured rejection context — what failed, why, and what to fix — and focuses **only on failed items**, not a full re-implementation. This dramatically reduces iteration time and token usage.
222273

223274
---
224275

@@ -301,7 +352,7 @@ git tag v0.2.0 && git push origin main --tags
301352
|-------|----------------|
302353
| [Architecture](docs/ARCHITECTURE.md) | Pipeline, signals, plugins, event log, master monitoring, resolution chains |
303354
| [Commands](docs/COMMANDS.md) | Every CLI command, environment variables, event log config |
304-
| [Agent Communication](docs/AGENT-COMMUNICATION.md) | FlowAI pipeline orchestration, approval matrix, adaptive memory protocol, failure handling |
355+
| [Agent Communication](docs/AGENT-COMMUNICATION.md) | Must rules, design principles, approval matrix, review cycle, rejection flows, adaptive memory |
305356
| [Knowledge Graph](docs/GRAPH.md) | Build passes, community detection, versioning, chronicle, configuration |
306357
| [Supported Tools](docs/TOOLS.md) | Tool plugin API, model catalog, config keys, vendor references |
307358
---

0 commit comments

Comments
 (0)