Guide
Workflow
How Gem Team turns AI coding into a structured, reliable engineering process.
Gem Team turns AI coding into a structured process. The Orchestrator runs a 4-phase pipeline: Init → Route → Plan → Execute → Output, with Learn & Persist between waves. Each phase adapts to task complexity: simple fixes get a quick checklist, complex features get full planning and review.
Phase 0: Init & Clarify
The Orchestrator assesses every incoming request:
- Read context: external references, errors, user config (
.gem-team.yaml), relevant memory. - Detect intent: feature, bug-fix, refactor, docs, research, or debug.
- Resolve Plan ID: continue existing plan or start new one.
- Classify complexity: intent-based defaults (bug-fix → LOW, research → LOW), with explicit user overrides. Full classification kicks in only when intent is ambiguous.
- Document gray areas: assumptions logged; only blocking ambiguities prompt the user.
Outcome: A clear complexity classification and plan state that drives everything downstream.
Phase 1: Route
Routes based on plan state:
| State | Action |
|---|---|
continue_plan + no feedback | Load plan → jump to Phase 3 Execution |
continue_plan + feedback | Load plan → Phase 2 Planning (revision) |
new_task | → Phase 2 Planning |
Phase 2: Planning
Planning depth matches complexity:
- TRIVIAL/LOW: Orchestrator creates a minimal ephemeral plan (direct task checklist). Bug-fix tasks route to
gem-debuggerfirst, thengem-implementer. - MEDIUM: Delegates to
gem-plannerfor DAG-based task decomposition, wave scheduling, and risk analysis.gem-reviewervalidates the plan. - HIGH: Same as MEDIUM, plus
gem-criticreviews architecture, contracts, breaking changes, and API/schema/data-flow impact.
Validation failure: Replan with findings, or escalate to user if not replanable.
Phase 3: Execution
Work runs in waves: groups of parallel tasks respecting dependency ordering:
- Wave collection: tasks with
status=pending,wave=current, all deps met. - Conflict prevention: tasks listed in
conflicts_withnever run in parallel. - Delegation: each task goes to its assigned specialist agent with a filtered context snapshot (only relevant envelope sections).
- Integration gates:
gem-reviewerverifies wave output:- HIGH: every wave gated.
- MEDIUM: only risk waves and the final wave.
- Learn & Persist: after each wave, high-confidence learnings (≥0.95) are batch-delegated: product decisions → PRD, technical conventions → AGENTS.md, patterns → memory, workflows → skills.
Plans are resumable: pause, inspect, continue from any completed wave.
Wave Example
Wave 1: [Researcher] explore codebase ───→ [Debugger] diagnose error
↓
Wave 2: [Implementer] fix + [Tester] verify
↓
Wave 3: [Reviewer] security + a11y audit
Phase 4: Output
Structured status report with:
- Plan ID and objective · Task progress (completed/total, %)
- Wave status · Blocked tasks with reasons · Next steps