Summary
Introduce a Planner Agent pre-execution phase to Orchestra's assistant pipeline. When enabled via PlannerConfig on an Assistant, the planner intercepts the first message in a thread, expands the user's short prompt (1-4 sentences) into a structured product specification, and optionally pauses for human-in-the-loop approval before the generator begins work.
This follows Anthropic's harness research showing that a high-level planning phase dramatically improves the ambition and coherence of generated output.
Key Capabilities
- PlannerConfig on the Assistant schema (toggleable
enabled, auto_approve, model override, scope_level)
- Planner runs as a pre-phase before the generator on the first message of a thread
- Expands short prompts into structured product specs (Overview, Features, User Stories, Tech Stack, Design Direction)
- Persists plan as
/PLAN.md in StateBackend for the generator to reference throughout execution
- Optional HITL approval — pause for user review before generator proceeds
- Planner prompted to be ambitious about scope and identify AI feature opportunities
Spec
Full spec: .claude/specs/planner-agent.md
Implementation Plan
Detailed plan: .claude/plans/planner-agent.md
Phases
- Schema & Data Layer —
PlannerConfig model, Assistant schema extension, Alembic migration
- Planner System Prompt — High-level expansion prompt at
backend/src/static/prompts/md/planner.md
- Pre-Execution Phase — LLMController integration, HITL interrupt, StateBackend persistence
- Frontend Display — Collapsible
PlanPanel, approval UI, status indicators
- Tests & Example — Unit + integration tests, example notebook
File Changes
| File |
Change |
backend/src/schemas/entities/planner.py |
New — PlannerConfig model |
backend/src/schemas/entities/llm.py |
Modify — add planner field to Assistant |
backend/src/controllers/llm.py |
Modify — pre-execution planner phase |
backend/src/static/prompts/md/planner.md |
New — planner system prompt |
backend/migrations/versions/xxx_add_planner.py |
New — Alembic migration |
frontend/src/components/chat/PlanPanel.tsx |
New — plan display component |
examples/agents/planner_example.ipynb |
New — example notebook |
Summary
Introduce a Planner Agent pre-execution phase to Orchestra's assistant pipeline. When enabled via
PlannerConfigon an Assistant, the planner intercepts the first message in a thread, expands the user's short prompt (1-4 sentences) into a structured product specification, and optionally pauses for human-in-the-loop approval before the generator begins work.This follows Anthropic's harness research showing that a high-level planning phase dramatically improves the ambition and coherence of generated output.
Key Capabilities
enabled,auto_approve,modeloverride,scope_level)/PLAN.mdin StateBackend for the generator to reference throughout executionSpec
Full spec:
.claude/specs/planner-agent.mdImplementation Plan
Detailed plan:
.claude/plans/planner-agent.mdPhases
PlannerConfigmodel, Assistant schema extension, Alembic migrationbackend/src/static/prompts/md/planner.mdPlanPanel, approval UI, status indicatorsFile Changes
backend/src/schemas/entities/planner.pybackend/src/schemas/entities/llm.pybackend/src/controllers/llm.pybackend/src/static/prompts/md/planner.mdbackend/migrations/versions/xxx_add_planner.pyfrontend/src/components/chat/PlanPanel.tsxexamples/agents/planner_example.ipynb