Purpose and responsibility
The orchestrator:- Parses user requests into documentation targets
- Delegates tasks to specialist agents based on the current phase
- Tracks session state through the blackboard
- Manages dependencies between documentation targets
- Determines when the session is complete
Agent creation
orchestrator.ts
Context structure
orchestrator.ts
docsPath- Path to the documentation directorycodebasePaths- Array of source code paths to analyze
Workflow
For comprehensive documentation tasks:
For simple requests (edits, fixes) in established sessions:
- Use existing findings and plans when relevant
- Go directly to writing if the scope is clear
- Don’t create new documentation targets for minor changes
Session awareness
The orchestrator receives injected session state before each step:orchestrator.ts
prepareStep hook, which adds warning signals based on state:
- If plans exist → don’t create new targets or re-research
- If all targets are complete → call
finish_sessionimmediately
Tool sets
The orchestrator has access to:Session management tools
create_doc_target- Create a documentation target to trackmark_target_complete- Mark a specific target as completefinish_session- End the documentation sessioncheck_session_status- Get overall progress of all targets
Delegation tools
delegate_research- Send research task to research agentdelegate_planning- Send planning task to planner agentdelegate_writing- Send writing task to writer agentdelegate_user_interaction- Send interaction task to user agent
Blackboard access
blackboard_read_summary- Read session summary (read-only access)
Blackboard communication
The orchestrator reads from and writes to the blackboard:orchestrator.ts
Termination rules
The orchestrator stops when:- All documentation targets reach status “complete” and
finish_sessionis called - The step count reaches 30 (safety limit)
- The
finish_sessiontool is called
orchestrator.ts
Model configuration
The orchestrator uses the planning model tier:orchestrator.ts
config.agents.runtime.orchestrator.