Sequential & Parallel Orchestration
GigiKit’s orchestration layer decides whether subagents run one-after-another or simultaneously. Choosing the right pattern is the difference between a fast, correct build and a slow, conflicted mess.
Mandatory Delegation Context
Every time you spawn a subagent via the Task tool, you must include three pieces of context in the prompt:
# Required delegation context
Task prompt: "Fix the parser bug in the token module."
Work context: /path/to/my-project
Reports: /path/to/my-project/plans/reports/
Plans: /path/to/my-project/plans/
If your current working directory differs from the project you are editing — for example, you are orchestrating from a tools repo while editing an app repo — use the app repo’s paths, not your CWD.
Sequential Chaining
Chain agents when each step depends on the output of the previous one. The next agent only starts after the current agent completes and its output is verified.
When to use sequential chaining
- The output of step N is required input for step N+1
- A failure in an early step should block later steps
- You need a clear audit trail where each phase is signed off before proceeding
Common sequential chains
Feature development chain:
Planning → Implementation → Simplification → Testing → Review
New system component chain:
Research → Design → Code → Documentation
Each agent in the chain receives the previous agent’s output as context. Pass reports, generated files, or structured summaries explicitly — do not rely on shared filesystem state unless paths are known and stable.
Parallel Execution
Spawn multiple agents simultaneously when tasks are independent — they do not read each other’s output and they own distinct files.
When to use parallel execution
- Implementing separate, non-conflicting components (API layer, UI layer, database layer)
- Running the same operation across multiple isolated modules
- Cross-platform work where iOS and Android agents never touch the same files
Common parallel patterns
| Pattern | Agents | File ownership |
|---|---|---|
| Code + Tests + Docs | implementer, tester, writer | src/*, tests/*, docs/* |
| Multiple feature branches | feature-A agent, feature-B agent | distinct feature directories |
| Cross-platform | ios-agent, android-agent | ios/*, android/* |
Parallel execution checklist
- Each agent owns a distinct glob pattern of files
- No agent reads a file owned by another parallel agent
- A merge or review step is planned for after all agents complete
- Reports path is the same for all agents so results accumulate in one place
Agent Teams (Advanced)
For large projects requiring multi-session parallel collaboration, activate the /gk:team skill. Teams add persistent coordination on top of basic parallel execution: task claiming, message passing between agents, and shutdown protocols.
Related Guides
- Agent Chaining Patterns — concrete chain templates
- Multi-Agent Team Orchestration — persistent team coordination
- File Ownership & Conflict Resolution — preventing parallel edit conflicts