Multi-Agent Team Orchestration
GigiKit teams are groups of specialized agents working in parallel under a lead coordinator. The lead assigns tasks, resolves conflicts, and synthesizes outputs. Each teammate owns a distinct slice of the codebase and communicates via structured message passing.
flowchart TD Lead([Lead Agent]) —> T1[Implementer\nsrc/api/] Lead —> T2[Implementer\nsrc/ui/] Lead —> T3[Tester\ntests/] Lead —> T4[Docs Manager\ndocs/]
T1 — TaskUpdate completed —> Lead T2 — TaskUpdate completed —> Lead T3 — TaskUpdate completed —> Lead T4 — TaskUpdate completed —> Lead
T1 — SendMessage message —> T2 T2 — SendMessage message —> T1
style Lead fill:#4f46e5,color:#fff style T1 fill:#0891b2,color:#fff style T2 fill:#059669,color:#fff style T3 fill:#d97706,color:#fff style T4 fill:#7c3aed,color:#fff
Activating a Team
Teams are an optional layer on top of standard orchestration. Activate them by invoking the /gk:team skill. The skill reads team configuration from ~/.claude/teams/{team-name}/config.json to discover teammates and their roles.
Lead Agent Responsibilities
The lead:
- Breaks work into tasks with explicit file ownership globs
- Assigns tasks to teammates via
TaskUpdate(owner: "alice") - Monitors
TaskListfor completion and newly unblocked tasks - Resolves file ownership conflicts by restructuring tasks or absorbing shared files
- Synthesizes teammate reports into a final completion message
- Issues shutdown requests when all tasks are complete
The lead never edits files directly unless a conflict forces it to absorb a contested file.
Teammate Responsibilities
Each teammate follows this loop:
- Run
TaskList— claim the lowest-ID unblocked task - Set task
in_progressviaTaskUpdatebefore touching any file - Read the full task description via
TaskGetto confirm file ownership bounds - Implement, respecting ownership strictly
- Run
TaskUpdate(status: "completed") - Send an implementation report to the lead via
SendMessage - Return to step 1
SendMessage Protocol
| Scenario | Message type | Recipient |
|---|---|---|
| Routine update to lead | message | lead’s name |
| Coordination with a peer | message | peer’s name |
| Critical blocker for whole team | broadcast | (all) |
| Shutdown acknowledgement | shutdown_response | lead’s name |
Always use teammate names, not agent IDs. Names come from the team config and are used as the recipient field in SendMessage and the owner field in TaskUpdate.
Completed task-03: implemented JWT middleware in src/api/auth-middleware.ts.
Added token validation, refresh logic, and error responses for 401/403.
Tests pass. Docs impact: minor (updated API contract in docs/api-reference.md).
Ready for review.
Report Conventions
Every teammate saves a report to the shared reports path injected by the subagent-start hook:
- Path:
{CK_REPORTS_PATH}(falls back toplans/reports/) - Naming:
{role}-{date}-{slug}.md— e.g.implementer-260305-auth-middleware.md - Content: files modified, tasks completed, docs impact verdict (
none | minor | major)
Idle State
Agents go idle after sending a message. This is normal — idle means waiting, not disconnected. A new message from the lead or a peer wakes the agent. Do not interpret idle notifications as completion signals.
Related Guides
- File Ownership & Conflict Resolution — ownership patterns, glob syntax, worktree setup
- Team Coordination Rules — full rule set for teammates
- Sequential & Parallel Orchestration — lighter-weight alternative to full teams